News for hackers. Stuff that matters.
Re:BuckleScript: write JavaScript faster, safer and smaller by djsumdog on Saturday January 21, 2017 @03:43AM (#13449397)
This looks pretty interesting. It makes me want to learn OCaml. :-P

I've been using Coffeescript in projects for about two years. I know people have raised issues with it vs ES6, but I still really like Coffeescript. I feels more natural with my Scala/Ruby background and it outputs into Javascript in ways that (mostly) make sense and are predictable.

Re:BuckleScript: write JavaScript faster, safer and smaller by aikah on Saturday January 21, 2017 @04:48AM (#13449524)
> This looks pretty interesting. It makes me want to learn OCaml. :-P

You can learn F# with dotnet core, which has a better ecosystem for web development. OCaml is quite poor in that domain.

Re:BuckleScript: write JavaScript faster, safer and smaller by yawaramin on Saturday January 21, 2017 @12:59PM (#13451197)
Have you heard of Ocsigen/Eliom? It's a complete OCaml system for web development.
Re:BuckleScript: write JavaScript faster, safer and smaller by KurtMueller on Saturday January 21, 2017 @10:28AM (#13450432)
Are you speaking from experience? If so, do you have any or know of any resources I could look at? Also, what type of backend are you using with F# and dotnet core?
Re:BuckleScript: write JavaScript faster, safer and smaller by ZenoArrow on Saturday January 21, 2017 @12:26PM (#13451051)
If you want the BuckleScript equivalent for F#, that would be Fable.

https://github.com/fable-compiler/Fable/blob/master/README.m...

There's a newer branch called Fable Arch which I believe is focused on promoting the Elm Architecture for structuring web apps:

https://github.com/fable-compiler/fable-arch

FunScript is another alternative:

http://funscript.info/

Re:BuckleScript: write JavaScript faster, safer and smaller by elbear on Saturday January 21, 2017 @04:18PM (#13452216)
Elm Architecture for F# is Elmish: https://github.com/fable-compiler/fable-elmish
Re:BuckleScript: write JavaScript faster, safer and smaller by Paradigma11 on Saturday January 21, 2017 @01:36PM (#13451374)
I do not think that Arch is a newer branch but a framework that uses the standard fable compiler.
Re:BuckleScript: write JavaScript faster, safer and smaller by Paradigma11 on Saturday January 21, 2017 @12:45PM (#13451141)
One popular web server is https://suave.io/ You can use http://fable.io/ for f# -> js transpilation. One big advantage is that you are able to use ts definitions for foreign js libraries. The js is generated by babel which is also nice.

There are several active projects and bindings that you can take a look at there: https://github.com/fable-compiler

Re:BuckleScript: write JavaScript faster, safer and smaller by KurtMueller on Saturday January 21, 2017 @04:33PM (#13452264)
What kind of data store do you use with F#? Some sort of SQL variant?
Re:BuckleScript: write JavaScript faster, safer and smaller by Paradigma11 on Sunday January 22, 2017 @10:46AM (#13455625)
https://blog.geist.no/suave-io-introduction-and-example-part...

"Database access from a Suave.IO app isn't any different from database access from any other .NET / F# app you write."

Any way you like, really.

Re:BuckleScript: write JavaScript faster, safer and smaller by k__ on Saturday January 21, 2017 @08:21AM (#13449932)
I was using LiveScript before ES2015 and syntax-wise it felt a step backwards to go back to JavaScript.
Re:BuckleScript: write JavaScript faster, safer and smaller by partycoder on Saturday January 21, 2017 @05:32AM (#13449591)
While CoffeeScript has some useful additions, it also has some that were not good ideas. When the language helps communicating an idea more clearly and concisely, it's fine.

But removing delimiters in my opinion does not help readability. Most time is spent reading, not writing. It's similar to claiming more efficiency by removing lanes and signaling from a highway...

Then, whitespace has more meaning than it should in CoffeeScript, and inconsistent indentation is possible, whereas in Python/Ruby it is not without an error. Therefore a formatter can break your code.

Snippets/templates/autocompletion can save the work of typing delimiters. Delimiters can be enforced with CoffeeLint, but then that's optional, it is more work, and it is a friction point with people that do not see value in formatting.

CoffeeScript does not have a lot of tooling around it, and the community has moved on.

There are documentation tools like docco and codo, but there is no tooling that makes it as well integrated with the language as JavaScript + JSDoc, where there is tooling that can verify types, function parameters and return types giving you a lot of static analysis power.

Then, the entire point of a scripting language is not having to compile. With CoffeeScript you lose that advantage to some extent, and the compiler does not filter many errors, making it a bad tradeoff.