Can’t talk to the debugger, but I did envy the unbelievable reliability that Elm purportedly had. Frequently read reports of applications just never crashing in years of being deployed.
I’ve always kept an eye on Haxe because the ability to compile down to anything just seems crazy cool: “Haxe can build cross-platform applications targeting JavaScript, C++, C#, Java, JVM, Python, Lua, PHP, Flash, and allows access to each platform’s native capabilities. Haxe has its own VMs (HashLink and NekoVM) but can also run in interpreted mode.”
I don’t think elm-ui fights html and css, it just build on top of it. as the Richard Feldman talk says, css as bytecode… and another thing is that elm-ui is not “just functions that return html elements”, it’s function that generate html with styling properties, it looks like html + tailwind but a few years before tailwind was created. also that paired with function currying makes very easy to create and build composable ui elements that is not easy to replicate in other languages.
hey, TIL that we have a hiccup like thing in elixir. is that maintained? althought heex nowadays is really cool
just to add to the list of cool things in Clojure…
hiccup is a really nice way to write html. The idea of having data represent markup properties is really cool. make it very easy to compose and transform.
but one of my favorite libraries on Clojure is pathom (I even started working on an equivalent in elixir/erlang boto). At the beginning it seems just a way to build a graph of data from different sources in a way that they relate to each other(that is a complex thing to understand already), but when you realize that resolvers are just functions and can do anything with the data, not only retrieve it, it’s when it really becomes very powerfull. on my perspective it’s a declarative data paradigm where you say what data you need and the engine finds the code to compute that data.
Oh yeah, elm-UI
is very cool, only used it for one or two projects and it probably the best experience I had making any kind of layout.
Saying it’s like tailwind is (IMO) a great disservice! It’s more like rethinking how we could layout and style things for a Browser, from the ground up. Kind of like how Elm.Browser
entirely ditches anything to do with scrolling and borrows viewport approaches from 3D graphics.
A possibly spicy take, but I miss the ease of Java Native Access for building C bindings.
The pattern is
- Look at the C header
- Translate each one you want into a single line
native
method (and its not difficult) - Voila, native access.
I used it heavily making GTK bindings, here’s an example: jgtk/src/main/java/com/gitlab/ccook/jgtk/gtk/GtkWindow.java at 7367816cbe30fbb76349d3b5a0570bbbf30d3082 · camatcode/jgtk · GitHub
I love Ruby/Rails way of doing relative time strings. “Two days ago”, “25 minutes ago”, “1 month ago”. It’s very clean. time_ago_in_words (ActionView::Helpers::DateHelper) - APIdock
I love in NextJS how much easier it is to import and render an image. Very clean and not confusing. In Elixir I still sometimes forget to properly reference files in priv, that breaks in prod. Inelegant.
I love in Nim how you can compile a static binary that can run on any target platform you want, while still looking like Ruby/Python.
LINQ
I love Ecto DSL but its SQL only, it would be awesome if we can build query for enumerable like LINQ
Not possible for Ecto or Ash, but it would be simple for SQL. Actually sqlx is table takes of what SQL can do. Since it builds an AST. Hooking in the DB for validation is something I’m going to explore in a future release as it will help me built integration tests.
Recently ported a fun concept in a cursed way to Elixir GitHub - zachdaniel/mixfix: Cursed mixfix operators in Elixir.
I hope those aren’t AI generated commit messages
Ruby has something similar, keyword arguments - which allows you to name parameters:
def add_values(first:, second:)
first + second
end
add_values(first: 5, second: 3)
Can be called in any order:
add_values(second: 3, first: 5)
Can be used with positional arguments:
def add_values(first, second:)
first + second
end
add_values(1, second: 2)
And you can supply default values:
def add_values(first: 0, second:)
first + second
end
I like how Rails generally has a lot of things built in that almost all apps/sites might use.
Recently I noticed Rails now also have a built in rate-limiter, super handy!
And something I have used in almost every Rails site is caching, which can really help make a site feel fast and responsive.
As an example:
This is cached and the cache is busted when the updated_at
field changes. It might not look like much but there are a lot of things that need to be calculated and pulled in - the category names and hover colours need to be worked out, the icon and colour in the top right needs to be worked out, the domain name is stripped from the full url, the tags need to be classified and displayed as portals or tags etc. That’s a lot of CPU per page without caching.
On top of that you can cache queries and set them to expire from as little as a minute to a day or more. I do this for even relatively simple queries as it can give you some protection against DDOS attacks.
def latest_spotlight
Rails.cache.fetch("latest_spotlight", expires_in: 1.hour) do
Topic.where(category_id: Category.in_the_spotlight).includes(:image_upload).last
end
end
Without caching a Rails page load can show more than 20% CPU usage, with caching, as little as 1%.
Many, many Rust ↔ XYZ bridging libraries use it to a crushing success (GTK ones included IIRC). The SQLite3 library that I am using to make a bridge to Elixir is also partially stepping on it.
AFAIU, Zig also has pretty much transparent integration with the C ABI: Chapter 4 - Working with C - zighelp.org.
Optional Chaining
and nil coalescing operator
from Swift programming language - Optional chaining - a free Hacking with Swift tutorial
The rust ?
operator providing early returns with Optional.
You’d like @ityonemo 's Pegasus (Pegasus - PEG grammar nimbleparsec generator). You write PEG grammar, and it compiles it down to nimbleparsec
with possibilities to transform inside matches etc.
Have y’all heard of objects? I’ve heard there is a language called (I think?) See Sharp that has them. From what I can gather, it looks like they are a primitive form of gen server, but maybe they would have some use in Elixir?
Yeah, that’s the slickest, most low friction syntax I’ve used for a Return type.
The problem is with that part, as for “look at C header” part you still need full C compiler and translating between C calls and NIFs isn’t that trivial matter in many cases.
If anything there could be bindings for libffi (there is even old EEP 0007 that never landed). This would allow loading native dynamic libraries at runtime and extract symbols from that, that would help with a lot of trivial cases (like for example getting euid
in Erlang code), but that will work only in super trivial cases.
Signals in GDScript 2, recently released with Godot 4, makes communicating between modules really easy. PubSub exists, and is pretty easy to use, but with Godot, I simply declare a signal in a global file and it becomes a top-level class that is dead simple to connect to any declared method in any script or emit from any method anywhere. Type safety can be baked in to the declaration, or the declaration can be more general with the type sniffing happening at the function level. It’s like the PubSub model, but better.