Live data from Hacker News

Programming a space invader in OCaml and OpenGL: lessons learned

marmelab.com

51–60 of 120 posts

Re: Programming a space invader in OCaml and OpenGL: lessons learned

#51

Earlier quoted context omitted.

If you were right OCaml wouldn't be the only language with a popular syntax veneer.

TypeScript says hi.

Typescript makes virtually no changes to JS syntax, except what's necessary to support types.

Re: Programming a space invader in OCaml and OpenGL: lessons learned

#52
post #25

ReasonML is adversely affected by it's Ocaml base if anything. StandardML would have been a much better base (they went with Ocaml because it was a lower-effort to implement and Facebook has a lot of Ocaml devs). The first bad part is that Ocaml does not have a language spec. The implementation is the spec. This puts them at the whim of the Ocaml devs with no other options. SML is a standard with several good impleme…

FYI strings are now immutable in OCaml. It was a compiler option starting with 4.02 and it has become enabled by default since 4.06.

That's nice to know. On the flip side, that's not nice for interaction between older code that wants to mutate and newer code that wants to "copy". If the "copy" code is actually copying all the time behind the scenes (something it has to do if you are compiling with mutable strings for backward compatibility with the rest of your codebase), that's a huge performance hit.

Re: Programming a space invader in OCaml and OpenGL: lessons learned

#53

Earlier quoted context omitted.

If you were right OCaml wouldn't be the only language with a popular syntax veneer.

TypeScript says hi.

TypeScript extends the syntax to support type annotations; it's not trying to fundamentally fix JS syntax.

Re: Programming a space invader in OCaml and OpenGL: lessons learned

#54
post #6

Earlier quoted context omitted.

> ReasonML seems to be just sugar coating That’s exactly what it is, no secret about that, that’s the goal of that project.

Which begs the question why not learn the real deal, instead of adding another layer to debug. Programing isn't poetry.

> Programing isn't poetry.

First time I've heard a C-like syntax described as "poetic".

Re: Programming a space invader in OCaml and OpenGL: lessons learned

#55
post #6

Earlier quoted context omitted.

> ReasonML seems to be just sugar coating That’s exactly what it is, no secret about that, that’s the goal of that project.

Which begs the question why not learn the real deal, instead of adding another layer to debug. Programing isn't poetry.

There is no layer above, it’s not like coffeescript which compiles to another language. It’s literally an alternative syntax.

Re: Programming a space invader in OCaml and OpenGL: lessons learned

#56
post #55
post #6

Earlier quoted context omitted.

Which begs the question why not learn the real deal, instead of adding another layer to debug. Programing isn't poetry.

There is no layer above, it’s not like coffeescript which compiles to another language. It’s literally an alternative syntax.

Sure it does, unless there is a ReasonML native compiler with its own ecosystem now.

Re: Programming a space invader in OCaml and OpenGL: lessons learned

#57
post #33

Earlier quoted context omitted.

Because people who know other programming languages, but not ML, might want to read your code, and it's nice if it looks familiar to them.

That is how languages like Go get designed, pour souls not able to spend some time learning.

I wish Go had been a reskin of OCaml.

Re: Programming a space invader in OCaml and OpenGL: lessons learned

#58
post #30

Earlier quoted context omitted.

And now it is dead, leaving behind a pile of code to rewrite in next cool toy.

Does Not look dead to me. last activity is within the last 30 days or so. https://github.com/jashkenas/coffeescript/ Its not as popular to be certain, though.

I bet Fortran and Cobol are getting more jobs offers than CoffeeScript.

Re: Programming a space invader in OCaml and OpenGL: lessons learned

#59
post #2

The underlying OCaml naturally. Having learned ML via Objective Caml's predecessor, Caml Light, ReasonML seems to be just sugar coating for those with aversion to ML classical syntax.

> ReasonML seems to be just sugar coating for those with aversion to ML classical syntax. So it's the Elixir to Ocaml's Erlang?

Elixir is a different language for the Erlang VM, but Reason is just a different syntax for the OCaml language. There's a 1:1 correspondence between their ASTs, and even a tool to convert between them.

Re: Programming a space invader in OCaml and OpenGL: lessons learned

#60

Earlier quoted context omitted.

What's the state of using Reason natively? Last time I checked all the documentation and examples where towards the reason/js/react ecosystem. Are there any good native code projects written in Reason to look at for reference?

People don't do it much, but if you're using the most popular build system (dune) you can replace your .ml files with .re ones and it will Just Work. So you can use OCaml projects for reference (I think anyone who's doing Reason should have a vague grasp of OCaml syntax, it's not really that different).

> I think anyone who's doing Reason should have a vague grasp of OCaml syntax, it's not really that different

Especially if you're targeting native, so all your dependencies are written and documented in OCaml syntax.

Post reply on HN