Open nelsonic opened 1 month ago
If you're reading this, please don't worry, for now it's just a placeholder. π I definitely don't have time to be learning a whole new programming language ... β³ But I will be returning to this in the future. π€
Excellent idea! Zig seems the thing, cross-compilation, compiles C code (cf FFmpeg for Zig
@ndrean yeah, we agree. π‘ π
A friend of @dwyl
is super keen on TigerBeetle which is built in/with Zig
. β‘
We've watched a few videos e.g: youtube.com/watch?v=sC1B3d9C_sI and are very impressed. π
It seems considerably easier to learn Zig
than Rust
(at least on the surface) and equally reliable/performant. ποΈ
Zigler
https://hexdocs.pm/zigler/Zig.html -> https://github.com/E-xyza/zigler is actively developed/maintained π
And allows incredible flexibility to run a specific/separate OTP
app to execute the Zig
functions/programs.
Supports Nerves
out-of-the-box so if we need to do something "low level" in IoT
we can use a NIF
.
Getting all the fault-tolerance, observability and developer happiness of Elixir
π§
and being able to use the performance of Zig
when we see a bottleneck feels like an awesome combo! π¦ΈββοΈ
Read this post: https://matklad.github.io/2023/03/26/zig-and-rust.html π
Thanks for sharing! β€οΈ I only skimmed Rust, and when I started to read a bit about async in Rust, I understood Rust was not for me. I am also curious about Go.
In my TO_VIEW list: don't write NIFs
Yeah, the 100% agree with not writing NIFs
in C
! π¬
The biggest danger with NIFs
is the "Shiny Object Syndrome" https://en.wikipedia.org/wiki/Shiny_object_syndrome β¨
whereby people start implementing Business Logic in the NIF
instead of just a single perf-focussed function! π
And that is a recipe for chaos if you do it in C
where the are no safeguards! π²
To-be-clear:
C
andC++
were the languages I used for years before I got into Web Dev. β³ So I would be pretty confident writingNIFs
inC
... π€ But I wouldn't for the simple reason that I don't wan to maintain them! π
NIF (Native Implemented Functions) docs: https://www.erlang.org/doc/system/nif.html π
explains why someone would want to use one if there's a perf bottleneck. π€
i.e. 99% of the time Erlang/Elixir
is perfectly performant ποΈ
because the bottleneck in most apps is the Network and Database latency! β³
Zig makes a lot of sense for NIFs
because the language is easier to learn than Rust
https://www.reddit.com/r/elixir/comments/hel3ps/zigler_elixir_ffis_with_zig/
So far I've only noted the technical reasons for learning Zig
.
But one of my biggest reasons for learning Zig
(towards the end of this year),
is simple: Career / Employability relevance.
A few of my friends working in finance are starting to use Zig
. π¦
Mostly because TigerBeetle
https://github.com/dwyl/technology-stack/issues/112
But I suspect it might be the reason a few other people learn Zig
:
https://survey.stackoverflow.co/2023/#section-top-paying-technologies-top-paying-technologies
Good to see Erlang
still in the Top π (second place after Zig
).
Ref: https://blog.logrocket.com/comparing-rust-vs-zig-performance-safety-more/
Looking forward to seeing where these languages are in the 2024
survey.
Yes, I know this survey data/result is very skewed by having low numbers of respondents for the lower usage languages ... so take everything with a grain of salt. There are still Fortran
and COBOL
programmers with deep institutional knowledge of their Bank / Gov systems who are earning way more than the Zig
average. π
Same way there are AI/ML engineers at Startup X
writing Python
and getting paid millions in <options>
that will pay-off if
their Unicorn gets acquired / goes public ... π¦ π π°
As usual, I like to be proactive with my learning; I see myself writing Zig
in the future. π
I definitely will still write Elixir
because I still think it's great for network apps! πΈοΈ
I love the reliability of Elixir
. But I know I'm not going to convince any of my Finance
friends to use it. π
Zig
might be the answer for "What Language to Learn Next?"
@ndrean we are currently writing Go
on a Project it's going well. π
What's Zig
got that C
, Rust
and Go
don't have? (with Loris Cro): https://youtu.be/5_oqWE9otaE @kristoff-it
Again, trying not to get sucked into this right now as have lots of work to do. β³
Thanks for sharing! I looked into TiggerBeetle. But banks are so conservative! Do they adopt this? Tbh, I really know nothing about banking IT but I am sure of one thing: safety is above everything.
π So what about building the Elxiir client for TiggerBeetle? You can promote fault tolerance, scalable web app using Elixir, and interface with Zig? With the advance of LiveView native, you could even propose a mobile version, mandatory I imagine ....
I loved this picture
And to answer your question from above: Yes, some banks are ultra-conservative and avoid any tech innovation. π΄ I've worked at/for a few and they weren't fun ... π β³ M&Ms ... π
But others are always trying to get an edge and invest heavily in their tech/teams! It all depends on how Management/Execs view their Tech:
You definitely don't want to work for a company that sees you as a "cost"; they will "downsize" you in a heartbeat. π Whereas working somewhere that understands that investing in tech can give a substantial ROI ... You will be appreciated and compensated accordingly.
The companies that are using Zig
are doing it for a reason; innovation in team + program performance. π
They are the early adopters - who similar to early investors - make strategic investments that produce outsized returns!
https://ziglang.org/learn/getting-started/
brew install zig
Just a tip! You drop your image, and make your image clickable and direct it to the location by using [<the result of the drop-in>](https://the origin)
[<img width="1179" alt="Screenshot 2024-07-16 at 09 43 06" src="https://github.com/user-attachments/assets/cfdc4ce7-3c57-4fe9-88ff-d3f9f14aebb1">](https://www.google.com/search?q=youtube+elon+musk+fires&oq=youtube+elon+musk+fires&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIGCAEQRRhAMgYIAhBFGDwyBggDEEUYPNIBCDQ1NDJqMGo5qAIAsAIB&sourceid=chrome&ie=UTF-8#fpstate=ive&vld=cid:13572b4c,vid:YZWcC7CbOKQ,st:0)
Target WebAssembly with Zig: https://dev.to/sleibrock/webassembly-with-zig-part-1-4onm and https://dev.to/sleibrock/webassembly-with-zig-pt-ii-ei7
Always find it interesting when a Programming Language uses Forem
(Ruby on Rails) to power their blog/site ... π
https://github.com/forem/forem
Clearly the goal was just to get started/going as quick as possible. :shipit:
And they aren't concerned about building the news site using Zig
. π¦
"Zig
came along and it just fixed everything that was wrong with C
"
Joran Dirk Greef describing why he chose Zig
for TigerBeetle
:
https://youtu.be/ayG7ltGRRHs?t=2400
And gives far more safety [than Rust
] including checked arithmetic.
"You want "checked arithmetic" enabled on mission critical systems ..."
Intro to the Zig Programming Language β’ Andrew Kelley β’ GOTO 2022: https://youtu.be/YXrb-DqsBNU