Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
arc776
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
14 ms
·
61.
▲
by
arc776
6y ago
> Nim Games Miniconf I'd be interested in that! From my perspective Nim is ideal as an indie gamedev language since it's so fast to iterate/prototype with and get good performance, and has mega easy FFI to C/C++/
62.
▲
by
arc776
6y ago
> every call to a virtual method-- including calls internal to the class-- goes through a dispatch step You've touched on a whole host of performance issues here too. Not only are we making indirection after indirection when accessi
63.
▲
by
arc776
6y ago
I feel like inheritance is the actual problem with OOP. Trees of types with increasing specialisations just don't describe many real world problems that well. When you do build programs like this, code gets more and more rigid until it
64.
▲
by
arc776
6y ago
My comment history is 90% talking about Nim because this is the account I talk about Nim on :) Probably it's the same for other people. My last comment was 7 months ago on the 1.0 release. It seems like when talking about a smaller lan
65.
▲
by
arc776
6y ago
You're right no dependent types, though to be fair that wasn't the only thing mentioned, and none of the other replies have yet suggested a language with dependent types either. I was responding to: > ...great tooling and moder
66.
▲
by
arc776
6y ago
Have a look at Nim: https://nim-lang.org/ It's a system language that's focused on readability and performance. It has OOP but isn't focused on it, and has some of the best AST metaprogamming out there built
67.
▲
by
arc776
7y ago
> Something I don't see here is macros that generate other macros, but the question is how much you really want that anyway You can do that in Nim in a readable way. import macros macro genMacro(name: untyped): untyped = r
68.
▲
by
arc776
7y ago
> However, it doesn't have any library calls that I'm aware of that are equivalent to C's malloc() and free(). You'd have to supply your own. The malloc/free equivilents are in the system module: https:/&#x
69.
▲
by
arc776
7y ago
In hindsight maybe the "performers" table would be better named "resultVars", as that's what it really represents.
70.
▲
by
arc776
7y ago
Metaprogramming is one of the core ideals in the birth of the language so is well supported. Personally I've not used Lisp, so can't comment there, but it is on the list of influences on the homepage. Essentially there's a VM
71.
▲
by
arc776
7y ago
I wouldn't say separating the GC at the type level is a major innovation, but as you say it's useful. I don't think Nim really sells itself on a groundbreaking GC implementation either. However it does give you a fast GC with
72.
▲
by
arc776
7y ago
Basically you only use GC if you declare something using a GC type. type # A `ref` type is GC and will use the heap. MyGCType = ref object fieldA: int # Otherwise ALL types are stack based. MyStackType = object
73.
▲
by
arc776
7y ago
This is a bit like saying you wouldn't use LLVM languages because of the semantics of IR, or that you have to understand the guarantees IR provides, isn't it? Ultimately if you're really interested in performance, regardless
74.
▲
by
arc776
7y ago
I would say metaprogramming (and maybe the excellent FFI) is the huge stand-out feature for Nim. However whilst you can compare all these languages and find a particular niche or set of features that sell them, Nim is just good at pretty mu
75.
▲
by
arc776
7y ago
Well the Nim team at Status is a separate team working on an open source Ethereum 2.0 implementation, rather than any blockchain 'product' (unless you count a working 2.0 client as a product). Their goal is to get Eth2.0 (and 1.0)
76.
▲
by
arc776
8y ago
Language server is in construction, but you can use gdb with VSCode quite well within the editor.
77.
▲
by
arc776
8y ago
Try "StInt: A fast and portable stack-based multi-precision integer library in pure Nim" Being stack based and having some nice compile time evaluation features should make it very performant. Here: https://github.com&#
78.
▲
by
arc776
8y ago
Mundane typing? Typing is awesome! Haven't you ever wondered what a parameter actually is in say, Python, and have to track back through callers to work out what the parameter is expected to contain? Completely solved by specifying typ
79.
▲
by
arc776
9y ago
> I guarantee you that if I were using such a project at work, we'd end up with the same variable being referenced different ways. Luckily this is trivial to resolve as the compiler reports ambiguous variables as errors and you can
80.
▲
by
arc776
9y ago
Definitely fits the bill: * Python-like syntax * Compiles to C/C++/JS/Object-C * Supports Windows, Linux and Mac. * Multithreading * Extensive metaprogramming * VERY fast compiler * Dead code elimination * Very strongly typed
81.
▲
by
arc776
9y ago
I just wanted to add to the arrays and seqs comment. >Why do I need two very distinct types performing essentially the same function? Arrays are very simple static blocks of memory and can be allocated on the stack, which is really fast,
82.
▲
by
arc776
9y ago
It appears so: https://github.com/TomCrypto/caret > This is an experiment for running Nim code on the ESP8266 ("NodeMCU") microcontroller. The end goal is an extendable framework on which to build autonomo
83.
▲
by
arc776
9y ago
Nim ameliorates this somewhat by being able to easily wrap any C/C++ libray, and even has c2nim to create wrappers automatically. One of the advantages of compiling to C and C++.
84.
▲
by
arc776
9y ago
Those facebook 'like' and 'share' buttons you see on a huge number of websites also interact with their systems. You don't have to be signed in, nor do you have to actually click them. They record your visit to the
85.
▲
by
arc776
9y ago
> There is a chance he could get away with precomputing an atan2(x) table in memory and then just reading the values off the table. Quick as lightning, and an old trick, probably invented in the 1950s!! I actually tried this for cos and
86.
▲
by
arc776
9y ago
However Delphi has more modern language features than Go, such as generics, full object orientation and reflection.
87.
▲
by
arc776
9y ago
A bit hyperbolic, there are loads of languages that are case insensitive. Are you really only using case to distinguish different variables? That seems more error prone.
88.
▲
by
arc776
9y ago
Curious as to when you had this problem, I thought the manual was fairly descriptive: https://nim-lang.org/docs/manual.html#types-reference-and-po... I'm sure your original question was more nuanced, but for anyon
89.
▲
by
arc776
10y ago
Some articles on Nim for those that haven't encountered it: Nim by example: https://nim-by-example.github.io/ Getting started with Nim: https://akehrer.github.io/posts/getting-started-with-nim/
90.
▲
by
arc776
10y ago
To be fair, this is library FFI code so this is actually for interfacing with C++ rather than 'native' Nim. Probably not something you'd encounter unless you're making a library wrapper. And if you are doing that, worth
More ›