Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
cb321
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
37 ms
·
391.
▲
by
cb321
3y ago
This sounds like a job for what standard C calls "popen". You can do import posix; for line in popen("ls", "r").lines: echo line in Nim, though you obviously need to replace `echo line` with other des
392.
▲
by
cb321
3y ago
On Unix, you might try Nim ( https://nim-lang.org ) with https://github.com/Vindaar/shell and there are a slew of pipeline-y/Unix-y utilities over at https://github.com/c-blake/bu N
393.
▲
by
cb321
3y ago
Also, the last time I tried, to do similar with FIFOs (no /tmp | whatever storage like other e.g.s here https://news.ycombinator.com/item?id=37211687 ), GNU parallel needed some - for me - specially compiled Perl inte
394.
▲
by
cb321
3y ago
This really is true and you may be understating with "most". Here are a couple: mkdir /tmp/g seq 1 10 | tr \\n \\0 | xargs -0n2 -P4 bash -c 't=$EPOCHREALTIME; sleep $((RANDOM%5)); echo "$@"
395.
▲
by
cb321
3y ago
You can probably do something that creates as many FIFOs as you have parallelism and just be careful about emitting whole records like https://github.com/c-blake/bu/blob/main/doc/funnel.md . That on
396.
▲
by
cb321
3y ago
It was mostly just a recommendation to check out. I did not actually do it myself, but I tend to think I could have right after lin.alg./multivar calc freshman year and would have preferred it. Can't prove that, of course, since
397.
▲
by
cb321
3y ago
Rather than 27 (or however many) books, an ambitious student may be able to use just one big-ish book: Ian D. Lawrie's "A Unified Grand Tour Of Theoretical Physics". This even has a little 18 page "Snapshots of the
398.
▲
by
cb321
3y ago
An "allusion" is an indirect reference/pun. The degree of indirection is clearly subjective. The phrasing great grandparent recognized from Adams (at least one other person) is actually a negation of the famous line f
399.
▲
by
cb321
3y ago
"So it goes" was a line used gajillions of times by Vonnegut in a similar way.[1] So, at least that. [1] https://www.goodreads.com/quotes/660696-so-it-goes-unlike-ma...
400.
▲
by
cb321
3y ago
There was amusing humor in this writing with allusion to Douglas Adams & Kurt Vonnegut (& maybe others I missed). This seems especially apt for a young person with ambitions to chair a committee for standardizing such an old langua
401.
▲
by
cb321
3y ago
LBSTs are pretty rare, too. :) Re: symmetry reasoning troubles, another benefit is that it enforces the symmetry algebraically rather than relying on code edits maintaining it (& multiplying it). As to DRY vs. reducing abstraction a
402.
▲
by
cb321
3y ago
If you like this article then you might also be interested in: https://github.com/c-blake/bst It's ANSI C with a bespoke macro generics system not Go, does not cover as many balancing rules, and is not written up
403.
▲
by
cb321
3y ago
Agreed! I would not take the other side of that bet! :-) Asimov sure liked to type words on a typewriter, too. So, he may well have even documented such. Just to point out the perhaps obvious, though, in terms of the history of that
404.
▲
by
cb321
3y ago
Nim is terse yet general and can be made even more so with effort. E.g., You can gin up a little framework that is even more terse than awk yet statically typed and trivially convertible to run much faster like https://github.co
405.
▲
by
cb321
3y ago
Boyle's "growing giant" idea probably at least partly inspired Jonathan Swift's Brobdingnagians in Gulliver's Travels several decades later in 1726.. maybe the natural inverse the Lilliputians. By the 1800s Mary Sh
406.
▲
by
cb321
3y ago
Anything with a finite (200 is small even) number of units misses the algebraic structure of the problem mentioned in https://news.ycombinator.com/item?id=36988497 wherein multiplying|dividing two things gives you a (potent
407.
▲
by
cb321
3y ago
Yes - you haven't seen the full scope until you confront unit system conversions as alluded to in my other comment ( https://news.ycombinator.com/item?id=36988497 ). There should also be conversions to/from SI|CGS a
408.
▲
by
cb321
3y ago
It's more like a 2-level situation for most things with a little more structure than you might realize. There are "physical kinds" or meta types like "energy" and then different concrete units those can be which al
409.
▲
by
cb321
3y ago
Units of measure are, of course, the aboriginal type system for pre-software hand calculation.. carrying units along to make sure you do not add apples to oranges { unless you know how to convert "apples" to "oranges"
410.
▲
by
cb321
3y ago
As a 2-step approach, you could also probably use https://github.com/mozilla/cbindgen and then Nim's native C FFI.
411.
▲
by
cb321
3y ago
To address your surprise, the article was attempting to focus on just induction while falsifiability is more the higher level https://en.wikipedia.org/wiki/Demarcation_problem , but admittedly, philosophy of science to
412.
▲
by
cb321
3y ago
Knuth was asked to demonstrate his new literate programming and probably thought an 8-page mini-paper was about the right "length" to do so: https://buttondown.email/hillelwayne/archive/donald-knuth-wa
413.
▲
by
cb321
3y ago
https://link.springer.com/content/pdf/10.1007/3-540-59222-9_...
414.
▲
by
cb321
3y ago
Nim [1] is like Ada in these ways but less verbose: import strutils # Or from strutils import repeat Or etc. type Foo = -5 .. 10 # Or range[-5 .. 10] echo Foo.low, " ", Foo.high # range limits
415.
▲
by
cb321
3y ago
Niceness is subjective, but Nim is just as valid an addition to that group. Nim compiles to C and has had an --os=standalone mode for like 10 years from its git history, and as mentioned else-thread ( https://news.ycombinator.com
416.
▲
by
cb321
3y ago
I don't know about Ada+Spark, Cyclone, D, but, since it can compile to C, you can write Linux kernel modules in Nim without Linus' permission / specific "help" from the Linux kernel team: https://forum.ni
417.
▲
by
cb321
3y ago
There is a way to disable the type column and embellish parameter descriptions or even replace the entire generated string, all at gradual investment of time, though docs can always be better. I disagree that it's a bad default since
418.
▲
by
cb321
3y ago
I don't know about all your other questions, and I realize your post was more about "why Rust?" rather than "why not Nim?", but that said the https://github.com/c-blake/cligen Nim CLI framework
419.
▲
by
cb321
3y ago
`grep -w 'pointer|ptr|addr|cast'` would do it in one.. (One can surely do a shell alias called `find-unsafe`..). Finding unsafe constructs in Nim code is not that hard, at least at the same level of accuracy as `grep unsafe *.rs`
420.
▲
by
cb321
3y ago
You can often/usually put ()s around things if you want. It's just an uncommon style. (Much like you can format bracey code like lisp with the close brackets bunched up all at the end of one line instead of one per line, but
More ›