Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
cb321
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
78 ms
·
751.
▲
by
cb321
6y ago
A Javascript backend is better focus than one usually sees. There are also quite a few web dev projects in the nimbleverse, and https://forum.nim-lang.org is written in Nim and there is much support code in the Nim stdlib. Fram
752.
▲
by
cb321
6y ago
Nim (like Python) has keyword argument calling that softens the need to remember the out-of-n! order of parameters (by either author|reader). I.e. you can say at the call site `myAPIcall(foo=1, bar="hi")` even if the definition i
753.
▲
by
cb321
6y ago
Nim, in particular, has rather terse but elegant ways to package abstractions so that use is "obviously" locally scoped. Just as one example (more fully elaborated here [1]), there is no pointer arithmetic by default, but one can
754.
▲
by
cb321
6y ago
Sounds like you just need a multi-bump cake/jello mold like [1] with multiple "input spigots" pouring in with a "fast harden" aspect to have the perfect logo/name combo. Not sure how to convey rapid hardening
755.
▲
by
cb321
6y ago
Oh, and, FWIW, most of the time Nim code runs much faster than Go. More like C/C++/Rust speed.
756.
▲
by
cb321
6y ago
Ok. Well, then...maybe your next hobby project should be in Nim. :-)
757.
▲
by
cb321
6y ago
Not sure how well it works (and I have no setup to test), but there is this [1]. It's pretty old and Nim has evolved quite a bit in the last 4 years. It probably doesn't compile, but it might not be hard to spruce it up (not tha
758.
▲
by
cb321
6y ago
Do you have any specific libraries that you are missing? The packages list [1] has almost 1600 packages. Also, the FFI in Nim is basically just declaring some C function as a `proc`. So, wrapping existing C libraries is as easy as Cython
759.
▲
by
cb321
6y ago
Totally agree Re: Swift drawbacks. Nim's stdlib is actually quite large (like 300 modules). I am sure there are things in Go's that are not in Nim's (like Go's `big`), but I am equally sure there are things in Nim'
760.
▲
by
cb321
6y ago
The Nim Forum and IRC channel are pretty helpful/rapid feedback. Maybe not as much as a canned StackOverflow answer for Python or an existing library to do exactly what you need, but the Nim ecosystem/userbase is growing all the
761.
▲
by
cb321
6y ago
Or Nim or Zig or ... Actually, I feel like Zig may be most in the compiled-but-keep-it-simple-like-C headspace as Go. I don't know either Go or Zig super well. From what I do know, Zig seems not quite as stubborn as Go about forcing c
762.
▲
by
cb321
6y ago
Also, I am not sure what counts as "in production" but on literally a daily basis I use about 15 different command line utilities I wrote in Nim using cligen [1] (EDIT: Really I have written several dozen but only about 15..20 are
763.
▲
by
cb321
6y ago
If you think of Cython as a "new but related" language rather than just a Py compiler then you can sprinkle enough C-like `cdef` code into your Cython so that, when compiled, your code can run much faster than Go..as fast as any C
764.
▲
by
cb321
6y ago
The Nim Forum [1] is written in Nim and has been used in prod for years. A commercial video game Reel Valley was written in Nim. Status [2] is doing Ethereum 2.0 stuff with it. [1] https://forum.nim-lang.org/ [2] https:&
765.
▲
by
cb321
6y ago
If I did that & something for bash that used awk | python to do FP arithmetic I might be able to evolve to a more "portable habit/muscle memory" even if Bash never learns FP arithmetic. Solid suggestion, @tux1968. Thank
766.
▲
by
cb321
6y ago
Short form loops are also great. Someone mentioned short for loops already, but I don't think anyone has mentioned these beauties: repeat 10 echo hi while {sleep 1} echo hi
767.
▲
by
cb321
6y ago
I use aliases, too. But an alias for every possible "bookmarked" directory seems excessive. Like this guy [1] in the current thread, I tend to just say x=`pwd` (no need to always `export`). Agreed there is probably a way to set
768.
▲
by
cb321
6y ago
Hah. @jolmg & I almost collided to the second. :-) That stackexchange link had an answer with the INC_APPEND_HISTORY_TIME setopt which seems to work without SHARE_HISTORY (I think using his whole stackexchange answer might still result
769.
▲
by
cb321
6y ago
Read this thread [1] at the Zsh mailing list to the end. It looks like either share_history or inc_append_history break recording duration in a fundamental way. The TL;DR is that the history line is written out before the command in questi
770.
▲
by
cb321
6y ago
Looks like you probably also have SHARE_HISTORY set? [1] [1] https://unix.stackexchange.com/questions/396809/zsh-share-hi...
771.
▲
by
cb321
6y ago
I have a shell function `.` that goes up one: .() { if [ $# -eq 0 ]; then cd ..; else source $\*; fi; } then alias ..='cd ../..' alias ...='cd ../../..' . . So that "howe
772.
▲
by
cb321
6y ago
Not sure why you are getting all zeros in your duration column. Should be setopt ExtendedHistory (Zsh setopts, like Nim identifiers, are "style insensitive"). From the Zsh man page: EXTENDED_HISTORY <C> Save each comman
773.
▲
by
cb321
6y ago
I agree. I have been using Zsh since about early 1993. I went through a pretty thorough "first I'll convert to tcsh!" then "to Bash!" then "to Zsh!" evaluation back then and Zsh was absolutely the clear
774.
▲
by
cb321
6y ago
As many others here have noted, terse syntax for things like `repeat` loops or normal `for`/`while` loops or shell var expansion can all be addictive, but some specific things I miss in Bash that are easy in Zsh are: 1) auto cd t
775.
▲
by
cb321
6y ago
Another practical application is using tinycc as a backend compiler for Nim [1]. I set up my nim.cfg to default to this for a rapid edit-compile-test cycle (usually under 250 millisec), with a quick define switch to move to gcc-optimized c
776.
▲
by
cb321
6y ago
Knuth, The Art Of Computer Programming V3, Sorting & Searching covered both multiply & shift and modulo prime integer hashing in some detail in its first edition written in the 1960s, published in 1973. While not "modern",
777.
▲
by
cb321
6y ago
Sounds not far from https://nim-lang.org/
778.
▲
by
cb321
6y ago
Probably. Cython compiles a C-style superset of Python into C. Then a C compiler compiles that to a Python-importable DLL/.so. So, the overhead to call a C function is no more than declaring its types (programmer person overhead) an
779.
▲
by
cb321
6y ago
Header-only is more applicable since you often only need declarations/Nim prototypes and a passL/C linkage to C libs where the C generated by Nim just calls into the C library. But if you wanted to port C to a "pure Nim"
780.
▲
by
cb321
6y ago
Fair enough. They surely don't support tcc directly anyway. So, what I really meant was "informal hacker community support" (probably on jail broken/rooted devices when/where applicable!), not "official compa
More ›