<< 15-03-2018 >>

00:06:34Araqfederico3: I don't understand. 'koch winrelease' is not a command for other projects to use
00:08:01*nuxdie quit (Quit: WeeChat 2.0.1)
00:08:20*nuxdie joined #nim
00:08:36*nuxdie quit (Client Quit)
00:11:48*smt joined #nim
00:12:11federico3Araq: I'm talking about the projects initialized by my project maker, not the Nim compiler. It could generate a config file for a windows installer generator, e.g. an .nsi file for NSIS
00:12:28*smt quit (Client Quit)
00:12:54*smt joined #nim
00:13:22Araqwell all I had in mind was appveyor as a CI service on windows
00:13:37Araqmaybe run 'nimble test' as the default
00:13:59Araqdidn't think of it as a package creation service
00:14:15Araqbut we can talk later, good night
00:14:55*nuxdie joined #nim
00:27:32*nuxdie quit (Read error: Connection reset by peer)
00:28:04*nuxdie joined #nim
00:30:39*nuxdie quit (Client Quit)
00:31:03*nuxdie joined #nim
00:34:19*nuxdie quit (Client Quit)
00:34:36*nuxdie joined #nim
00:35:43*nuxdie quit (Client Quit)
00:36:10*nuxdie joined #nim
00:37:36*nuxdie quit (Client Quit)
00:37:55*nuxdie joined #nim
00:39:08*nuxdie quit (Client Quit)
00:39:28*nuxdie joined #nim
00:53:24*ieatnerds joined #nim
01:29:34*nuxdie quit (Ping timeout: 246 seconds)
02:23:49*gangstacat quit (Ping timeout: 246 seconds)
02:25:44*gangstacat joined #nim
02:37:15*vlad1777d quit (Ping timeout: 276 seconds)
02:57:50*S1t1Schu joined #nim
03:01:51*S1tiSchu quit (Ping timeout: 268 seconds)
03:02:56*dddddd quit (Remote host closed the connection)
03:19:24*Tanger quit (Remote host closed the connection)
03:28:39*endragor joined #nim
03:57:47FromGitter<gogolxdong> How to compare arrays?
03:58:44FromGitter<gogolxdong> compare with these two MAC addresses DstMac = [0xB8u8, 0x2Au8, 0x72u8, 0xDBu8, 0xECu8, 0xE8u8] ⏎ SrcMac = [0x44u8, 0xa8u8, 0x42u8, 0x0eu8, 0xccu8, 0xa8u8]
04:00:55FromGitter<gogolxdong> array[6, byte] compare with these literals .
04:01:07FromGitter<Varriount> Does "==" not work?
04:57:23*vlad1777d joined #nim
05:02:03FromGitter<gogolxdong> @dom96,I think we can help to translate Nim in Action into chinese.
05:02:41*SenasOzys quit (Remote host closed the connection)
05:13:53*Tanger joined #nim
05:32:05FromGitter<gogolxdong> how to transform string to array?
05:56:31*arecacea1 quit (Remote host closed the connection)
05:56:53*arecacea1 joined #nim
06:09:09*nsf joined #nim
06:13:49Tangergogolxdong: https://nim-lang.org/docs/strutils.html#split,string,set[char],int <- Will convert to a sequence
06:14:30*jalbo joined #nim
06:14:57FromGitter<gogolxdong> a literal string like "hello"
06:19:32Tangergogolxdong: Like "hello".split(AllChars)?
06:19:50FromGitter<gogolxdong> mostly
06:22:35*r3d9u11 joined #nim
06:29:17Tangergogolxdong: Convert it to a sequence, then push the characters into another array?
06:30:23FromGitter<gogolxdong> It is a bit trivial though I can manage.
06:30:34*smt` joined #nim
06:34:33*smt quit (Ping timeout: 264 seconds)
06:41:41*jalbo2 joined #nim
06:41:42*jalbo quit (Read error: Connection reset by peer)
06:47:47*jalbo2 quit (Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org)
06:48:57*onionhammer joined #nim
06:51:45*onionhammer1 quit (Ping timeout: 248 seconds)
06:54:24*nuxdie joined #nim
06:55:02*nuxdie quit (Client Quit)
07:03:14*Vladar joined #nim
07:39:58*jaco60 joined #nim
07:48:05*JustASlacker joined #nim
07:49:05*xkapastel quit (Quit: Connection closed for inactivity)
08:04:52*gangstacat quit (Remote host closed the connection)
08:05:05*PMunch joined #nim
08:05:17*gangstacat joined #nim
08:27:55ieatnerdsanybody that can give me some quick help?
08:29:05PMunchSuree
08:29:34*floppydh joined #nim
08:29:46PMunchErr, I meant "Sure", didn't want to sound like an old timey cowboy :P
08:30:23ieatnerdsso im just trying to switch around a line, want to know if i did it right as i dont have any tests up yet
08:30:35ieatnerdsline.strip().split()[1].parseFloat()
08:31:17ieatnerdsI think it go like this "parseFloat(split(strip(line),,1))"
08:31:55ieatnerdsbut im not quite sure about the 1, cant find any good examples
08:32:17PMunchSplit returns a sequence, the 1 selects the second element in that sequence
08:32:44ieatnerdsokay, i was reading split and thought that was ho wmany times i was splitting for some reson
08:33:12PMunchSo let's say you have the string "hello 12.34" then it will split in two ["hello", "12.34"] select the string at index 1: "12.34" then calls parseFloat on that
08:33:32ieatnerdsright
08:33:51Tangerieatnerds, split has a maxsplit argument that you can pass in as well
08:33:57ieatnerdsits just 4:30 am here and im a bit tired, was reading it wrong
08:34:06PMunchIf you wanted that you could do line.strip().split(maxsplits = 1)[1].parseFloat()
08:34:22PMunchs/maxsplits/maxsplit
08:34:34ieatnerdsthank you both!
08:35:15PMunchAh, and it seems like you can't call split without something to split on
08:35:30PMunchSo you probably want either split(' ') or splitWhitespace
08:36:54ieatnerdsI'll have to check on that later, im actually working on my own implementation of a library and am just moving the old nim code over
08:37:33ieatnerdsthey just have the line.split(), which seemed to work at least for that lib
08:39:30PMunchYeah I think this has changed recently
08:40:11ieatnerdsalright, as soon as I get a test up I can make the change properly.
08:41:38*r3d9u11 quit (Remote host closed the connection)
08:42:00*yglukhov joined #nim
08:43:05*r3d9u11 joined #nim
08:43:51*yglukhov_ quit (Ping timeout: 276 seconds)
08:46:05FromGitter<mratsim> @Araq yes I’m adding travis appveyor template + readme generation to Nimbus launch today
08:46:17*sendell joined #nim
08:47:17*r3d9u11 quit (Remote host closed the connection)
08:47:47*dddddd joined #nim
08:48:24*r3d9u11 joined #nim
08:49:51TangerThere's a bunch of character sets that you can use for split as well https://nim-lang.org/docs/strutils.html#Whitespace
08:54:38FromGitter<mratsim> @dom96 yes nimbus-launch is a binary but I’m willing to provide a JS version to convert all the JS devs out there ;)
08:58:06PMunchnimbus-launch?
08:58:46FromGitter<mratsim> https://github.com/status-im/nimbus-launch
08:59:25FromGitter<mratsim> A helper to setup Nim repos at Status since they are being created at a rate of several per week
09:04:47Araqis that something that should be moved into 'nimble' eventually?
09:05:35euantorthere's been talk in the past about `nimble` generating a more opinionated directory structure like `nimbus-launch` seems to, but I can't remember what the conclusion was
09:09:30PMunchI feel like that would be a good idea. If it's going to whine about directory structure it should be able to just make it for me as well
09:10:23*Arrrr joined #nim
09:10:36euantorFound the issue: https://github.com/nim-lang/nimble/issues/413
09:11:05*niv quit (Quit: Ping timeout (120 seconds))
09:11:32*niv joined #nim
09:14:36FromGitter<mratsim> feel free to steal the code :P
09:32:23*rokups joined #nim
09:40:23*r3d9u11 quit (Read error: Connection reset by peer)
09:43:43FromGitter<mratsim> continuous integration templates added
09:56:07*r3d9u11 joined #nim
10:21:17*Arrrr quit (Quit: Leaving.)
10:26:06*SenasOzys joined #nim
10:33:33*edcragg joined #nim
10:41:16FromGitter<mratsim> @dom96 Twitch is waiting for you: https://www.reddit.com/r/programming/comments/84klns/video_making_a_snake_game_in_rust/
10:47:21Araqthat '$' for arrays was a bloody stupid idea. consistency my ass, now hash routines which return arrays get the wrong string representation out of the box instead of a typecheck error
11:04:08Araqoh well...
11:05:03FromGitter<mratsim> I don’t think it was stupid, I think using array[N, char] and array[N, uint8] to represent binary data is wrong
11:05:14FromGitter<mratsim> I’ve been dealing with that for the past week ...
11:05:39FromGitter<mratsim> See: https://github.com/jangko/nimSHA2/issues/2
11:06:21euantor^ +1
11:07:17FromGitter<mratsim> We have an open design issue at Status for the return type of hash functions and using seq[byte] instead of string because it’s semantically very different.
11:07:59FromGitter<mratsim> If that could be settled before 1.0 in the std lib that would be nice ;)
11:18:25*endragor_ joined #nim
11:18:25FromGitter<mratsim> I’ll put a RFC togther
11:20:17*ketralni` joined #nim
11:20:21*libman__ joined #nim
11:21:35*floppydh_ joined #nim
11:22:33*floppydh quit (Ping timeout: 264 seconds)
11:23:18*arecaceae joined #nim
11:24:27*kier_ joined #nim
11:24:36*askatasu1 joined #nim
11:24:37federico3Araq: https://github.com/nim-lang/nimble/issues/413
11:27:19*arecacea1 quit (*.net *.split)
11:27:19*vlad1777d quit (*.net *.split)
11:27:19*endragor quit (*.net *.split)
11:27:20*ketralnis quit (*.net *.split)
11:27:20*libman_ quit (*.net *.split)
11:27:20*kier quit (*.net *.split)
11:27:20*askatasuna quit (*.net *.split)
11:28:17federico3I'm happy to accept PRs to improve the project maker tool
11:28:21*pwntus_ joined #nim
11:29:00*awal quit (Ping timeout: 260 seconds)
11:29:00*Pwntus quit (Ping timeout: 260 seconds)
11:29:00*awal joined #nim
11:29:30*awal is now known as Guest86106
11:31:52*vlad1777d joined #nim
11:36:27Araq"array[N, uint8] to represent binary data is wrong" what? o.O
11:36:51Araqan array of byte is binary data. besides, if you use 'seq' instead, the $ for seqs is wrong too
11:38:40Araqbut you're right in this issue and it should probably be wrapped in an object
11:39:00Araqfor which we have a $ too, and it would be wrong...
11:39:54Araqmaybe echo shouldn't take a varargs[`$`] but a varargs[toEcho]
11:40:14Araqthe reason we have $ for everything is so that 'echo' can be used to echo it.
11:42:03Araqa 'distinct array' doesn't have an $
11:42:04Araq:-)
11:42:21*vlad1777d quit (Ping timeout: 265 seconds)
11:43:19PMunchdom96, I tried to symlink nim to nim0 as we talked about for choosenim/koch. It works fine. Maybe koch should try to use "nim" if no "nim0" is found?
11:43:59Araqkoch creates nim0. if it cannot find the file it created itself, it should use 'nim' instead
11:44:08Araq*should not
11:44:57dom96koch copies a 'nim' from path and places it in 'nim0'
11:44:59dom96that's the problem
11:45:27PMunchWhat? I ran "nim c -d:release koch", then "./koch boot -d:release" and it failed because it couldn't find nim0
11:45:35PMunchIn my toolchain path for choosenim
11:45:57dom96Does compiler/nim0.exe exist?
11:46:20PMunchWell, compiler/nim0 exists
11:46:31dom96yeah, it was copied from ~/.nimble/bin
11:46:38dom96and it's a proxy exe
11:47:05dom96so it searches for ~/.choosenim/toolchains/current-toolchain/bin/nim0.exe
11:47:07dom96which won't exist
11:48:15PMunchAaah
11:48:40PMunchWhy is .nimble/bin/nim a proxy exe and not a symlink?
11:48:55dom96because Windows doesn't support symlinks
11:49:15PMunchWait, really?
11:50:10dom96yeah
11:50:26PMunchhttps://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/
11:50:55PMunchWhat's the difference between a mklink /D and a ln -s link?
11:52:18PMunchOh wait, that's only a Windows 10+ feature?
12:06:07*DarkArctic joined #nim
12:09:16Yardanicotime to clean up our issues a bit again (to go under 1.2k)
12:21:13*Guest86106 is now known as awal
12:35:27FromGitter<mratsim> @Araq : https://github.com/nim-lang/Nim/issues/7337
12:40:13FromGitter<narimiran> @mratsim how is that stuff solved in other languages? can nim adopt that?
12:41:18FromGitter<mratsim> Python has a standard lib with all crypto stuff ;)
12:43:00FromGitter<mratsim> Not sure about the statically typed languages (because it’s all about the types here)
12:44:39*smt` is now known as smt
12:48:57PMunchHmm, maybe a new common operator (like $) that converts to seq[byte]?
12:51:51*Snircle joined #nim
12:56:48FromGitter<mratsim> C++17 added a distinct type called “byte” btw
13:14:42*qleda joined #nim
13:23:42*sz0 joined #nim
13:45:07FromGitter<narimiran> @mratsim yeah, python is dynamic, but python's stuff be checked simply by `type(ans)` to see what type is it and if it is the same one in all occasions
13:48:39*BitPuffin joined #nim
13:50:49*PMunch quit (Quit: Leaving)
13:50:56Araqinput type: openArray[byte]
13:51:26Araqoutput type: array[X, byte] where X depends on the concrete hashing algorithm
13:52:26*PMunch joined #nim
14:04:42*nuxdie joined #nim
14:07:40*nuxdie quit (Client Quit)
14:07:58*nuxdie joined #nim
14:11:56*nuxdie quit (Client Quit)
14:22:24*nuxdie joined #nim
14:22:40*nuxdie quit (Client Quit)
14:22:55FromGitter<mratsim> and now `$`(a: open array[byte]) = … ? The hex representation?
14:23:14*nuxdie joined #nim
14:23:54*SenasOzys quit (Ping timeout: 268 seconds)
14:30:26*nuxdie quit (Quit: WeeChat 1.4)
14:31:24*nuxdie joined #nim
14:31:34*SenasOzys joined #nim
14:39:08*nuxdie quit (Quit: WeeChat 1.4)
14:39:36*nuxdie joined #nim
14:42:38*nuxdie quit (Client Quit)
14:42:47*nuxdie joined #nim
14:42:56*nuxdie quit (Client Quit)
14:43:08*nuxdie joined #nim
14:58:13*nuxdie quit (Quit: WeeChat 1.4)
14:58:25*nuxdie joined #nim
15:20:45*JustASlacker quit (Ping timeout: 264 seconds)
15:22:24*r3d9u11 quit (Remote host closed the connection)
15:26:34*rinzai quit (Quit: Connection closed for inactivity)
15:28:53*sz0 quit (Quit: Connection closed for inactivity)
15:41:15*smt` joined #nim
15:44:02*PMunch quit (Quit: Leaving)
15:45:21*smt quit (Ping timeout: 264 seconds)
15:49:32*endragor_ quit (Remote host closed the connection)
15:51:40*endragor joined #nim
15:52:40*endragor_ joined #nim
15:56:14*endragor quit (Ping timeout: 260 seconds)
15:57:16*endragor_ quit (Ping timeout: 256 seconds)
16:03:54*r3d9u11 joined #nim
16:11:47Araqmratsim: there is no '$' proc for it
16:13:13FromGitter<mratsim> `$`(a: array[N, byte]) currently returns a string of number like [1, 10, 255].
16:14:05Araqyeah, output type should probably be a 'distinct array'
16:14:42Araqbut I'm replying on this RFC of yours
16:16:00federico3what is the reason for reimplementing crypto primitives in Nim?
16:25:46FromGitter<mratsim> libsodium doesn’t have the elliptic curve secp256k1 which is needed for Ethereum (and bitcoin) ⏎ OpenSSL license (all advertising must mention OpenSSL, and other stuff I have to document)
16:27:35FromGitter<mratsim> also the OpenSSL breakage one year ago: https://news.ycombinator.com/item?id=13284648
16:29:43FromGitter<mratsim> I’m taking a break and adding libsodium to the review just after @federico3, I feel like I’ve written kilometers of text today
16:30:26federico3libsodium is under ISC license. There is https://github.com/bitcoin-core/secp256k1 for that EC which seems relatively popular but I'm not familiar with it
16:31:31FromGitter<mratsim> https://github.com/status-im/nim-secp256k1 ;)
16:32:03*sendell quit (Remote host closed the connection)
16:33:19federico3https://github.com/nim-lang/nimble/issues/424 might be relevant to keep track of crypto libs
16:35:49Araqthe only problem with my proposal is that there is no way to get an openArray[byte] from a (pointer, length) pair
16:36:18Araqbut that is really needed anyway. probably yet another builtin for system.nim
16:36:31FromGitter<mratsim> we can have a overloaded hashBytes with ptr, length pair
16:36:52Araqyeah I know but that's meh :-)
16:37:17Araqeventually we also want to create an openArray from a slice
16:37:28Araqor make openarray nim's slice notion
16:37:48Araqwould be nice to sort this out before proceeding with the RFC
16:37:57FromGitter<mratsim> “Illegal capture youropenarray”, I met that so often when I started ;)
16:38:13Araqthat's a different problem
16:38:24Araqa much harder one.
16:38:59Araqbecause when I solve it by introducing a hidden copy you'd also complain :P
16:39:45FromGitter<mratsim> you bet :P
16:40:31Araqyou can only capture stuff that is on the heap. and an openArray is a hidden pointer, most likely on pointing to a stack frame.
16:40:48*DarkArctic quit (Remote host closed the connection)
16:41:09Araqthat is, if the closure escapes.
16:41:57FromGitter<mratsim> I know why it doesn’t work now. I was talking about the me one year ago, even before starting Arraymancer
16:42:33Araqwhether it does escape depends on your use cases. for async or UI development, it almost always escapes. for functional programming where you use map instead of 'for', it does not escape.
16:42:57Araqsolution: use 'mapIt' :-)
16:43:27*JustASlacker joined #nim
16:43:37Araqwell yeah, I can imagine you know that. but others hopefully read this too.
16:48:39*Trustable joined #nim
17:01:08*JustASlacker quit (Ping timeout: 268 seconds)
17:04:49*athenot quit (Remote host closed the connection)
17:05:23*athenot joined #nim
17:26:33*floppydh_ quit (Ping timeout: 240 seconds)
17:38:20*xkapastel joined #nim
17:39:23FromGitter<mratsim> I like the “Buffer” type idea of euantorino, it can them be customized for needs of graphics, crypto, networking, ….
17:56:14FromGitter<zacharycarter> the more I work with AWS / Terraform / Serverless framework / etc... the more I just hate it all :/
17:58:51*DarkArctic joined #nim
18:00:12shashlickis there much interest in having PCRE compiled in as a static binary on Windows rather than having a dependency on pcre32.dll? I'm thinking of making a lib but curious on demand
18:03:34*endragor joined #nim
18:10:19Yardanicoshashlick, I think it's better to contribute to https://github.com/nitely/nim-regex :)
18:25:37*SenasOzys quit (Ping timeout: 246 seconds)
18:28:12FromGitter<zacharycarter> aren't PEGs better than REGEXs anyway?
18:28:22FromGitter<zacharycarter> and doesn't Nim ship with a native PEGs implementation?
18:31:30*SenasOzys joined #nim
18:35:20*PMunch joined #nim
18:41:53shashlickwell, what about software already using regex, why move to pegs, also why reimplement regex engines
18:43:34Yardanicoshashlick, so you don't need to ship pcre library for macos/windows, and IDK what you will do about JS ;)
18:44:24*endragor quit (Remote host closed the connection)
18:56:34*nsf quit (Quit: WeeChat 2.0.1)
18:58:39FromGitter<zacharycarter> Just stumbled across - https://learning-rust.github.io/
19:00:50Yardanicohuh, I probably found a bug in nim's JS backend
19:01:17Yardanicoin compiled JS for simple nim-regex example there's some makeNimstrLit(null) calls, but makeNimstrLit doesn't handle null
19:01:38Yardanico(it works if I manually change makeNimstrLit though). I'll try to make a small example
19:09:12shashlickYardanico: i'd agree for smaller libraries but for established implementations, i think it is a waste of talent, plus JS already has a native regex implementation, you just need to make a consistent API
19:11:35*btbytes joined #nim
19:12:18*btbytes quit (Client Quit)
19:40:19*r3d9u11 quit (Remote host closed the connection)
19:40:57PMunchMan, when used to working with regular Nim macros the compiler is so confusing to look at :P
19:41:59PMunchI can see it doing the same kind of stuff (creating nodes, building trees) but it's just dissimilar enough that I feel I have to learn it over again :P
19:42:35*athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:43:19FromGitter<zacharycarter> the thing is - if you're relying on an external library for any functionality - you either need to ship that dependency with your solution or as a prerequisite install the third-party dependency
19:43:23FromGitter<zacharycarter> if it's a native Nim module - you avoid all of that
19:43:45*athenot joined #nim
19:43:47FromGitter<zacharycarter> and if you think this isn't a big deal - just wait until you're trying to release your project for different OS's and you have to start cross compiling all the third party libs for each target cpu / os
19:44:07FromGitter<zacharycarter> shashlick^
19:50:00shashlicki agree with that but I'd rather work on solving that problem than reimplementing libs
19:50:12FromGitter<mratsim> We’re dealing with that at Status, basically we’re git submoduling/copy-pasting the whole library code: https://github.com/status-im/nim-ttmath/tree/master/src/headers and https://github.com/status-im/nim-secp256k1/tree/master/secp256k1_wrapper
19:51:03FromGitter<mratsim> During the first month, every newcomer at issue building one package or the other on Windows, mac, cmak problems ...
19:51:11FromGitter<mratsim> had issues*
19:51:32shashlick@mratsim that's what I'm trying to improve with nimgen
19:52:17shashlicksee some of the wrapper libs i've posted
19:52:26shashlicki'm debating whether nimgen should get smarter about cmake, make, etc. and handle that on your behalf
19:52:40shashlickso it will just be nimble install xyz and the prep happens behind the scenes
19:52:52FromGitter<mratsim> I’ve used nimgen myself ;) :https://github.com/numforge/nim-clblast
19:53:26FromGitter<zacharycarter> IMO - the best tool I've found for handling this problem is honestly Docker
19:54:10FromGitter<zacharycarter> with Docker - you can avoid users having to install cross compilation tool chains on their local machine - you just dockerize everything and mount a virtual file system and then once the libs you need are compiled in the docker image, copy them back to your machine.
19:54:14FromGitter<mratsim> but for the first case, Nim doesn’t have a proper way to handle header-only libraries (try it, first issue you will get is that the header must be copied into nimcache OR you have to write a .c empty file that just include the header OR you “emit” the header)
19:54:32FromGitter<zacharycarter> couldn't you just emit some c/c++ code including the header?
19:55:28shashlick@mratsim - that's cool! I'll post that on the nimgen page, cool to see adoption :D
19:55:38shashlick@mratsim: how about nimfuzz which is a header only nimgen lib
19:55:40FromGitter<mratsim> yes you can, with slurp/staticRead you can probably git submodule the repo you’re wrapping
19:55:49shashlickhttps://github.com/genotrance/nimfuzz
19:56:17FromGitter<mratsim> interesting
19:57:04shashlickor even the nim --cincludes flag, you can point to a dir during compilation
19:57:26FromGitter<zacharycarter> but just including the header won't do anything
19:57:29FromGitter<zacharycarter> you need some code referencing it
19:57:47FromGitter<zacharycarter> so in other words - you're going to need to include it in C or C++ code
19:59:04shashlicki think you mean something like nimfuzz but i'm not 100% sure, guess i need an example
19:59:06*athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:59:09FromGitter<mratsim> btw @shashlick, not having the actual nim wrapper code on Github, makes it harder to check the datastructure or parameters expected by a proc. For nim-clblast I copy pasted in a folder called “generated” so that it is apparent. I had trouble today to check nimssl for instance.
20:01:11FromGitter<mratsim> So feature request: “Allow to choose where to put the generated nim code + bindings"
20:01:14shashlickthat's fair - what i think needs to happen is that each wrapped lib has a bunch of nim methods that abstract the underlying API, make the C interop seamless
20:01:51shashlickcause just giving a C API isn't really very helpful to regular users, i know i struggle with the data types expected and the casting and other challenges
20:02:35FromGitter<mratsim> Yes but for example for nim-clblast it’s really meant as a very low-level library and the high level abstraction will be given by Arraymancer and Neo.
20:02:54shashlickI was just thinking about that last night when you posted the RFC
20:03:23FromGitter<mratsim> And others in other fields (biology, physics, …) might also need their own high level abstractions (finite element, lattice stuff …)
20:03:31shashlickbut won't looking at the C code in the parent repo show you those APIs?
20:04:30*athenot joined #nim
20:04:30*athenot quit (Remote host closed the connection)
20:04:41FromGitter<mratsim> I’d rather look at Nim code ;)
20:04:41shashlickI see the general challenge though, guess having a cached copy isn't too much to ask
20:04:53shashlicki've been putting in some test cases to document but it could be better
20:05:12*athenot joined #nim
20:05:24shashlickdid you see the tests folder for nimssl? i'll admit it's not been that elaborate for the other nimgen libs
20:05:47FromGitter<mratsim> yes that’s what I referenced in the RFC
20:05:50*athenot quit (Remote host closed the connection)
20:06:28*athenot joined #nim
20:08:07*athenot quit (Remote host closed the connection)
20:08:19shashlicksomething to think about surely, let me write up an issue
20:08:57*athenot joined #nim
20:12:13*adeohluwa joined #nim
20:13:47shashlickback to the original point though - I'm open to improving nimgen to make it easier to solve the cross-platform wrapper issues you mentioned
20:14:29shashlickbut i'm open to inputs and appreciate it might not work for every use case
20:15:21shashlickmy primary motivation is to reduce complaints about missing libs
20:21:06*nsf joined #nim
20:21:35FromGitter<zacharycarter> again - I don't think it's an easily solved problem shashlick
20:24:36FromGitter<zacharycarter> cross compilation between different host / target CPUs and OSs requires cross-compile toolchains
20:25:05FromGitter<zacharycarter> so you're automatically inferring that your end user will have these toolchains available to cross compile your project / dependencies to another target OS / CPU
20:32:54shashlickare you saying building a linux binary from nim source without having a linux host?
20:33:24shashlickcan you do that with pure nim modules today? say I build my app for ubuntu on my windows machine
20:34:02ieatnerdshttps://nim-lang.org/docs/nimc.html#cross-compilation
20:41:56FromGitter<mratsim> @shashlick: thanks, I guess my main need is choosing the location of the autogenerated bindings + wrapped lib clone. ⏎ ⏎ Second may add some examples classified with ⏎ ⏎ 1) single header C dynamic library ... [https://gitter.im/nim-lang/Nim?at=5aaada937685a046389cacc3]
20:42:03FromGitter<mratsim> maybe*
20:42:34FromGitter<mratsim> 1) wrapping a static library
20:42:38FromGitter<mratsim> 4
20:43:22*smt joined #nim
20:45:16FromGitter<zacharycarter> shashlick - yes that's what I'm getting at
20:45:22FromGitter<zacharycarter> and yes you can - that's why I was mentioning docker earlier
20:47:07*smt` quit (Ping timeout: 252 seconds)
20:53:54*pvn left #nim (#nim)
21:01:04*Jesin joined #nim
21:02:15shashlick@mratsim I've categorised some of them on the nimgen page, but not to that detail
21:03:49shashlick@zacharycarter that's a tall order 🙂
21:04:12shashlickIsn't docker really just one OS
21:06:33*yglukhov quit (Remote host closed the connection)
21:07:06*yglukhov joined #nim
21:07:07FromGitter<zacharycarter> no - docker can install whatever OS you want on an image
21:07:26FromGitter<zacharycarter> shashlick: I have to go home from work right now - but when I get home I'll post some example stuff I did with docker for FRAG
21:07:30FromGitter<mratsim> you can add nim-clblast as a library that links to a dynamic lib
21:07:33FromGitter<zacharycarter> might be somewhat enlightening maybe
21:08:32PMunchIs there anything like dumpTreeRepr in the compiler?
21:08:35PMunchFor debugging
21:10:05*rokups quit (Quit: Connection closed for inactivity)
21:10:15*yglukhov quit (Read error: Connection reset by peer)
21:10:28*yglukhov joined #nim
21:11:51shashlick@mratsim that's like nimbass, will do
21:12:28*qleda quit (Ping timeout: 240 seconds)
21:12:38shashlick@zacharycarter sounds good, I'll take a look. Guess we can't do much for cross compiling but for most common use cases, wrapping should do
21:14:37*yglukhov quit (Client Quit)
21:16:00*yglukhov joined #nim
21:27:52*Trustable quit (Remote host closed the connection)
21:36:46GitDisc<cavariux> Hi, anyone of you know if tuples are store in memory packed? like arrays?
21:38:15PMunchI think so
21:38:22PMunchDon't quote me on that though
21:38:35PMunchWhy do you ask?
21:39:06GitDisc<cavariux> Because I'm making some vectors to interact with opengl but they need to be packed, but don't want to use arrays because they make ugly syntax haha
21:39:12GitDisc<cavariux> thanky you btw will try
21:39:42PMunchAaah, that makes sense
21:39:51PMunchYou could always take a look at the actual C output
21:40:26GitDisc<cavariux> ohh, that's a good idea will test it out ty
21:40:32*Vladar quit (Quit: Leaving)
21:41:43PMunchJust checked and they appear to be converted to just a regular struct
21:42:22PMunchSo if you declare a tuple[hello: int, world: int] it would be converted to a C struct with two int fields
21:43:36GitDisc<cavariux> hmmm it looks like so
21:43:57*Jesin quit (Quit: Leaving)
21:44:45GitDisc<cavariux> will see if opengl complains, if so I will have to make a lot of templates
21:44:55GitDisc<cavariux> well, thank you for the help @PMunch
21:45:00PMunchNo problem
21:45:21PMunchWorking with Nim and C code is always a bit wonky, but once you get it working it's pretty neat
21:46:28GitDisc<cavariux> Yes haha, I'm makin some bindings for graphics related stuff but I can't import glm and can't use Neo because it has to be working with memory alignment.
21:46:35GitDisc<cavariux> So I have to make my own
21:53:32*yglukhov quit (Remote host closed the connection)
21:54:05*yglukhov joined #nim
21:56:07*nsf quit (Quit: WeeChat 2.0.1)
21:57:03*PMunch quit (Quit: leaving)
21:58:29*yglukhov quit (Ping timeout: 260 seconds)
21:58:54*rbrt joined #nim
22:17:41*noonien joined #nim
22:23:14FromGitter<zacharycarter> cavariux: opengl and Nim is tricky
22:23:49FromGitter<zacharycarter> when it comes to data structures anyway
22:24:18FromGitter<zacharycarter> I've never quite gotten packed values to work correctly - why do you need these to be packed?
22:24:46FromGitter<zacharycarter> I'm sure there's a way but you have to imagine that alignment and all that comes into play and will get tricky
22:24:56FromGitter<zacharycarter> why not just pass structs to OpenGL?
22:25:22FromGitter<zacharycarter> in my experience - this is the easier and more straightforward route to take
22:25:34FromGitter<zacharycarter> @krux02 can probably weigh in on this
22:26:57FromGitter<zacharycarter> also - why can't you use glm?
22:27:58FromGitter<zacharycarter> and can you also tell me a bit about what you're working on? :)
22:32:08FromGitter<mratsim> or use `type MyAwesomeType {.packed.} = object`
22:37:17FromGitter<zacharycarter> I remember trying that - at least I think
22:38:40FromGitter<zacharycarter> @Varriount - can you share w/ me what you already did w/ Nim and boto? If not - no worries, but I'm either going to start where you left off or study rust code
22:39:09FromGitter<zacharycarter> or go off your guidance on where to get started (if you can't share the code w/ me that is)
22:40:36FromGitter<zacharycarter> kubernetes is awesome - I'm just going to use it instead of the terraform / serverless framework crap I was writing earlier today
22:41:03ieatnerdscan I get your guy;s quick opinion?
22:41:33FromGitter<zacharycarter> on what?
22:42:06ieatnerdssay I'm working with /proc/ would you rather all cpu information be together in one module, or would it be fine to say, ust have all of proc/stat in one module, all of proc/cpuinfo in another?
22:42:39ieatnerdsI think the former would be better, probably easier for me to maintain too
22:43:05FromGitter<zacharycarter> are you talking about this being in the stdlib?
22:43:56FromGitter<zacharycarter> I mean modularity exists for a reason - if they can be broken down into modules under the same namespace, and it makes sense to do so, then I'd do it.
22:44:33ieatnerdsI'm working on my own kind of psutil and just trying to figure out where I went to break thing apart at.
22:44:42FromGitter<zacharycarter> gotcha
22:44:49FromGitter<zacharycarter> I mean it's always easier to put everything into a single source file
22:44:56FromGitter<zacharycarter> but probably not advisable
22:46:39ieatnerdsRight, I already know it'll be a pain to have a single 1500 or more source file, and breaking it down would be nice. Only problem was seeing at which point it makes sense to break it up, since there are so many different ways I could do it.
22:49:32FromGitter<zacharycarter> maybe start writing it all inside one module - then if you find a logical break and figure out some code you can reuse or split off, do it
22:49:51ieatnerdsSound plan. Thank you!
22:52:30*rbrt quit (Quit: Oíche mhaith)
23:12:01*vlad1777d joined #nim
23:18:08*yglukhov joined #nim
23:18:32GitDisc<cavariux> @zacharycarter sorry to be late, I'm working on some bindings https://github.com/cavariux/nimgl still pretty experimental. And I can't use glm because I want to use only C stuff
23:19:09GitDisc<cavariux> and I need them to be packed to only send the pointer of the first value and opengl can read it
23:22:27*yglukhov quit (Ping timeout: 240 seconds)
23:22:34FromGitter<zacharycarter> cavariux: there's a pure Nim glm library
23:23:20FromGitter<zacharycarter> also regarding them needing to be packed - you can send a whole struct representing a vertex / color / whatever to opengl with Nim, and you don't need to pack the data
23:23:28FromGitter<zacharycarter> if you want - I can share plenty of example code
23:23:58GitDisc<cavariux> oh, if you don't mind I would love it
23:24:24FromGitter<zacharycarter> first of all - here's the pure Nim glm library - https://github.com/stavenko/nim-glm
23:26:45GitDisc<cavariux> damn, it's pretty complete and in pure nim hmm
23:27:30GitDisc<cavariux> would it be bad that I make my implementation?
23:28:55FromGitter<zacharycarter> I'd just use glm
23:28:59FromGitter<zacharycarter> the nim glm I mean
23:29:32FromGitter<zacharycarter> I used it for - https://github.com/zacharycarter/zengine
23:30:15FromGitter<zacharycarter> also did you see - https://github.com/jackmott/easygl ?
23:30:18GitDisc<cavariux> hahaha I would never imagine I was talking to you, nice engine btw I saw it but didn't know who made it
23:30:29FromGitter<zacharycarter> oh - thank you!
23:31:06FromGitter<zacharycarter> yeah - I'm currently re-writing https://github.com/fragworks/frag - I haven't really started... but I know I want to ship an editor with whatever I write this time - so that's paramount
23:32:25GitDisc<cavariux> yeah I did see easygl but my objective with nimgl is to aproach as much as I can to a combination of nim with c, with a lot of bindings my inspiration is lwjgl and to be honest also to learn
23:34:14FromGitter<zacharycarter> gotcha
23:34:14GitDisc<cavariux> I also saw the glfw port, but they made an abstraction on top of the wrapper which I didn't completly liked
23:34:15FromGitter<zacharycarter> I'm honestly using SFML currently - I'm not sure how that's going to play out with WASM
23:34:15FromGitter<zacharycarter> just the windowing stuff
23:34:55GitDisc<cavariux> with wasm you refer to webassembly?
23:34:58FromGitter<zacharycarter> but the windowing library isn't a big deal - I'd probably stick to SDL2 / GLFW3 / SFML unless you want to write the windowing code yourself - which is totally possible, just not trivial.
23:35:05FromGitter<zacharycarter> yup
23:35:30*jaco60 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:35:31FromGitter<zacharycarter> there's also - https://github.com/yglukhov/nimx
23:35:48GitDisc<cavariux> yes, the window making is not that difficult it's just write a lot of code that makes the same tbh and adapt it to the different platforms
23:35:58FromGitter<zacharycarter> yeah
23:36:28GitDisc<cavariux> I was also thinking of making my own opengl library loader in pure nim but, too much work for something that has already been made
23:36:35GitDisc<cavariux> or what do you think, would it be useful?
23:37:10FromGitter<zacharycarter> actually @krux02 and someone else recently was showing how you could load gl extensions rather easily with Nim and GLEW rather than using the opengl Nim stuff
23:37:42FromGitter<zacharycarter> I'm not too concerned with it as I'm planning to use BGFX - but it looks pretty simple - let me see if I can find the IRC log
23:38:47GitDisc<cavariux> oh yeah, I'm making the bindings for glew so it could be useful thanks
23:39:00FromGitter<zacharycarter> damnit... I don't know how to search IRC logs anymore for Nim
23:39:02FromGitter<zacharycarter> help anyone?
23:39:23GitDisc<cavariux> I have never used bgfx but have read about it, is it good?
23:39:59FromGitter<zacharycarter> define good haha
23:40:09FromGitter<zacharycarter> I guess it depends on your use case / goal
23:40:14GitDisc<cavariux> haha would it save you more work than it makes you do?
23:40:42FromGitter<zacharycarter> well certainly yes - but right tool for the job and all that you know
23:40:54FromGitter<zacharycarter> so if your goal is just to write a simple opengl app - it's probably overkill
23:41:24FromGitter<zacharycarter> if your goal is cross platform portability and supporting as many graphics apis as possible - then it's probably right up your alley
23:41:48GitDisc<cavariux> hmm good point
23:41:59GitDisc<cavariux> I also saw you are rendering text in your engine, what are you using?
23:42:05FromGitter<zacharycarter> which engine?
23:42:14GitDisc<cavariux> zengine
23:42:51GitDisc<cavariux> and also frag, or are you doing it in different styles?
23:44:04*BitPuffin quit (Remote host closed the connection)
23:44:07FromGitter<zacharycarter> I'm trying to remember what I did with frag - there's quite a few ways to render fonts with OpenGL
23:44:57FromGitter<zacharycarter> you can do bitmap font rendering or use freetype fonts
23:45:16FromGitter<zacharycarter> you can do SDF font rendering
23:45:47FromGitter<zacharycarter> really depends on what your objective is
23:46:15GitDisc<cavariux> I would like to make some bindings for a font library but still don't know which
23:46:34GitDisc<cavariux> freetype looks good but I don't like it's license
23:47:05FromGitter<zacharycarter> bitmap font rendering is super simple and you won't need a license for it
23:47:31FromGitter<zacharycarter> same with SDF rendering
23:48:41GitDisc<cavariux> hmm will look into both and how they work thanks btw
23:48:51FromGitter<zacharycarter> np
23:48:52GitDisc<cavariux> will go grab something to eat but thank you for everything
23:49:13GitDisc<cavariux> do you think it's useful I'm doing all this bindings?
23:49:14FromGitter<zacharycarter> sure thing! - feel free to ping me if you need help with anything / have any questions
23:49:33FromGitter<zacharycarter> I think writing native Nim code to replace the bindings would be more beneficial :)
23:49:51FromGitter<zacharycarter> and definitely make sure bindings for what you're planning to wrap, don't already exist
23:50:31FromGitter<zacharycarter> also - you can already do a lot with Nim and its current ecosystem when it comes to gamedev
23:50:42FromGitter<zacharycarter> I don't think you should need to wrap much
23:51:09FromGitter<zacharycarter> if you really want a challenge I can give you some libraries that would be really sweet to have bindings to, that we currently lack
23:51:18FromGitter<zacharycarter> as far as gamedev goes
23:51:22GitDisc<cavariux> yeah that's true, will try to make it more like lwjgl to make more pure nim code instead of bindings
23:51:38GitDisc<cavariux> if you could I would love to make useful bindings
23:52:20GitDisc<cavariux> gtg to eat but if you don't mind send them and I will check the logs when I come back
23:52:23GitDisc<cavariux> thank you for all
23:53:36*yglukhov joined #nim
23:54:49FromGitter<zacharycarter> bullet3 - no bindings to that ⏎ ImgUI / ImgUI-Gizmo ⏎ and of course... Qt haha - that one is really challenging, and if you can swing it - you'll be a Nim demi-god I imagine
23:55:31FromGitter<zacharycarter> and there's always the opportunity to find an interesting library written in one language, and port it to another
23:58:33*yglukhov quit (Ping timeout: 264 seconds)