Grain, a WebAssembly functional language - Interview with co-author Oscar Spencer

preview_player
Показать описание

Thanks much to Oscar for the interview!

0:00 Intro
0:19 Hello World demo
0:46 Option/Result demo
1:55 HSV conversion demo
4:01 Interview intro
4:18 History
4:59 Why WebAssembly (Wasm)
6:08 Client vs server focus
7:30 Wasm influence on language design
9:05 OCaml, Reason(ML), ReScript, Grain relationship
11:46 Is Grain an ML?
12:33 Academic language features
14:36 Numbers in Grain
16:52 Data first and printable data
19:48 Explicit markers for recursion and mutability
22:04 Async plans
23:01 Roadmap for 1.0
24:28 Aspirations for Grain
25:49 Closing words
Рекомендации по теме
Комментарии
Автор

oh wow this is everything ive ever wanted!! a high level ml type language that compiles to web assembly? im gonna go check it out right now!

eyemotif
Автор

"Don't wory about overlow errors; these aren't the bugs that people are expecting. Sometimes number get big - and that's okay! They don't care that it's going to take up extra memory, they just want it to work."
And, just like that, I became a believer.

calorus
Автор

Using and learning for last 3 months , absolutely awesome.

saipan
Автор

the data-first quote source is Peter Deutsch: "if you get the data structures and their invariants right, most of the code will just kind of write itself"

zyptoskid
Автор

Wonderful video. Excited about the future of grain.

spotandjake
Автор

Sounds awesome, OCaml is a great language and derivatives are very welcome. I like the focus and improvements of the imperative side of OCaml.

shilangyu
Автор

Thanks for doing this channel. I just discovered it but already found ton of value in it. Big fan!

MarekFajkus
Автор

OCaml is the best language that I have used, I love that ML languages are becoming popular on the wasm world

yuzuru
Автор

Nice interview and interesting language :)

I don't know so much about ML, type theory and functional programming, thus seing these topics presented on an accessible way it's pretty nice

Andre-LA
Автор

Im not even a minute in the video and think that this should be linked in the webpage. The languages it was inspired by, a hello world inside an editor and importing stuff that's all good stuff one wants to see at his first look.

jondo
Автор

21:05 That's a nice philosophy. I also try to apply this where possible.
By default, things should be as restrictive as possible, and more work means being able to do more.
In case of programming this means things are not variables by default and you have to explicitly define them as mutable.
In case of my petri net editor this means, you can't create a new arc, if it would forbid any state which could have been reached before.

porky
Автор

19:50
I just realized a problem with object oriented languages, especially the main stream GC ones like Java an C#
Every class is some heavy thing, that stays around for a long time after it's created.
In languages like Rust (and probably OCaml and Grain as well, I never used them), I often create a struct or enum, and then just pass it to the next function, maybe turn in into some different struct or enum, or destruct it and do something with the values, and pass it to some other function or just return.

porky
Автор

This is a very interesting conversation. Sorry I am late to the party.

GQLewis
Автор

Damn, imagine if that grad professor said no to WASM 😅

dhkatz_
Автор

Ocaml fans unite!✊ Seriously, though, the whole printing problem is a good example of how Ocaml really needs a better system for ad-hoc polymorphism. I pray for modular implicits everyday.

adamvandolder
Автор

What was the graduate compiler course you took? I would like to learn ocaml and build compilers.

Also could you do a video going more in depth into the application of wasm please

gagansrai
Автор

I went through their docs and I must say i love how the syntax looks so much like js.

One thing i missed though is something like interfaces/typeclasses. Are these called something else in grain? Or are they still in the works?

vikingthedude
Автор

About the Number type, the comparison to Python makes me a bit confused. WebAssembly itself doesn’t support BigInt or rational. Does Grain only do enlargement up to f64, or does it aspire to make the calculations precise by default like Python? Because the number type is not only a memory issue like mentioned in the interview, it is also a precision issue and a performance issue. I can see maybe performance issue goes with memory issue and can be put off, but precision issue doesn’t sound so benign.

YuFanLou
Автор

This language is great but I really wish I had the same syntax as F# and OCaml tbh...

sceptwo
Автор

Weird priorities imho...no recursion without explicit declaration because you could do it unintentionally (really?), but then it allows shadowing which I think you can only call a footgun.
But still interesting interview, and I'm glad yet another language makes data printable by default.

SaHaRaSquad