Earlier quoted context omitted.
Would love to see the 3ms solution. Post a gist if you have it available.
Sure. Here's a gist with 3 versions (original, the 25ms version and the 3ms version): https://gist.github.com/nickjj/99ea84f460f41dae4139d0610ce80... The reason I didn't use the 3ms version was due to it having too many concepts that are unknown to me. At the end of the day I would still need to maintain the code and the 25ms version is a lot easier to change (for me at least). But, if I had very strict time requirem…
Why am I interested in Elixir?
151–160 of 183 posts
Re: Why am I interested in Elixir?
#152Where are people getting their documentation for Phoenix? The stuff on the website is awful for grasping the bigger picture and how the parts of Phoenix combine. It gave me the impression of being an immature version of Rails when I tried it recently which doesn’t gel with the attitude people seem to have of it.
I would say Phoenix doesn't attempt to be quite as magical as Rails and Django-style frameworks. It is a bit more explicit and as such hopefully easier to follow. The goal doesn't seem to be Rails for Elixir but rather that every new backend language needs a good web framework or it may be dead in the water. As someone suggested, check out the Hex docs. That is where you get the better in-depth stuff and API referenc…
Then look at the 'magic' bits. _web.ex is an important one, and the view/template distinction can be a bit confusing at first.
From there I suppose endpoint.ex covers pretty much all the rest of it (and then hands things off to router.ex).
With Rails I was always uncomfortable that I couldn't quite follow or understand the path taken through my codebase, but with the exception of a few 'magic' things, Phoenix is wonderfully transparent in this regard.
Re: Why am I interested in Elixir?
#153Earlier quoted context omitted.
In the Erlang VM, process execution can stop at an arbitrary point and resume later on. This time slicing is done to ensure that no process, takes up too much time. So you must treat your code as asynchronous since if you get a value from another module, then get it again in the next line it might have changed because your process was suspended in between those two lines.
While that is true it does not make a difference for day to day programming, unless you are super accustomed to think about locks. You can get very far in Elixir without considering the nitty gritty parts of OTP.
Re: Why am I interested in Elixir?
#154Earlier quoted context omitted.
Not sure about the BEAM, but Java isn't considered an interpreted language at all. First, discerning the compilation step to IR is relevant, which is why for example, Python can be compiled or interpreted. That distinction matters. Even though it is compiled to intermediate representation, it is still compiled. Now, with regards to the intermediate representation, Java Byte Code is also not interpreted. Java Byte Cod…
We should be more precise: the JVM may or may not have an interpreter. This is implementation dependent. There are JVMs that are interpreted fully and AOT compilers as well. Hotspot includes an interpreter -- your code may be interpreted until it gets hot and gets compiled. Still, I don't think it's fair to call Java an interpreted language since the parts that are interpreted are only during warm up or slow enough n…
Java on the other hand is 100% compiled (to bytecode). And byte code is machine code for a non existent machine. Actually, I think Sun had built machines that could natively execute Java Byte Code. Someone could build an interpreter for it, but I'm not aware of one.
Re: Why am I interested in Elixir?
#155Earlier quoted context omitted.
Performance is definitely not close to Ruby, this is just blatantly incorrect. Elixir and Erlang can easily hold their ground vs Go. The BEAM was originally designed to run software for telephone switches. It's often referred to as soft realtime because it is so responsive. It has been battle-tested for now over 3 decades. Where the BEAM falls flat is pure number crunching but it's blazing fast with binary processing…
For CPU intensive tasks, performance _is_ close to Ruby, while both Ruby and Elixir are far behind Go. Soft realtime doesn't mean fast, it just means good std deviation on response time and not a lot of missed deadlines. Fortunately as the article points out, there's always Rustler if you need to optimize while still keeping BEAM crash proof. That being said, I agree that performance for certain IO intensive applicat…
Yeah, but how many companies do you know of that perform heavy computations in such large scale that their choice of programming language has a noticeable effect on the result?
I mean, it might matter for tech giants like Google, who need to squeeze every bit of processing power out of their CPUs. For almost everyone else, it will be a non-issue.
Re: Why am I interested in Elixir?
#156Earlier quoted context omitted.
> Async everything What do you mean by that? Most code in Erlang/Elixir is synchronous, meaning it will block the process (but not the scheduler). Maybe you meant concurrent (or message-passing) everything?
Yeah I'm curious too. I've written about 2,000 lines of code on this course platform so far and everything except for 1 function is synchronous from a "this is my code" standpoint. I only used Task.start once to launch something in the background.
The elixir standard library is just full of things that make your concurrent programming seamless, easy, and bulletproof, even for a junior that's never done things that way.
I can't imagine him getting this correct with python async, JavaScript promises and callbacks, or having to create go channels.
Re: Why am I interested in Elixir?
#157Earlier quoted context omitted.
With WordPress, you need a server at all times and the HTML is generated each time you try to access your site. Sure, you can use caching plugins, but it only makes things complex. Eg. You need to now keep those plugins updated at all times, along with WordPress itself. A static site doesn't need a server and can work right off a CDN. It's blazingly fast and it's virtually unhackable. There are no security updates wh…
Thanks. Not sure why I got downvotes for asking a question though. Also, I recently built http://blog.winricklabs.com for example which uses my own static site generator. I didn't use wordpress just because it'd be overkill.
Re: Why am I interested in Elixir?
#158Earlier quoted context omitted.
While that is true it does not make a difference for day to day programming, unless you are super accustomed to think about locks. You can get very far in Elixir without considering the nitty gritty parts of OTP.
It's interesting that people would like Elixir without understanding OTP.
Re: Why am I interested in Elixir?
#159Earlier quoted context omitted.
Would love to see the 3ms solution. Post a gist if you have it available.
Sure. Here's a gist with 3 versions (original, the 25ms version and the 3ms version): https://gist.github.com/nickjj/99ea84f460f41dae4139d0610ce80... The reason I didn't use the 3ms version was due to it having too many concepts that are unknown to me. At the end of the day I would still need to maintain the code and the 25ms version is a lot easier to change (for me at least). But, if I had very strict time requirem…
Re: Why am I interested in Elixir?
#160Earlier quoted context omitted.
Would love to see the 3ms solution. Post a gist if you have it available.
Sure. Here's a gist with 3 versions (original, the 25ms version and the 3ms version): https://gist.github.com/nickjj/99ea84f460f41dae4139d0610ce80... The reason I didn't use the 3ms version was due to it having too many concepts that are unknown to me. At the end of the day I would still need to maintain the code and the 25ms version is a lot easier to change (for me at least). But, if I had very strict time requirem…