|
I remember one time thinking I was so clever at my last job making a data structure like that, it ended up being 100% useless. It's adds needless data structure overhead and usually some needless conditional checking on every access too, the people suffering under some performance problem are going to want to be able to solve their problems, not suffer under them because their code is checking the structure of the string one widechar at a time.
|
# ? Oct 7, 2015 09:24 |
|
|
# ? Jun 12, 2024 11:39 |
|
hey erlang ppl would i be doing myself a disservice by jumping into elixir without learning erlang?
|
# ? Oct 7, 2015 09:54 |
|
you are optimizing precisely one case here: avoiding a constant overheard on code that manages to make a lot of calls to charAt in such a way that hotspot does not manage to figure out that all calls past the first are monomorphic (in that they are now used on a realized, flat, string), and to preserve performance in this one case you suggest forcing all cases of concatenating strings to be hand-optimized using a secondary builder class (and it is up to the programmer to then ensure that they thread the builder through all code that may keep making concatenations, avoiding realizing it too early) the prior case should be fantastically less common than the latter, not least because you really should use codePointAt to actually deal with full unicode these days (a method which involves several branches in itself, trivially masking the overhead of checking the layout of the string) i mean, again, it is hardly important, and in a general sense you are right that one should avoid scattered data structures trying to optimize stuff beforehand, but this is specifically for java.lang.String, and inspecting that precise type, going through all the ways you can use it, it is actually really hard to make a case against lazy concatenations
|
# ? Oct 7, 2015 09:58 |
|
Actually it's really easy to make the case for not having lazy concatenations, you should pay the cost where you code does the concatenation. You need to have the performance of your code be as simple to understand as possible. You also are making more work for the JIT, preventing it from doing something else. Code that relies on it has more GC overhead. It's bad ideas all around and doesn't solve any real problem with the world.
|
# ? Oct 7, 2015 10:27 |
|
Shinku ABOOKEN posted:hey erlang ppl Not really. You'll know when you'll be forced back into learning Erlang for a bunch of stuff. Most Elixir people I see these days are only interested in replacing Rails with Phoenix and frankly that web stuff is so isolated from the rest of the language when 90% of the stuff you do is live within the framework and database there's not that much needed from the language itself, much less from the underlying one (Erlang).
|
# ? Oct 7, 2015 12:29 |
|
the lfe people send me sw8 stickers a million years ago when i had a spasm of interest in working in lfe and on lfetool and i've accomplished nothing since and don't even bother to lurk in the irc channel any more ;_;
|
# ? Oct 7, 2015 14:31 |
|
MononcQc posted:Not really. You'll know when you'll be forced back into learning Erlang for a bunch of stuff. Most Elixir people I see these days are only interested in replacing Rails with Phoenix and frankly that web stuff is so isolated from the rest of the language when 90% of the stuff you do is live within the framework and database there's not that much needed from the language itself, much less from the underlying one (Erlang). How is Phoenix compared to other p-lang web frameworks?
|
# ? Oct 7, 2015 16:10 |
|
CommunistPancake posted:How is Phoenix compared to other p-lang web frameworks? it's a match for the family, but isn't as dog slow as most of them would be.
|
# ? Oct 7, 2015 17:08 |
|
why would you ever use a plang let alone for web development? just use asp.net
|
# ? Oct 7, 2015 17:10 |
|
aspie.net
|
# ? Oct 7, 2015 17:31 |
|
Blotto Skorzany posted:aspie.net
|
# ? Oct 9, 2015 09:58 |
|
Notorious b.s.d. posted:a public field is a direct reference to the data. a user outside the defining class is writing directly to memory. the implementation can't change without also changing all calling code well... sorta but not quite... you could ship your updated class and include with it instruction-level transformations that can replace old style accesses in calling methods with the correct instructions needed for accessing the field after your change e.g. if one 32-bit field was replaced with 2 32-bit fields then a transformation would need to add an extra local variable inside a caller to accommodate the additional data. a bit tricky perhaps, but doable
|
# ? Oct 10, 2015 02:53 |
|
Shinku ABOOKEN posted:hey erlang ppl nah. the only semantic difference really is that elixir has variables that can be updated and if you want to match against them you have to use the pin operator. erlang has unification, not variable assignment you might want to learn erlang tho because most of the good otp documentation uses erlang for examples and a lot of the tooling you'll want to use is much better in erlang than in elixir
|
# ? Oct 10, 2015 03:35 |
|
CommunistPancake posted:How is Phoenix compared to other p-lang web frameworks? it's like an evolution of rails. which is ok i guess but there are more interesting things going on in web frameworks than MVC, CRUD and ORMs
|
# ? Oct 10, 2015 03:39 |
|
the talent deficit posted:it's like an evolution of rails. which is ok i guess but there are more interesting things going on in web frameworks than MVC, CRUD and ORMs they're all still crud, op
|
# ? Oct 10, 2015 03:43 |
|
more like object relational mayhem!!!
|
# ? Oct 10, 2015 04:50 |
|
fleshweasel posted:more like object relational mayhem!!!
|
# ? Oct 10, 2015 04:55 |
|
the talent deficit posted:it's like an evolution of rails. which is ok i guess but there are more interesting things going on in web frameworks than MVC, CRUD and ORMs like what
|
# ? Oct 10, 2015 05:33 |
|
my stepdads beer posted:like what Exploring ways to open security holes more efficiently through **convention**.
|
# ? Oct 10, 2015 06:04 |
|
my stepdads beer posted:like what graphql, crdts shared between clients and servers, flux, state transformations, ...
|
# ? Oct 10, 2015 07:09 |
|
PSA: keep your nodejs comments short. They effect performance. https://top.fse.guru/nodejs-a-quick-optimization-advice-7353b820c92e
|
# ? Oct 15, 2015 09:34 |
|
Making that sort of optimisation would make me feel really clever until someone pointed out how stupid it was to even exist in the first place.
|
# ? Oct 15, 2015 09:35 |
|
And here's where that setting is controlled. So apparently there are slightly more sensible heuristics (number of AST nodes) kicking around too...
|
# ? Oct 15, 2015 10:15 |
|
pointsofdata posted:PSA: keep your nodejs comments short. They effect performance. lmao
|
# ? Oct 15, 2015 14:07 |
|
pointsofdata posted:PSA: keep your nodejs comments short. They effect performance. too close to the metal
|
# ? Oct 15, 2015 14:15 |
|
the real hosed up thing is having comments in the function body rather than as a docblock above
|
# ? Oct 15, 2015 15:51 |
|
pointsofdata posted:PSA: keep your nodejs comments short. They effect performance. lmao
|
# ? Oct 15, 2015 16:25 |
|
pointsofdata posted:PSA: keep your nodejs comments short. They effect performance. affect
|
# ? Oct 15, 2015 17:09 |
|
defect
|
# ? Oct 15, 2015 17:10 |
|
infect
|
# ? Oct 15, 2015 17:10 |
|
https://eval.in/451711 rubby code:
|
# ? Oct 16, 2015 01:39 |
|
|
# ? Oct 16, 2015 01:47 |
|
tef posted:https://eval.in/451711 how
|
# ? Oct 16, 2015 01:57 |
|
|
# ? Oct 16, 2015 01:57 |
|
nil turns a lookup into a lexical lookup. code:
n.b you can't emulate this by doing Butt::nil::A, as that produces an exception for an undefined method nil during constant lookup on the object Butt, but you can do this by doing nil::A, or ::A with the other one, module A::B and module A, module B are different. the first one will look up in A::B, the second will lookup in A::B and A
|
# ? Oct 16, 2015 02:03 |
|
every single feature rubyists tout as being magical, the quirks that make it pleasant to write a dsl for your boilerplate, and the shorthand that lets your example fit neatly on a slide, well, they have a downside. code:
|
# ? Oct 16, 2015 02:06 |
|
loving nil every time
|
# ? Oct 16, 2015 02:10 |
|
have you ever truly inherited a util *function*. i don't mean one of those enormous 10,000 line modules with 197 different functions wrapping the standard library, i mean a single 10,000 line function. the sort of code where they've truly avoided implementing anything twice, and frankly the code re-use is astonishing. the sort of thing where the code is written from today's usecase down through all twelve intermingled switch statements. a large proportion of ruby was designed by taking a simple language and adding edge cases to it.
|
# ? Oct 16, 2015 02:13 |
|
Symbolic Butt posted:loving nil every time change the `if nil` to `if true` and you'll get an exception.
|
# ? Oct 16, 2015 02:14 |
|
|
# ? Jun 12, 2024 11:39 |
|
javascript has nothing on ruby for footguns
|
# ? Oct 16, 2015 02:16 |