
NimConf 2020 Videos - dom96
https://conf.nim-lang.org/index.html?ref=hn
======
sidkshatriya
I am ... confused by Nim a bit. Nim on the surface has a dream set of
features: python like syntax, strong types, compilation to C, good garbage
collection, good metaprogramming...

OTOH there seems to be a rapid accumulation of features. The language wants
implement the "next shiny thing" (e.g. ownership ala rust) or at least that is
how it appears to me from the outside.

For those people using Nim -- how do you cope with the ever increasing scope
of the language? Isn't there a possibility that things aren't going to be well
baked/abandoned?

I like the philosophy of evolving your language slowly and consolidating
before adding newer and newer features.

Do you think the pace of change in Nim is OK?

~~~
arc776
> Nim on the surface has a dream set of features

It's "too good to be true" is for real. The lack of friction when developing
in Nim is what makes it so fun to code in (IMO). Metaprogramming in particular
is just great in Nim and give you a lot of scope for doing things that would
otherwise require new language features.

> how do you cope with the ever increasing scope of the language?

I've been using Nim pretty intensively for several years. From my perspective
the language design has been very stable, even since before 1.0. I don't feel
like the scope is expanding, and I don't think it really needs to either
because the core language is built to be expanded with metaprogramming.

None of my code breaks when updating versions (and I do a lot of heavy
metaprogramming). Nothing seems to be abandoned, only refined, and there's a
big effort towards backwards compatability so breaking changes are exceedingly
rare. The only one I only remember was some time ago when seq (the variable
sized list type à la C++ vector) became not nil, so I had to replace `if list
!= nil` with `if list.len > 0`, so a good change IMO.

Most of the new things have been mechanical under the hood improvements and
ownership is one of those. As I understand it, when using gc refs, you'll get
free extra speed, better multithreadding, and better compile-time checks. No
code needs to be changed, and when it's considered ready it will replace the
previous GC, and you can add extra annotations for performance. It's
refinement of the GC using ownership rules rather than a whole new set of
rules for your program.

The stdlib is very stable (at least from my experience), and again great
effort is spent on backwards compatability. Stdlib focus is on being small and
"essential", so there's a high bar for stuff getting into it, and probably why
it's rare for anything to change API there.

So personally the pace of change has been great - basically my code's just got
free speed boosts when it's already fast enough :)

~~~
codetrotter
> Metaprogramming in particular is just great in Nim and give you a lot of
> scope for doing things that would otherwise require new language features.

Metaprogramming is v alluring to me, but I’ve been wondering, people that
write code super heavy on the metaprogramming, doesn’t revisiting code and
debugging become much more taxing?

~~~
mratsim
You have multiple ways to print the macros either as AST tree or even Nim code
that can be copy-pasted to replace the macro:

\- dumpTree

\- lisprRepr

\- treeRepr

\- toStrLit

This means that for debugging you can generate your code. Replace the macro by
regular code temporarily and understand what's wrong and then fix the macros.

I don't think I have a single library without macro but I try to keep them as
reasonable as you can. But sometimes you need to give a Python feel (for
example to provide a Numpy interface for a multidimensional array library) or
you have to do code transformation (implementing async or multithreading as a
library or autovectorizing high-performance computing code or implementing a
GPU or Audio DSL) and there is no way around macros.

------
mratsim
And just when "Why Figma Wins" is #1 on HN, we have Figma integration in Nim
via Fidget:

\- [https://github.com/treeform/fidget](https://github.com/treeform/fidget)

\-
[https://www.youtube.com/watch?v=IB8Yt2dqZbo&list=PLxLdEZg8DR...](https://www.youtube.com/watch?v=IB8Yt2dqZbo&list=PLxLdEZg8DRwTIEzUpfaIcBqhsj09mLWHx&index=15)

\-
[https://news.ycombinator.com/item?id=23584954](https://news.ycombinator.com/item?id=23584954)

\- [https://kwokchain.com/2020/06/19/why-figma-
wins/](https://kwokchain.com/2020/06/19/why-figma-wins/)

~~~
jedisct1
This is pretty amazing!

------
dom96
At time of writing, we've had 9 talk premieres so far. You can watch them
using this playlist[1] or watch the latest talk premiere live here[2].

1 -
[https://www.youtube.com/playlist?list=PLxLdEZg8DRwTIEzUpfaIc...](https://www.youtube.com/playlist?list=PLxLdEZg8DRwTIEzUpfaIcBqhsj09mLWHx)

2 -
[https://www.youtube.com/watch?v=NOAI2wH9Cf0&list=PLxLdEZg8DR...](https://www.youtube.com/watch?v=NOAI2wH9Cf0&list=PLxLdEZg8DRwTIEzUpfaIcBqhsj09mLWHx&index=12)

------
mratsim
Even as a speaker, I'm surprised by how wide the use cases are being found for
Nim:

\- DSL for real-time audio processing

\- Embedded programming with light switch

\- Creating GBA games!

\- Compiling to Android without Android Studio

\- Game dev in 30min

\- Promising REPL

------
elcritch
Fun talks so far! The esp8266 one is a good example of running Nim on embedded
targets. I’ve been happy with Nim in iterating on a hardware product with an
esp32, despite being more of an embedded Linux guy. Hoping to expand it out
once async is ARC ready. If others are interested in esp32 support, I was able
to create an initial PR to target for the ESP-IDF, which is a fork of FreeRTOS
and LwIP. It supports much of the basic POSIX api’s, including `select` which
is crucial for efficient servers. Freertos tasks and inter-task queues need
Nim-ified, but I’m not an expert in FreeRTOS. :/ The Nim library code is
surprisingly easy to hack on!

~~~
GeorgeTirebiter
I'd love to be able to easily write Nim with the esp32 as target; please, say
more!

~~~
elcritch
Can do! I've got the basic OS target as `freertos`, so in theory any FreeRTOS
device could work! FreeRTOS has a decent amount of POSIX API's but you'll want
the `newlib` and/or `devfs` extra components for `select` (or using uart's
with socket api's). The other big piece is `LwIP`, which has slightly
different structs for IP addresses than standard *NIXes. Between FreeRTOS/LwIP
you could cover a lot of embedded development and chips...

Here's an example esp-idf project with a README describing the build and
setup:
[https://github.com/elcritch/esp32_nim_net_example/blob/maste...](https://github.com/elcritch/esp32_nim_net_example/blob/master/README.md)

Here's the Nim Forum thread, if you want to chime in and discuss/help out!
[https://forum.nim-lang.org/t/6345](https://forum.nim-lang.org/t/6345)

It's pretty rough, but it surprisingly stable. Nim wraps enough OS level
concepts you could easily use Nim only wrappers without needing specific RTOS
idea's except when you want. Wrapping vTask's with Nim's thread api would be
awesome. I don't know FreeRTOS hardly at all though.

When Nim's async works with ARC, I wonder if it'd be possible to port LwIP or
rewrite it in Nim. LwIP seems somewhat buggy. :-)

------
impbox
So many interesting talks, DSP, games, deep internals, embedded stuff. I did a
quick talk on making games in it. Hopefully do a Nim Games Miniconf in the
future seeing as there was a lot of interest.

~~~
arc776
> 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++/JS to reuse anything in those
ecosystems.

------
treeform
The talk about the new garbage collector by the Nim's creator Andreas Rumpf,
is a must watch:
[https://www.youtube.com/watch?v=aUJcYTnPWCg&list=PLxLdEZg8DR...](https://www.youtube.com/watch?v=aUJcYTnPWCg&list=PLxLdEZg8DRwTIEzUpfaIcBqhsj09mLWHx&index=9)

~~~
Willyboar
Personally I am waiting yours.

------
filleokus
Is there any usage of Nim in “production”? How is the performance of the
compiled code (and also the compiler)?

(NB: I love a fun new language to play with as much as the next guy, just
curious)

~~~
planetis
Short answer yes. See: [https://github.com/nim-lang/Nim/wiki/Companies-using-
Nim](https://github.com/nim-lang/Nim/wiki/Companies-using-Nim)

People usually announce this stuff in the forum before this page is edited so
you might want to search there as well.

~~~
Isomorpheus
2/12 of those are dead links

~~~
planetis
Here is the first one:
[https://github.com/OnsetGame](https://github.com/OnsetGame)

Maybe someone can find the other.

------
michaelcampbell
I'm rather fond of the language in the abstract, but this decision has baffled
me.

[https://nim-lang.org/docs/manual.html#lexical-analysis-ident...](https://nim-
lang.org/docs/manual.html#lexical-analysis-identifier-equality)

`fOo_Bar` is the same identifier as `fooBar`. I'm not sure I'm sold on this,
or don't understand the problem it's trying to solve.

~~~
pietroppeter
One idea is that two identifiers which differ by style (e.g. foo_bar and
fooBar) should not appear in the same code base (in the sense that they should
not be used to refer to two different objects).

On the other side if a library is written in snake_case and your project is
camelCase, you can keep your style throughout your project and still use that
library.

From a practical point of view you should keep a consistent style and the
official style for Nim is CamelCase.

This feature has never been an issue for those who actually use Nim, but it
sure is something which is mentioned a lot by those who do not use it.

Note that first letter is case sensitive and the convention is to use Capital
letter for types. The following is idiomatic:

type Person = object var person: Person

------
planetis
I am hyped about the last talk "Introducing Enu, 3D live-coding in Nim", can't
find any information about it online. Seems like a genuine reveal!

~~~
dsrw
Thanks! The repo is at
[https://github.com/dsrw/enu](https://github.com/dsrw/enu), but it's still a
month or two away from what I'd consider "reveal worthy". There are no docs,
and what's there barely works. However, I really wanted to be part of NimConf,
so I cobbled things together as best as I could. I'm going to do a bigger PR
push when it's a little farther along.

------
deckarep
Ok honest question I got really excited about Nim when I looked into it about
1 year ago.

But I started looking at community projects on Github and found nothing except
for Nimlang itself. This is not meant to be critical of what I think is an
impressive language...just more of a question of where are Nim open source
projects to be found?

~~~
ggregoire
I got really excited about Nim 1 or 2 weeks ago and what worried me a bit is
the number of questions on StackOverflow. In the "new question" section, the
most recent one was from hours ago, the second one from 1 or 2 days ago, the
third one from the previous week. It could just mean that the language is
straightforward and the documentation perfect. But it's still a good metric to
measure the popularity of a language. Also, it makes me wonder, if I need to
find "how to do X", would I find an existing answer? If I need to ask a
question, would someone answer?

(still excited about Nim anyway, seems like the perfect replacement for Python
at my job)

~~~
mratsim
Personally I don't want to deal with StackOverflow elitism, "closed
duplicate", "you don't know what you want to do, what you want to do is this",
etc.

~~~
planetis
I was thinking the same, that StackOverflow has failed to attract nim users
that are able to answer the questions, but afraid to sound too radical didn't
express it. Myself included won't login to stackoverflow, since i can't __even
__post an answer! Instead I help in the Nim forums.

------
smabie
Nim looks really awesome but I have a couple questions. Is Nim a replacement
for high level for performant languages like OCaml, Haskell, etc. Or is it
supposed to be lower level and replace C? How does GC interact with the
preferred style? Can you go without it?

~~~
dsrw
It’s really for both. I’m paraphrasing, but during Araq’s intro talk during
the conference he said something like “Nim should be suitable for every task,
but maybe not every programmer”. Whatever you’re trying to do, there’s
probably a pretty good way to do it in Nim. It can run on microcontrollers or
supercomputers. It can compile to C, C++, JS or LLVM ir (via nlvm), and has a
good interop story with all of them. You can use it’s advanced meta
programming facilities to create specialized domain specific languages, or you
can ignore that feature and write code that looks more or less like python. It
has an advanced compiler with lots of optimization opportunities, but it also
has an interpreter if performance is less important.

You can use it without GC, but the new arc collector is suitable for hard
real-time, so I don’t think there are many cases where you’d need to drop to
manual management.

The main downsides (in my mind) are the small community and somewhat limited
debugging support. I really like the language however, and use it wherever I
can.

------
Tiberium
Talks are really nice, from embedded to web programming :) I'm watching till
the very start and will probably watch till the very end. Nice to see so much
people using Nim, it's certainly gaining popularity.

------
Willyboar
Great talks so far. More coming...

------
ddlsmurf
Very surprisingly wide range of subjects so far.

