06:47:52 | * | NimBot joined #nim |
06:48:21 | dom96 | Should be fixed now. The VPS ran out of space :) |
06:49:50 | * | nsf joined #nim |
06:50:19 | couven92 | dom96, NimBot is that the one that powers the irclogs.nim-lang.org site? |
06:50:24 | dom96 | yes |
06:50:47 | couven92 | ah... I saw Gitter also had to log off/log on earlier :) |
06:51:43 | couven92 | But FromGitter is probably just a default GitHub/Gitter thing? |
06:51:59 | dom96 | nope, created by BlaXpirit |
06:52:11 | dom96 | gotta go, bye |
06:52:17 | couven92 | bye |
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:18 | gokr | Morning folks |
07:44:19 | * | yglukhov quit (Ping timeout: 245 seconds) |
07:44:33 | couven92 | gokr, morning! :) |
07:44:56 | gokr | couven92: New Nimmer? Don't recognize your nick |
07:45:07 | * | yglukhov joined #nim |
07:45:49 | couven92 | gokr, Been here for a year now I think... |
07:45:54 | gokr | Oh, my bad! |
07:46:10 | * | Vladar joined #nim |
07:46:12 | couven92 | PMunch dragged me into Nim when we did a university project together |
07:46:19 | ldlework | nice what was it |
07:46:52 | * | Andris_zbx joined #nim |
07:46:57 | couven92 | crating a dynamic schema system for relational databases |
07:47:13 | ldlework | oh nice where is it? |
07:48:47 | couven92 | we 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:09 | couven92 | gokr, I am the one responsible to vccexe in the Nim tools, BTW. Making it easier to use the vcc backend on Windows |
07:51:21 | gokr | Ah, nice! |
07:51:24 | * | rauss quit (Quit: WeeChat 1.7) |
07:52:08 | couven92 | And dom96 currently has me working on implementing SChannel in Nim as a possible alternative to OpenSSL on Windows |
07:53:27 | gokr | I have unfortunately not been nimming much lately. |
07:56:30 | couven92 | gokr, 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:06 | couven92 | And each time I do I learn some new great feature of Nim! It's amazing really! :D |
07:57:48 | gokr | I am a different kind of Nimmer - since I am a Smalltalker at heart. |
07:57:53 | couven92 | And 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:55 | gokr | Which is... almost a contradiction. |
07:58:09 | couven92 | :D I am a C# person myself |
07:59:10 | gokr | Hehe, well, C# is quite ok, definitely nicer than Java in my book. |
07:59:57 | gokr | If you are interested in game dev - atomicgameengine now has C# support - which is quite interesting. |
07:59:57 | ldlework | I love C# |
08:00:34 | ldlework | I hope Nim can become as well-working as C# some day, as its already a bit more expressive. |
08:00:59 | couven92 | :) I really am a backend person! :P No graphics stuff for me! |
08:02:15 | couven92 | I am also sketching a reworked version of NimStudio, i.e. full 1st class Nim support in Visual Studio |
08:03:16 | couven92 | Being 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:07 | gokr | IDE... I just say Smalltalk :) |
08:16:25 | * | zachcarter quit (Quit: zachcarter) |
08:16:49 | couven92 | gokr, is smalltalk sth that you do not use an IDE for? |
08:17:12 | couven92 | (I actually have no idea about Smalltalk! :P ) |
08:17:19 | gokr | Smalltalk is a fully reflective live "IDE" in itself. |
08:17:32 | gokr | The best modern example is: pharo.org |
08:17:46 | * | krux02 joined #nim |
08:18:26 | couven92 | okay... :D |
08:23:11 | Tiberium | ehh, it seems that parsecfg can't parse this custom .ini-like settings format :( |
08:23:21 | Tiberium | for example, there's a line "Title:Goodbye To A World" |
08:23:33 | Tiberium | if I try to get Title, I'll get only "Goodbye" |
08:24:08 | Tiberium | well, but I know, that parsecfg isn't suited for parsing other formats |
08:25:22 | gokr | couven92: I do recommend looking at Smalltalk - just to get a completely different take on programming. |
08:32:23 | * | bjz joined #nim |
08:37:18 | couven92 | gokr, I'll look into it while I get bored writing my M.Sc. :P |
08:37:34 | gokr | Do 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:40 | zachcarter | Varriount: 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:05 | zachcarter | btw |
09:57:06 | zachcarter | https://github.com/zacharycarter/nimrl/blob/master/src/noise/seeded_noise.nim |
09:57:18 | zachcarter | I plan on adding up to 6d |
09:57:34 | zachcarter | and then probably some other types of noise too |
09:58:22 | Tiberium | lol |
09:58:23 | Tiberium | 6d? |
09:58:44 | zachcarter | yup! |
09:59:36 | zachcarter | this is a very convoluted port but |
10:00:26 | zachcarter | https://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:39 | zachcarter | :P |
10:01:01 | FromGitter | <Varriount> Does adding another dimension always follow the same process? |
10:01:22 | zachcarter | no it actually gets quite hairy in the later dimensions |
10:01:38 | zachcarter | my 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:04 | zachcarter | although that is non-simplex noise |
10:02:23 | Tiberium | what is the purpose of 4d-6d noise? |
10:02:25 | zachcarter | for simplex noise, adding the extra dimensions is pretty straightforward |
10:02:30 | Tiberium | where it can be useful? |
10:02:45 | FromGitter | <Varriount> Any resources you could recommend on learning how simplex noise works? |
10:03:03 | zachcarter | all sorts of places, texture synthesis, I used 4d in my map generator |
10:03:07 | zachcarter | sure, one second |
10:03:28 | zachcarter | I think this is a pretty good paper - http://webstaff.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf |
10:03:29 | FromGitter | <Varriount> I know it works on the principle of sampling using a random number algorithm |
10:04:12 | zachcarter | yup |
10:04:58 | krux02 | Varriount: 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:19 | zachcarter | I forget what the triangles are referred to as |
10:06:25 | zachcarter | that paper should remind me |
10:07:13 | zachcarter | Tiberium: I used 4d noise on this project extensivley - https://github.com/zacharycarter/mapgen |
10:08:13 | FromGitter | <Varriount> Perhaps I should try implementing simplex noise in Nim, to help understand it |
10:08:35 | krux02 | that paper has a reference I think |
10:09:04 | krux02 | Varriount, please do it using the glm librariy that I contributed to :D |
10:09:41 | zachcarter | I wouldn’t study my implementation |
10:10:12 | zachcarter | it’s for seedable simplex noise |
10:11:17 | krux02 | well there is also this c++ library, libnoise |
10:12:57 | zachcarter | ah yeah |
10:13:03 | zachcarter | accidental noise is a lot nicer than libnoise |
10:13:06 | Tiberium | how 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:41 | Tiberium | example file - https://gist.github.com/TiberiumN/31502f04ea255cc7604849ec7312e9ff |
10:13:55 | krux02 | Tiberium: define nicer? |
10:14:07 | Tiberium | krux02, I mean maybe there's a better way to do it |
10:14:18 | krux02 | define better? |
10:14:42 | Tiberium | krux02, so ok, is this line normal? |
10:15:16 | krux02 | well I think it creates a lot of temporary objets that you know ahead of time you never need |
10:15:27 | krux02 | but is is very compact |
10:15:47 | Tiberium | hmmm, I actually have an idea |
10:15:50 | krux02 | and dosn't need the regular expression library that might cause problems under windows (sadly) |
10:15:56 | Tiberium | maybe using scanf |
10:16:00 | krux02 | so I don.t know what you mean by better |
10:16:12 | zachcarter | krux02: it’s modular |
10:16:17 | zachcarter | defines all sorts of different types of noise modules |
10:16:24 | zachcarter | allows you to chain noise modules together |
10:16:38 | zachcarter | I can show you some example Java code if you’d like |
10:17:18 | zachcarter | oh you were talking about Tiberium |
10:17:21 | zachcarter | :P |
10:17:24 | krux02 | well, when it's java it kind of excludes itself to write bindings for it in nim |
10:17:34 | Tiberium | krux02, jnim? |
10:17:35 | krux02 | not that it is impossible, but who would want that? |
10:17:38 | Tiberium | ah yes |
10:17:45 | Tiberium | it's better to port it |
10:18:11 | krux02 | you can start with a binding when you really want to experiment with it |
10:18:15 | krux02 | and then gradually port it |
10:18:37 | krux02 | when you have a binding you always have a reference to compare it to, in case you screw up |
10:18:44 | krux02 | make life easier |
10:19:38 | krux02 | I 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:54 | zachcarter | well there’s no C lib for accidental noise unfortunately |
10:20:00 | krux02 | but I am ranting again |
10:22:14 | krux02 | I 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:45 | zachcarter | no but what I mean is this |
10:23:47 | zachcarter | https://github.com/zacharycarter/mapgen/blob/master/core/src/com/carterza/planet/map/generator/MapGenerator.java#L984-L1035 |
10:25:25 | zachcarter | I don’t think you can do that kind of stuff with libnoise, I may be mistaken |
10:27:10 | krux02 | zachcarter: well a fractal noise is nothing more than a sum of noise values of different frequencies |
10:27:19 | zachcarter | sure |
10:27:36 | zachcarter | but 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:48 | zachcarter | you just specify the octaves and the frequencies and then sample away |
10:28:02 | zachcarter | number of octaves* |
10:28:06 | * | Ven is now known as Guest42930 |
10:28:14 | zachcarter | I think the power is in things like the domain translation / scaling, etc |
10:28:30 | zachcarter | where you can take noise module A and noise module B and scale or translate one by the other |
10:28:31 | zachcarter | and then sample |
10:28:51 | krux02 | well fith free form fucntions, you can do anything as far as I know |
10:28:59 | krux02 | and I did some 3D noise stuff |
10:29:14 | krux02 | you can always put the result of a noise in another noise function |
10:29:42 | krux02 | ok lunch time for me |
10:29:45 | zachcarter | enjoy! |
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:04 | krux02 | I am back |
11:26:50 | * | PMunch joined #nim |
11:27:13 | zachcarter | wb |
11:29:03 | * | krux02 quit (Remote host closed the connection) |
11:32:07 | * | arnetheduck joined #nim |
11:37:47 | FromGitter | <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:04 | Tiberium | what's better for performance? using split or scanf? |
12:34:08 | Tiberium | (scanf from strscans) |
12:35:14 | Tiberium | I 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:06 | demi- | i don't think it matters |
12:38:16 | flyx | scanf would be faster, but can only process a fixed number of ints |
12:38:54 | flyx | you can use parseutils.parseInt and set the start index to avoid creating multiple strings |
12:39:29 | flyx | then check that every character it stops at is a ',' |
12:39:48 | flyx | repeat until end of string |
12:39:50 | demi- | if you are worrying about the perf of `scanf` then i think you are worrying about the wrong thing tbh |
12:40:22 | Tiberium | yeah :) |
12:40:31 | Tiberium | maybe firstly I need to actually implement parser |
12:40:40 | Tiberium | and then compare it with "reference" realization |
12:41:10 | Tiberium | (it's not reference, it's just the full parser for this format written in C++) |
12:41:18 | Tiberium | and everyone port this C++ parser to another languages |
12:41:28 | Tiberium | and I don't want to do it |
12:44:38 | * | Ven_ quit (Ping timeout: 240 seconds) |
12:44:39 | demi- | what parser? |
12:45:41 | Tiberium | https://github.com/Francesco149/oppai |
12:45:47 | Tiberium | code is hard to understand :D |
12:45:50 | Tiberium | https://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:05 | FromGitter | <Varriount> You could write a wrapper instead. |
13:08:57 | Tiberium | I don't want to mess with portability :D |
13:09:10 | Tiberium | I mean I want to have pure-nim parser |
13:11:04 | couven92 | Tiberium, 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:48 | krux02 | Tiberium: 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:48 | zachcarter | I’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:02 | couven92 | zachcarter, that's actually an interesting idea... :O |
14:49:37 | PMunch | Hmm, I guess if golang can do it Nim should be possible.. |
14:50:04 | zachcarter | I’ll try to cook up a prototype |
14:50:11 | zachcarter | might help me eventually get Nim in my workplace |
14:51:02 | demi- | I think the only fundamental different there would be that go statically links all dependencies whereas nim doesn't necessarily |
14:51:21 | demi- | 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:01 | cheatfate | demi-, the main problem not in libc, but in supported syscalls |
15:07:16 | * | Trustable joined #nim |
15:13:06 | FromGitter | <Varriount> Why can't aws lambda run C/C++? |
15:24:27 | demi- | why would you want to write/run that on lambda? |
15:41:37 | * | Andris_zbx quit (Remote host closed the connection) |
15:42:22 | libman | https://aws.amazon.com/blogs/compute/running-executables-in-aws-lambda/ |
15:44:26 | * | sz0 quit (Quit: Connection closed for inactivity) |
15:45:48 | cheatfate | libman, 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:09 | dom96 | zachcarter: 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:18 | libman | cheatfate: https://skia.googlesource.com/skia/+/master/LICENSE == 3-clause BSD == good |
16:12:26 | cheatfate | thanks |
16:12:36 | libman | I'm not the authority, copyfree.org is. |
16:13:48 | libman | (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:47 | demi- | BSD 3-clause and MIT are generally the most compatible licenses |
16:15:32 | libman | I 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:18 | libman | Languages 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:43 | FromGitter | <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:27 | FromGitter | <Bennyelg> Hey guys, first time here. wanted to tell this is look like the next language to come :D |
16:29:38 | Tiberium | hi :) |
16:29:46 | FromGitter | <Bennyelg> I am a python developer for the past 5 years |
16:29:56 | FromGitter | <TiberiumPY> I am a python developer for 5 months :D |
16:30:05 | FromGitter | <Bennyelg> I want to get into nim as soon as I can ':D |
16:30:07 | FromGitter | <TiberiumPY> but I started learning Nim like 2 weeks ago |
16:30:57 | FromGitter | <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:17 | FromGitter | <TiberiumPY> for doing something that require a lot of speed - nim is your choice |
16:31:51 | FromGitter | <Bennyelg> What about councarrecy ? |
16:32:41 | Tiberium | you can read a lot here - https://nim-lang.org/docs/manual.html |
16:33:11 | Tiberium | https://nim-lang.org/docs/manual.html#parallel-spawn |
16:33:23 | Tiberium | and https://nim-lang.org/docs/manual.html#threads |
16:33:32 | FromGitter | <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:47 | FromGitter | <TiberiumPY> @mratsim do I need to pass some parameters to compiler? |
16:34:54 | FromGitter | <TiberiumPY> or it would pass them to gcc automatically? |
16:34:58 | FromGitter | <TiberiumPY> (for including openmp) |
16:35:09 | FromGitter | <Bennyelg> Thanks. |
16:35:12 | FromGitter | <mratsim> it will be in the C code generated if you open it |
16:35:36 | FromGitter | <Bennyelg> I'll stick around and play with it soon. ⏎ bad we dont have proper ide such intelji |
16:35:49 | FromGitter | <TiberiumPY> it's good on the other side |
16:35:55 | FromGitter | <TiberiumPY> you can learn language faster :D |
16:38:19 | FromGitter | <Bennyelg> What ide do you use>? |
16:38:56 | FromGitter | <TiberiumPY> ide-like visual studio code |
16:38:57 | FromGitter | <mratsim> I use Visual Studio Code |
16:39:19 | FromGitter | <TiberiumPY> you will not have smart intellisence, but you'll have error highlighting (best in the world :D) |
16:39:33 | FromGitter | <TiberiumPY> because nim provides error checking from itself, it's not dependent on IDE |
16:41:55 | FromGitter | <Bennyelg> visual studio gives autocompletion? |
16:41:56 | FromGitter | <TiberiumPY> @mratsim "Same as .. but the loop may run in parallel." how can I know if my loop will run in parallel? |
16:42:15 | FromGitter | <TiberiumPY> @Bennyelg only from text lines in currently opened file |
16:42:17 | FromGitter | <stisa> Well, in VSCode there's also autocompletion and the suggestions also show doc comments |
16:42:19 | FromGitter | <TiberiumPY> no smart intelli-sence as I said |
16:42:48 | FromGitter | <Bennyelg> Thanks. |
16:43:57 | FromGitter | <mratsim> @TiberiumPY Besides opening the ASM code I think the best way would be to check in top |
16:44:10 | FromGitter | <mratsim> (or whatever process manager you prefer) |
16:44:43 | FromGitter | <TiberiumPY> for simple recursive fibonacci calculation is still done on 1 core |
16:44:59 | FromGitter | <TiberiumPY> ah, maybe iterative would give multi core |
16:45:51 | FromGitter | <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:10 | libman | VScode 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:45 | FromGitter | <TiberiumPY> vscode is multiplatform |
16:52:00 | FromGitter | <TiberiumPY> ah, you're about license. ⏎ well, I don't care about them yet |
16:52:24 | libman | Yes, It's tri-platform: Windows, MacOS, and Linux. |
16:52:37 | FromGitter | <TiberiumPY> I use it on my manjaro |
16:52:46 | * | mwbrown quit (Quit: Exiting) |
16:52:56 | FromGitter | <TiberiumPY> and I have nvidia, so proprietary drivers |
16:53:02 | * | mwbrown joined #nim |
16:53:57 | libman | But 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:09 | FromGitter | <TiberiumPY> yeah, I know |
16:55:31 | FromGitter | <TiberiumPY> but for modern developers it's easier, since JS is one of the most popular languages |
16:55:40 | FromGitter | <TiberiumPY> and devs are too lazy to create something like vscode in C++, for exmaple |
16:55:45 | FromGitter | <TiberiumPY> *example |
16:56:47 | libman | JS 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:04 | FromGitter | <TiberiumPY> well, I really hope that webassembly will become a real thing |
16:58:15 | FromGitter | <TiberiumPY> and I hope that gcc will have a good webassembly backend :) |
16:59:21 | libman | Wasm 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:36 | FromGitter | <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:56 | FromGitter | <TiberiumPY> @mratsim but typescript is still transpiled to JS |
16:59:57 | libman | Think outside the browser. |
17:00:20 | FromGitter | <barcharcraz> but like nobody wants desktop apps these days |
17:00:30 | FromGitter | <barcharcraz> at least not ones that can't also run as webapps |
17:01:04 | demi- | because the tooling around javascript is so much better than native tooling on almost any platform |
17:01:08 | FromGitter | <mratsim> And then you need gulp + webpack + babel to get anything up ... |
17:05:05 | libman | "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:06 | FromGitter | <stisa> anyone knows how to get the `kind` of an object variant passed to a macro? |
17:05:37 | Tiberium | well, 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:44 | Tiberium | so with "+" you can convert it to integer |
17:05:49 | libman | We just need to come up with the right stack for building awesome desktop apps in Nim. |
17:06:18 | Tiberium | libman, honestly I think the best thing possible is to have drag'n'drop editor :) |
17:06:22 | Tiberium | so you can make prototypes faster |
17:06:29 | Tiberium | or even something like Delphi :) |
17:06:49 | Tiberium | I mean IDE for GUI development |
17:09:23 | Tiberium | nimx has very basic gui drag'n'drop editor |
17:09:28 | Tiberium | but it crashes on my linux :( |
17:09:36 | Tiberium | with 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:33 | ldlework | zachcarter: 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:16 | ldlework | Someone once showed me an interface library implemented in Nim |
18:03:24 | ldlework | Anyone know what it is? I can't find it on the stdlib listing |
18:03:33 | Tiberium | ldlework, there's a lot |
18:03:35 | Tiberium | maybe "nimx" ? |
18:03:42 | Tiberium | or araq's libui wrapper? |
18:03:53 | ldlework | By interface I don't mean UI |
18:03:58 | Tiberium | ah, sorry :) |
18:04:01 | FromGitter | <mratsim> https://nim-by-example.github.io/oop/ |
18:04:19 | ldlework | No |
18:04:24 | ldlework | It was a library implementing an interface type. |
18:04:53 | * | nightmared joined #nim |
18:05:03 | FromGitter | <mratsim> In this thread, this library implement a trait macro: https://forum.nim-lang.org/t/278/2 |
18:07:33 | ldlework | It was a full library on github. Doh. |
18:09:36 | Tiberium | use search on github with language:Nim and "interface" |
18:09:38 | Tiberium | and search in code :D |
18:10:11 | Tiberium | ldlework, ah, maybe https://github.com/andreaferretti/interfaced ? |
18:10:41 | Tiberium | anyway, this search does the trick - https://github.com/search?q=language%3ANim+interface&type=Repositories&utf8=%E2%9C%93 |
18:10:53 | ldlework | Tiberium: that might be it! |
18:11:21 | * | kunev quit (Ping timeout: 255 seconds) |
18:13:00 | ldlework | Has 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:32 | zachcarter | Idlework: I work at Carfax |
18:38:48 | zachcarter | Idlework: I do think people have done dependency injection with Nim |
18:38:51 | ldlework | zachcarter: ah doin what |
18:39:04 | zachcarter | mostly data pipeline stuff, some backend web dev |
18:39:21 | ldlework | docker? |
18:39:30 | zachcarter | lot of, this system has this data, this system needs this data figure out how to get the data there / expose it etc |
18:39:36 | zachcarter | yup |
18:39:42 | ldlework | cool I work at docker |
18:39:44 | zachcarter | all JVM at the moment, trying to push golang |
18:39:45 | zachcarter | oh nice! |
18:40:16 | zachcarter | good 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:40 | FromGitter | <Varriount> I work on infrastructure automation. Most of the stuff I write is in Python. |
18:48:46 | ldlework | Cool we could start a Nim orchestration company with the expeirence in here :) |
18:49:06 | FromGitter | <mratsim> No JS ? :P |
18:59:30 | Tiberium | lol |
18:59:33 | Tiberium | https://github.com/search?utf8=%E2%9C%93&q=language%3ANim+coreutils&type= |
18:59:41 | Tiberium | there's 6 "coreutils" repositories in Nim |
19:11:49 | couven92 | how many Windows API repos? |
19:13:13 | Tiberium | couven92, ehm, maybe I search wrongly, but one |
19:13:24 | Tiberium | let me look in nimble registry |
19:13:53 | couven92 | I got 15 https://github.com/search?utf8=%E2%9C%93&q=language%3ANim+windows&type= |
19:14:02 | Tiberium | couven92, they're not windows api |
19:14:09 | Tiberium | there's only winim |
19:14:15 | Tiberium | and old-winapi on bitbucket |
19:14:18 | couven92 | True... I saw that... |
19:14:23 | Tiberium | ah no |
19:14:25 | Tiberium | it's on github too |
19:14:32 | Tiberium | hmmm, https://github.com/Vikaton/nim-keylogger |
19:15:39 | couven92 | interesting approach... :) |
19:16:24 | Tiberium | well, github sucks :( It can't search only 500-600 nim repos |
19:16:29 | Tiberium | maybe because they're not in cache |
19:16:33 | Tiberium | https://github.com/search?utf8=%E2%9C%93&q=language%3ANim&type=Repositories |
19:16:46 | Tiberium | "this search took too long to finish" question mark |
19:17:03 | Tiberium | and for language:Python it shows ~500 thousands |
19:17:13 | couven92 | Ooooh! NimBorg... I like the name (and the description)! :D |
19:17:27 | couven92 | (Trekkie at heart! :D ) |
19:18:11 | * | PMunch joined #nim |
19:18:17 | ldlework | zachcarter: do you have any examples of Nim IoC container |
19:19:01 | zachcarter | let me see |
19:21:08 | Tiberium | oh wait |
19:21:12 | Tiberium | there's no Nim wrapper for https://github.com/ocornut/imgui ? |
19:21:19 | zachcarter | Idlework: have you seen this thread: https://forum.nim-lang.org/t/1271 |
19:21:27 | zachcarter | I don’t think folks have done much beyond what’s mentioned in there |
19:23:44 | zachcarter | so it’s very manual |
19:26:05 | ldlework | Yeah not much to say there |
19:26:23 | * | yglukhov quit (Remote host closed the connection) |
19:26:36 | ldlework | Tiberium: wanna implement imgui for Dadren? |
19:26:55 | Tiberium | ldlework, I think it's not so easy :D |
19:27:18 | ldlework | yeah Dadren is not using opengl :( |
19:27:35 | ldlework | I'm too dumb for that stuff |
19:27:36 | Tiberium | ldlework, what is it using? |
19:27:42 | ldlework | Tiberium: just normal SDL2 |
19:27:48 | Tiberium | SDL2 can use OpenGL |
19:27:57 | ldlework | I know, I'm saying I'm just blitting |
19:28:24 | Tiberium | oh, look at this C++ code https://github.com/ocornut/imgui |
19:28:26 | ldlework | It would be cool to find an opengl collaborator who wanted to upgrade Dadren to opengl, give us some batched sprites and stuff |
19:28:28 | Tiberium | I mean example |
19:28:44 | Tiberium | ldlework, I know nothing where it comes to graphics |
19:30:41 | zachcarter | I’ve implemented something similar to imgui for frag |
19:30:42 | zachcarter | Nuklear |
19:30:45 | ldlework | I will probably just steal Frag's code |
19:30:47 | ldlework | :) |
19:30:49 | zachcarter | :P |
19:31:31 | Tiberium | zachcarter, but imgui seems to be easier-to-use (at least it's C++ code is straightforward) |
19:31:40 | zachcarter | well it’s C++ :/ |
19:31:48 | zachcarter | Nuklear is ANSI-C |
19:32:16 | * | rokups quit (Quit: Connection closed for inactivity) |
19:34:57 | ldlework | zachcarter: 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:21 | Tiberium | well, where can I find info how to fix headers for c2nim (c++ headers)? |
19:36:06 | ldlework | Tiberium: are you going to try to wrap it |
19:36:07 | zachcarter | Idlework: the code is very bgfx specific |
19:36:13 | ldlework | zachcarter: that's OK |
19:36:24 | ldlework | probably a good thing |
19:36:28 | Tiberium | ldlework, it's my first try in nim ffi in general |
19:37:13 | zachcarter | I’d say the code is a decent starting point for a sprite batch implementation |
19:37:41 | zachcarter | it needs support for generic shaders, but that’s next on my todo list |
19:37:43 | ldlework | zachcarter: 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:00 | Tiberium | huh, c2nim installation from git master fails |
19:38:03 | Tiberium | "/home/tiber/.nimble/pkgs/compiler-#head/compiler/idents.nim(15, 21) Error: cannot open 'etcpriv'" |
19:39:04 | zachcarter | I think krux02 is trying to solve that with his project, although he’s also focusing on 3D |
19:39:54 | zachcarter | Tiberium - 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:00 | ldlework | zachcarter: it seems like you're already solving it but its tied up with the rest of frag |
19:40:23 | zachcarter | yeah :/ I’m not sure how easy it would be to decouple it |
19:40:40 | Tiberium | zachcarter, I don't want to build something, I just want to try to create bindings via Nim :) |
19:40:56 | Tiberium | and imgui can be ran on many backends as well |
19:40:58 | zachcarter | Ah okay - Tiberium I wrote the start of a guide on creating bindings to libs with Nim |
19:41:07 | zachcarter | it can be - i just meant because the code was C++ |
19:41:13 | zachcarter | portability may be an issue |
19:41:57 | zachcarter | Idlework: 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:06 | zachcarter | Tiberium: finding the guide now |
19:42:28 | zachcarter | https://gist.github.com/zacharycarter/846869eb3423e20af04dea226b65c18f |
19:42:42 | zachcarter | I should finish that thing... |
19:44:20 | Tiberium | zachcarter, reading about soloud - c2nim is THAT simple!? |
19:44:26 | Tiberium | for simple libraries :) |
19:44:29 | * | Arrrr quit (Read error: Connection reset by peer) |
19:44:30 | zachcarter | yup! |
19:44:38 | Tiberium | magic |
19:44:45 | zachcarter | Nuklear is probably the most complex library I’ve bound to |
19:44:49 | zachcarter | actually nix that |
19:44:52 | zachcarter | the spine runtime was pretty complex too |
19:45:11 | Tiberium | zachcarter, I think nuklear is hard because everything is in header |
19:45:21 | zachcarter | nah it’s not bad :P |
19:45:27 | zachcarter | single header libs are nice actually |
19:45:37 | zachcarter | I can share my bindings Tiberium if you’d like to see how I did them for Nuklear |
19:45:45 | zachcarter | they’re on github actually under my username |
19:45:47 | zachcarter | nuklear-nim |
19:45:55 | Tiberium | I saw it :) |
19:46:08 | zachcarter | https://github.com/zacharycarter/nuklear-nim/tree/master/src |
19:46:13 | zachcarter | bind.c is the secret sauce |
19:46:13 | zachcarter | and then |
19:46:27 | zachcarter | https://github.com/zacharycarter/nuklear-nim/blob/master/nuklear.nim#L242 |
19:46:32 | zachcarter | krux02 taught me that trick :P |
19:46:38 | Tiberium | ohhh |
19:47:13 | zachcarter | no linking to any libraries at all :) just compiling the C code with that Nim pragma :D |
19:48:45 | Tiberium | eh, 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:52 | Tiberium | (offline game) |
19:53:21 | libman | PKZIP 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:07 | Tiberium | libman, yeah, it's normal modern zip (but not winzip) |
19:54:14 | libman | I assume the game is closed-source? |
19:54:17 | Tiberium | yeah :) |
19:54:35 | Tiberium | there was the game released in 2008 with the same engine and without zip encrypting |
19:54:46 | Tiberium | and library handling those zips is made in C++ |
19:54:59 | libman | Hire some Eastern European guru to decompile it for you. |
19:55:19 | * | zachcarter quit (Ping timeout: 240 seconds) |
19:55:40 | Tiberium | libman, russian hackers? maybe I can ask my friends :D |
19:55:45 | libman | It's probably not as simple as looping through `strings` and trying them as password... |
19:55:51 | Tiberium | yeah, 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:58 | FromGitter | <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:17 | zachcarter | time to port my A* code |
20:42:53 | couven92 | zachcarter, did you get the AWS Lambda to work? |
20:43:17 | zachcarter | couven92: I haven’t spent much time on it yet, it definitely doesn’t look simple nor does it look well documented |
20:43:53 | couven92 | yeah... That has been my experience with AWS as well... :/ |
20:44:26 | zachcarter | https://github.com/eawsy/aws-lambda-go-shim/tree/master/src |
20:44:33 | zachcarter | I think runtime.c is where I start |
20:45:26 | libman | AWS Lambda - it's like FastCGI but closed and expensive. :P |
20:45:49 | libman | (Unless your API suddenly jumps to ten zillion hits.) |
20:47:51 | * | aedigix joined #nim |
20:50:26 | FromGitter | <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:33 | FromGitter | <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:54 | Araq | isn't that the point of a typechecker? |
20:55:03 | * | nhywyll joined #nim |
20:59:20 | FromGitter | <mratsim> @Araq, here is what I’m trying to work with: https://gist.github.com/mratsim/98ddd0ba308ea1a7e378d647082339e6 |
21:00:02 | FromGitter | <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:53 | FromGitter | <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:19 | FromGitter | <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:48 | Araq | let x = if cond: "string" else: 4 |
21:08:16 | * | aedigix quit (Remote host closed the connection) |
21:08:28 | Araq | ^ you wrote this and scratch your head |
21:08:35 | FromGitter | <mratsim> oh thanks |
21:09:17 | couven92 | Araq, that only works if cond is compile-time constant, right? |
21:09:48 | Araq | couven92: no, it's always invalid |
21:10:23 | krux02 | Araq: I wrote in the forum a question about: magicsAfterOverloadResolution |
21:10:30 | krux02 | I don't think you saw it |
21:11:13 | couven92 | Araq, 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:16 | krux02 | I would like to know what exactly this procedure is supposed to do, since I could not find the documentaiton of it |
21:12:06 | krux02 | when you explain it, I will add the documentation to the function on my branch |
21:12:29 | * | aedigix joined #nim |
21:13:04 | krux02 | couven92: a trinary expression does not need the same type for both branches, but at least some with a common base type |
21:13:37 | krux02 | let a : SuperType = if cond: SubTypeA else: SubTypeB |
21:13:41 | krux02 | should work, too |
21:13:51 | couven92 | yeah, right... Okay... my mind is fried if I don't get those anymore... Time to go to bed! :P |
21:14:09 | couven92 | Good night! :) |
21:14:12 | Araq | krux02: ok, well you wrote the proc's signatures and they seem fine |
21:14:14 | krux02 | gn8t |
21:14:46 | Araq | PContext represents the current module that is being compiled |
21:14:57 | Araq | most importantly it contains the symbol table |
21:15:15 | Araq | PContext = symbol table to a very approximation |
21:15:22 | Araq | *very godo |
21:16:08 | Araq | so ... you need to check the semantics like "does obj even have the named field?" |
21:16:38 | * | couven92 quit (Quit: Disconnecting) |
21:16:59 | Araq | and then as you said, you create a PNode with the integer value that is the offset |
21:17:38 | Araq | anything else? |
21:17:44 | * | bjz joined #nim |
21:18:56 | krux02 | one moment I grep through the code |
21:19:34 | * | Tiberium quit (Remote host closed the connection) |
21:21:41 | krux02 | I 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:00 | krux02 | and last thing is, where are the constructor functions for the Nodes? |
21:24:05 | * | chemist69 joined #nim |
21:24:44 | FromGitter | <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:18 | krux02 | I looked at the PContext type and I found this: TContext = tuple[spacing: int, flags: TSubFlags] |
21:25:40 | krux02 | that is just an int and flags |
21:25:48 | krux02 | how is that a symbol table? |
21:26:09 | libman | Very enjoyable downvoting opportunity on a comment on https://www.quora.com/What-do-you-say-about-Nim-programmning-language 3:) |
21:28:51 | FromGitter | <mratsim> Wow that’s some obnoxious comment - "My view of the world is right, why are you not me" |
21:30:12 | zachcarter | how do you downvlote? |
21:30:23 | zachcarter | downvote* |
21:30:51 | krux02 | I did my job |
21:31:07 | zachcarter | I think you upvoted krux02 :P |
21:32:13 | krux02 | yea I did |
21:32:18 | krux02 | never used quora |
21:32:31 | krux02 | I am more home at the stack overflow pages |
21:32:46 | krux02 | but very nice comment |
21:33:06 | Araq | krux02: https://github.com/nim-lang/Nim/blob/devel/compiler/semdata.nim#L72 |
21:33:44 | Araq | it's not important, it's just a parameter that is passed around all the time, opaque for your purposes |
21:35:17 | zachcarter | thank you! |
21:37:11 | krux02 | so I go the wrong TContext type |
21:37:20 | krux02 | no wonder I was confused |
21:37:37 | krux02 | for some reasons my development environment does not really work that well on the Nim compiler |
21:38:00 | * | devted joined #nim |
21:44:52 | krux02 | Araq: one last thing, what is the most important function to debug a PNode? |
21:45:16 | krux02 | I think you onced told be, but that was a long time ago and I forgot it, so please excuse me |
21:45:27 | gokr | That guy is IMHO obnoxious. I truly am embarrassed about him being a Smalltalk advocate. |
21:45:47 | krux02 | he even has racket on the list |
21:47:01 | Araq | krux02: echo renderTree n |
21:47:04 | Araq | debug n |
21:47:14 | * | Jesin quit (Quit: Leaving) |
21:47:33 | Araq | https://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:37 | dom96 | libman: nice find! |
21:53:08 | * | Jesin joined #nim |
21:55:26 | dom96 | Somebody requested an answer from me on this, but it sounds like something Araq would be able to answer very well :) |
21:55:28 | dom96 | https://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:59 | FromGitter | <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:02 | Araq | I gave no solution |
22:10:11 | Araq | I told you it can't work. |
22:10:47 | ldlework | lol |
22:11:21 | Araq | fm: proc (gradient: DMatrix32): DMatrix32 |
22:11:36 | * | mwbrown quit (Remote host closed the connection) |
22:12:02 | Araq | ^ here is a solution. KISS. the 'fm' callback is free to only use one field/row/column instead of the full DMatrix32 |
22:13:32 | Araq | accept 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:02 | FromGitter | <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:37 | FromGitter | <mratsim> Libraries in other languages rebuild everything from scratch with a common Tensor type |
22:20:11 | FromGitter | <mratsim> If possible I wanted to avoid that |
22:20:29 | FromGitter | <Varriount> @mratsim My sympathies. |
22:20:52 | FromGitter | <Varriount> @mratsim If it's any consolation, you'd face this problem in any statically typed language, not just Nim |
22:22:02 | FromGitter | <mratsim> @Varriount, I already feel headaches about an efficient memory layout of such a Tensor type >_> |
22:22:51 | ldlework | anyone wanna buy me Dependency Injection in .NET by Mark Seemann? |
22:24:05 | FromGitter | <Varriount> ldlework: To what purpose? |
22:24:24 | ldlework | So I can understand how to apply those principles to Nim |
22:24:31 | ldlework | and perhaps build an IoC container |
22:24:43 | ldlework | dunno if Nim has the reflection nessecary but I'm interested to find out |
22:26:46 | FromGitter | <Varriount> The typeinfo module needs to grow a 'get real underlying type of variable' module. |
22:27:05 | FromGitter | <Varriount> Currently getType just gets the variable/member type |
22:28:53 | ldlework | I bet that books is super fascinating |
22:29:08 | FromGitter | <Varriount> How much does it cost? |
22:29:10 | ldlework | this guy's blog is filled with really interesting design insight |
22:29:20 | ldlework | 34! |
22:30:11 | ldlework | I'm not seriously asking anyone to purchase on my behalf, but I'll have to wait a month or two ^^ |
22:30:31 | Araq | why keep in empty bottle in the fridge? |
22:30:33 | * | devted quit (Quit: Sleeping.) |
22:30:52 | Araq | - because we might have guests who do not want to drink anything. |
22:31:20 | Araq | ^ that's how you guys write your programs. |
22:31:42 | ldlework | whatever that means |
22:32:12 | * | krux02 quit (Remote host closed the connection) |
22:33:17 | Araq | always concerned with non-issues. |
22:34:49 | * | bjz joined #nim |
22:37:50 | * | Nobabs27 joined #nim |
22:39:31 | FromGitter | <Varriount> Araq: I assume you're criticising our concern with abstractions such as dependency injection? |
22:39:44 | Nobabs27 | ok |
22:44:06 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:44:18 | ldlework | My main usecase for Nim is exploring the possibilities of software engineering in general, so I think that makes them issues for me. |
22:45:19 | ldlework | I agree that I fall into design holes that are not practical but excite me purely from the persepctive of expressibility. |
22:46:25 | ldlework | While 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:47 | ldlework | That is, instead of having classes initialize their own dependencies, they are passed in as parameters, etc |
22:47:06 | ldlework | Which is just a baseline way to make unit testing easier (or even possible) |
22:48:03 | ldlework | Varriount are you familiar with anything I just said? |
22:52:59 | Araq | no, 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:34 | Araq | nor did I encounter a library which supports roughly 8 different callback types all in merged in a sum type |
22:55:51 | ldlework | I mean implementing some application is not the same as writing modular, reusable, testable and maintainable code though. |
22:56:25 | ldlework | I'm sure they are just attempting to generalize their software. It shouldn't be looked down upon. |
22:58:46 | FromGitter | <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:28 | Araq | no, 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:31 | Araq | then f'(x) = h(f(g(x)) |
23:04:12 | Araq | but it tends to come up rarely. |
23:04:25 | * | brson joined #nim |
23:08:21 | * | willprice quit (Ping timeout: 255 seconds) |
23:10:25 | FromGitter | <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:23 | FromGitter | <Varriount> @mratsim Have you used C or C++ before? |
23:32:24 | FromGitter | <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:44 | FromGitter | <mratsim> so gradient will go Float -> Vec -> Mat -> Mat -> Mat -> Mat |
23:33:45 | FromGitter | <mratsim> Other libraries in Python, C++, haskell, Lua will model each operation has a class with a forward and a backward method |
23:34:00 | FromGitter | <mratsim> but it makes it really clunky to use |
23:34:48 | FromGitter | <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:22 | FromGitter | <mratsim> in Torch which is Facebook library, you wuickly get to these: ⏎ ⏎ torch.mul(a,torch.mul(b,torch.ln(a))) |
23:35:53 | FromGitter | <mratsim> a `* b `* ln(a) |
23:37:43 | FromGitter | <Varriount> Sounds like an abstract syntax tree |
23:37:47 | FromGitter | <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:09 | FromGitter | <Varriount> @mratsim What's the current problem? I saw your post on the forum stating that you found a solution. |
23:39:14 | ldlework | mratsim, I just implemented a binary graph |
23:39:21 | ldlework | maybe that would be of use to you? |
23:39:42 | ldlework | (even using forward and backward fields ;) |
23:40:41 | FromGitter | <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:54 | FromGitter | <mratsim> @idlework, I would be very interested to see it yes |
23:41:01 | ldlework | https://github.com/dustinlacewell/dadren/blob/master/dadren/bsp.nim |
23:42:05 | FromGitter | <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:34 | ldlework | It sounds like the problem is how do you formulate a graph with distinct types |
23:42:45 | FromGitter | <mratsim> @Idlework yes |
23:42:52 | ldlework | If so, my link should help you (I also have an object variant version, but its less robust and clean) |
23:43:07 | ldlework | I recommend dispatch in this case |
23:43:18 | ldlework | you can highly refactor the implementation without case statements everywhere |
23:43:32 | ldlework | (IE have Nim's runtime do all that casing behind the scenes) |
23:43:39 | FromGitter | <Varriount> ldlework: I tried that. |
23:43:47 | FromGitter | <mratsim> @idlework, dispatch = method? |
23:43:49 | ldlework | tried what |
23:43:53 | ldlework | mratsim, yeah |
23:44:23 | FromGitter | <Varriount> ldlework, @mratsim : https://gist.github.com/Varriount/9e32806b5c9dbdfdea2b66ebc4e6b83f |
23:45:20 | ldlework | dunno what this is doing really |
23:45:22 | ldlework | was there a problem? |
23:45:41 | FromGitter | <Varriount> 'Cannot instantiate "call"` |
23:48:42 | FromGitter | <Varriount> Wait, now it appears to be working. |
23:49:00 | ldlework | lol |
23:49:10 | FromGitter | <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:14 | ldlework | Nim. |
23:49:44 | ldlework | that should be the byline on the website |
23:49:56 | ldlework | "Wait. Now it appears to compile." |
23:52:20 | FromGitter | <mratsim> I have cannot instantiate “call” @Varriount |
23:57:24 | FromGitter | <Varriount> @Araq Any idea why this wont work (updated): https://gist.github.com/Varriount/9e32806b5c9dbdfdea2b66ebc4e6b83f |