mudasobwa
Creator of Cure
Trending in Discussions
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
New
I want to open this thread for you all to discuss and help those who really like Ash but are still hesitant to use it in a real project. ...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
I’m posting this in response to Jose’s recent tweet (Cr. link) :
People are sleeping on Elixir for a coding harness:
Hot-code swappi...
New
It would be helpful to have a list of companies worldwide that hire engineers without prior experience in Elixir. Often, it can be quite ...
New
Anyone running long-lived stateful processes on BEAM? We’re building an AI agent runtime and would love to compare notes.
We’re a small ...
New
I’ve just put together a small POC exploring PDF inspection from Elixir/Phoenix:
The idea is pretty simple: drag & drop a PDF in a...
New
Other Trending Topics
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
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
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #blog-post
- #ai
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 4- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
Eiji
Well … and that’s exactly what happens when you try to write short messages and don’t want to go too off-topic. There is always someone who would catch just one tiny part that was not explained properly.
Yes, they can be functions and macros as well. Sigils are not even a data type in
Elixir, but exactly a function that return some data. They can return different types depending on flags etc., etc. The true value of sigils is not that they change a string into some data because therefore as you said it could be replaced with a “normal” parse-like function.It’s more like a way to represent a custom struct data in a short format that could even have it’s own syntax highlight. This can’t be replaced with a “regular” strings and any functions unless some library would claim that they reserve some specific naming. This only adds more work for the developers.of
LSPand other tools, so there is really no acceptable replacement here as far as I know.mudasobwa
This was not a nitpicking, in the first place. Messages on forums are public domain and people tend to memoize slogans, therefore I felt kinda obliged to help not so experienced devs reading this not to memoize the plain wrong statement.
Why is that? The sigil is the syntactic sugar for a function call under the hood. One might use
Kernel.sigil_r("0-9", [])everywhere instead of~r/0-9/and literally nothing would have changed for them.Sure it can.
What “this”? The parser is a rather dumb thing, it pays no dime to whether it should highlight the string inside some fancy brackets or inside
sigil_r("and the closing".Eiji
and that’s exactly why people here say I go often off-topic
That’s not true
Pattern matching the
ASTlooks completely different. In first case you pattern-match bysigilname. In second case you pattern-match on the call. Let’s see it in practice:now same for a call:
So if you would look for unifying them into regular functions then:
LSP/ tools maintainersElixircore which would not happen before version2.0.0I have no idea if custom highlights for sigils support “regular” sigil call and I’m not sure if anyone really care about it. Also look that I use
input_astandstringin each case as they are completely different. For you it all looks simple, but somehow needs to make it work under the hood.The parser indeed is, but the parser is not everything. You don’t highligh whole
.exand.exsfile withhtmlparser just because it can containHTMLcode in some sigil, right? Think that you call ahighlightcode for everystringyou find inAST. That’s obvious waste of resources.Also as said sigils can be macros. With macros we work on compile-time and that’s completely different thing that a simply function call.
Again, this goes off-topic. Sigils are not related at all to the original topic and also not to my proposal which is just one of many possible solutions for readability and
LSPintegrations.josevalim
You can hash it out here, but let’s please keep that convo on topic!