4 ms·
Morph C++ into Javascript
- warfangle 16y agoI don't see closures. That's one of the most powerful aspects of Javascript.
- vjeux 16y agoJust added a part on Closure: http://blog.vjeux.com/2011/javascript/jspp-morph-cpp-into-javascript.html#closure http://blog.vjeux.com/2011/javascript/jspp-morph-cpp-into-ja... It was a bit more difficult than expected :(
- iam 16y agoGood luck, last time I tried nested lambdas in VC10 they weren't able to capture local variables from any context except the immediate outer context. This makes doing something like e.g. map(map(...)) extremely annoying. Javascript (nor does, really, any other proper closure implementation) has no such issues.
- vjeux 16y agoI started developing with Visual Studio but their C++0x implementation is far from complete. Indeed, the following easy code ( http://pastebin.com/bjFWBrJq http://pastebin.com/bjFWBrJq ) does not compile under Visual Studio: "function returning function is not allowed" It works fine in g++ though.
- deleted 16y ago[deleted]
- hebejebelus 16y agoThat's fantastic! I might finally be idly productive in C++ as I am in javascript. In javascript, I find that you can just write code, while in C++ I feel that I need to plan out every design choice, need to protect against everything. While that's a good thing when writing production code, in certain situations (writing up proof-of-concept projects for example) it's just not what I want. I love that in javascript, half the time I don't need to give a crap - it just works. Hopefully, as a side-effect of this project, I'll be able to do what I do in C++ as I do in Javascript - although in the long run that probably isn't a good thing. ;)
- tomn 16y agoNow all we need is a gratuitous regular expression to get rid of the extra bits of syntax...
- dhruvbird 16y agowow!! this is great!!
- jpr 16y agoI would categorize this as programmer-gore.
- maxogden 16y agonot to be confused with https://github.com/mikeal/jspp https://github.com/mikeal/jspp
- UncleOxidant 16y agoI'd rather be able to go the other way. js->c++. But that would be much harder, I think.
- yatsyk 16y agoIf C++0x is much closer to javascript CoffeScript to C++ is possible.
- Groxx 16y agoWhy haven't I seen this blog before? Loads of interesting stuff.... I'll definitely be trying this out. Utterly awesome idea.
- kirbysayshi 16y agoThere was mention of a performance overhead of _ as a suggestion as to how to improve... How does JSPP, in its current state, compare with V8 execution speed?