Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
klibertp
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
95 ms
·
811.
▲
by
klibertp
5y ago
> My point was nowhere nearly as interesting as if a specially crafted gif somehow triggered a memory leak in a driver when rendered. There's absolutely no mention of "specially crafted" GIF or "when rendered" in
812.
▲
by
klibertp
5y ago
Uh-oh, this is sooo important, some title on the Internet is wrong ! If I read it correctly, the same app, compiled from the same code, for the same OS, but different CPU architectures, exhibits wildly different memory consumption for the
813.
▲
by
klibertp
5y ago
> I don't think $ You're right, although cycling instead of erroring out was surprising to me. Another verb I had trouble with is roll/deal: https://code.jsoftware.com/wiki/Vocabulary/query >
814.
▲
by
klibertp
5y ago
Well, for what it's worth - and as mentioned by a sibling poster - most verbs, and certainly all arithmetic operators, obey a few simple rules for determining which behavior you'll get. I should have noted this, before I started w
815.
▲
by
klibertp
5y ago
1 2 3 + 4 5 6 7 |length error | 1 2 3 +4 5 6 7 In general - depends on the operation. Sometimes the verb checks that both operands have the same rank and dimensions, sometimes the shorter/smaller side gets app
816.
▲
by
klibertp
5y ago
I think this is pseudo-code? `flatMap` and `=>` for lambdas look like Scala, but there are no array literals using `[]` there. Assuming you mean Scala-like semantics, your second example wouldn't work at all: scala> Array(A
817.
▲
by
klibertp
5y ago
> without the ambiguity There's no ambiguity! In J, all (with some exceptions) operations work on arrays, period. `1 + 1` is not an addition of two scalars, but instead of two arrays of length 1. As I mentioned, you can have scalars
818.
▲
by
klibertp
5y ago
Unfortunately, I have no idea about the implementation and what optimizations are done in J or APL for which operations :( I know that there are hardcoded "fast path" expressions (particular combinations of operations) which have
819.
▲
by
klibertp
5y ago
No, an array language is one in which all the built-in operations are applicable to arrays. Take addition as an example: 4 + 4 8 In array languages the same operator can be used for arrays; or equivalently you can say that
820.
▲
by
klibertp
5y ago
Both are valid, and were the only ways of initializing objects before C++11, I think. Brace initialization has an advantage in that it allows you to initialize compound values, like containers and structs, even if they're nested:
821.
▲
by
klibertp
5y ago
That's actually what pattern_tap's tap macro expands into :) See: https://github.com/mgwidmann/elixir-pattern_tap/blob/master/...
822.
▲
by
klibertp
5y ago
I think you mean `with`, not `where`? Yes, it helps a bit in some cases, but it's not a replacement for a pipeline - mainly because you'd need to name your intermediate results and "thread" them through the calls yoursel
823.
▲
by
klibertp
5y ago
I was very, very disappointed that the `tap` macro has nothing to do with pattern_tap: https://github.com/mgwidmann/elixir-pattern_tap Basically, in Elixir pipelines are not very friendly to simple destructuring: if a
824.
▲
by
klibertp
5y ago
I have no idea, unfortunately. On the other hand, the trademark doesn't seem to be a problem to guys behind Racket, which has the most advanced contracts system out there; the canonical book for programming classes in Racket, "How
825.
▲
by
klibertp
5y ago
No! Eiffel should be the default OOP language for any kind of course. Being forced to think about pre- and postcoditions and invariants by the language is a really good thing for beginner programmers. While the syntax is somewhat verbose
826.
▲
by
klibertp
5y ago
> adheres to the Unix philosophy of doing one thing well and not clutter the binary with additional stuff for fringe use cases Nginx? Really? "One" thing? Try running `./configure --help` in the Nginx source dir...
827.
▲
by
klibertp
5y ago
Elixir's stdlib is great. It's small, based on a just a handful of concepts, but thanks to how powerful the concepts are it covers a lot of use cases. Every module contains pretty much everything you'd ever need to work wit
828.
▲
by
klibertp
5y ago
I was 7 when I started writing simple programs (to solve simple equations which came up in maths class) in QBasic. I was 8 when I learned about arrays, which led to writing a contacts app (storing name, address, and phone number in a file,
829.
▲
by
klibertp
5y ago
Wow, I missed its introduction. Nice. On a cursory glance Celery doesn't make use of it yet, unfortunately.
830.
▲
by
klibertp
6y ago
And pay in memory for that luxury: when using lots of complex libraries (like in ML) the Python process can eat quite a lot of RAM.
831.
▲
by
klibertp
6y ago
qt-console is great, but it's not a notebook, ie. you don't have cells you can go back to and edit. It's more of a classic console, with great readline emulation and ability to display images easily.
832.
▲
by
klibertp
6y ago
Worth noting that org files can also embed images inline. Unfortunately, I don't think it's enough to attract new users: images are non-interactive, you can't embed any other media, you have to pop a separate window to edit c
833.
▲
by
klibertp
6y ago
And frames. And tables with iframes. And, indeed, 1x1.gifs. Fun times!
834.
▲
by
klibertp
6y ago
The second option seems much more convenient - I didn't know you can do that!
835.
▲
by
klibertp
6y ago
> Some cpp structures do allow for custom allocators, Yeah, that's what I was thinking about, but my only knowledge of allocators comes from gcc error messages which include all the template parameters - I have no idea how they work
836.
▲
by
klibertp
6y ago
D is garbage collected language. I've spent the past weekend writing some toy programs in D, and it was very pleasant experience, mainly because of the GC - I didn't have to think about allocating arrays or strings, I could just u
837.
▲
by
klibertp
6y ago
> From that point on, every "allocation" is equivalent to bumping a pointer in that arena. I'm not a C++ developer, so I have a hard time imagining how would this be implemented in real code. I know how to allocate a blob
838.
▲
by
klibertp
6y ago
> And, you can't be a Catholic and pro-Russian at same time. It's more being anti-EU than pro-Russian, but the geopolitics of Poland are brutal enough that these are both almost one and the same. And being a Catholic, at least
839.
▲
by
klibertp
6y ago
I don't disagree, but "simpler to use" and "easier to read" are almost orthogonal things :)
840.
▲
by
klibertp
6y ago
> but in reality "window.location" is easier to both read and write No, it's not easier to read. Really. You think it is, but that's only because you're used to it. If you take a step back and look at the "
More ›