Live data from Hacker News

How I fell in love with Erlang

boragonul.com

191–200 of 263 posts

Re: How I fell in love with Erlang

#192
post #161

Earlier quoted context omitted.

I used to think that Clojure was going to be the first FP language that was going to go mainstream but it seems to have fizzled. What went wrong?

in some ways Elixir is a child of Clojure! > JOSE: Yeah, so what happened is that it was the old concurrency story in which the Clojure audience is going to be really, really familiar. I’ve learned a lot also from Clojure because, at the time I was thinking about Elixir, Clojure was already around. I like to say it’s one of the top three influences in Elixir, but anyway it tells this whole story about concurrency, ri…

I work with elixir daily and I would concur. elixir's semantics line up nearly 1:1 with the clojure code I used to write a few years ago. Its basically if you replaced the lisp brackets with ruby like syntax. The end result is a language that is much easier to read and write on the daily with the disadvantage of making macros more difficult. I would argue that it should be difficult since you should avoid using it until absolutely necessary. Lisps on the other hand, practically beg you to use macros as the entire language is optimized for their use.

Re: How I fell in love with Erlang

#193

Earlier quoted context omitted.

This stands to reason. If you need to bridge different languages together like in your case, they need to speak a common tongue. REST/GrahQL/gRPC solve this problem in different ways. There is no technical limitation keeping you from serving HTTP traffic from Erlang/Elixir, but from my own experience it isn't a pleasant experience. JavaScript or Python are dead simple, until you realise that 64-bit integers are not a…

64 bit ints are a thing in JS for a while now

No, they aren't. You have to use BigInt, which will throw an error if you try to serialise it to JSON or combine it with ordinary numbers. If you happen to need to deserialise a 64-bit integer from JSON, which I sadly had to do, you need a custom parser to construct the BigInt from a raw string directly.

Re: How I fell in love with Erlang

#194
post #115

Earlier quoted context omitted.

> That would be an absolutely awesome project. Usually when you can think of it someone has already done it so a bit of googling I've done a bit of googling and research, nothing viable has surfaces, and I still haven't found the time to create a prototype myself, just some doodling around here and there. I do agree that it's an awesome idea, and it's been stewing in my head for a couple years now! There are a lot of…

> Any reason you haven't posted it on Github/Codeberg? Yes, I don't want Microsoft to be able to pretend claim I gave it to them for some particular purpose which I didn't. They'll have to come and take it. Feel free to use that code and do anything you want with it, and if there are no more seeds for the code let me know and I'll serve up the torrent.

I hear you. These days all my projects are on private SSH repositories on my servers.

Re: How I fell in love with Erlang

#195
post #171
post #115

Earlier quoted context omitted.

> That would be an absolutely awesome project. Usually when you can think of it someone has already done it so a bit of googling I've done a bit of googling and research, nothing viable has surfaces, and I still haven't found the time to create a prototype myself, just some doodling around here and there. I do agree that it's an awesome idea, and it's been stewing in my head for a couple years now! There are a lot of…

I've got a hobby OS you may want to check out. Crazierl is a just enough kernel that can run the FreeBSD build of BEAM as a single OS process. Features include: x86-32 only, bios boot only, SMP capable, drivers in Erlang (there's nifs for managing memory with devices or i/o; and the kernel manages the interrupt controller(s) and has console output before userspace takes over), a kind of working IPv4 stack, dist! It d…

That last link deserves its own HN post!

Re: How I fell in love with Erlang

#196
post #130
post #69

For what it's worth, I'm stuck on the very first x = x + 1 thing. Not sure if you want to call it a screwup or bad grammar or whatnot, but it is perhaps the huge mistake that the "equals" sign was used for something that feels like, but emphatically DOES NOT mean, "is equal to." It's "put this into that". It's an action verb. Should have perhaps insisted on x x

> It's an action verb. The difference is that it is an instruction. Conventional mathematical notation, while declarative by default, switches into instruction mode just the same with the "let" keyword. The usage of the "=" operator then becomes equivalent: e.g. let x = 1. But as the aforementioned x = x + 1 comes from notations that are never declarative, where every statement is an instruction, the "let" keyword is…

In one character

    x ← x + 1

Re: How I fell in love with Erlang

#197

Took me a long time to figure out what gets lost with Erlang is: a) Ubiquity — everything understands HTTP. Erlang nodes only talk to Erlang (or a compatible runtime) b) Because there are no middleware standards (REST, GraphQL, OAuth, etc.), you must build or integrate your own abstractions c) Giving up infrastructure (reverse proxies, load balancers, CDNs), You handle distribution yourself or through OTP design d) I…

Incidentally, it makes Erlang-built systems robust. I used to run yaws-based web servers (and still do). One laughs at the logs, the feeble adversarial attempts to run this exploit or that. Nothing fits, nothing penetrates, nothing is even remotely relatable.

Re: How I fell in love with Erlang

#198
It's funny, because I find Erlang to be one of the least accessible languages I've ever tried (and my entry into this world of digital wonders was thru disassembling cracktros on a M68k, before internet, in a then-foreign language).

That said, the metaphors are so elegant, the key concepts so well chosen -- yes, the initial onramp may be a cognitive slog, but it's well worth it. It makes everything downstream so much easier.

Re: How I fell in love with Erlang

#199
post #195
post #171

Earlier quoted context omitted.

I've got a hobby OS you may want to check out. Crazierl is a just enough kernel that can run the FreeBSD build of BEAM as a single OS process. Features include: x86-32 only, bios boot only, SMP capable, drivers in Erlang (there's nifs for managing memory with devices or i/o; and the kernel manages the interrupt controller(s) and has console output before userspace takes over), a kind of working IPv4 stack, dist! It d…

That last link deserves its own HN post!

v86 has been posted a few times [1], I'm pretty sure that's how I became aware of it to use as a target platform. It's a nice project, and they've taken three PRs from me (so far) that make it easier for me to run my weird OS :) Lots of other contributions here and there from others which is great, because I thought I was going to have to build a virtio-net device in v86 or write a ne2k driver in crazierl, and other people built and debugged the virtio-net so I can just use it.

[1] https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...

Re: How I fell in love with Erlang

#200
post #22

> X equals X plus one? That’s not math. That’s a lie. That's really interesting... My wife, who has no real mathematical background had the EXACT same reaction when I was trying to teach her some simple programming. I tried to explain that equals in that context was more of a storage operator than a statement that said line is true. She found it very frustrating and we gave up on the endeavor shortly thereafter. I've…

> She found it very frustrating [...] I wonder if I should try a [different language] with her

Or, perhaps, preprocess left-arrow to equal?

Customizing a language to taste. Especially for shallow syntactic issues. Like "no multi-line string literals allowed ... I'm sorry, that's just not ok". Or "ok kid, what nicknames would you like to give the keywords today"?

When programming for just fun, I'll sometimes go "this aspect of the language bugs me - I could of course just live with it... but here, I think it will be more fun not to". So for recent example, a few lines of recast.js ast tweaking, and I could use infix unicode mathematical symbols as javascript functions.

I wonder if one could teach programming by build-your-own language. Perhaps even of the video-scanned desktop variety. "Draw a circle around your toys to create a collection. Label it with a letter. Now you can sort/filter it by..."

Post reply on HN