News for hackers. Stuff that matters.
Re:SICP translated to JavaScript by jophde on Saturday September 14, 2013 @01:34PM (#6386338)
I just want to meet one programmer who can work on server side code, client side code, etc who can't handle them being written in different languages. This fad just doesn't make any sense to me. Let's reinvent the wheel so we can have JSON literals instead of Ruby hashes!
Re:SICP translated to JavaScript by erikpukinskis on Saturday September 14, 2013 @02:02PM (#6386454)
I always thought this would be self-evident to people, but apparently not: The reason why I want to have Javascript on both the client and the server is so I can re-use code.

My software has a fairly large chunk of code which is a gardening expert system. I'm hesitant to call it AI because it's so dumb, but it's along those lines. It knows things like "If you live in Phoenix and it's April, you should wait to plant your lettuce until September".

It's useful to have it on the client, when you're in the garden and there's no connectivity, or when you tweak your settings and don't want to have to download a bunch of "conclusions" from the server. It's useful to have it on the server so that the server can send emails, pre-cache HTML for faster loading pages, etc.

If my server is written in Ruby (which is is right now) then I have to re-implement that entire system twice. That's double the code. It feels gross. And I can't help but feel like most web-apps have code like this that could be shared between the client and the server.

Re:SICP translated to JavaScript by acjohnson55 on Saturday September 14, 2013 @08:05PM (#6387618)
Fortunately, I think we're entering an era where JS can be a nearly transparent target language for translation from the languages of our choice, with things like asm.js and source maps. We're not quite there yet, but it definitely seems like where we're going.
Re:SICP translated to JavaScript by Tichy on Sunday September 15, 2013 @09:34AM (#6389028)
I'd prefer the other way round. JavaScript is better than most popular programming languages (including Python). It is not perfect, so I consent there might better languages out there.
Re:SICP translated to JavaScript by beambot on Saturday September 14, 2013 @04:44PM (#6387009)
Sounds like that part of the system could be written once (in any language) and then encapsulated and treated as a local service... (analogous to using a local copy of SQLite if you need a db). Then you can use the "best tool for the job" on the client and-or server?
Re:SICP translated to JavaScript by Tichy on Sunday September 15, 2013 @09:34AM (#6389031)
What if JS is the best tool for the job?
Re:SICP translated to JavaScript by beambot on Sunday September 15, 2013 @06:29PM (#6390571)
Then so be it. "The best tool" is a complex multi-value optimization that includes intangibles like personal preference. For me personally, server-side js wouldn't make any sense (right now) -- it's not my preferred language and it doesn't have the same sort of library support as other langs.
Re:SICP translated to JavaScript by wpietri on Saturday September 14, 2013 @03:51PM (#6386840)
Yeah, I'm with you on this. Aesthetically, I'm in the "ugh, Javascript" camp. But practically, I recognize that I should just get over this. For web stuff, I fully expect that I'll be writing everything in JS in a few years.
Re:SICP translated to JavaScript by jophde on Saturday September 14, 2013 @04:20PM (#6386933)
Considering it doesn't even support multiple core processors, and processors are only coming out with more and more cores, I doubt it. This is assuming you are actually doing something that requires performance. Check out Elixir or Go if you want something new that actually makes technical sense.
Re:SICP translated to JavaScript by cgag on Saturday September 14, 2013 @05:58PM (#6387220)
Or Clojure, which has a good concurrency story as well as compiles to javascript.
Re:SICP translated to JavaScript by wpietri on Saturday September 14, 2013 @11:42PM (#6388048)
Sorry, by "web stuff" I meant the client side plus the first tier of stuff. I agree that for serious computation I want something else. Thanks for the tip on Elixir, though; that looks appealing.
Re:SICP translated to JavaScript by mheathr on Sunday September 15, 2013 @08:11AM (#6388823)
If the language can do so competently, why not? I think that would be a great leap forward for programming as it would consolidate efforts developing libraries, documentation, and tools.