2,570 karma · joined May 8, 2019 (7y ago) · 1,261 submissions
comment 1y ago · link · parent
But OCaml sadly can't replace F# for all my use cases. F# does get access to many performance-oriented features that the CLR supports and OCaml simply can't, such as value-types. Maybe OxCaml can fix that long term, but I'm currently missing a performant ML-like with a simple toolchain.
comment 1y ago · link · parent
Modules are like structurally-typed records that can contain both abstract types and values/functions dependent on those types; every implementation file is itself a module. When passed to functors (module-level functions), they allow you to parameterize large pieces of code, depending on multiple types and functions, all at once quite cleanly. And simply including them or narrowing their signatures is how one exports library APIs.
(The closest equivalent I can imagine to module signatures is Scala traits with abstract type members, but structurally-typed and every package is an instance.)
However, they are a bit too verbose for finer-grained generics. For example, a map with string keys needs `module String_map = Map.Make(String)`. There is limited support for passing modules as first-class values with less ceremony, hopefully with more on the way.
comment 1y ago · link · parent
OCaml does have an okay LSP implementation though, and it's getting better; certainly more stable than F#'s in my experience, since that comparison is coming up a lot in this comment section.
comment 1y ago · link · parent
comment 1y ago · link · parent
Avalonia is the go-to library for cross-platform UI in .NET right now. But Microsoft's own apps have been switching to web stacks, in a clear case of "Do as I say, not as I do."
comment 1y ago · link · parent
The 5G version of the Surface Pro 10 (second to last) is completely unusable, the SP8-10 need a kernel fork just for keyboard and touchpad (!), SP4-10 need it for the touchscreen (SP4 is 2015), and the cameras won't work at all since SP7 (2019).
Don't get me wrong, I still run Linux on my devices and would be willing to tinker with custom kernels if certain hardware were worth it. I just can't consider this "runs perfectly fine".
comment 1y ago · link · parent
Are we reading the same tables? The last several models are full of question marks and crosses in the support matrix, and many models old and new seemingly require the linux-surface kernel fork for key features like touchscreens and even some touchpads, you can't just install your distro of choice.
Even compared to my disappointing experience running Linux at home, I'd say that's more of an asterisk minefield, except for a few Surface Laptop models.
comment 1y ago · link · parent
comment 1y ago · link · parent
[1]: https://gleam.run/news/v0.25-introducing-use-expressions/
comment 1y ago · link · parent
> You can flag submissions that you think don't belong on Hacker News.
Well, this is a very low quality submission in my eyes. A tiny read with an unsubstantiated, purely contrarian take that completely misses the point of the debate. Just to be clear, I think anyone is free to post anything on their blogs, that's what they're for, but I don't think posts like these contribute to HN having a good atmosphere for discussion; if I were to write something like this, I'd be ok with it being unsuitable for HN.
BTW I hadn't flagged this before reading your comment. I've done so after reading the submission though.
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
Well, spiritually this is the 13th(?) major version of .NET (possibly more if we count Silverlight's runtime). You missed the part when there was .NET Core 1-3 alongside the old .NET Framework 4.8., and then they skipped Core 4 and stopped supporting Framework so they could finally fix their naming scheme.
comment 1y ago · link · parent
I considered experimenting with web DRM for art sites/portfolios, on the assumption that scrappers won't bother with the analog loophole (and dedicated art-style cloners would hopefully be disappointed by the quality), but gave up because of limited compatible devices for the strongest DRM levels, and HDCP being broken on those levels anyway. If the DRM technique caught on it would take attackers, at most, a few bucks and hours once to bypass it, and I don't think users would truly understand that upfront.
comment 1y ago · link · parent
These days I just handroll recursive descent parsers with a mutable stream record, `raise_notrace` and maybe some combinators inspired by FParsec for choices, repetition and error messages. I know it's not as rigorous, but at least it's regular code without unexpected limitations.
comment 1y ago · link · parent
let a = 10;
{
let a = 20;
}
print(a);
And even more clear in OCaml: let a = 10 in
begin
let a = 20 in
()
end;
print a
BTW you should also close the page on Rust then, which also has OCaml-like variable shadowing (and many other languages use very similar forms of shadowing, such as local variables shadowing object fields in Java/C#).