Live data from Hacker News

Programming a space invader in OCaml and OpenGL: lessons learned

marmelab.com

61–70 of 120 posts

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

#61
post #19

Earlier quoted context omitted.

While I didn't try to use Docker (though we did use the same pxhere image :-p), I also struggled to get a productive setup of OCaml. Getting a switch running wasn't the hard part, it was making the environment suitable for real project work. I had a set of Make targets in mind (test, build, shell), some language dev features I wanted (jump to definition, type of expression under cursor), and some properties of the pr…

I agree it's quite annoying to set up an OCaml project, and all the Jane Street stuff makes it even more confusing for newcomers. But to be fair, it may be the case with other languages as well. I recently tried to learn some Javascript, and I spent some time understanding the tooling and package management (npm/yarn, bundling, transpiling, node vs browser, difference between javascript versions).

Modern JavaScript is a major pain to set up, but the difference with other languages is that for some things it's the only language available.

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

#62
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.

True.

But the accumulation of @-signs, for example, seems to be a bit much.

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

#63
post #58

Earlier quoted context omitted.

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.

Whereby you seem to be making the case for "dead" languages.

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

#64
post #36

This article title and conclusions are misleading. It shows how to write a simple game in OCaml and then proceeds to conclude that ReasonML is better. I would expect the author to have the same game implemented in ReasonML for comparison to show us why. Otherwise, it is not very convincing.

having done some OCaml and F#, where F#’s syntax is more like reason, i think it is pretty clear that OCaml is a fascinating language but what does impose some weird syntactic work that both reason and f# relieve you of. probably to someone sufficiently used to ocaml it doesn’t matter but it can hurt adoption

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

#65
post #40

Earlier quoted context omitted.

There isn't anything to fix.

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

On the other hand, if Reason were such a massive improvement to OCaml syntax, where are the people clamoring for F# to adopt more of Reason's ideas?

(Admittedly, F# already shares a couple Reason ideas like C-style comments instead of OCaml's traditional ones. So the waters are clearly muddy here to begin with, but a lot of the big things like let-binding scopes and ;; versus ; presumably would be big F# requests if Reason was so strongly superior to the inherited OCaml legacy.)

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

#66
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.

reason isn't another layer, it's an alternate syntax. it doesn't compile via translation to ocaml code; both reason syntax and ocaml syntax compile to the same thing.

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

#67
post #36

This article title and conclusions are misleading. It shows how to write a simple game in OCaml and then proceeds to conclude that ReasonML is better. I would expect the author to have the same game implemented in ReasonML for comparison to show us why. Otherwise, it is not very convincing.

having done some OCaml and F#, where F#’s syntax is more like reason, i think it is pretty clear that OCaml is a fascinating language but what does impose some weird syntactic work that both reason and f# relieve you of. probably to someone sufficiently used to ocaml it doesn’t matter but it can hurt adoption

I always thought ReasonML was just a more JavaScript-ish syntax on top of OCaml, not necessarily better but just different. In what ways is it an actual improvement?

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

#68
post #36

This article title and conclusions are misleading. It shows how to write a simple game in OCaml and then proceeds to conclude that ReasonML is better. I would expect the author to have the same game implemented in ReasonML for comparison to show us why. Otherwise, it is not very convincing.

having done some OCaml and F#, where F#’s syntax is more like reason, i think it is pretty clear that OCaml is a fascinating language but what does impose some weird syntactic work that both reason and f# relieve you of. probably to someone sufficiently used to ocaml it doesn’t matter but it can hurt adoption

I don't see how you can say F#'s syntax is more like Reason. OCaml and F# have nearly identical syntax for the core language, with the few differences being:

1) places features diverged

2) modules

3) F#'s "light" syntax mode

None of these really seem like Reason at all. Do you have any specific places where they're similar?

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

#69
post #40

Earlier quoted context omitted.

There isn't anything to fix.

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

As a guy who tried to get into OCaml development several times, the language is not the problem at all. It's the several different "standard" libraries, lack of good official agreed upon tutorials and guides, and the fact that it has a GIL and is essentially single-threaded.

If OCaml had Erlang's runtime (parallelism and concurrency via actors with message inboxes) it would likely be the most used language.

Its lack of adoption isn't at all related to syntax IMO. Programmers use all sorts of quirky syntaxes and the world hasn't ended yet.

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

#70

> it is very complicated to install the base stack to develop in OCaml I'm not sure why the author decided to use such a complicated setup using Make and Docker. They could have just ran `opam switch create 4.09.0`, which would have created the compiler, then `opam install ...` for the dependencies. Still, an interesting article. I wouldn't recommending using OCaml/ReasonML for gamedev since getting it to work with W…

Agreed, the choice to use obuild was also bizarre. Dune has been standard for the last ~2 years and before that Oasis was the most popular build tool I believe.
Post reply on HN