Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
cb321
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
68 ms
·
691.
▲
by
cb321
6y ago
Just to corroborate - with gcc's gcj Java folk could get compilation to an ELF binary for free as well. I was profiling such in 2004. This was unpopular/unmaintained enough that eventually gcc discontinued it. Sadly, people ofte
692.
▲
by
cb321
6y ago
That json test gets a lot of attention but A) large scale floating point IO is a terrible application of json (if for no other reason than that float parsing is slow) and B) this mostly measures construction of a big object graph, not json
693.
▲
by
cb321
6y ago
The first public release of Nim was June, 2008, but work began a few years earlier. So, Nim is at least a couple or more years older than Rust. Stability is often subjective (in terms of features people actually use).
694.
▲
by
cb321
6y ago
Nim [1] has cligen [2]. An output binary size for the trivial: proc f = discard import cligen dispatch f is about 708 KiB on Linux, 621 KiB stripped. And if you like colors, hldiff [3] is not a terrible example. [1] http
695.
▲
by
cb321
6y ago
This may be more fair for the "simple" case in Nim. import tables, strutils var counts = initCountTable[string](16384) for line in stdin.lines: for word in line.toLowerASCII.split: counts.inc word c
696.
▲
by
cb321
6y ago
Sure. Feel free. I agree it's probably a bit advanced, and it breaks a rule or two of the "constraints" some people seem passionate about and needs to include punctuation to match results. Feedback-wise, yours isn't so
697.
▲
by
cb321
6y ago
You keep ignoring the author literally opening it up as an avenue in: >I’m sure there’s further you could go with the C version: investigate memory-mapped I/O, avoid processing byte-at-a-time, use a fancier data structure for counti
698.
▲
by
cb321
6y ago
I disagree. mmap will demand page into memory - typically read ing 4K at a time off storage (though really the buffer cache in all these timings). Much less than 64K. Were the file bigger than RAM/were there competition, it would a
699.
▲
by
cb321
6y ago
> That's one of the constraints of the challenge: it has to be able to work on a stream. I cannot find any stream constraint in either the article or the countwords repo. He just says "standard input" and his "test.s
700.
▲
by
cb321
6y ago
Knuth-McIlroy comes up a lot. Previous discussion [1]. For this example I can make a very similar Nim program [2] run almost exactly the same speed as `wc -w`, yet the optimized C program runs 1.2x faster not 1.15x slower than `wc -w` - a
701.
▲
by
cb321
6y ago
Yeah. It's not for everyone. I think " different ergonomic issues" may cover that and I did mention the type checking already. :-) It is a smaller learning curve from pure C than "all of Rust" or even "all o
702.
▲
by
cb321
6y ago
I feel we've talked past each other about what is/is not Python a few times. There is Cython and Pythran and Pypy and ShedSkin and Numba and others that are targeting, for lack of a more precise term, "extreme compatibility
703.
▲
by
cb321
6y ago
And now one of mine https://news.ycombinator.com/item?id=26448822 in a subthread where the other main commentor says the subthread is his favorite of this whole thread. There just might be something to this downvoting clai
704.
▲
by
cb321
6y ago
When I used to write in Cython + NumPy I would pre-allocate numpy arrays written into by Cython. It's C-like, but because of the gradual typing I think firmly in the high er level (for some value of "er"). One can certainl
705.
▲
by
cb321
6y ago
Ok. "Afford parallelism => afford high level" with the implication of HL=slow does sound pretty off base. So, fair enough. FWIW, as per your subtle claim, it all seems pretty hot spot optimizable to me, at least if you includ
706.
▲
by
cb321
6y ago
I am not trying to contradict anyone here, but any language mature enough to have an impl/way to not have arbitrary performance ceilings needs access to inline assembly/SIMD. Cython/Nim/SBCL can all do that..probably Ha
707.
▲
by
cb321
6y ago
Several posts by @pjmlp..(if they stay downvoted).
708.
▲
by
cb321
6y ago
Cython with all the appropriate cdef type declarations can match C and so might also do it. Not sure Cython exactly counts as "Python"..it's more a superset/dialect { and I also doubt such a port would hold many lessons
709.
▲
by
cb321
6y ago
You are right in a library-demographical sense, but not in a fundamental sense. There is a 3rd way. Have a look at the CTL I linked to (downvoted..maybe I should have explained more?). Once you give up the closed source/prebuilt bina
710.
▲
by
cb321
6y ago
https://github.com/glouw/ctl/
711.
▲
by
cb321
6y ago
Sometimes endowing existing syntax with richer semantics requires almost no documentation because things "just work". For example, cligen [1] uses a macro to synthesize an argv parser -> call dispatch CLI system. It could alm
712.
▲
by
cb321
6y ago
Is C garbage collected? There is no simple answer to that. Link with Boehm (or something similar) and it is. These things are often (with almost any language) aspects of the implementation & deployment, and most mature languages have
713.
▲
by
cb321
6y ago
Many people find just searching the big index [1] to be enough. Besides the Forum and the IRC (often more immediate), there is also a Wiki [2] where you can maybe contribute documentation for "what you would have liked to have seen&qu
714.
▲
by
cb321
6y ago
Whitespace as syntax is a somewhat controversial choice. Others will talk about missing semi-colon bugs or other delimiter-not-matching-whitespace bugs. Their counter "You only have to mis-indent an if relative to semi-colons once to
715.
▲
by
cb321
6y ago
Nim is a very flexible language where things that would, in almost any other language (besides Lisp/Racket/etc) require direct compiler support (like async/coloring) can be done as libraries. Consequently, people disagreeing
716.
▲
by
cb321
6y ago
Something often overlooked in comparisons is "The many dimensions of beat". In some ways ORC probably already beats the best JVM while in others it may never. The best benchmark is, as always, one's own code. :-) I'
717.
▲
by
cb321
6y ago
If the Nim folks seem to skim over this, it is probably because of the large diversity of options & concerns. You can --gc:none or --gc:arc to blow off the reference cycle problem, but the default gc handles it fine (and --gc:orc and -
718.
▲
by
cb321
6y ago
I think the resolution to the author's consternation is that Rust's/some/most async run-times have "good enough" (in his view) color management . You still need to manually manage color (aka blocking vs non-bl
719.
▲
by
cb321
6y ago
The pattern matching blog post is indeed great (good job @haxscramper!). Casual Nim observers might want to click on the Blog link at the top (Or all the other links!). There have been quite a few posts in the past year or so on ARC &
720.
▲
by
cb321
6y ago
Costs can go up, but do not always. Nim has some `acyclic` pragmas to help. Answers to almost all performance questions include a "depends", but now we are back on "speed" not completeness. :-) Anyway, you can probably
More ›