<< 10-04-2017 >>

06:47:52*NimBot joined #nim
06:48:21dom96Should be fixed now. The VPS ran out of space :)
06:49:50*nsf joined #nim
06:50:19couven92dom96, NimBot is that the one that powers the irclogs.nim-lang.org site?
06:50:24dom96yes
06:50:47couven92ah... I saw Gitter also had to log off/log on earlier :)
06:51:43couven92But FromGitter is probably just a default GitHub/Gitter thing?
06:51:59dom96nope, created by BlaXpirit
06:52:11dom96gotta go, bye
06:52:17couven92bye
07:09:12*rokups joined #nim
07:15:37*zachcarter joined #nim
07:16:36*bungoman quit (Ping timeout: 255 seconds)
07:18:06*zachcarter quit (Read error: Connection reset by peer)
07:18:51*zachcarter joined #nim
07:38:05*gokr joined #nim
07:40:02*yglukhov joined #nim
07:44:18gokrMorning folks
07:44:19*yglukhov quit (Ping timeout: 245 seconds)
07:44:33couven92gokr, morning! :)
07:44:56gokrcouven92: New Nimmer? Don't recognize your nick
07:45:07*yglukhov joined #nim
07:45:49couven92gokr, Been here for a year now I think...
07:45:54gokrOh, my bad!
07:46:10*Vladar joined #nim
07:46:12couven92PMunch dragged me into Nim when we did a university project together
07:46:19ldleworknice what was it
07:46:52*Andris_zbx joined #nim
07:46:57couven92crating a dynamic schema system for relational databases
07:47:13ldleworkoh nice where is it?
07:48:47couven92we only made a very crude prototype for testing in Nim by emulating a simple key-value store in memory... But we wrote a longer paper about it afterwards explaining how you would do in a real relational database system... I am still thinking about doing that when I get the time :P
07:51:09couven92gokr, I am the one responsible to vccexe in the Nim tools, BTW. Making it easier to use the vcc backend on Windows
07:51:21gokrAh, nice!
07:51:24*rauss quit (Quit: WeeChat 1.7)
07:52:08couven92And dom96 currently has me working on implementing SChannel in Nim as a possible alternative to OpenSSL on Windows
07:53:27gokrI have unfortunately not been nimming much lately.
07:56:30couven92gokr, I try things out all the time, I'm sharing an office with PMunch and is always encouraging me to do stuff in Nim :P
07:57:06couven92And each time I do I learn some new great feature of Nim! It's amazing really! :D
07:57:48gokrI am a different kind of Nimmer - since I am a Smalltalker at heart.
07:57:53couven92And being here in #nim is really fun! I love how the community is and how much help and lovely discussions we have here
07:57:55gokrWhich is... almost a contradiction.
07:58:09couven92:D I am a C# person myself
07:59:10gokrHehe, well, C# is quite ok, definitely nicer than Java in my book.
07:59:57gokrIf you are interested in game dev - atomicgameengine now has C# support - which is quite interesting.
07:59:57ldleworkI love C#
08:00:34ldleworkI hope Nim can become as well-working as C# some day, as its already a bit more expressive.
08:00:59couven92:) I really am a backend person! :P No graphics stuff for me!
08:02:15couven92I am also sketching a reworked version of NimStudio, i.e. full 1st class Nim support in Visual Studio
08:03:16couven92Being a C# guy, I am really spoiled by the rich IntelliSense and IDE features in VS :P (Yes, VS is insanely BIG, I know...)
08:04:18*Tiberium joined #nim
08:08:07gokrIDE... I just say Smalltalk :)
08:16:25*zachcarter quit (Quit: zachcarter)
08:16:49couven92gokr, is smalltalk sth that you do not use an IDE for?
08:17:12couven92(I actually have no idea about Smalltalk! :P )
08:17:19gokrSmalltalk is a fully reflective live "IDE" in itself.
08:17:32gokrThe best modern example is: pharo.org
08:17:46*krux02 joined #nim
08:18:26couven92okay... :D
08:23:11Tiberiumehh, it seems that parsecfg can't parse this custom .ini-like settings format :(
08:23:21Tiberiumfor example, there's a line "Title:Goodbye To A World"
08:23:33Tiberiumif I try to get Title, I'll get only "Goodbye"
08:24:08Tiberiumwell, but I know, that parsecfg isn't suited for parsing other formats
08:25:22gokrcouven92: I do recommend looking at Smalltalk - just to get a completely different take on programming.
08:32:23*bjz joined #nim
08:37:18couven92gokr, I'll look into it while I get bored writing my M.Sc. :P
08:37:34gokrDo so!
08:45:34*couven92 quit (Ping timeout: 245 seconds)
08:53:32*yglukhov quit (Remote host closed the connection)
08:56:58*yglukhov joined #nim
09:02:36*ngc joined #nim
09:02:49*ngc quit (Client Quit)
09:10:15*Ven joined #nim
09:10:55*Ven is now known as Guest52333
09:15:18*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
09:16:54*bjz joined #nim
09:28:27*Guest52333 quit (Ping timeout: 255 seconds)
09:37:58*Ven_ joined #nim
09:42:29*Ven_ quit (Ping timeout: 255 seconds)
09:43:18*Arrrr joined #nim
09:43:18*Arrrr quit (Changing host)
09:43:18*Arrrr joined #nim
09:46:20*Ven_ joined #nim
09:51:55*zachcarter joined #nim
09:52:40zachcarterVarriount: I didn’t get that far but I don’t see why it couldn’t
09:54:56*zachcarter quit (Read error: Connection reset by peer)
09:55:31*zachcarter joined #nim
09:57:05zachcarterbtw
09:57:06zachcarterhttps://github.com/zacharycarter/nimrl/blob/master/src/noise/seeded_noise.nim
09:57:18zachcarterI plan on adding up to 6d
09:57:34zachcarterand then probably some other types of noise too
09:58:22Tiberiumlol
09:58:23Tiberium6d?
09:58:44zachcarteryup!
09:59:36zachcarterthis is a very convoluted port but
10:00:26zachcarterhttps://github.com/JTippetts/accidental-noise-library -> https://github.com/SudoPlayGames/Joise -> https://github.com/SquidPony/SquidLib/blob/master/squidlib-util/src/main/java/squidpony/squidmath/SeededNoise.java -> https://github.com/zacharycarter/nimrl/blob/master/src/noise/seeded_noise.nim
10:00:39zachcarter:P
10:01:01FromGitter<Varriount> Does adding another dimension always follow the same process?
10:01:22zachcarterno it actually gets quite hairy in the later dimensions
10:01:38zachcartermy buddy who is working on porting Joise to his lib (Squidlib) is fighting a lot of surflet artifacts at the moment in 4d+
10:02:04zachcarteralthough that is non-simplex noise
10:02:23Tiberiumwhat is the purpose of 4d-6d noise?
10:02:25zachcarterfor simplex noise, adding the extra dimensions is pretty straightforward
10:02:30Tiberiumwhere it can be useful?
10:02:45FromGitter<Varriount> Any resources you could recommend on learning how simplex noise works?
10:03:03zachcarterall sorts of places, texture synthesis, I used 4d in my map generator
10:03:07zachcartersure, one second
10:03:28zachcarterI think this is a pretty good paper - http://webstaff.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
10:03:29FromGitter<Varriount> I know it works on the principle of sampling using a random number algorithm
10:04:12zachcarteryup
10:04:58krux02Varriount: I understood simplex noise like the normal gridient nois, just with the difference, that there is no interpolation in the hypercube, but in a triangle
10:06:19zachcarterI forget what the triangles are referred to as
10:06:25zachcarterthat paper should remind me
10:07:13zachcarterTiberium: I used 4d noise on this project extensivley - https://github.com/zacharycarter/mapgen
10:08:13FromGitter<Varriount> Perhaps I should try implementing simplex noise in Nim, to help understand it
10:08:35krux02that paper has a reference I think
10:09:04krux02Varriount, please do it using the glm librariy that I contributed to :D
10:09:41zachcarterI wouldn’t study my implementation
10:10:12zachcarterit’s for seedable simplex noise
10:11:17krux02well there is also this c++ library, libnoise
10:12:57zachcarterah yeah
10:13:03zachcarteraccidental noise is a lot nicer than libnoise
10:13:06Tiberiumhow can I make this line nicer? "rawTP = data[1].split("[TimingPoints]")[1].split("[HitObjects]")[0].splitlines().filterIt(len(it)>0)" I have custom .ini file, so it contains sections as in normal .ini file, but there's data like "0,0,0,1,0" in some sections instead of key-value, so I need to split this .ini file into 3 part - first part (contains a few sections, but I already can parse it), second part - timing points, third part - hit objects
10:13:41Tiberiumexample file - https://gist.github.com/TiberiumN/31502f04ea255cc7604849ec7312e9ff
10:13:55krux02Tiberium: define nicer?
10:14:07Tiberiumkrux02, I mean maybe there's a better way to do it
10:14:18krux02define better?
10:14:42Tiberiumkrux02, so ok, is this line normal?
10:15:16krux02well I think it creates a lot of temporary objets that you know ahead of time you never need
10:15:27krux02but is is very compact
10:15:47Tiberiumhmmm, I actually have an idea
10:15:50krux02and dosn't need the regular expression library that might cause problems under windows (sadly)
10:15:56Tiberiummaybe using scanf
10:16:00krux02so I don.t know what you mean by better
10:16:12zachcarterkrux02: it’s modular
10:16:17zachcarterdefines all sorts of different types of noise modules
10:16:24zachcarterallows you to chain noise modules together
10:16:38zachcarterI can show you some example Java code if you’d like
10:17:18zachcarteroh you were talking about Tiberium
10:17:21zachcarter:P
10:17:24krux02well, when it's java it kind of excludes itself to write bindings for it in nim
10:17:34Tiberiumkrux02, jnim?
10:17:35krux02not that it is impossible, but who would want that?
10:17:38Tiberiumah yes
10:17:45Tiberiumit's better to port it
10:18:11krux02you can start with a binding when you really want to experiment with it
10:18:15krux02and then gradually port it
10:18:37krux02when you have a binding you always have a reference to compare it to, in case you screw up
10:18:44krux02make life easier
10:19:38krux02I think a jvm in the backend isn't too bad to experiment, but I really dislike the startup time and the high memory usage of basically anything that is written in java
10:19:54zachcarterwell there’s no C lib for accidental noise unfortunately
10:20:00krux02but I am ranting again
10:22:14krux02I think as soon as you have a function like this ``proc noise(arg: vec4): vec4`` you already have something that is very composable
10:22:45zachcarterno but what I mean is this
10:23:47zachcarterhttps://github.com/zacharycarter/mapgen/blob/master/core/src/com/carterza/planet/map/generator/MapGenerator.java#L984-L1035
10:25:25zachcarterI don’t think you can do that kind of stuff with libnoise, I may be mistaken
10:27:10krux02zachcarter: well a fractal noise is nothing more than a sum of noise values of different frequencies
10:27:19zachcartersure
10:27:36zachcarterbut the library does all of that for you
10:27:37*Ven_ quit (Read error: Connection reset by peer)
10:27:42*Ven joined #nim
10:27:48zachcarteryou just specify the octaves and the frequencies and then sample away
10:28:02zachcarternumber of octaves*
10:28:06*Ven is now known as Guest42930
10:28:14zachcarterI think the power is in things like the domain translation / scaling, etc
10:28:30zachcarterwhere you can take noise module A and noise module B and scale or translate one by the other
10:28:31zachcarterand then sample
10:28:51krux02well fith free form fucntions, you can do anything as far as I know
10:28:59krux02and I did some 3D noise stuff
10:29:14krux02you can always put the result of a noise in another noise function
10:29:42krux02ok lunch time for me
10:29:45zachcarterenjoy!
10:44:38*Guest42930 quit (Ping timeout: 240 seconds)
10:45:46*Ven_ joined #nim
10:57:15*ftsf quit (Quit: :q!)
11:14:17*Ven_ quit (Ping timeout: 255 seconds)
11:14:22*couven92 joined #nim
11:15:22*Ven_ joined #nim
11:18:04krux02I am back
11:26:50*PMunch joined #nim
11:27:13zachcarterwb
11:29:03*krux02 quit (Remote host closed the connection)
11:32:07*arnetheduck joined #nim
11:37:47FromGitter<mratsim> @Varriount I managed to get something working with object variants https://forum.nim-lang.org/t/2907 (last post). I had to use andrea’s DMatrix32 instead of Matrix32[M,N: static[int]]. Compiler refused those due to not being concrete types. Thanks for your help. ⏎ ⏎ Now if you have a better solution, I’m all ears, I don’t think it’s possible to wrap different statically typed parameter in an object variant is
11:43:16*zachcarter quit (Quit: zachcarter)
11:44:48*Ven_ quit (Ping timeout: 255 seconds)
11:55:28*Ven joined #nim
11:55:56*Ven is now known as Guest11277
11:59:44*Guest11277 quit (Ping timeout: 255 seconds)
12:00:08*vlad1777d joined #nim
12:00:20*zachcarter joined #nim
12:00:20*zachcarter quit (Client Quit)
12:14:55*sz0 joined #nim
12:16:18*Ven_ joined #nim
12:17:50*krux02 joined #nim
12:23:28*bungoman joined #nim
12:34:04Tiberiumwhat's better for performance? using split or scanf?
12:34:08Tiberium(scanf from strscans)
12:35:14TiberiumI mean if I have a string "1,2,3,4,5,6" it's better to split it and parse all ints using parseInt, or use scanf?
12:38:06demi-i don't think it matters
12:38:16flyxscanf would be faster, but can only process a fixed number of ints
12:38:54flyxyou can use parseutils.parseInt and set the start index to avoid creating multiple strings
12:39:29flyxthen check that every character it stops at is a ','
12:39:48flyxrepeat until end of string
12:39:50demi-if you are worrying about the perf of `scanf` then i think you are worrying about the wrong thing tbh
12:40:22Tiberiumyeah :)
12:40:31Tiberiummaybe firstly I need to actually implement parser
12:40:40Tiberiumand then compare it with "reference" realization
12:41:10Tiberium(it's not reference, it's just the full parser for this format written in C++)
12:41:18Tiberiumand everyone port this C++ parser to another languages
12:41:28Tiberiumand I don't want to do it
12:44:38*Ven_ quit (Ping timeout: 240 seconds)
12:44:39demi-what parser?
12:45:41Tiberiumhttps://github.com/Francesco149/oppai
12:45:47Tiberiumcode is hard to understand :D
12:45:50Tiberiumhttps://github.com/Francesco149/oppai/blob/master/beatmap.cc
12:50:19*Ven_ joined #nim
13:07:19*yglukhov quit (Read error: Connection reset by peer)
13:07:51*yglukhov joined #nim
13:08:05FromGitter<Varriount> You could write a wrapper instead.
13:08:57TiberiumI don't want to mess with portability :D
13:09:10TiberiumI mean I want to have pure-nim parser
13:11:04couven92Tiberium, then the solution flyx suggested is probably the safest one
13:12:52*zachcarter joined #nim
13:14:29*Ven_ quit (Ping timeout: 240 seconds)
13:16:18*yglukhov quit (Remote host closed the connection)
13:16:20*Ven joined #nim
13:16:43*Ven is now known as Guest90388
13:16:51*yglukhov joined #nim
13:21:11*yglukhov quit (Ping timeout: 255 seconds)
13:37:48krux02Tiberium: the fastest way to implement a parser is where you do not need to allocate any unnecessary substrings. So when you have an iterator split that does not allocate the substring but rather yields an index/size pair, then this is probably very close the the fastest implementation
13:37:50*nhywyll joined #nim
13:55:19*Snircle joined #nim
14:07:06*gokr quit (Ping timeout: 252 seconds)
14:12:29*Guest90388 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:13:21*vendethiel quit (Quit: q+)
14:32:12*shashlick quit (Ping timeout: 255 seconds)
14:35:06*shashlick joined #nim
14:45:48zachcarterI’m wondering - since it’s possible to interface python with Nim, would it be possible to get Nim code running on AWS lambda using a shim like golang does?
14:48:02couven92zachcarter, that's actually an interesting idea... :O
14:49:37PMunchHmm, I guess if golang can do it Nim should be possible..
14:50:04zachcarterI’ll try to cook up a prototype
14:50:11zachcartermight help me eventually get Nim in my workplace
14:51:02demi-I think the only fundamental different there would be that go statically links all dependencies whereas nim doesn't necessarily
14:51:21demi-and potentially any incompatibility with the libc that is used on AWS
14:54:40*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
14:59:01cheatfatedemi-, the main problem not in libc, but in supported syscalls
15:07:16*Trustable joined #nim
15:13:06FromGitter<Varriount> Why can't aws lambda run C/C++?
15:24:27demi-why would you want to write/run that on lambda?
15:41:37*Andris_zbx quit (Remote host closed the connection)
15:42:22libmanhttps://aws.amazon.com/blogs/compute/running-executables-in-aws-lambda/
15:44:26*sz0 quit (Quit: Connection closed for inactivity)
15:45:48cheatfatelibman, is this library license good? https://skia.org
15:52:58*smt_ joined #nim
15:55:00*smt quit (Ping timeout: 255 seconds)
16:00:09dom96zachcarter: ooh yeah, please do it :)
16:05:01*nsf quit (Quit: WeeChat 1.7)
16:06:08*couven92 quit (Ping timeout: 240 seconds)
16:07:34*krux02 quit (Remote host closed the connection)
16:12:18libmancheatfate: https://skia.googlesource.com/skia/+/master/LICENSE == 3-clause BSD == good
16:12:26cheatfatethanks
16:12:36libmanI'm not the authority, copyfree.org is.
16:13:48libman(I've been ranting about the harms of lawyer FUD in the temple of free software before I discovered the Copyfree Initiative though.)
16:14:47*Trustable quit (Remote host closed the connection)
16:14:47demi-BSD 3-clause and MIT are generally the most compatible licenses
16:15:32libmanI hate to annoy people with this, but it's a selling point for Nim, the most unencumbered lawyer-free programming language. Although its competitors are slowly inching in the right direction. Yesterday there was big news about Dlang re-licensing.
16:18:18libmanLanguages like Go and NodeJS are copyfree on the surface, but in practice you toss in a few common libraries and end up with a dozen of different licenses. Nim's advantage over those is Nimble license predominance.
16:18:43FromGitter<mratsim> Is there any performance/memory/anything else tradeoffs I should be aware off between those to types ? (note the place of the `ref` ⏎ ⏎ type ⏎ Context* = object ⏎ ... [https://gitter.im/nim-lang/Nim?at=58ebb0654cb8d0917378f4cb]
16:19:41*yglukhov joined #nim
16:24:03*yglukhov quit (Ping timeout: 252 seconds)
16:27:04*mwbrown joined #nim
16:29:27FromGitter<Bennyelg> Hey guys, first time here. wanted to tell this is look like the next language to come :D
16:29:38Tiberiumhi :)
16:29:46FromGitter<Bennyelg> I am a python developer for the past 5 years
16:29:56FromGitter<TiberiumPY> I am a python developer for 5 months :D
16:30:05FromGitter<Bennyelg> I want to get into nim as soon as I can ':D
16:30:07FromGitter<TiberiumPY> but I started learning Nim like 2 weeks ago
16:30:57FromGitter<Bennyelg> I don't know if it can replace python purposes. I dont know on what nims excellect but I'll sure to know soon enuge.
16:31:17FromGitter<TiberiumPY> for doing something that require a lot of speed - nim is your choice
16:31:51FromGitter<Bennyelg> What about councarrecy ?
16:32:41Tiberiumyou can read a lot here - https://nim-lang.org/docs/manual.html
16:33:11Tiberiumhttps://nim-lang.org/docs/manual.html#parallel-spawn
16:33:23Tiberiumand https://nim-lang.org/docs/manual.html#threads
16:33:32FromGitter<mratsim> @Bennyelg there is a chapter about “spawn”, and also doing for i in 1||n instead of for i in 1..n automatically insert OpenMP pragma
16:34:47FromGitter<TiberiumPY> @mratsim do I need to pass some parameters to compiler?
16:34:54FromGitter<TiberiumPY> or it would pass them to gcc automatically?
16:34:58FromGitter<TiberiumPY> (for including openmp)
16:35:09FromGitter<Bennyelg> Thanks.
16:35:12FromGitter<mratsim> it will be in the C code generated if you open it
16:35:36FromGitter<Bennyelg> I'll stick around and play with it soon. ⏎ bad we dont have proper ide such intelji
16:35:49FromGitter<TiberiumPY> it's good on the other side
16:35:55FromGitter<TiberiumPY> you can learn language faster :D
16:38:19FromGitter<Bennyelg> What ide do you use>?
16:38:56FromGitter<TiberiumPY> ide-like visual studio code
16:38:57FromGitter<mratsim> I use Visual Studio Code
16:39:19FromGitter<TiberiumPY> you will not have smart intellisence, but you'll have error highlighting (best in the world :D)
16:39:33FromGitter<TiberiumPY> because nim provides error checking from itself, it's not dependent on IDE
16:41:55FromGitter<Bennyelg> visual studio gives autocompletion?
16:41:56FromGitter<TiberiumPY> @mratsim "Same as .. but the loop may run in parallel." how can I know if my loop will run in parallel?
16:42:15FromGitter<TiberiumPY> @Bennyelg only from text lines in currently opened file
16:42:17FromGitter<stisa> Well, in VSCode there's also autocompletion and the suggestions also show doc comments
16:42:19FromGitter<TiberiumPY> no smart intelli-sence as I said
16:42:48FromGitter<Bennyelg> Thanks.
16:43:57FromGitter<mratsim> @TiberiumPY Besides opening the ASM code I think the best way would be to check in top
16:44:10FromGitter<mratsim> (or whatever process manager you prefer)
16:44:43FromGitter<TiberiumPY> for simple recursive fibonacci calculation is still done on 1 core
16:44:59FromGitter<TiberiumPY> ah, maybe iterative would give multi core
16:45:51FromGitter<mratsim> It might be that the compiler decided the trade-off is not worth it. Or maybe GCC has to be called with -lopenmp or something like that
16:50:18*mwbrown quit (Changing host)
16:50:18*mwbrown joined #nim
16:51:10libmanVScode seems the be the dominant Nim dev environment right now. (Unless you're already in Emacs/VIM land, which most people are not.) But VScode is far from perfect. I'm a BSD zealot, and VScode is my leading excuse for being stuck on Linux...
16:51:45FromGitter<TiberiumPY> vscode is multiplatform
16:52:00FromGitter<TiberiumPY> ah, you're about license. ⏎ well, I don't care about them yet
16:52:24libmanYes, It's tri-platform: Windows, MacOS, and Linux.
16:52:37FromGitter<TiberiumPY> I use it on my manjaro
16:52:46*mwbrown quit (Quit: Exiting)
16:52:56FromGitter<TiberiumPY> and I have nvidia, so proprietary drivers
16:53:02*mwbrown joined #nim
16:53:57libmanBut Electron is a very bloated way to develop an editor. There was a nerdfight about that on the forum recently - https://forum.nim-lang.org/t/2706 3:)
16:55:09FromGitter<TiberiumPY> yeah, I know
16:55:31FromGitter<TiberiumPY> but for modern developers it's easier, since JS is one of the most popular languages
16:55:40FromGitter<TiberiumPY> and devs are too lazy to create something like vscode in C++, for exmaple
16:55:45FromGitter<TiberiumPY> *example
16:56:47libmanJS is like Stalin. Of course it's popular. It's been the only option. He who hates JS is a traitor to Mother Web! :P
16:57:04FromGitter<TiberiumPY> well, I really hope that webassembly will become a real thing
16:58:15FromGitter<TiberiumPY> and I hope that gcc will have a good webassembly backend :)
16:59:21libmanWasm isn't a panacea. We need to go back to a local-first approach to app development, with easy sandboxing and instant deployment.
16:59:36FromGitter<mratsim> Typescript is OK as a JS replacement to get type checking. JS issue has more to do with Jquery, and the frameworks that pops up like mushrooms
16:59:56FromGitter<TiberiumPY> @mratsim but typescript is still transpiled to JS
16:59:57libmanThink outside the browser.
17:00:20FromGitter<barcharcraz> but like nobody wants desktop apps these days
17:00:30FromGitter<barcharcraz> at least not ones that can't also run as webapps
17:01:04demi-because the tooling around javascript is so much better than native tooling on almost any platform
17:01:08FromGitter<mratsim> And then you need gulp + webpack + babel to get anything up ...
17:05:05libman"nobody wants desktop apps these days" - if Justin Bieber is more popular than Mozart, that doesn't mean he's better than Mozart.
17:05:06FromGitter<stisa> anyone knows how to get the `kind` of an object variant passed to a macro?
17:05:37Tiberiumwell, I know that every language has it quirks, but today I saw this in JS: "+params[1]" where params is a list of strings
17:05:44Tiberiumso with "+" you can convert it to integer
17:05:49libmanWe just need to come up with the right stack for building awesome desktop apps in Nim.
17:06:18Tiberiumlibman, honestly I think the best thing possible is to have drag'n'drop editor :)
17:06:22Tiberiumso you can make prototypes faster
17:06:29Tiberiumor even something like Delphi :)
17:06:49TiberiumI mean IDE for GUI development
17:09:23Tiberiumnimx has very basic gui drag'n'drop editor
17:09:28Tiberiumbut it crashes on my linux :(
17:09:36Tiberiumwith some strange gtk error
17:11:34*PMunch quit (Quit: leaving)
17:19:19*nightmared quit (Ping timeout: 245 seconds)
17:21:07*nightmared joined #nim
17:37:41*brson joined #nim
17:46:12*kunev quit (Ping timeout: 260 seconds)
17:47:16*kunev joined #nim
17:57:15*vlad1777d_ joined #nim
17:57:33*Matthias247 joined #nim
17:58:23*vlad1777d quit (Ping timeout: 255 seconds)
18:00:27*nightmared quit (Read error: Connection reset by peer)
18:00:33ldleworkzachcarter: what do you do for work
18:01:00*kunev quit (Ping timeout: 255 seconds)
18:02:24*kunev joined #nim
18:02:49*bungoman quit (Ping timeout: 240 seconds)
18:03:16ldleworkSomeone once showed me an interface library implemented in Nim
18:03:24ldleworkAnyone know what it is? I can't find it on the stdlib listing
18:03:33Tiberiumldlework, there's a lot
18:03:35Tiberiummaybe "nimx" ?
18:03:42Tiberiumor araq's libui wrapper?
18:03:53ldleworkBy interface I don't mean UI
18:03:58Tiberiumah, sorry :)
18:04:01FromGitter<mratsim> https://nim-by-example.github.io/oop/
18:04:19ldleworkNo
18:04:24ldleworkIt was a library implementing an interface type.
18:04:53*nightmared joined #nim
18:05:03FromGitter<mratsim> In this thread, this library implement a trait macro: https://forum.nim-lang.org/t/278/2
18:07:33ldleworkIt was a full library on github. Doh.
18:09:36Tiberiumuse search on github with language:Nim and "interface"
18:09:38Tiberiumand search in code :D
18:10:11Tiberiumldlework, ah, maybe https://github.com/andreaferretti/interfaced ?
18:10:41Tiberiumanyway, this search does the trick - https://github.com/search?q=language%3ANim+interface&type=Repositories&utf8=%E2%9C%93
18:10:53ldleworkTiberium: that might be it!
18:11:21*kunev quit (Ping timeout: 255 seconds)
18:13:00ldleworkHas anyone any experience with IoC? Does Nim have an IoC container? Is it possible? I'm just learning about this stuff.
18:13:23*kunev joined #nim
18:21:44*yglukhov joined #nim
18:26:12*yglukhov quit (Ping timeout: 255 seconds)
18:32:49*yglukhov joined #nim
18:38:32zachcarterIdlework: I work at Carfax
18:38:48zachcarterIdlework: I do think people have done dependency injection with Nim
18:38:51ldleworkzachcarter: ah doin what
18:39:04zachcartermostly data pipeline stuff, some backend web dev
18:39:21ldleworkdocker?
18:39:30zachcarterlot of, this system has this data, this system needs this data figure out how to get the data there / expose it etc
18:39:36zachcarteryup
18:39:42ldleworkcool I work at docker
18:39:44zachcarterall JVM at the moment, trying to push golang
18:39:45zachcarteroh nice!
18:40:16zachcartergood product you all have :D
18:41:32*couven92 joined #nim
18:41:38*vlad1777d__ joined #nim
18:43:50*vlad1777d_ quit (Ping timeout: 255 seconds)
18:44:40*couven92 quit (Read error: Connection reset by peer)
18:44:59*couven92 joined #nim
18:46:40FromGitter<Varriount> I work on infrastructure automation. Most of the stuff I write is in Python.
18:48:46ldleworkCool we could start a Nim orchestration company with the expeirence in here :)
18:49:06FromGitter<mratsim> No JS ? :P
18:59:30Tiberiumlol
18:59:33Tiberiumhttps://github.com/search?utf8=%E2%9C%93&q=language%3ANim+coreutils&type=
18:59:41Tiberiumthere's 6 "coreutils" repositories in Nim
19:11:49couven92how many Windows API repos?
19:13:13Tiberiumcouven92, ehm, maybe I search wrongly, but one
19:13:24Tiberiumlet me look in nimble registry
19:13:53couven92I got 15 https://github.com/search?utf8=%E2%9C%93&q=language%3ANim+windows&type=
19:14:02Tiberiumcouven92, they're not windows api
19:14:09Tiberiumthere's only winim
19:14:15Tiberiumand old-winapi on bitbucket
19:14:18couven92True... I saw that...
19:14:23Tiberiumah no
19:14:25Tiberiumit's on github too
19:14:32Tiberiumhmmm, https://github.com/Vikaton/nim-keylogger
19:15:39couven92interesting approach... :)
19:16:24Tiberiumwell, github sucks :( It can't search only 500-600 nim repos
19:16:29Tiberiummaybe because they're not in cache
19:16:33Tiberiumhttps://github.com/search?utf8=%E2%9C%93&q=language%3ANim&type=Repositories
19:16:46Tiberium"this search took too long to finish" question mark
19:17:03Tiberiumand for language:Python it shows ~500 thousands
19:17:13couven92Ooooh! NimBorg... I like the name (and the description)! :D
19:17:27couven92(Trekkie at heart! :D )
19:18:11*PMunch joined #nim
19:18:17ldleworkzachcarter: do you have any examples of Nim IoC container
19:19:01zachcarterlet me see
19:21:08Tiberiumoh wait
19:21:12Tiberiumthere's no Nim wrapper for https://github.com/ocornut/imgui ?
19:21:19zachcarterIdlework: have you seen this thread: https://forum.nim-lang.org/t/1271
19:21:27zachcarterI don’t think folks have done much beyond what’s mentioned in there
19:23:44zachcarterso it’s very manual
19:26:05ldleworkYeah not much to say there
19:26:23*yglukhov quit (Remote host closed the connection)
19:26:36ldleworkTiberium: wanna implement imgui for Dadren?
19:26:55Tiberiumldlework, I think it's not so easy :D
19:27:18ldleworkyeah Dadren is not using opengl :(
19:27:35ldleworkI'm too dumb for that stuff
19:27:36Tiberiumldlework, what is it using?
19:27:42ldleworkTiberium: just normal SDL2
19:27:48TiberiumSDL2 can use OpenGL
19:27:57ldleworkI know, I'm saying I'm just blitting
19:28:24Tiberiumoh, look at this C++ code https://github.com/ocornut/imgui
19:28:26ldleworkIt would be cool to find an opengl collaborator who wanted to upgrade Dadren to opengl, give us some batched sprites and stuff
19:28:28TiberiumI mean example
19:28:44Tiberiumldlework, I know nothing where it comes to graphics
19:30:41zachcarterI’ve implemented something similar to imgui for frag
19:30:42zachcarterNuklear
19:30:45ldleworkI will probably just steal Frag's code
19:30:47ldlework:)
19:30:49zachcarter:P
19:31:31Tiberiumzachcarter, but imgui seems to be easier-to-use (at least it's C++ code is straightforward)
19:31:40zachcarterwell it’s C++ :/
19:31:48zachcarterNuklear is ANSI-C
19:32:16*rokups quit (Quit: Connection closed for inactivity)
19:34:57ldleworkzachcarter: is there any way in which pulling out the bit that provides your drawing and batching and stuff out of frag makes sense?
19:35:21Tiberiumwell, where can I find info how to fix headers for c2nim (c++ headers)?
19:36:06ldleworkTiberium: are you going to try to wrap it
19:36:07zachcarterIdlework: the code is very bgfx specific
19:36:13ldleworkzachcarter: that's OK
19:36:24ldleworkprobably a good thing
19:36:28Tiberiumldlework, it's my first try in nim ffi in general
19:37:13zachcarterI’d say the code is a decent starting point for a sprite batch implementation
19:37:41zachcarterit needs support for generic shaders, but that’s next on my todo list
19:37:43ldleworkzachcarter: if we had just a nice 2D rendering library backed by opengl for bgfx that'd be pretty nice for all nim game libraries
19:38:00Tiberiumhuh, c2nim installation from git master fails
19:38:03Tiberium"/home/tiber/.nimble/pkgs/compiler-#head/compiler/idents.nim(15, 21) Error: cannot open 'etcpriv'"
19:39:04zachcarterI think krux02 is trying to solve that with his project, although he’s also focusing on 3D
19:39:54zachcarterTiberium - why do you want to wrap imgui just ooc? I imagine it’s going to kill the portability of whatever you’re trying to build
19:40:00ldleworkzachcarter: it seems like you're already solving it but its tied up with the rest of frag
19:40:23zachcarteryeah :/ I’m not sure how easy it would be to decouple it
19:40:40Tiberiumzachcarter, I don't want to build something, I just want to try to create bindings via Nim :)
19:40:56Tiberiumand imgui can be ran on many backends as well
19:40:58zachcarterAh okay - Tiberium I wrote the start of a guide on creating bindings to libs with Nim
19:41:07zachcarterit can be - i just meant because the code was C++
19:41:13zachcarterportability may be an issue
19:41:57zachcarterIdlework: if there was a consensus from the community in how they’d want a 2d rendering API to work / what features they’d want in it etc… I could probably come up with something
19:42:06zachcarterTiberium: finding the guide now
19:42:28zachcarterhttps://gist.github.com/zacharycarter/846869eb3423e20af04dea226b65c18f
19:42:42zachcarterI should finish that thing...
19:44:20Tiberiumzachcarter, reading about soloud - c2nim is THAT simple!?
19:44:26Tiberiumfor simple libraries :)
19:44:29*Arrrr quit (Read error: Connection reset by peer)
19:44:30zachcarteryup!
19:44:38Tiberiummagic
19:44:45zachcarterNuklear is probably the most complex library I’ve bound to
19:44:49zachcarteractually nix that
19:44:52zachcarterthe spine runtime was pretty complex too
19:45:11Tiberiumzachcarter, I think nuklear is hard because everything is in header
19:45:21zachcarternah it’s not bad :P
19:45:27zachcartersingle header libs are nice actually
19:45:37zachcarterI can share my bindings Tiberium if you’d like to see how I did them for Nuklear
19:45:45zachcarterthey’re on github actually under my username
19:45:47zachcarternuklear-nim
19:45:55TiberiumI saw it :)
19:46:08zachcarterhttps://github.com/zacharycarter/nuklear-nim/tree/master/src
19:46:13zachcarterbind.c is the secret sauce
19:46:13zachcarterand then
19:46:27zachcarterhttps://github.com/zacharycarter/nuklear-nim/blob/master/nuklear.nim#L242
19:46:32zachcarterkrux02 taught me that trick :P
19:46:38Tiberiumohhh
19:47:13zachcarterno linking to any libraries at all :) just compiling the C code with that Nim pragma :D
19:48:45Tiberiumeh, and sorry, fully offtopic question: I have a game which has all it's gamedata in encrypted ZIP archive. what would be the easiest way to get the password?
19:48:52Tiberium(offline game)
19:53:21libmanPKZIP encryption was once a joke, but I think that's no longer the case for modern zipfiles.
19:53:51*roygbiv joined #nim
19:54:07Tiberiumlibman, yeah, it's normal modern zip (but not winzip)
19:54:14libmanI assume the game is closed-source?
19:54:17Tiberiumyeah :)
19:54:35Tiberiumthere was the game released in 2008 with the same engine and without zip encrypting
19:54:46Tiberiumand library handling those zips is made in C++
19:54:59libmanHire some Eastern European guru to decompile it for you.
19:55:19*zachcarter quit (Ping timeout: 240 seconds)
19:55:40Tiberiumlibman, russian hackers? maybe I can ask my friends :D
19:55:45libmanIt's probably not as simple as looping through `strings` and trying them as password...
19:55:51Tiberiumyeah, I've tried that
19:55:58*gokr joined #nim
19:56:32*libman is not a serious programmer specialist.
19:57:11*roygbiv left #nim (#nim)
19:57:36*Vladar quit (Quit: Leaving)
20:02:27*bungoman joined #nim
20:02:58FromGitter<TiberiumPY> Ah, and the worst thing is that this game is Windows only :)
20:04:40*couven92 quit (Read error: Connection reset by peer)
20:05:06*couven92 joined #nim
20:08:05*couven92 quit (Read error: Connection reset by peer)
20:08:25*couven92 joined #nim
20:09:17*nsf joined #nim
20:10:06*chemist69_ quit (Quit: WeeChat 1.7)
20:10:07*couven92 quit (Read error: Connection reset by peer)
20:10:24*chemist69 joined #nim
20:10:27*couven92 joined #nim
20:27:15*Tiberium quit (Remote host closed the connection)
20:27:46*Tiberium joined #nim
20:37:24*PMunch quit (Quit: leaving)
20:39:07*nsf quit (Quit: WeeChat 1.7)
20:39:30*zachcarter joined #nim
20:41:01*zachcarter quit (Read error: Connection reset by peer)
20:41:19*nhywyll quit (Ping timeout: 240 seconds)
20:41:27*zachcarter joined #nim
20:42:17zachcartertime to port my A* code
20:42:53couven92zachcarter, did you get the AWS Lambda to work?
20:43:17zachcartercouven92: I haven’t spent much time on it yet, it definitely doesn’t look simple nor does it look well documented
20:43:53couven92yeah... That has been my experience with AWS as well... :/
20:44:26zachcarterhttps://github.com/eawsy/aws-lambda-go-shim/tree/master/src
20:44:33zachcarterI think runtime.c is where I start
20:45:26libmanAWS Lambda - it's like FastCGI but closed and expensive. :P
20:45:49libman(Unless your API suddenly jumps to ten zillion hits.)
20:47:51*aedigix joined #nim
20:50:26FromGitter<mratsim> Is there no way to unwrap from an object variant with something like this ⏎ ⏎ `template unwrap(bp: YourObject): untyped =`
20:50:36*aedigix quit (Remote host closed the connection)
20:51:33FromGitter<mratsim> if I try to use “if elif” or a case statement, the typechecker will try to typecheck all statements.
20:51:33*aedigix joined #nim
20:52:55*aedigix quit (Remote host closed the connection)
20:53:17*aedigix joined #nim
20:53:54Araqisn't that the point of a typechecker?
20:55:03*nhywyll joined #nim
20:59:20FromGitter<mratsim> @Araq, here is what I’m trying to work with: https://gist.github.com/mratsim/98ddd0ba308ea1a7e378d647082339e6
21:00:02FromGitter<mratsim> The error is: ⏎ ⏎ Error: type mismatch: got (float32) ⏎ but expected one of: ⏎ proc (gradient: DVector32): float32{.closure, noSideEffect.} [https://gitter.im/nim-lang/Nim?at=58ebf25468bee3091f2cd036]
21:00:53FromGitter<mratsim> which is in “unwrap_apply” template. Actually if I replace every call in that template by bp.ff(deriv) it works
21:01:32*krux02 joined #nim
21:02:19FromGitter<mratsim> so even though the object variant is not of the proper “kind”, it tried to check the variant field
21:02:57*aedigix quit (Remote host closed the connection)
21:04:28*aedigix joined #nim
21:07:48Araq let x = if cond: "string" else: 4
21:08:16*aedigix quit (Remote host closed the connection)
21:08:28Araq^ you wrote this and scratch your head
21:08:35FromGitter<mratsim> oh thanks
21:09:17couven92Araq, that only works if cond is compile-time constant, right?
21:09:48Araqcouven92: no, it's always invalid
21:10:23krux02Araq: I wrote in the forum a question about: magicsAfterOverloadResolution
21:10:30krux02I don't think you saw it
21:11:13couven92Araq, Oh... right... Because it's a trinary expression that needs the same type for both branches? Ah, it would work in a when statement, right?
21:11:16krux02I would like to know what exactly this procedure is supposed to do, since I could not find the documentaiton of it
21:12:06krux02when you explain it, I will add the documentation to the function on my branch
21:12:29*aedigix joined #nim
21:13:04krux02couven92: a trinary expression does not need the same type for both branches, but at least some with a common base type
21:13:37krux02let a : SuperType = if cond: SubTypeA else: SubTypeB
21:13:41krux02should work, too
21:13:51couven92yeah, right... Okay... my mind is fried if I don't get those anymore... Time to go to bed! :P
21:14:09couven92Good night! :)
21:14:12Araqkrux02: ok, well you wrote the proc's signatures and they seem fine
21:14:14krux02gn8t
21:14:46AraqPContext represents the current module that is being compiled
21:14:57Araqmost importantly it contains the symbol table
21:15:15AraqPContext = symbol table to a very approximation
21:15:22Araq*very godo
21:16:08Araqso ... you need to check the semantics like "does obj even have the named field?"
21:16:38*couven92 quit (Quit: Disconnecting)
21:16:59Araqand then as you said, you create a PNode with the integer value that is the offset
21:17:38Araqanything else?
21:17:44*bjz joined #nim
21:18:56krux02one moment I grep through the code
21:19:34*Tiberium quit (Remote host closed the connection)
21:21:41krux02I guess the flags are give for example when it is called in a for loop header?!
21:21:42*chemist69 quit (Ping timeout: 255 seconds)
21:23:00krux02and last thing is, where are the constructor functions for the Nodes?
21:24:05*chemist69 joined #nim
21:24:44FromGitter<mratsim> @Araq, unfortunately it doesn’t seem to work. This compiles: ⏎ ⏎ template unwrap(bp: BackPropRef): untyped = ⏎ let output = if bp.kind == bpFF: bp.ff else: bp.ff ⏎ output ... [https://gitter.im/nim-lang/Nim?at=58ebf81e4cb8d091737a4e6a]
21:25:18krux02I looked at the PContext type and I found this: TContext = tuple[spacing: int, flags: TSubFlags]
21:25:40krux02that is just an int and flags
21:25:48krux02how is that a symbol table?
21:26:09libmanVery enjoyable downvoting opportunity on a comment on https://www.quora.com/What-do-you-say-about-Nim-programmning-language 3:)
21:28:51FromGitter<mratsim> Wow that’s some obnoxious comment - "My view of the world is right, why are you not me"
21:30:12zachcarterhow do you downvlote?
21:30:23zachcarterdownvote*
21:30:51krux02I did my job
21:31:07zachcarterI think you upvoted krux02 :P
21:32:13krux02yea I did
21:32:18krux02never used quora
21:32:31krux02I am more home at the stack overflow pages
21:32:46krux02but very nice comment
21:33:06Araqkrux02: https://github.com/nim-lang/Nim/blob/devel/compiler/semdata.nim#L72
21:33:44Araqit's not important, it's just a parameter that is passed around all the time, opaque for your purposes
21:35:17zachcarterthank you!
21:37:11krux02so I go the wrong TContext type
21:37:20krux02no wonder I was confused
21:37:37krux02for some reasons my development environment does not really work that well on the Nim compiler
21:38:00*devted joined #nim
21:44:52krux02Araq: one last thing, what is the most important function to debug a PNode?
21:45:16krux02I think you onced told be, but that was a long time ago and I forgot it, so please excuse me
21:45:27gokrThat guy is IMHO obnoxious. I truly am embarrassed about him being a Smalltalk advocate.
21:45:47krux02he even has racket on the list
21:47:01Araqkrux02: echo renderTree n
21:47:04Araqdebug n
21:47:14*Jesin quit (Quit: Leaving)
21:47:33Araqhttps://nim-lang.org/docs/intern.html#debugging-the-compiler
21:49:22*nsf joined #nim
21:49:32*Jesin joined #nim
21:50:55*Jesin quit (Max SendQ exceeded)
21:52:37dom96libman: nice find!
21:53:08*Jesin joined #nim
21:55:26dom96Somebody requested an answer from me on this, but it sounds like something Araq would be able to answer very well :)
21:55:28dom96https://www.quora.com/Are-there-any-disadvantages-of-using-C-as-the-intermediate-language-in-compilation-process?__filter__&__nsrc__=2&__snid3__=864888520
21:58:21*willprice joined #nim
22:04:42*Matthias247 quit (Read error: Connection reset by peer)
22:06:09*gokr quit (Quit: Leaving.)
22:07:59FromGitter<mratsim> @Araq: I’m still stuck on unwrapping the different variants of the object variant, even with your ternary solution, the compiler still complains. I guess in my case I should use inheritence instead?
22:10:02AraqI gave no solution
22:10:11AraqI told you it can't work.
22:10:47ldleworklol
22:11:21Araq fm: proc (gradient: DMatrix32): DMatrix32
22:11:36*mwbrown quit (Remote host closed the connection)
22:12:02Araq^ here is a solution. KISS. the 'fm' callback is free to only use one field/row/column instead of the full DMatrix32
22:13:32Araqaccept that static typing is an approximation of the runtime behaviour and things are much simpler to design.
22:14:10*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:18:51*brson quit (Ping timeout: 255 seconds)
22:19:02FromGitter<mratsim> I actually quite like static typing, my design issue is how to use types coming from an external library. To build neural networks, I need to store a list of transformation from float to Matrix to Vector to ...
22:19:37FromGitter<mratsim> Libraries in other languages rebuild everything from scratch with a common Tensor type
22:20:11FromGitter<mratsim> If possible I wanted to avoid that
22:20:29FromGitter<Varriount> @mratsim My sympathies.
22:20:52FromGitter<Varriount> @mratsim If it's any consolation, you'd face this problem in any statically typed language, not just Nim
22:22:02FromGitter<mratsim> @Varriount, I already feel headaches about an efficient memory layout of such a Tensor type >_>
22:22:51ldlework anyone wanna buy me Dependency Injection in .NET by Mark Seemann?
22:24:05FromGitter<Varriount> ldlework: To what purpose?
22:24:24ldleworkSo I can understand how to apply those principles to Nim
22:24:31ldleworkand perhaps build an IoC container
22:24:43ldleworkdunno if Nim has the reflection nessecary but I'm interested to find out
22:26:46FromGitter<Varriount> The typeinfo module needs to grow a 'get real underlying type of variable' module.
22:27:05FromGitter<Varriount> Currently getType just gets the variable/member type
22:28:53ldleworkI bet that books is super fascinating
22:29:08FromGitter<Varriount> How much does it cost?
22:29:10ldleworkthis guy's blog is filled with really interesting design insight
22:29:20ldlework34!
22:30:11ldleworkI'm not seriously asking anyone to purchase on my behalf, but I'll have to wait a month or two ^^
22:30:31Araqwhy keep in empty bottle in the fridge?
22:30:33*devted quit (Quit: Sleeping.)
22:30:52Araq- because we might have guests who do not want to drink anything.
22:31:20Araq^ that's how you guys write your programs.
22:31:42ldleworkwhatever that means
22:32:12*krux02 quit (Remote host closed the connection)
22:33:17Araqalways concerned with non-issues.
22:34:49*bjz joined #nim
22:37:50*Nobabs27 joined #nim
22:39:31FromGitter<Varriount> Araq: I assume you're criticising our concern with abstractions such as dependency injection?
22:39:44Nobabs27ok
22:44:06*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:44:18ldleworkMy main usecase for Nim is exploring the possibilities of software engineering in general, so I think that makes them issues for me.
22:45:19ldleworkI agree that I fall into design holes that are not practical but excite me purely from the persepctive of expressibility.
22:46:25ldleworkWhile I typically use "Poor Man's Dependency Injection" throught my coding style no matter what language I'm working on, the concept of a strcutre that could somehow know how to compose the entire object graph for my whole program is interesting to me.
22:46:47ldleworkThat is, instead of having classes initialize their own dependencies, they are passed in as parameters, etc
22:47:06ldleworkWhich is just a baseline way to make unit testing easier (or even possible)
22:48:03ldleworkVarriount are you familiar with anything I just said?
22:52:59Araqno, it's just that I've been able to write neural networks without a "list of transformations from float to Matrix to Vector to ..."
22:54:34Araqnor did I encounter a library which supports roughly 8 different callback types all in merged in a sum type
22:55:51ldleworkI mean implementing some application is not the same as writing modular, reusable, testable and maintainable code though.
22:56:25ldleworkI'm sure they are just attempting to generalize their software. It shouldn't be looked down upon.
22:58:46FromGitter<Varriount> Araq: But were those neural networks dealing with types provided by other libraries?
23:00:37*nsf quit (Quit: WeeChat 1.7)
23:02:28Araqno, because I know the secrets of programming. to make a function f: T -> T work with data type Q instead all it takes are two isomorphisms g: Q -> T and h: T -> Q
23:03:31Araqthen f'(x) = h(f(g(x))
23:04:12Araqbut it tends to come up rarely.
23:04:25*brson joined #nim
23:08:21*willprice quit (Ping timeout: 255 seconds)
23:10:25FromGitter<Varriount> Doesn't that assume that T and Q can be converted?
23:23:22*vlad1777d__ quit (Quit: Leaving)
23:27:08*arnetheduck quit (Ping timeout: 240 seconds)
23:27:33*nhywyll quit (Quit: nhywyll)
23:31:23*devted joined #nim
23:31:23FromGitter<Varriount> @mratsim Have you used C or C++ before?
23:32:24FromGitter<mratsim> In my case, I have a list of functions that will go like this: Mat -> Mat -> Mat -> Mat -> Vec -> float. Each Mat->Mat or Mat->Vec or Vec->Float will (should) add the corresponding gradient transformation to a list
23:32:44FromGitter<mratsim> so gradient will go Float -> Vec -> Mat -> Mat -> Mat -> Mat
23:33:45FromGitter<mratsim> Other libraries in Python, C++, haskell, Lua will model each operation has a class with a forward and a backward method
23:34:00FromGitter<mratsim> but it makes it really clunky to use
23:34:48FromGitter<mratsim> Currently just for scalar I can do that with my code: ⏎ ⏎ a = ctx.variable(10) ⏎ b = ctx.variable(15) ⏎ y = a * b * ln(a) [https://gitter.im/nim-lang/Nim?at=58ec169a08c00c092a6a9225]
23:35:22FromGitter<mratsim> in Torch which is Facebook library, you wuickly get to these: ⏎ ⏎ torch.mul(a,torch.mul(b,torch.ln(a)))
23:35:53FromGitter<mratsim> a `* b `* ln(a)
23:37:43FromGitter<Varriount> Sounds like an abstract syntax tree
23:37:47FromGitter<mratsim> @Varriount, I never coded in C++, I can read C, and have basic understanding on it as I spent 3 months coding a go bot in Rust 1.5 years ago and had to read on reference implementation
23:39:09FromGitter<Varriount> @mratsim What's the current problem? I saw your post on the forum stating that you found a solution.
23:39:14ldleworkmratsim, I just implemented a binary graph
23:39:21ldleworkmaybe that would be of use to you?
23:39:42ldlework(even using forward and backward fields ;)
23:40:41FromGitter<mratsim> @Varriount Well actually I can get the closure in an object variant (so quite verbose/ugly solution I posted) but I can’t get them out of it
23:40:54FromGitter<mratsim> @idlework, I would be very interested to see it yes
23:41:01ldleworkhttps://github.com/dustinlacewell/dadren/blob/master/dadren/bsp.nim
23:42:05FromGitter<Varriount> @mratsim I think what @araq said that he did was just create a conversion/equivalency between the various data types. Would that work for you?
23:42:34ldleworkIt sounds like the problem is how do you formulate a graph with distinct types
23:42:45FromGitter<mratsim> @Idlework yes
23:42:52ldleworkIf so, my link should help you (I also have an object variant version, but its less robust and clean)
23:43:07ldleworkI recommend dispatch in this case
23:43:18ldleworkyou can highly refactor the implementation without case statements everywhere
23:43:32ldlework(IE have Nim's runtime do all that casing behind the scenes)
23:43:39FromGitter<Varriount> ldlework: I tried that.
23:43:47FromGitter<mratsim> @idlework, dispatch = method?
23:43:49ldleworktried what
23:43:53ldleworkmratsim, yeah
23:44:23FromGitter<Varriount> ldlework, @mratsim : https://gist.github.com/Varriount/9e32806b5c9dbdfdea2b66ebc4e6b83f
23:45:20ldleworkdunno what this is doing really
23:45:22ldleworkwas there a problem?
23:45:41FromGitter<Varriount> 'Cannot instantiate "call"`
23:48:42FromGitter<Varriount> Wait, now it appears to be working.
23:49:00ldleworklol
23:49:10FromGitter<mratsim> @Varriount Actually, I thought using the object variant was already a kind of type conversion. I can probably convert type at some places but either I convert back to linalg types before computation (for the fast computation routines) or I implement the operations on my own type, might as well redo the library in this case
23:49:12*ldlework makes sweeping arm gestures
23:49:14ldleworkNim.
23:49:44ldleworkthat should be the byline on the website
23:49:56ldlework"Wait. Now it appears to compile."
23:52:20FromGitter<mratsim> I have cannot instantiate “call” @Varriount
23:57:24FromGitter<Varriount> @Araq Any idea why this wont work (updated): https://gist.github.com/Varriount/9e32806b5c9dbdfdea2b66ebc4e6b83f