🌗 Jane Street Blog - GADTs 對效能的重要性
➤ 如何利用 GADTs 優化 OCaml 程式的記憶體管理及效能
https://blog.janestreet.com/why-gadts-matter-for-performance/
本文探討了廣義代數資料型別 (GADTs) 如何提升 OCaml 程式的效能。作者分享了 Jane Street 在使用 GADTs 方面的心得,指出 GADTs 允許更精細地控制記憶體表示,從而優化程式效能。文章以一個簡單的例子說明瞭在沒有 GADTs 的情況下,嘗試設計一個既能使用通用陣列又能使用 bytes 的陣列類型所遇到的問題,並展示了 GADTs 如何有效地解決這些問題,並避免不必要的記憶體開銷。
+ 這篇文章清楚地解釋了 GADTs 的實用價值,即使我不是 OCaml 專家,也能理解它如何提升效能。
+ 我一直在尋找提升 OCaml 程式效能的方法,這篇文章提供了一個很有趣的切入點,讓我對 GADTs 產生了興趣。
#編程 #OCaml #GADTs #效能優化
Why GADTs matter for performance

When GADTs (Generalized Algebraic DataTypes) landed inOCaml, I wasn’t particularly happy about it. I assumed that it was the kind ofnonsense you get when you...

Jane Street Blog
Oh, great! Another riveting read on #GADTs and #performance from the folks over at Jane Street, because who doesn't love a good bedtime story about #OCaml and type systems? 💤✨ Spoiler alert: GADTs are apparently the unsung heroes of speed, and if you don't obsess over them, you're clearly doing life wrong. #NerdAlert 🚀
https://blog.janestreet.com/why-gadts-matter-for-performance/ #TypeSystems #JaneStreet #NerdAlert #HackerNews #ngated
Why GADTs matter for performance

When GADTs (Generalized Algebraic DataTypes) landed inOCaml, I wasn’t particularly happy about it. I assumed that it was the kind ofnonsense you get when you...

Jane Street Blog
Why GADTs matter for performance

When GADTs (Generalized Algebraic DataTypes) landed inOCaml, I wasn’t particularly happy about it. I assumed that it was the kind ofnonsense you get when you...

Jane Street Blog
I'm really glad to share my last work about μTCP, #unikernels, effects and #OCaml 5. I talk about TCP/IP, #GADTs, and some useful data-structures. https://blog.robur.coop/articles/utcp_and_effects.html
Robur's blog - μTCP, Miou and unikernels

My experiment about the TCP/IP stack, effects and unikernels

I started to work a bit (on my free time) on `vif`: https://github.com/robur-coop/vif. It's really experimental but I really like the idea to launch a simple webserver from an #OCaml script. `vif` is also a library and you can use it to make your own webserver. I also started to work on `hurl` which is the client part: https://github.com/robur-coop/hurl. These projects are truly experimental, but I am quite satisfied with the API they are proposing. Lot of #GADTs everywhere!
GitHub - robur-coop/vif: A simple HTTP server for OCaml 5

A simple HTTP server for OCaml 5. Contribute to robur-coop/vif development by creating an account on GitHub.

GitHub
GitHub - sdiehl/wiwinwlh: What I Wish I Knew When Learning Haskell

What I Wish I Knew When Learning Haskell. Contribute to sdiehl/wiwinwlh development by creating an account on GitHub.

GitHub

[Haskell-cafe] Regular Expressions without GADTs
"Might we actually decide semantic subtyping
(yielding a coercion) that way?

So what's the point? GADTs are a very convenient way to provide data
which describe types. Their encoding via type classes, or
whatever, may be possible, but this encoding is not necessarily as
convenient as the GADT. Whether or not the various encodings of #GADTs
deliver more convenience in this example is not clear, because the
programs do not correspond. Moreover, once you have to start messing
about with equality constraints, the coding to eliminate GADTs becomes a
lot hairie"
https://mail.haskell.org/pipermail/haskell-cafe/2005-October/011747.html#:~:text=Might%20we%20actually,a%20%0Alot%20hairier

[Haskell-cafe] Regular Expressions without GADTs

Now, #Bob can be used by anyone who understand the drag'n drop user interface on Windows! To celebrate, robur.io and me wrote an article about our #OCaml experience and #GADTs available here: https://blog.osau.re/articles/gadt_and_state_machine.html Bob is usable and our #MirageOS still alives!