rvirding
Creator of Erlang
Where can I find a proper Elixir language reference manual? Need it for courses. The web site is very much a tutorial, as are the books.
Trending in Questions
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
Hello,
I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind.
However, when I launch mix phx.server, I get an error...
New
I really like the adapter patterns that ecto, nebulex, waffle, etc. use and would love find something similar for a key management servic...
New
Hello folks!
So at work, we are seeing some situations where we have to define some “fixed” strings that are used across the codebase in...
New
I’m working on a small exercise involving update_in/3, and I came up with this solution:
data = %{
name: "Periodic Table",
category:...
New
I’ve got trouble wrapping my head around the order in which functions are called in this snippet (from Phoenix’s authentication):
toke...
New
Is there any way to avoid the Hologram compiler running when using iex? It seems like the front-end code could potentially be disregarded...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #ai
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #security
- #metaprogramming











Showing Posts 56 to 47- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
OvermindDL1
Just an aside,
ifreally should not be a special form or parsed with the syntax or anything of the sort in Elixir, it could easily be just a macro like:Or something of that sort. There’s no reason for it to be anything but a macro in
Kernel, oh and look it is (although it does some weird stuff like special case the random atomniland such… *cough* still not a fan ofnilbeing special at all), but yea it is not syntax, nor isdefas it is just a macro as well.The point of this is, since they are macro’s then the user could override them to make them do something else (like how I override
defin mydefguardlibrary to allow you to define super-guards likeis_struct(I still think my style (though complete) ofdefguardshould be built-in to elixir) (I might be in a lisp’y mood…)), but because of that syntax coloring them special may not always make sense, like say in a DSEL.What I really really hate being special-form’d are things like
withandfor, both of those could have been done in other more traditionally ‘macro’ ways without the comma-splosion, but since they are special-formed then syntax coloring on them can be specialized…tmbb
Ok, we do agree on this one.
Here I’m not sure we agree. The definition of syntax I use (it’s been a long time since I’ve read a book on the subject) is the same as the one given on Wikipedia (Syntax (programming languages) - Wikipedia):
While semantics is (from the same article):
From the point of view of the syntax, there is nothing special about
ifanddef. The rules you use to decide whether they are part of a valid program are the same. They are both ordinary identifiers.I admit my perspective might be too pedantic, strict and theoretical. After all, you’re the one who has implemented (real, used by may people) languages in practice, so I certainly respect your mental models regarding this topic!
But in this case, the difference these definitions draw between Syntax and Semantics is useful to me, while your nebulous notion of “it’s syntax if most programmers agree it is” is to vague for me personally.
rvirding
Yes, you are misunderstanding my position.
We do agree. I did not say that “it looks like syntax”, what I said was “what a binary looks like” “is very much syntax”. I could flip the order and say syntax is what they look like.
Again I did not say looks like syntax, but what it looks like is syntax. And I see
defandifas syntax as they are part of the standard definition of the Elixir language. In the same as data types.OvermindDL1
Mmmmmmmm… ^.^
I mean, uh, cough…
tmbb
I wonder if there should be two reference guides: one for Developers who don’t want to write macros and one for Developers who want to write macros, maybe titled something like:
Reference for Developers who don’t like LISP or don’t know what it is, which basically describes elixir like if it were python. After all, it has
def,if,with,Enum.reduce_while(basically a pythonforloop that doesn’t leak outside the scope).defmacrodoes not exist and the|>operator is a special form that does magic with your functions to put the arguments in the right place. Modules are like classes that have no internal state and can’t be instantiated, unless they inherit (sorry, use! they use!) GenServers and you mess with something arcane like the process registry. Then you get gets and sets and mutable internal object state. Ok, I’ll stop nowReference for Developers who think that LISP is the best thing ever and that the characters that compose the program are mere distractions from the holy truth of the AST, which describes elixir as if it were LISP and in which after chapter 2 all programs are written directly by manipulating the AST using functions (
do ... end?defmacro? who needs them? We write our AST directly!)Despite the joking nature of these titles, and the parody-like description, I’m being serious, and I’d totally buy a book like number two if someone were to write it. And if @rvirding’s right, then reference #1 might be useful for many people too.
tmbb
I don’t think we agree. You say it looks like it is syntax. I say it is syntax. It’s a sequence of symbols that’s translated into an AST in a very unconventional way compared to the rest of the language (the same goes for maps, tuples, etc).
You’ve written this, which makes me think you think these cases are analogous. My position is that
defandiflook like syntax (they are turned into an AST node the way any function call is), while<<...>>is syntax (the parser does funny stuff with it to turn it into an AST node).Or am I misunderstanding your position?
EDIT: The individual expressions separated by commas inside of a
<<...>>are certainly not syntax (but they do look like it, enough to fool me before trying quote a binaryquote do <<...>> end, like José showed above).rvirding
I agree. What a binary looks like is very much syntax, the same as for all the other data types. The syntax describes what things look like. What they are parsed to is basically irrelevant to most users.
I think the important thing is to understand for whom you are writing a syntax description.
tmbb
Ok, thanks! I agree with you, then. The types inside the
<<>>are certainly not syntax, and they shouldn’t be highlighted any differently in a syntax highlighter.rvirding
I would say that that is a language developers way of looking at it.
For most users of Elixir whether parts of the “standard syntax” like
defandifare built-in syntax or macros is completely irrelevant. How I write them and how do I use them are the important bits.do ... endvsdo: ...is a little more complex but I think you can happily just describe what they look like and how they equate to make most users happy and to get them right.Again, I think most users, even those who write big complex systems, will not define their own macros even though they will be using lots of things defined by macros. In one way it is similar to the fact that using OTP you can write large extremely concurrent and parallel systems without a
spawn,sendorreceivein sight. You should know that things are being done concurrently but you don’t need to use the explicit concurrency primitives.josevalim
Sigils are very different from containers such as tuples, lists and binaries.
Yes. But the parser does not add meaning to this. You can also write this:
Therefore, syntax wise,
<<>>can mean anything. That’s why I said you won’t find the documentation for what<<1::byte>>means in the syntax reference. The syntax allows you to put whatever you want on the right side of::, the meaning comes from elsewhere.This is a big contrast to other languages, such as Erlang, where what is allowed inside
<<>>is a directly known by the parser.