melange
ocaml
melange | ocaml | |
---|---|---|
15 | 125 | |
855 | 5,530 | |
2.1% | 1.3% | |
9.3 | 9.9 | |
5 days ago | 3 days ago | |
OCaml | OCaml | |
GNU General Public License v3.0 or later | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
melange
- OCaml Syntax Sucks
-
Melange for React devs book, alpha release
Hey HN, at Ahrefs we have been working on an online book that hopefully helps React developers get up and running with Melange, an OCaml to JavaScript compiler. You can read more about Melange here: https://melange.re/.
There are still a few chapters that we'd like to add before considering it "complete", but it might be already helpful for some folks out there, that's why we decided to publish it early.
The book uses Reason syntax to implement React components using ReasonReact components. You can read more about both in:
https://reasonml.github.io/
-
Reason and React Meta-Frameworks
In my previous post on trying to use the NextJS App Router and Reason I described some of the problems and limitations of their compatibility with one another. With the release of Melange 2 I decided to see if the new features of Melange 2 could help to increase the compatibility of Reason and the NextJS App Router. I have also documented some of the things learnt after trying Melange (v1) with Astro and Remix.
- GitHub - melange-re/melange: A mixture of tooling combined to produce JavaScript from OCaml & Reason
-
OCaml 5.0 Alpha Release
So it's Reason, not ReasonML which the umbrella project's name, and Rescript is a imcompatible syntax split from the Bucklescript team (that previously transpiled Reason to JS). Bucklescript's new name is... Rescript.
But not everyone agrees with the split and work is being done on Melange to replace Bucklescript : https://github.com/melange-re/melange
Ultimately JsOfOcaml can directly transpile Ocaml to JS.
-
Question about the Reason project in general
In reality, most folks that developed BuckleScript frontends with ReasonML switched to ReScript syntax and are happy with it. Some felt more friction because of their reliance on PPXes or FP-heavy libraries (like Relude) and those people tend to use the Melange fork of BuckleScript or they switched to js_of_ocaml.
-
From TypeScript to ReScript
There is a fork of ReScript that supports ReasonML syntax and with the goal of maintaining Ocaml compatibility: https://github.com/melange-re/melange.
-
From object-oriented JS to functional ReScript
There's also a fork of BuckleScript/ReScript called Melange that guts its build system so that instead of using ninja, it works with more standard tools for the ecosystem, specifically dune and esy. In doing so they managed to also finally get the compiler off of OCaml 4.06: now it can use a newer OCaml compiler and take advantage of four years worth of language and compiler improvements.
- Are Dynamic Languages Going to Replace Static Languages? (2003)
-
Writing custom VSCode extensions in ReasonML
For OCaml and ReasonML your options are js_of_ocaml (mentioned here in ReasonML docs) or a fairly new fork of BuckleScript called melange. They differ in implementation and output, with JSOO taking intermediate bytecode generated by ocamlc and turning it into unreadable JS, vs Melange being a patched compiler that builds more human-readable JS.
ocaml
- Non-temporal store heuristics on the Apple M2
-
TypeScript's Lack of Naming Types and Type Conversion in Angular
Elm, ReScript, F#, Ocaml, Scala… it’s just normal to name your types, then use them places. In fact, you’ll often create the types _before_ the code, even if you’re not really practicing DDD (Domain Driven Design). Yes, you’ll do many after the fact when doing functions, or you start testing things and decide to change your design, and make new types. Either way, it’s just “the norm”. You then do the other norms like “name your function” and “name your variables”. I’m a bit confused why it’s only 2 out of 3 (variables and functions, not types) in this TypeScript Angular project. I’ll have to look at other internal Angular projects and see if it’s common there as well.
-
Whence '\N'?
It does, it links to this: https://github.com/ocaml/ocaml/blob/4d6ecfb5cf4a5da814784dee...
-
My first experience with OCaml
open Monitoring let test_get_websites_from_file () = let websites = Config.get_websites_from_file "test_websites.yaml" in assert (List.length websites = 2); let first = List.hd websites in assert (first.url = "https://ocaml.org"); assert (first.interval = 20) let () = Unix.chdir "../../../test/"; test_get_websites_from_file ();
- My first experience with Gleam Language
-
ReScript has come a long way, maybe it's time to switch from TypeScript?
Ocaml is still a wonderful language if you want to look into it, and Reason is still going strong as an alternate syntax for OCaml. With either OCaml or Reason you can compile to native code, or use the continuation of BuckleScript now called Melange.
-
Autoconf makes me think we stopped evolving too soon
> OCaml’s configure script is also “normal”
If that’s this OCaml, it has a configure.ac file in the root directory, which looks suspicious for an Autotools-free package: https://github.com/ocaml/ocaml
-
The Return of the Frame Pointers
You probably already know, but with OCaml 5 the only way to get flamegraphs working is to either:
* use framepointers [1]
* use LBR (but LBR has a limited depth, and may not work on on all CPUs, I'm assuming due to bugs in perf)
* implement some deep changes in how perf works to handle the 2 stacks in OCaml (I don't even know if this would be possible), or write/adapt some eBPF code to do it
OCaml 5 has a separate stack for OCaml code and C code, and although GDB can link them based on DWARF info, perf DWARF call-graphs cannot (https://github.com/ocaml/ocaml/issues/12563#issuecomment-193...)
If you need more evidence to keep it enabled in future releases, you can use OCaml 5 as an example (unfortunately there aren't many OCaml applications, so that may not carry too much weight on its own).
[1]: I haven't actually realised that Fedora39 has already enabled FP by default, nice! (I still do most of my day-to-day profiling on an ~CentOS 7 system with 'perf --call-graph dwarf', I was aware that there was a discussion to enable FP by default, but haven't noticed it has actually been done already)
-
Top Paying Programming Technologies 2024
11. OCaml - $91,026
-
OCaml: a Rust developer's first impressions
> It partially helps since it forces you to have types where they matters most: exported functions
But the problém the OP has is not knowing the types when reading the source (in the .ml file).
> How would it feels like to use list if only https://github.com/ocaml/ocaml/blob/trunk/stdlib/list.ml was available,
If the signature where in the source file (which you can do in OCaml too), there would be no problem - which is what all the other (for some definition of "other") languages except C and C++ (even Fortran) do.
No, really, I can't see a single advantage of separate .mli files at all. The real problém is that the documentation is often worse too, as the .mli is autogenerated and documented afterwards - and now changes made later in the sources need to be documented in the mli too, so anything that doesn't change the type often gets lost. The same happens in C and C++ with header files.
What are some alternatives?
js_of_ocaml - Compiler from OCaml to Javascript.
Alpaca-API - The Alpaca API is a developer interface for trading operations and market data reception through the Alpaca platform.
rescript - ReScript is a robustly typed language that compiles to efficient and human-readable JavaScript.
VisualFSharp - The F# compiler, F# core library, F# language service, and F# tooling integration for Visual Studio
reason - Simple, fast & type safe code that leverages the JavaScript & OCaml ecosystems
dune - A composable build system for OCaml.
haxe - Haxe - The Cross-Platform Toolkit
TradeAlgo - Stock trading algorithm written in Python for TD Ameritrade.
Nim - Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
koka - Koka language compiler and interpreter
vscode-ocaml-platform - Visual Studio Code extension for OCaml
rust - Empowering everyone to build reliable and efficient software.