Recent submissions

Comment · 8 years ago
It can target everything that C89 can target, but it may require some additional steps like writing the Nim interface code for target specific system libraries etc. There are also tools to help with this, but I prefer to write the Nim interface to existing C code myself.

A thread about the added Android support: https://forum.nim-lang.org/t/3098

An old article about targeting IOS: http://www.thomasdenney.co.uk/blog/2015/1/27/nim-on-ios/

Also have a look at the following list: https://forum.nim-lang.org/t/2670 (nimx, a cross-platforn GUI library, seems to support Android/IOS)

The following shows how to interface with ObjectiveC code / libraries: https://github.com/jangko/objc (Of course, if they are not already available, you will have to create the Nim interface to the IOS libraries yourself)

One of the tools that can be used to create Nim interface code from existing C header files: https://github.com/nim-lang/c2nim

Comment · 8 years ago
Comment · 8 years ago
I will just repost my old post, but a lot has happened since then:

Nim comes very close to be the perfect language for me (game development, machine learning etc.). Some things I experimented with including some links to show what I tried as follows:

- Fully controllable and plugable GC: I can decide for myself when the GC runs and for how long. Very important for games. If I do not like the GC I can even write my own or choose one of the many existing ones. See: http://forum.nim-lang.org/t/2646

- Meta-programming, templates, concepts etc.: To be able to write a machine learning library I needed something that can replace simple code (DSL) with more complex code using scalar math, SIMD, SPIR-V, OpenCL or Cuda. I also wanted to be able to automatically generate bindings for scripting. See: http://forum.nim-lang.org/t/2654 and http://forum.nim-lang.org/t/2635 . As I understood by reading the forums they will soon merge in many concept improvements. See: http://forum.nim-lang.org/t/2396

- Nim itself can be used as an embedded scripting language: Nim as a scripting language is used by the compiler to run Nim while compiling to generate new code. Nim as a scripting language can also be used as a more advanced configuration language (like Lua in the beginning). It can be used as an embedded or standalone scripting language as well. See: http://forum.nim-lang.org/t/2647 and https://github.com/komerdoor/nim-embedded-nimscript

- Compiling to C89 code (useful for creating libraries and cross-platform support etc.): I want my games to compile on platforms not supported by GCC or Clang/LLVM (actually I am sure they can support them all after some patching) but with their own C89 compiler. After compiling to C it is easier for me to see what the code will actually do. Still if I really want to I can choose to compile to Javascript, C++, Objective-C and LLVM (not officially included yet) as well. See: https://github.com/arnetheduck/nlvm

- Pretty good functional programming support (as far as compiled code allows for): For this I created a library that use the zero-overhead iterators. There are many alternatives as well and I like to be able to choose between multiple implementations of higher level functionality. See: https://gist.github.com/komerdoor/70d9c25820952624cf797890a1.... . Of course a better implementation is possible by combining this with concepts, generic dynamic method binding and all other of Nim's features. See the following again: http://forum.nim-lang.org/t/2654

- Easy integration of existing C code: I wrote part of my code in C (low-level) and another part in Nim (mid-level).

Some things which may get new Nim users in shock but I learned to love:

- Use of indentation using spaces for grouping like Python: I never really liked this but I cannot ignore that this made my code easier to read and discourages my preference for one-liners (yes I know bad habit and does not work well inside editors and with source-control).

- Multiple ways to write the same identifier (case/underscore insensitive): Liked this from the beginning. I am really consistent to choose a single style but all my C code is written using underscore (ex.: typens_do_something(x)) while in Nim in prefer to use camel case (ex.: typensDoSomething(x)) or fully drop the namespace entirely (ex.: doSomething(x) or x.doSomething()).

- Multiple ways to call methods: Both "abc".toUpper() and toUpper("abc") are the same. There are no namespace conflicts because Nim uses the best match for toUpper like: func toUpper(c: char): char or toUpper(s: string): string. It also makes it easier to add new methods for existing types while still being able to call the methods like if OOP is being used.

- Minimal support for OOP but encouraging composition over inheritance

Comment · 9 years ago
I once started experimenting with (GNU) C macros: https://gist.github.com/machuidel/d7cc099ddc4970c6ddf4

It became an abomination consisting out of many C-preprocessor hacks and impossible to debug. I never put it online (and I never will).

In the end if you want to use C at a more abstract level you may as well use Nim (not C, but it compiles to C89), C++ (of course) or write your own code generator (using libclang with annotations for ex.).

Comment · 9 years ago
Comment · 9 years ago
A company in the Netherlands sometimes hires me to help them guide the interns. They are what is called a learning-company over here.

Out of the 100 IT interns every year there are usually about 5 that know more than only the basics. This has been a consistent pattern I've seen over the last 4 years. It does not matter what level education they are having. Many times I even had to explain what functions, conditions etc. are while they somehow still managed to get average grades for classes that require this knowledge.

I really do not understand how so many people manage to fool almost everyone for so long. It usually ends up being the case that I (because I get hired to guide them) or the about 5 good interns that are there do most of the work for them. Of course some of them still manage to setup a Wordpress website or write some simple HTML. Just enough to impress the company owners.

Another consistent pattern (as mentioned before) is that very often their end-goal is to become an IT-manager. These are usually the better talkers.

Of course this is all anecdotal, but I've asked many other people that guide IT interns and they noticed the same thing. Probably something that can be researched.

Now I may seem like the one that thinks very highly of himself (by reading my own text I can understand why it may look like this) and this is exactly what makes this difficult to explain to the company owners when I notified them about this. They just do not believe the 5 to 100 ratio and think I've some difficulty accepting people.

Comment · 9 years ago
I agree. Thank you for pointing that out. That is why I restricted my JWT code to only accept / use certain options. Of course I could still have chosen the wrong cipher for my specific use case and am aware that JWT will not solve this for me.

What JWT is doing is actually not that special as it is just a standardized container (akin to MKV and supported codecs) inside which existing technologies can be used. Easy to write something similar if you know what you are doing. I did that before, but still missed some extra verifications already build into JWT.

Of course, the chosen technologies allowed to be used inside a JWT can still be prone to vulnerabilities. I am not sure if that can be blamed on JWT. People should still think about which options to use.

Comment · 9 years ago
Comment · 9 years ago
And the following where you can hear from himself what kind of person he is: https://youtu.be/HXqty2rkUDY

I took me months to read most Open Society leaks and I personally do not like how they influence the political climate etc.

Comment · 9 years ago
Yes I agree. It did not take long before it started getting into a fight not being about game journalism anymore but about more diversity in games, misogyny, racism etc.
Comment · 9 years ago
Comment · 9 years ago
I know the whole movement that got Trump elected started from this but at that time it was as far as I know not called alt-right (because I remember the thread on 4chan were they actually made it up).

Yes, the division between groups (pro/anti) created while gamergate was going on were about the same. On one side people calling for social justice on the other side the people that in a way are against social justice + the ones that did not want to choose a side.

At the beginning gamergate was just about ethics in journalism (mostly in gaming).

Comment · 9 years ago
Comment · 9 years ago
Alt-right? How did a term made up on 4chan get so popular and taken seriously (/pol where I saw this term used for the first time). It really has no meaning at all only to find a opposite alternative to (the also misused term) regressive-left. Before last year people did not even identify as such. People that now do identify as such do not even seem legit and behave like actors (the same feeling I have with people like Alex Jones).

Now even people I would call moderate / left-leaning are now called alt-right (a term they do not use for themselves).

Comment · 9 years ago
Obama also signed many executive orders in his first week. He set the precedent.

>> - without studying the history of why things are the way they are

In this case. Studying history about immigration from certain countries?

>> - without appropriate counsel of stakeholders

Who decides what is appropriate?

>> - without any repercussions for such actions (no checks and balances provided by democratic systems)

Chosen for by the US democratic system and exactly done as promised.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton