News for hackers. Stuff that matters.
Re:Erlang/OTP 21's new logger by xutopia on Wednesday November 28, 2018 @04:44PM (#18555965)
I'm really impressed with all that is happening in the Erlang/Elixir world nowadays. I didn't realize that this community was so actively introducing new features and improvements to what is already a rock solid toolset.
Re:Erlang/OTP 21's new logger by dragosmocrii on Wednesday November 28, 2018 @04:55PM (#18556046)
I agree. Just starting myself with Elixir, and boy do I love the pipe operator, pattern matching, and the wonderful OTP goodies. I've only practiced with Elixir for a couple weeks, but for work when I write PHP code, I feel sad, and look forward to work on the next Exercism task. Also joined the Elixir slack, never seen such an awesome community. I hope Erlang/Elixir continues to thrive
Re:Erlang/OTP 21's new logger by mrdoops on Wednesday November 28, 2018 @06:06PM (#18556535)
The worst part of Elixir is when you're working with other languages and you know it'd be better in Elixir.
Re:Erlang/OTP 21's new logger by dnautics on Wednesday November 28, 2018 @06:53PM (#18556830)
It's not perfect. There's a few strange things like calling function variables with the dot notation, but it's there for a reason, and the rest of it worth the worst of the quirks.

Side note, I wish variable rebinding were off by default but allowed on names with a sigil (or a ! ).

Re:Erlang/OTP 21's new logger by derefr on Wednesday November 28, 2018 @07:33PM (#18557102)
> a few strange things like calling function variables with the dot notation, but it's there for a reason

I feel like anyone who has written a Yacc-based parser for programming-language syntax will appreciate Elixir's grammar even more for these "quirks." Elixir's syntax is as beautiful as it can be while also being explicitly unambiguous. Which means that the language syntax is very easy to change or extend—unlike other PLs I could name, where the set of parsing rules resembles a late-game Jenga tower.

Or, to put that another way: Elixir isn't just a joy to use; it's a joy to be a core maintainer of. (How often have you ever heard anyone consider that part of a programming language's UX?)

Oh, and this simple, explicit set of parse rules also results in a highly-predictable and regular AST, which means you can write an macro-based DSL library in Elixir—one that will actually works with any arbitrary Elixir code hanging out inside your macro body—in not-much code, and without worry that a minor language change in the future will break your lib.

Re:Erlang/OTP 21's new logger by Bjartr on Wednesday November 28, 2018 @07:42PM (#18557173)
> fork and base your own programming language upon. (How often have you ever heard anyone consider that part of a programming language's UX?)

Any time lisp macros come up?

Re:Erlang/OTP 21's new logger by dnautics on Thursday November 29, 2018 @03:09AM (#18558805)
The dominant relational database system (Ecto) very elegantly dsl's databases.
Re:Erlang/OTP 21's new logger by dnautics on Thursday November 29, 2018 @03:07AM (#18558795)
Specifically speaking the optionality (inexplicitness) of parens for function calls causes some parsibg difficulty. The compiler automatically assuming that a bare atom is a function call with () versus a variable, for example.

However, this is really minor in the grand scheme of things, it really is one of the most beautiful pls otherwise

Re:Erlang/OTP 21's new logger by Thaxll on Wednesday November 28, 2018 @07:47PM (#18557203)
Other language that have strong typing for instance or good performance?
Re:Erlang/OTP 21's new logger by ramchip on Wednesday November 28, 2018 @08:05PM (#18557285)
I enjoy Elixir tremendously, but usually I’m forced to use another language (Python) due to popularity, not technical merits.

It’s hard to sell anything that’s not in the TIOBE top 10.

To answer your comment more directly though, for many systems the benefits of excellent concurrency, monitorability, and fault tolerance can outweigh those of a strong type system or raw performance. It really depends what you’re doing, and how your team likes to work. No such thing as a silver bullet and all that.

Re:Erlang/OTP 21's new logger by nine_k on Wednesday November 28, 2018 @08:46PM (#18557426)
You don't have to let go of the FP goodies for a good type system or speed: take F#, or Haskell, or even Scala (with akka) or Kotlin. Ocaml or SML would do, too, but their concurrency story is not as good.
Re:Erlang/OTP 21's new logger by zerogvt on Thursday November 29, 2018 @07:02AM (#18559588)
Same here. Yet, as I'm gonna be job hunting soon, I feel that investing in learning more in Elixir/OTP won't land me a job (let alone a remote one). Too few jobs asking it. It seems that the vast majority is all about microservices/java (still), k8s, nodejs and the like.
Re:Erlang/OTP 21's new logger by skrebbel on Thursday November 29, 2018 @03:57AM (#18558949)
Actually, the worst part of Elixir is when you're realizing that something asynchronous, of all things, would be easier in JavaScript, of all languages.

Eg JavaScript lets you trivially memoize asynchronous requests, by caching Promise objects instead of responses. In Elixir you'll end up with enormous case expressions like this one: https://github.com/melpon/memoize/blob/master/lib/memoize/ca...

Re:Erlang/OTP 21's new logger by narrowtux on Thursday November 29, 2018 @04:45AM (#18559098)
Elixir has a Task module that can be used like Promises.

A task is a process that calculates something and eventually returns a result, which you can get synchroneously with `Task.await/1`. There's also an equivalend for Promise.all, which is just `Enum.map(tasks, &Task.await/1)`.

Re:Erlang/OTP 21's new logger by skrebbel on Thursday November 29, 2018 @07:06AM (#18559602)
You can't use those to cache requests.

You can store an Elixir task but you can only await it once. You can `.then` a JavaScript promise as often as you want which makes a promise an excellent primitive for caching things that take time (eg network requests) without triggering the same request twice.

Re:Erlang/OTP 21's new logger by _asummers on Thursday November 29, 2018 @08:12AM (#18559900)
You can leave a process around as a cache, sending it messages when its values need to change. And if it dies for whatever reason, its supervisor can restart it to a known good state. You shouldn't concern yourself as the caller of how the cache updates itself, you should send it an explicit message like "the cache for X is out of date" and let that go and do its thing accordingly.
Re:Erlang/OTP 21's new logger by skrebbel on Thursday November 29, 2018 @08:21AM (#18559958)
Yes and that's a lot of work for what would be a two-liner in JS.

Every time someone says "just make a process and a supervisor, put it elegantly in the supervisor tree, go think through the failure modes, ponder a bit about these 3 or 4 edge cases and potential race conditions, and you're done! hooray!" I get a bit grumpy.

Elixir is awesome, but there's a simplicity to a single-threaded execution model that takes away a lot of the things that make concurrency hard.

Re:Erlang/OTP 21's new logger by polmuz on Thursday November 29, 2018 @08:42AM (#18560063)
At the small prize of parallelism. And now that you are dealing with workers, task queues, etc. a native process + supervisor solution doesn't seem bad at all.
Re:Erlang/OTP 21's new logger by skrebbel on Thursday November 29, 2018 @01:24PM (#18562442)
It's not a contest!

All I'm saying is that there are things that Elixir isn't the best at. Is that so weird? I feel like everybody responding to me has this strong emotional need to defend Elixir. Why? it's just a tool. Like any tool it has pros and cons.

Re:Erlang/OTP 21's new logger by cultofmetatron on Friday November 30, 2018 @02:40PM (#18571960)
Elixir is amazing at creating parrallelized network heavy iobound applications. obviously its going to be shit if you want to do machine learning or anything computationally bound. Thats why it has amazing first class integrations!

https://github.com/fazibear/export and https://github.com/hansihe/rustler

Re:Erlang/OTP 21's new logger by drcongo on Wednesday November 28, 2018 @06:05PM (#18556530)
I recently started working through the tutorials here [1] and they're excellent, but kinda like you I get grumpy when I have to do Django at work now.

[1] https://www.phoenix-tutorial.com/

Re:Erlang/OTP 21's new logger by andy_ppp on Wednesday November 28, 2018 @06:13PM (#18556576)
Nice! You wrote flask-security etc. right? I actually reported a bug again flask-login years ago because of the way Elixir handled a certain security issue. Small world...
Re:Erlang/OTP 21's new logger by drcongo on Thursday November 29, 2018 @05:56AM (#18559363)
Flask Security isn't my work, that would be Matt Wright [1], though coincidentally I did link to an article by Matt on here a few days ago.

http://mattupstate.com

Re:Erlang/OTP 21's new logger by doanguyen on Wednesday November 28, 2018 @06:12PM (#18556571)
Just wanted to know what's wrong with Django?
Re:Erlang/OTP 21's new logger by andy_ppp on Wednesday November 28, 2018 @06:17PM (#18556604)
Slow, GIL, Python, ORM, no otp, no supervisions, no runtime code inspection, bad code formatter, error handling, no macros, no pipe, not immutable, not functional, very complex writing multithreaded code, 100 different ways to write doc strings, ugly docs, hidden state everywhere... etc.
Re:Erlang/OTP 21's new logger by doanguyen on Thursday November 29, 2018 @06:25AM (#18559454)
I would disagree with many of these, but thanks anyway.
Re:Erlang/OTP 21's new logger by drcongo on Thursday November 29, 2018 @06:01AM (#18559374)
I agree with some of andy_ppp's list below, but my main gripe is how much Django hides from the user through magic and endless inheritance chains. When I write code I like to know what it's going to do, and when it goes wrong I like to be able to find where it went wrong without jumping through 20 classes in 10 files.
Re:Erlang/OTP 21's new logger by doanguyen on Thursday November 29, 2018 @06:16AM (#18559429)
Appreciate your response. I would happy to see your reaction when you're working with Laravel, lol.

I fully agree that too much of magic makes Django difficult and easy to newcomers at the same time. So I switched to Flask which is much pleasure to work with and now I'm very happy.

Re:Erlang/OTP 21's new logger by andy_ppp on Thursday November 29, 2018 @07:15AM (#18559638)
This is covered in hidden state everywhere...
Re:Erlang/OTP 21's new logger by brightball on Wednesday November 28, 2018 @10:29PM (#18557821)
Nothing major. Elixir is just such a good experience it has the effect of making everything else feel really clunky.