6 ms·
The Opa Framework for JavaScript
- _delirium 13y agoSome earlier discussions, fwiw: https://news.ycombinator.com/item?id=4647476 https://news.ycombinator.com/item?id=4647476 https://news.ycombinator.com/item?id=4142192 https://news.ycombinator.com/item?id=4142192
- zura 13y agoI guess they didn't get much traction with "opa language" and now they advertise it as "opa framework for js". It is odd that they still don't have any SQL database support.
- klibertp 13y agoCan't you just use node-mysql or something like that? They broke my heart when they dropped custom runtime (and ML-like syntax) in favor of Node and JS, but it should allow Opa users use Node libraries directly, no? I like the idea of such a "framework" - it's time to abstract away all the cruft web developers need to write and focus on actual logic. I didn't use Opa or anything similar yet, but I'm keeping an eye on them and will try them at some point.
- raphinou 13y agoHave taken a look at http://webtoolkit.eu http://webtoolkit.eu ?
- lux 13y agoFrom their site, they say that "Opa generates and is fully compatible with standard JavaScript code" so it's really no different than preprocessors like CoffeeScript. So the tagline seems acceptably accurate IMO. And is it really that odd that they've targeted Mongo to start with? Meteor has done the same thing.
- Torn 13y agoYeah I'm wondering what the differences between this and Meteor is.
- pepijndevos 13y agohttp://blog.opalang.org/2012/04/one-web-app-one-language.html http://blog.opalang.org/2012/04/one-web-app-one-language.htm... As far as I understand, Opa has 2 killer features over Meteor: Type inference and "location inference".
- zura 13y agoWhile type inference is nice, I'd still prefer to mark locations explicitly.
- hbbio 13y agoOpa has Postgres support. It requires almost no code change from MongoDB to Postgres, as explained in this blog post: http://www.josetteorama.com/to-sql-from-nosql/ http://www.josetteorama.com/to-sql-from-nosql/
- maxhowell 13y agoRecently I wrote a less overwhelming pre-compiler that allows you type HTML inline with your Javascript, may be worth a look: http://mxcl.github.io/bs http://mxcl.github.io/bs BullScript’s goal is just to make writing JS a little nicer, but not to be some whole new language.
- pepijndevos 13y agoSo it's like PHP for JS?
- tracker1 13y agoSomewhat silly question... why not write BSC in JS? I mean, this seems like something that would be a natural fit in a NodeJS environment, and tying into NPM similar to CoffeeScript, Less etc. I don't mean to come across as an ass, just curious. Though, I do think what you are doing could be a natural extension to CoffeeScript itself. Also, I would suggest having an htmlEncode(variable) by default, I know that htmlEncode isn't a built-in JS method, but you should want to escape html entities.
- maxhowell 13y agoYes with hindsight I wish I had written it in JS, but writing the BS compiler was something I wanted to get done fast, and I'm more proficient with Ruby. BS has the #x{foo} syntax for htmlEncoding, or did you mean that should just be the default?
- tracker1 13y agoI didn't notice the #x{foo}, though was thinking that should be the default (safe-first), and if you want unsafe/raw have that be explicit.
- CGamesPlay 13y agoCan I create new HTML elements? I'm not psyched about the kind of syntax in http://hasteb.in/rikuquyaju.xml http://hasteb.in/rikuquyaju.xml and would much rather have something like http://hasteb.in/bisilexope.xml http://hasteb.in/bisilexope.xml
- Yoric 13y agoI'm not sure I understand your question. Oh, and this.getChildren() doesn't look very Opa-ish.
- phatbyte 13y agoPersonally as a web developer I honestly wished this sort of tools started to get more and more traction. I'm getting a tad tired of using "dozens" of different languages and tools/frameworks to get a freaking website up and running by using good practices. Quite frankly, I think web developers are, among all the IT people, the ones with more fragmented and disposable tools there is. If you look at a Mac developers, all they have is Xcode, that's it, one language, one framework to rule them all. Window developers have .NET. Game developers, they use one language/engine and that's it ! Not saying it's easier in anyway, just saying they don't worry about what tools to pick, they just do it, almost with just one language. Web developers on the other hand have to work with a back-end and front-end language, deal with front-end JS mvc frameworks, maybe Coffescript instead ? CSS frameworks, or just use SASS ? cross-browsing issues and hacks, picking the right web server, database, VPN or CAP, on top of that you better have a task runner for all those "compiled" JS files and css, and a watcher so it compiles when you update a file..See where this is going ? Plus web development tools are so volatile to change. Just look at Backbone for instance, last year it was the best thing for JS standalone apps. This year it's Ember... It's freaking insane IMO. So I really wish either OPA or something even more clever to come along and give us a little and let us just worry about building an app and not having to learn dozens of tools every year. Having options is awesome, but needing to pick lots of options it's frustrating sometimes
- marban 13y agoAgreed on the first part but who says you have to use this fashionable stuff? The web's underlying parts haven't changed in years so there's nothing wrong with just using, say, pure perl & JS, that is whatever gets the job done.
- MatthewPhillips 13y agoThe web isn't for you. If you want an authority figure telling you what tools to use, those platforms exist but it's not the way the web can or will ever be.
- phatbyte 13y agoNot saying that. I just wished there wasn't so much fragmentation as there is.
- endeavour 13y agoIt's a real shame they took out the nice terse OCaml syntax to make it look more similar to javascript.
- jeffbr13 13y agoI'm looking forward to writing modern (i.e. web) programs with features stolen from functional languages! And, at the end of the day, more people are more familiar with Java-like syntax, and that's good for adoption. But can anyone tell me whether the change from ML-like -> Java-like syntax has meant a loss of composability/expressability/any other traditional strengths of FP languages?
- hbbio 13y agoThere is no loss at all: There are just two parsers for the same Abstract Syntax Tree. After parsing which is the very first step of the compiler, everything is the same. All the features of Opa lie in the ability to analyze the code and generate JS code from the AST.
- hbbio 13y agoThe OCaml syntax is still available: opa --parser classic Indeed, most of the stdlib is implemented using the "classic syntax".
- UncleOxidant 13y agoIs this still available? I don't think that's a valid option in the later versions (at least for the last year). There's been some discussion of this on the Opa forums, and it seems that the OCaml-like syntax is gone now. It's a pity, really. Edit: ah, you're right. It apparently still exists, but the original ML-like syntax is undocumented now.
- deleted 13y ago[deleted]