

The Opa Framework for JavaScript - IgorPartola
http://opalang.org/

======
phatbyte
Personally 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

~~~
MatthewPhillips
The 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
Not saying that. I just wished there wasn't so much fragmentation as there is.

------
maxhowell
Recently 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.

~~~
tracker1
Somewhat 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
Yes 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
I 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.

------
endeavour
It's a real shame they took out the nice terse OCaml syntax to make it look
more similar to javascript.

~~~
jeffbr13
I'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
There 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.

------
_delirium
Some 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
I 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.

~~~
lux
From 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
Yeah I'm wondering what the differences between this and Meteor is.

~~~
pepijndevos
[http://blog.opalang.org/2012/04/one-web-app-one-
language.htm...](http://blog.opalang.org/2012/04/one-web-app-one-
language.html)

As far as I understand, Opa has 2 killer features over Meteor: Type inference
and "location inference".

~~~
zura
While type inference is nice, I'd still prefer to mark locations explicitly.

------
CGamesPlay
Can 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
I'm not sure I understand your question. Oh, and this.getChildren() doesn't
look very Opa-ish.

