2,345 karma · joined September 8, 2010
Active open source contributor: https://github.com/bendmorris
ben@bendmorris.com
http://www.reddit.com/u/bendmorris
My point is, this is an actual deficiency that you need to consider when evaluating Nim, that isn't just a function of the language being new. For example, Zig is another option which puts any C libraries at your fingertips, without requiring bindings. If Nim had better interop (not just relatively good, but zero effort) this would no longer be a concern and you wouldn't need all of your libraries to be in Nim.
Because language age doesn't make a difference. People have to actually use the language, and this is a practical concern.
If you were choosing to put a high school football player or an NFL player on your team right now it'd be an easy choice, wouldn't it?
With that said, down the line I plan to add procedural macros, and those will likely be lexical (they take a series of tokens as input, which doesn't need to parse into valid AST.) If I do go that route, such macros would have to be invoked explicitly.
>My intuition is that ambiguities are at least possible, so what about precedence, which AST term is evaluated first? I'm thinking of some situation where two subtrees match the rule, but you end up with different results depending on which is transformed first. E. g. if you were to define a cross product rule, and apply it to a × b × c.
This is absolutely a potential issue, and the examples I have up now are quite bad. This is why it's important for rules to be strictly scoped. The only rules that can affect an expression are the ones you've explicitly brought in with a "using" block, or those that are defined for the types you're directly working with. Given the scoping, I think overlapping rule applications will be uncommon in practice.
>What about infinite loops in rule sets? What about recursion?
There's a sanity limit on the number of times an expression can be rewritten, and it'll show an error in that case which displays the transformations that triggered the limit (including the first, last, and any non-repeating transformations going backward from the last - so it should be very clear.)
>Is there any way to debug the transformations?
This is definitely an area for improvement. I'm planning to (1) add enforced "rewrite this" metadata that will fail to compile if the expression isn't rewritten, and (2) enable dumping not only the final AST but also all of the transformations that occurred.
I'll just comment on this part. I'm a contributor to Haxe (not so mainstream perhaps but more so than Kit.) Kit was a chance to try out some features that don't fit in well to Haxe (and in fact I did propose several of these features as additions to Haxe, and they were explicitly rejected.) Sometimes the answer really is to write a new language, because language simplicity is still important and one language can't be everything to everyone.
And of course, Haxe wouldn't exist if its creator hadn't been unsatisfied with existing languages at the time...
I like to think that when I'm writing Kit, I'm writing C, so I am writing in a "real language." Total interop, no real drawbacks.
Zig is awesome - I've used it and would use it again, I'm funding the creator on Patreon, and I see these two languages as filling slightly different niches and having different pros and cons.
>Basically, what "designed for game development" means?
I've been doing a lot of work in Haxe, but have struggled with performance issues due to GC and memory churn. I wanted a lower level language with more control, but without sacrificing the ergonomics and abstractions I'm used to. Term rewriting and implicits are examples of features that let me layer abstractions onto a language but still maintain complete control.
>What was the original language and why made the change?
It's not up on GitHub, but the prototype was begun in Rust. Ultimately I found I'm much more productive in Haskell and made the switch.
Rust has had untagged unions since last year (https://blog.rust-lang.org/2017/07/20/Rust-1.19.html)
A few other tips:
* Use a parser generator. Parsing is more or less a solved problem; get it out of the way as fast as possible.
* Writing a language that compiles to another language is very helpful as you can often borrow the underlying language's implementation of a feature. Doubly helpful if you can leverage the underlying language's libraries for things like syscalls.
* Make a todo list (I like Trello for this) full of self-contained tasks. Pick one at a time, think through how you would implement that feature, and go to work. Compilers look like a lot of work in the beginning, but if you take one step at a time, one day you'll look back and have accomplished more than you realize. The list can also be helpful to avoid scope creep; add any new ideas to your backlog and deal with them later.
* Write unit tests, as you'll very likely want to refactor something down the line. Once your compiler becomes complex enough, add functional tests that verify entire programs can compile and run and produce the expected output.
>As an example, someone who thinks of the machine as something that can evaluate list comprehensions in Python and use OO to access data elements has no clue whatsoever about what and how might be happening at the memory level with their creations. Hence code bloat and slow code.
Not having to care about details that aren't contextually important is a good thing. When someone is constrained more by development time than by computational resources, working in a high level language means you're explicitly shunting low level concerns so you can spend more time dealing with domain logic.
There are many situations where finishing something faster, which will run 10x slower and use more memory, is a worthwhile tradeoff.
As of 2016 they are the most heavily Republican-leaning religious group in the U.S. [1]
Technically, there's a Democrat in every city in Utah, but let's not pretend they're a microcosm of the country without a very distinct culture.
[1] http://www.pewresearch.org/fact-tank/2016/02/23/u-s-religiou...
Nominally, sure, just like other Christian religions. There are still plenty of big expensive houses in the Salt Lake area.
In fact, employers can have legitimate reason to ask your age, such as background checks.
Anyone should be proud of writing a widely used tool that provides value to so many individuals and companies, regardless of nitpicks from the peanut gallery.
>Does that mean I’m a happy camper? Fuck no. My total comp for the first year is only $145k out of undergrad with a base of $106k. My friends at places like Google, FB and Cruise are making more like $180k-$230k by comparison. Perks are also nonexistent.
>The worst part, though, is knowing that i have become stuck in a company with a significantly lower hiring bar. Im honestly terrified that the value on the resume will decline over time and i will never be able to get into a more prestigious company. The idea of being relegated to a 2nd or third tier company has been eating at me, and comments on places like CSCQ, Blind and this AskHN nearly drove me to suicide before.
OP, what makes you happy? I suggest that being at a "more prestigious" company like Facebook or Google (granting for argument's sake that they actually are) will not make you happier, neither will making a few thousand bucks a year more than your already higher-than-median salary. You can waste years of your life chasing these things only to discover they didn't make the difference you thought they would. At the end of the day, what do you want to do?