ds300 / jetzt

Speed reader extension for chrome
Other
485 stars 124 forks source link

coffeescript rewrite #115

Open ds300 opened 10 years ago

ds300 commented 10 years ago

When I started writing jetzt, I didn't expect it to become a compelling long-term project for me. It was just a two-day hackathon type thing to implement a version of Spritz I could use to read stuff on project gutenberg. I chose Javascript because I'd been using it a lot for work recently, and was sure I could conjure up something fast.

Now, however, I've got some rather grand plans for jetzt, but have been dreading working on the codebase because I actually find Javascript very tedious to write. Coffeescript is still quite new to me (I'm mostly a clojure/java guy), but it solves pretty much everything I dislike about Javascript, so I'm going to start a re-write on another branch.

I hope this doesn't upset those of you who have invested time and effort into the project so far. It has all been valuable input, I assure you, and I hope that you will continue to contribute.

nomicode commented 10 years ago

:+1:

nomicode commented 10 years ago

I wanna work on #91. Should I wait for the rewrite?

Do you want help with the rewrite? Perhaps I can help?

h0ru5 commented 10 years ago

@ds300 I can totally relate to use a strong-typed language for better maintenance (at least for the core).

As there are quite some options now, its a bunch of languages that compile to javascript to choose from. Google is pushing Dart, Microsoft is pushing TypeScript and there are also some other options as well.

A few months ago I had the same choice and decided for GWT. My train of thought was: you don't have to learn a new language, can use all the nice tooling of Java and still have browser-neutral js as output. It has of course downsides, idioms and is pretty much the SUV among the languages, but its quite a solid base for large or complex applications.,

I am curious about the backgrounds why you chose coffeescript, as i do not knoe much of that language. where does it have its sweet-spot?

ds300 commented 10 years ago

@nslater

As I said in #91, it should be quite easy to integrate blockquote wrapping into the current parseDom function, so feel free to do that.

As for the rewrite, I'm starting with the long-overdue new parsing stuff and I don't know exactly how it's going to impact the design of the rest of the codebase yet, so would prefer to go it alone for a little while.

@h0ru5

GWT is too cumbersome for this. I really just want a nicer interface to javascript. One where you don't have to keep typing the same flakey boilerplate over and over. I think that is exactly coffeescript's sweet-spot.

nomicode commented 10 years ago

Okay, thanks!

dburt commented 10 years ago

It should be possible, and not even too hard, to convert all your existing Javascript code to Coffeescript using Js2coffee. The command-line utility is installable via npm or bower. I've done this with a significant commerical codebase I picked up last year, and have contributed a little code that solved the only real problem I encountered in my automated conversion.

ds300 commented 10 years ago

Thanks, @dburt ! That looks really promising.

dburt commented 10 years ago

@ds300 also it might help to bear in mind the first rule of Coffeescript: Coffeescript IS Javascript. Two implications: 1) you could consider it simple translation rather than a rewrite (which is good -- rewrites are very expensive); 2) perhaps limit your expectations of the benefit (though I did it for my big codebase and it helped me understand the codebase and I enjoyed reading and writing the cleaner converted code)

@h0ru5 Coffeescript is basically just a cleaner syntax for Javascript plus a very few extra bits of sugar, so is useful anywhere you would use Javascript; i.e. any web scripting, Node.js, mobile, etc.

nomicode commented 10 years ago

@ds300 what's the status of this work?

ds300 commented 10 years ago

stalled. Work stuff came up and now this patent violation business is a real headache. I might end up just deleting the repo.

nomicode commented 10 years ago

Eep! What patent violation stuff?

ds300 commented 10 years ago

Spritz Inc have a patent pending in the US which has root claims for:

all in the context of displaying words serially on a computer screen.

They sent me an email implying that if I join their official developer program, that I'll be able to use their 'inventions' without being sued. However, I can't see anything in their license which explicitly guarantees the no-litigation bit. Nor can I see any indication of the extent to which one's software must make use of their official SDK to qualify for the no-litigation stuff. This vagueness is rather off-putting.

Of course, they're extremely unlikely to get the patent granted in the EU (I don't think they've even bothered to apply), but jetzt would still be indirectly infringing by virtue of being available to US citizens. I don't know if spritz could take legal action against me for that, or simply against github for hosting the project. Both are undesirable anyway. I've sent an email to the EFF to ask for advice.

nomicode commented 10 years ago

Thank you for the update. This is very disheartening. Please keep us posted.