Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
cb321
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
48 ms
·
601.
▲
by
cb321
5y ago
The Nim variant (yes, knowing Nim first matters) has terser syntax, but retains the strong typing that allows compiling to fast running code. E.g., from the rp --help, to total just the positive integers: rp -b'var t=0' -w&
602.
▲
by
cb321
5y ago
I hear the D compiler has pretty fast compile times. I'm not sure how low the syntactic noise can be gotten. Of course, with very slow compiles it will mostly seem not very pointful. It works with a C backend [1], too, and TinyCC
603.
▲
by
cb321
5y ago
I think most confusions come from how divisive significant white space can be and Python being the most popular among that class of surface syntaxes. I am aware (and maybe you are, too) that there is a long list besides Nim: https:/
604.
▲
by
cb321
5y ago
I have to back up ModernMech here. C with -O0 is not very fast on any compiler that has it (by design) which is most. Nor is the output of barely optimizing compilers like tinycc/tcc. Saying "C is inherently fast" is very n
605.
▲
by
cb321
5y ago
I should have said, those help strings at the very bottom of the file are also part of the "documentation" to the extent the variable names in the proc signature are not self explanatory.
606.
▲
by
cb321
5y ago
Oh, btw, all that "Nim code for XYZ" in the crp,help={} section at the end should be "C code". Oops. { Sorry. I mostly just ported the rp.nim to crp.nim to time how fast tcc could make a pure C backend run and didn'
607.
▲
by
cb321
5y ago
I'll go ahead and post crp.nim here. pjmlp rightly (and often here) observes that people become very trapped in their thinking about PLs. It perhaps helps to emphasize that the whole program generator need not be in the same PL as th
608.
▲
by
cb321
5y ago
I think the design is just about 100X easier for mere mortals { in bogus "effortmeters" ;-) }, but it is absolutely true that some backend languages are more suited than others. It is also true that having real optimizing compile
609.
▲
by
cb321
5y ago
This is fair, but argument in favor of the approach is that it is so simple it really could be done with any backend language {EDIT: by a 1st year CS student in an afternoon, um, maybe.. ;-)}..Go, Pascal, Ada, even slow running ones like Py
610.
▲
by
cb321
5y ago
> the extent of rp's "documentation" Unfortunately, yes. My hope was that it would be compact/small enough to be "quasi-self-documenting" to the likes of "compiler writer types". Probably not to
611.
▲
by
cb321
5y ago
Instead of interpreters, if one has less of a "must be a full featured prog.lang" mentality and a fast compiler like Go or Nim [1] (or is willing to wait, for slow optimizing compiles to apply against big data sets) then an end-to
612.
▲
by
cb321
5y ago
I would say the author is also confusing the words "digit" and "radix". From The Free On-line Dictionary of Computing (30 December 2018) [foldoc]: radix <mathematics> The ratio, R, between the weig
613.
▲
by
cb321
5y ago
> isn't cpan pretty much the grandfather of "oh there's a library for that"? The TeX CTAN in 1992 [1] was clearly the inspiration for CPAN a year or three later [2] (in both name & thing). So, maybe CTAN is the g
614.
▲
by
cb321
5y ago
Sounds like a lot of "contemporary automation today" to me - automation that would often apply about as well to C code bases as well as horrifically overcomplex C++ codebases. Also, why even draw a stark contrast between "a l
615.
▲
by
cb321
5y ago
Very minor correction - Nim tends to attract people specifically with its language power via its powerful Lisp-like metaprogramming facilities, static introspection, etc. These features are expressly there to automate away mundane repetiti
616.
▲
by
cb321
5y ago
Nim's concepts [0] are sort of like Rust's traits or Haskell's typeclasses - maybe more expressive in some ways. Pattern matching can be added on as a simple library and has been done several times, maybe most pedagogicall
617.
▲
by
cb321
5y ago
I think plac and argh in the Python space pre-dated Click by a long time and had many similar features. I'm not sure if they had everything the Click author exactly wanted, but they do seem like strong prior related work.
618.
▲
by
cb321
5y ago
If the PL you are using already has named parameters with defaults then you can roll a CLI on top of it with a more well specified "spec" language (the PL itself) and with less work. There are a few Python packages for this and
619.
▲
by
cb321
5y ago
Ada is a bit verbose for my tastes. Nim [1] is fast like C - I have yet to really find anything rewritten in Nim be slower. It's safe-ish like Rust { there is an easily identifiable subset of unsafe constructs }. It's kind of l
620.
▲
by
cb321
5y ago
The options are nim c --styleCheck:hint --styleCheck:usages (you need both). Though not on by default you could put it in your config.nims or nim.cfg's to make it on by default for you or for your code.
621.
▲
by
cb321
5y ago
https://github.com/treeform/shady
622.
▲
by
cb321
5y ago
I am no C historian, but I believe part of the idea was to be able to have macro wrappers around proper language symbols like "#define sin(x) real_sin(x, 1e-7)" or some such, for example. The "warning character" (what y
623.
▲
by
cb321
5y ago
Much Nim code is similarly concise.
624.
▲
by
cb321
5y ago
In the C world ALL_CAPS very often signify preprocessor macro identifiers (or some other "class" of identifier), but, yeah..they may all be "insane". ;-)
625.
▲
by
cb321
5y ago
This more|less also describes Nim. The recent automatic memory management ARC/ORC alternative is not really even what most people think of as "garbage collection". Its macros give you full AST accept & re-emit powers an
626.
▲
by
cb321
5y ago
I thought it a bit odd, given its numerical/data analytical focus, that the article mentions mratsim's weave but not arraymancer which might in some situations allow a pure Nim approach.
627.
▲
by
cb321
5y ago
No. To be more clear, you can mmap read only and just cast the pointer. You probably want the struct type to be "packed" unless you are intimately familiar with your compiler's struct padding behavior. Every C compiler I am
628.
▲
by
cb321
5y ago
I get ~50% the speed of the article's variant with no SIMD at all in https://github.com/c-blake/nio/blob/main/utils/c2tsv.nim While in Nim, the main logic is really just bout 1 screenful for me
629.
▲
by
cb321
5y ago
The "real" format being binary with debugging tools is absolutely the best way to go. For example, you can use `nio print` (or even just `nio p`) in the Nim multi-program https://github.com/c-blake/nio to ge
630.
▲
by
cb321
5y ago
You need not newfstatat every dirent unless you need more metadata (times, size, etc.) for something else (as alluded to above by, at least, both me and bscphil elsewhere in this thread). You can simply try to call `opendir()` based upon `
More ›