HNHacker News
TopNewBestAskShowJobs

V1ndaar

320 karma · joined August 14, 2019

submissionscomments
V1ndaar··on Atlas, a hopefully better engineering IDE
I've recently written a units library for Nim [0]. It's still WIP, but it's already proven extremely useful for me as a physicist.

Thanks to Nim's strong type system and metaprogramming features, it allows for a fully compile time design, without any runtime overhead (in form of special unit objects or such things; everything is a `distinct float`).

In addition Nim's unicode support, the code even looks nice!

A more complex use case (I can link more if desired): [1]

[0]: https://github.com/SciNim/Unchained/

[1]: https://github.com/SciNim/Unchained/tree/master/examples

V1ndaar··on Dvorak vs Colemak (2010-2020)
Yep, switched to neo2 last June or so after thinking about it for a couple of years. Beginning was tough (relearning Emacs shortcuts, ouch), but now I type faster than on qwerty (~90-100 wpm, still improving though).

It is so great for programming! Also although I'm German, probably 90% of what I type is English. Works perfectly for English as well.

Also being able to type Greek letters is great as a physicist, hehe.

V1ndaar··on Physicists argue that black holes from the Big Bang could be the dark matter
That is being willfully ignorant.

Yes, "dark matter" is a kind of catch all term for a bunch of phenomenon / experimental measurements we don't properly understand. There's a large number of different models trying to describe the seen behavior and make predictions to be able to detect it. And in most of those models, dark matter is indeed matter!

V1ndaar··on Physicists argue that black holes from the Big Bang could be the dark matter
For all reasonable sizes of black holes, the flux due to Hawking radiation would be _so ridiculously low_ that it wouldn't change anything about our usage of the term "dark matter".

In fact most dark matter models do assume some form of extremely weak interactions with normal matter or dark matter decay, which is how we try to detect dark matter. The effective flux from such interactions is a lot larger than Hawking radiation would be.

V1ndaar··on Array Programming with NumPy
If you talked to me about my PhD for a few minutes you would surely put me into your "had to reinvent the wheel for no reason" category.

As indeed, I wrote an analysis framework for my data (of a gaseous detector used for axion search) [0] instead of using an existing framework used by my predecessor. However, things are always more complicated than they seem. Many of those not talked about students who rewrite stuff probably have reasons!

In my case the existing framework [1] was a monster that was bent to allow it to work with the kind of data we have in the first place. In my case my detector had several additional features, which fit _even less_ into the existing framework. It would have been a hack and still a significant amount of work to make it work well.

To be fair, when I started this I expected it to be less work than it ended up being. But that's the story of software development.

The advantages now are significant of course. I know the whole codebase. It does exactly what I want. I can extend it easily as I see fit.

That doesn't mean I didn't also partly procrastinate writing software. Far from it. Hell, there was no reason to write a freaking plotting library (a sort of port of ggplot2 for Nim) [3]. But again, this means my thesis will have plots created natively using a TikZ backend while at the same time provide links to Vega-Lite plots for each and every plot in my thesis (which of course will include the data for each plot!).

Finally, the most important point: A university / professor who only pays me for 20h a week does not get to tell me how I do my PhD.

[0]: https://github.com/Vindaar/TimepixAnalysis [1]: https://ilcsoft.desy.de/portal/software_packages/marlintpc/ [2]: https://github.com/Vindaar/ggplotnim

V1ndaar··on Nim: Scripting Ease in a Compiled Language
Since you mention tidyverse, I might shamelessly mention that I'm currently working on a sort of port of ggplot2 and some dplyr features in Nim [1]. It's super WIP, but for most plots and simple data frame operations (complicated stuff I do beforehand) I need it has mostly replaced plotly [2] (or in some cases matplotlib).

However, don't expect the included data frame to be fast. That in combination with a dynamic nature has been out of scope for me alone.

[1] https://github.com/Vindaar/ggplotnim/tree/addDocs

[2] https://github.com/brentp/nim-plotly

V1ndaar··on Nim: Scripting Ease in a Compiled Language
Not really a data scientist myself, but using Nim for my PhD in physics to analyze the data I took for an axion search experiment, code at [1].

I just love it. Super productive to work with and in my case faster than the C++ framework I'm replacing.

The ecosystem of course is pretty small. But for me wrapping C code, porting something or reimplementing some libraries can be a lot of fun, too. In my experience every hole I've found was easily plugged so far.

[1] https://github.com/Vindaar/TimepixAnalysis (recently due to ..reasons.. all development happened on the open PR)

V1ndaar··on Root: CERN's scientific data analysis framework for C++
Sorry for the missing line breaks in there, typed this on my phone. And for some reason my edits don't stick. :|
V1ndaar··on Root: CERN's scientific data analysis framework for C++
Haha, well you can get payed for it, but you won't be payed well.

It's hard to give an easy answer for that.

But let's step back a little: I played around with Julia several years ago. I don't know when exactly, probably in 2015 (?). Back then I thought of it as a faster python for science. Many things I would use python for back then I could have done in Julia too. Others I couldn't though, because the eco system was still too small. And while Julia was somewhat faster for the things I tried, it wasn't amazingly faster. My interest in the language dropped sometime after that. But still, I felt like it was a language targeted specifically to scientists. Many things I wanted from my analysis framework however were outside that bubble I felt. I didn't simply want to write a faster "analysis script". I do realize however, that the language has evolved a lot and I'm happy it's finding acceptance!

Fortran on the other hand, I never really considered. I suppose modern Fortran is a pretty good language though.

So why did I choose Nim then? It gave me: - the ability to produce standalone binaries I could just put on any data acquisition pc without a hassle (well ok, be careful about old glibcs) - it's fast, and I felt right at home syntax wise coming from python - the community is amazing. The first time I entered Nim's IRC channel I noticed Araq, the creator of the language, answering random people's questions! In general the community allows for a super quick feedback loop to learn the language - it's a pretty concise language. The whole manual can be read in less than a day - having written some Clojure, I loved the idea of a powerful macro system - after seeing mratsim's arraymancer library [1] I was happy to 1) have a numpy substitute and 2) thought if one person could write such a great library in O(1 year) it must be a pretty awesome language to work with :) - being able to trivially wrap any C code around is super helpful - a pretty strong type system! No more annoying implicit conversions from any type to a bool, error prone implicit int <-> float conversions etc.

I probably forgot many points, but well. The truth is of course, many languages could have worked for me, but the time I spent with Nim in the beginning was just super pleasant.

[1] https://github.com/mratsim/Arraymancer

V1ndaar··on Root: CERN's scientific data analysis framework for C++
I'm a PhD student in physics, working on CAST [1], a small experiment at CERN. That fortunately means I don't depend on other peoples' code too much.

With the C++ interpreter of ROOT you can run so called ROOT macros. They are basically just C++ files containing your code at top level in pair of `{}`. The "funny" thing is half the time you run a piece of code it'll work the first time. But then running it again will cause the interpreter to segfault, due to the mess of global state and the half baked memory management of ROOT.

And don't get me started on the usability of the ROOT classes. A huge amount of stuff is string based, so throw away your type checking guarantees. I mean why bother...

Since I really didn't want to continue working with ROOT for my PhD (after having used it before), I decided to ditch the previous data analysis code and start from scratch [2]. I decided to use Nim for it, because it provides me with a powerful language (on par with python for my purposes - aside from admittedly certain libraries, which I had to wrap), yet still being as fast as the old ROOT code (in fact faster for my data analysis, but the comparison is problematic).

Yeah, it cost me a lot of time to get "back to where I started", the code itself might also not be a shining example of perfection, but I learned a huge amount about programming and I understand every piece of it. It was totally worth it. The gains in efficiency thanks to Nim and due to the fact I know the codebase means I make up a lot of the lost time anyways.

So to any people out there who may be in a similar position, don't be afraid to throw out what you don't like. :)

[1] https://home.cern/science/experiments/cast [2] https://github.com/Vindaar/TimepixAnalysis

← PreviousPage 4 of 4