News for hackers. Stuff that matters.
Re:Validating Data in Elixir: Using Ecto and NimbleOptions by mjhay on Tuesday November 07, 2023 @07:24AM (#38176001)
I tried out Elixir a couple months back, but had no end of problems getting the tooling set up in VSCode.
Re:Validating Data in Elixir: Using Ecto and NimbleOptions by selykg on Tuesday November 07, 2023 @07:56AM (#38176212)
My experience, admittedly is not one where I am a full time developer just a hobbyist and sort of dev adjacent for work, is that getting _any_ tooling setup in VSCode is a path with no end of problems. So, at least when someone says that type of thing here I go "ah, so the norm." I think saying things like that is more an indictment against VSCode.

Don't get me wrong, I think getting vim/neovim setup to do the same types of things is possibly worse, but I haven't really had much of a better experience in VSCode either.

Re:Validating Data in Elixir: Using Ecto and NimbleOptions by matthewsinclair on Tuesday November 07, 2023 @08:01AM (#38176249)
I have to say that my experience could not have been more different.

So far, everything I’ve done within the Elixir ecosystem has “just worked” (with the exception of some stuff with supervisors, the config and intuition for which are currently eluding me).

For example, I managed to code a full image processing pipeline (classification, labelling, and description) using Elixir, Nx, Bumbkebee, etc on the train on the way into work the other day. Which is about a 35 min trip.

If we’re talking about tooling, the last time I tried to just print “Hello, world!” in either Python or JavaScript, it took me down a hell dungeon of configuration and dependency nightmares. To be fair to both, tho, that was some time ago so I can only hope that situation has cleared up more recently.

Re:Validating Data in Elixir: Using Ecto and NimbleOptions by rob on Tuesday November 07, 2023 @08:34AM (#38176517)
[delayed]
Re:Validating Data in Elixir: Using Ecto and NimbleOptions by thibaut_barrere on Tuesday November 07, 2023 @10:16AM (#38177720)
You can also do "brew install elixir".

But for any serious work I will more likely use asdf or nvm/rbenv/rvm.

Re:Validating Data in Elixir: Using Ecto and NimbleOptions by karmajunkie on Tuesday November 07, 2023 @11:11AM (#38178564)
i basically never recommend the brew version. on the occasion it gets installed i’ve had no end of problems from mismatched erlang version requirements and path management. asdf is just easier.
Re:Validating Data in Elixir: Using Ecto and NimbleOptions by matthewsinclair on Tuesday November 07, 2023 @12:35PM (#38179963)
You left out what I said next in the comment you pull-quoted. :)
Re:Validating Data in Elixir: Using Ecto and NimbleOptions by mjhay on Tuesday November 07, 2023 @08:26AM (#38176447)
I was mainly interested in working with Nx and friends, which look pretty nice. Good to hear about your experience with that.

The ElixirLS server always crashed for me on init. The problem is assuredly on my end, but I was never able to fix it.

https://elixirforum.com/t/elixirls-not-working-runtime-termi...

Re:Validating Data in Elixir: Using Ecto and NimbleOptions by atonse on Tuesday November 07, 2023 @09:34AM (#38177182)
I just discovered elixir-tools which has an LSP and it works instantly, and seems to have a more robust architecture than ElixirLS. I used ElixirLS for a couple years now but it was the best option for a while, but elixir-tools (which I literally installed 30 mins ago) has been a delight to work with.

The instant feedback actually feels like how it always should've been.

Re:Validating Data in Elixir: Using Ecto and NimbleOptions by karmajunkie on Tuesday November 07, 2023 @11:08AM (#38178527)
i tried it out but wasn’t really happy with it in emacs. ended up going back to elixir-ls until elixir-tools is a little further along.
Re:Validating Data in Elixir: Using Ecto and NimbleOptions by mhanberg on Tuesday November 07, 2023 @12:18PM (#38179682)
Next LS author here! I would love to hear about how your emacs experience went and what your setup/config is. My emacs skills are not the best (zero), so I've not been able to really work through any of the kinks.

I have recently gotten it working tho with vanilla emacs with eglot, as well as doom emacs (again, with eglot).

No pressure!

Re:Validating Data in Elixir: Using Ecto and NimbleOptions by karmajunkie on Tuesday November 07, 2023 @02:31PM (#38181622)
happy to provide feedback when i get a minute! i’m also utterly useless in elisp so not sure how useful it’ll be but ill try and make it helpful :)
Re:Validating Data in Elixir: Using Ecto and NimbleOptions by roblh on Tuesday November 07, 2023 @09:39AM (#38177238)
I had this problem too when I started, for me it was an incorrect Erlang version. Using asdf to install both of them fixed it for me completely, and was pretty much a good enough experience all around that I use it to manage Nodejs installs too now.
Re:Validating Data in Elixir: Using Ecto and NimbleOptions by freedomben on Tuesday November 07, 2023 @10:12AM (#38177674)
Yes, protip: Use asdf to manage erlang and elixir versions. The only exception might be if you're on Fedora the packages tend to stay pretty new, but anywhere else (and even there if you need a specific version) asdf is a godsend. I use it to manage go, node, python, and ruby as well.
Re:Validating Data in Elixir: Using Ecto and NimbleOptions by freedomben on Tuesday November 07, 2023 @10:11AM (#38177657)
Getting set up a dev environment for me was painless, with ElixirLS being a big exception. For me the wrong version of erlang/OTP was causing crashes that weren't getting surfaced well. Fortunately I have enough Elixir experience that once I got the error message surfaced I was able to figure it out pretty readily, but yeah that experience can definitely be improved.
Re:Validating Data in Elixir: Using Ecto and NimbleOptions by thibaut_barrere on Tuesday November 07, 2023 @10:15AM (#38177707)
I am a long time Elixir user and I also find the VSCode experience a bit frustrating ; sometimes the completion did not work, for hard-to-tell reasons (I'm switching computers often).

I have seen a couple of issues that have been worked-out.

In particular, it's nice to have completion in ".exs" files!

Re:Validating Data in Elixir: Using Ecto and NimbleOptions by epiccoleman on Tuesday November 07, 2023 @12:36PM (#38179967)
One thing that's been bugging me recently is completions in eex/heex template files. It seems like a tough problem to solve, since you need reasonable completion for html, heex syntax, and arguably also completion on things like schema fields for forms and then components that the project defines.

But man, if I could have a smart editor for those templates I would be like... three times as productive on my little side projects.

Re:Validating Data in Elixir: Using Ecto and NimbleOptions by pawelduda on Tuesday November 07, 2023 @08:02AM (#38176255)
Had no problem with neovim but I think it uses the same LSP under the hood
Re:Validating Data in Elixir: Using Ecto and NimbleOptions by freedomben on Tuesday November 07, 2023 @10:13AM (#38177684)
It does. That's what I use. If you have trouble, check that the erlang version you're using is compatible.
Re:Validating Data in Elixir: Using Ecto and NimbleOptions by pawelduda on Tuesday November 07, 2023 @10:38AM (#38178032)
That's a good point which also applies to tooling such as observer, etc.
Re:Validating Data in Elixir: Using Ecto and NimbleOptions by sph on Tuesday November 07, 2023 @08:06AM (#38176284)
That's an unrelated tangent better served by asking on elixirforum.com instead of polluting a thread with a drive by complaint.
Re:Validating Data in Elixir: Using Ecto and NimbleOptions by lawik on Tuesday November 07, 2023 @08:08AM (#38176306)
The in-editor tooling definitely has rough edges. I've done a lot of Elixir and the ElixirLS stuff falls over a lot for me. There is a new effort with NextLS that seems very promising.
Re:Validating Data in Elixir: Using Ecto and NimbleOptions by mjhay on Tuesday November 07, 2023 @08:30AM (#38176490)
Thanks, I'll check that out.
Re:Validating Data in Elixir: Using Ecto and NimbleOptions by mhanberg on Tuesday November 07, 2023 @12:16PM (#38179637)
Next LS author here! Feel free to reach out with any questions!

My contact links should be discoverable on the website: https://www.elixir-tools.dev

Re:Validating Data in Elixir: Using Ecto and NimbleOptions by sergiotapia on Tuesday November 07, 2023 @08:21AM (#38176398)
Elixirls is finnicky and works 50% of the time in my experience. Don't know why.

Try using Zed it comes with Elixir support out of the box, and uses nextls, which works always for me. Snappy as hell! Like Sublime Text 4.0 https://github.com/elixir-tools/next-ls

Re:Validating Data in Elixir: Using Ecto and NimbleOptions by mhanberg on Tuesday November 07, 2023 @12:19PM (#38179697)
Next LS author here, thanks for the kind words!
Re:Validating Data in Elixir: Using Ecto and NimbleOptions by aeturnum on Tuesday November 07, 2023 @01:20PM (#38180677)
NextLS also has an extension for VSCode![1] I've found the ElixirLS works best with the projects I use at work, but there's a lot of exciting language server development in the space.

[1] https://marketplace.visualstudio.com/items?itemName=elixir-t...

Re:Validating Data in Elixir: Using Ecto and NimbleOptions by sergiotapia on Tuesday November 07, 2023 @02:25PM (#38181548)
This did not work for me. I installed the extension on Linux Mint, VS Code Insiders, and intellisense/autocomplete never worked no matter how many times I restarted the editor.
Re:Validating Data in Elixir: Using Ecto and NimbleOptions by aeturnum on Tuesday November 07, 2023 @11:44PM (#38186903)
I never got it fully working either - it kept getting stuck on one of my dependencies, which happens to ElixirLS sometimes too.
Re:Validating Data in Elixir: Using Ecto and NimbleOptions by itronitron on Tuesday November 07, 2023 @03:57PM (#38182723)
That is why I don't use VSCode. While it's is a nice text editor, VSCode is lacking features that were standard in IDEs over twenty years ago.
Re:Validating Data in Elixir: Using Ecto and NimbleOptions by tokamak-teapot on Tuesday November 07, 2023 @04:09PM (#38182875)
What kind of features? With Elixir, I use the ‘click in stack trace to go to error’ feature, do some debugging, use code completion, test running - and not much else.

I’d be interested to know what other kinds of features there could or should be, as I’d like to be as productive as possible and I don’t feel like I really am.

Re:Validating Data in Elixir: Using Ecto and NimbleOptions by itronitron on Wednesday November 08, 2023 @04:13PM (#38197141)
I'm just starting to learn Elixir, but for other languages as you type in the code editor in an IDE it will auto-suggest method names and method arguments based on the libraries/modules you have included in your project.

Eclipse got this right, but the JetBrains IDEs (such as IntelliJ and CLion) are a bit heavy-handed.

Re:Validating Data in Elixir: Using Ecto and NimbleOptions by tokamak-teapot on Thursday November 09, 2023 @06:21AM (#38203626)
The Elixir add-ons for VS Code provide this too.