00:06:34 | Araq | federico3: 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:11 | federico3 | Araq: 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:22 | Araq | well all I had in mind was appveyor as a CI service on windows |
00:13:37 | Araq | maybe run 'nimble test' as the default |
00:13:59 | Araq | didn't think of it as a package creation service |
00:14:15 | Araq | but 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:47 | FromGitter | <gogolxdong> How to compare arrays? |
03:58:44 | FromGitter | <gogolxdong> compare with these two MAC addresses DstMac = [0xB8u8, 0x2Au8, 0x72u8, 0xDBu8, 0xECu8, 0xE8u8] ⏎ SrcMac = [0x44u8, 0xa8u8, 0x42u8, 0x0eu8, 0xccu8, 0xa8u8] |
04:00:55 | FromGitter | <gogolxdong> array[6, byte] compare with these literals . |
04:01:07 | FromGitter | <Varriount> Does "==" not work? |
04:57:23 | * | vlad1777d joined #nim |
05:02:03 | FromGitter | <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:05 | FromGitter | <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:49 | Tanger | gogolxdong: 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:57 | FromGitter | <gogolxdong> a literal string like "hello" |
06:19:32 | Tanger | gogolxdong: Like "hello".split(AllChars)? |
06:19:50 | FromGitter | <gogolxdong> mostly |
06:22:35 | * | r3d9u11 joined #nim |
06:29:17 | Tanger | gogolxdong: Convert it to a sequence, then push the characters into another array? |
06:30:23 | FromGitter | <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:55 | ieatnerds | anybody that can give me some quick help? |
08:29:05 | PMunch | Suree |
08:29:34 | * | floppydh joined #nim |
08:29:46 | PMunch | Err, I meant "Sure", didn't want to sound like an old timey cowboy :P |
08:30:23 | ieatnerds | so 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:35 | ieatnerds | line.strip().split()[1].parseFloat() |
08:31:17 | ieatnerds | I think it go like this "parseFloat(split(strip(line),,1))" |
08:31:55 | ieatnerds | but im not quite sure about the 1, cant find any good examples |
08:32:17 | PMunch | Split returns a sequence, the 1 selects the second element in that sequence |
08:32:44 | ieatnerds | okay, i was reading split and thought that was ho wmany times i was splitting for some reson |
08:33:12 | PMunch | So 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:32 | ieatnerds | right |
08:33:51 | Tanger | ieatnerds, split has a maxsplit argument that you can pass in as well |
08:33:57 | ieatnerds | its just 4:30 am here and im a bit tired, was reading it wrong |
08:34:06 | PMunch | If you wanted that you could do line.strip().split(maxsplits = 1)[1].parseFloat() |
08:34:22 | PMunch | s/maxsplits/maxsplit |
08:34:34 | ieatnerds | thank you both! |
08:35:15 | PMunch | Ah, and it seems like you can't call split without something to split on |
08:35:30 | PMunch | So you probably want either split(' ') or splitWhitespace |
08:36:54 | ieatnerds | I'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:33 | ieatnerds | they just have the line.split(), which seemed to work at least for that lib |
08:39:30 | PMunch | Yeah I think this has changed recently |
08:40:11 | ieatnerds | alright, 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:05 | FromGitter | <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:51 | Tanger | There's a bunch of character sets that you can use for split as well https://nim-lang.org/docs/strutils.html#Whitespace |
08:54:38 | FromGitter | <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:06 | PMunch | nimbus-launch? |
08:58:46 | FromGitter | <mratsim> https://github.com/status-im/nimbus-launch |
08:59:25 | FromGitter | <mratsim> A helper to setup Nim repos at Status since they are being created at a rate of several per week |
09:04:47 | Araq | is that something that should be moved into 'nimble' eventually? |
09:05:35 | euantor | there'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:30 | PMunch | I 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:36 | euantor | Found 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:36 | FromGitter | <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:43 | FromGitter | <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:16 | FromGitter | <mratsim> @dom96 Twitch is waiting for you: https://www.reddit.com/r/programming/comments/84klns/video_making_a_snake_game_in_rust/ |
10:47:21 | Araq | that '$' 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:08 | Araq | oh well... |
11:05:03 | FromGitter | <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:14 | FromGitter | <mratsim> I’ve been dealing with that for the past week ... |
11:05:39 | FromGitter | <mratsim> See: https://github.com/jangko/nimSHA2/issues/2 |
11:06:21 | euantor | ^ +1 |
11:07:17 | FromGitter | <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:59 | FromGitter | <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:25 | FromGitter | <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:37 | federico3 | Araq: 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:17 | federico3 | I'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:27 | Araq | "array[N, uint8] to represent binary data is wrong" what? o.O |
11:36:51 | Araq | an array of byte is binary data. besides, if you use 'seq' instead, the $ for seqs is wrong too |
11:38:40 | Araq | but you're right in this issue and it should probably be wrapped in an object |
11:39:00 | Araq | for which we have a $ too, and it would be wrong... |
11:39:54 | Araq | maybe echo shouldn't take a varargs[`$`] but a varargs[toEcho] |
11:40:14 | Araq | the reason we have $ for everything is so that 'echo' can be used to echo it. |
11:42:03 | Araq | a 'distinct array' doesn't have an $ |
11:42:04 | Araq | :-) |
11:42:21 | * | vlad1777d quit (Ping timeout: 265 seconds) |
11:43:19 | PMunch | dom96, 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:59 | Araq | koch creates nim0. if it cannot find the file it created itself, it should use 'nim' instead |
11:44:08 | Araq | *should not |
11:44:57 | dom96 | koch copies a 'nim' from path and places it in 'nim0' |
11:44:59 | dom96 | that's the problem |
11:45:27 | PMunch | What? I ran "nim c -d:release koch", then "./koch boot -d:release" and it failed because it couldn't find nim0 |
11:45:35 | PMunch | In my toolchain path for choosenim |
11:45:57 | dom96 | Does compiler/nim0.exe exist? |
11:46:20 | PMunch | Well, compiler/nim0 exists |
11:46:31 | dom96 | yeah, it was copied from ~/.nimble/bin |
11:46:38 | dom96 | and it's a proxy exe |
11:47:05 | dom96 | so it searches for ~/.choosenim/toolchains/current-toolchain/bin/nim0.exe |
11:47:07 | dom96 | which won't exist |
11:48:15 | PMunch | Aaah |
11:48:40 | PMunch | Why is .nimble/bin/nim a proxy exe and not a symlink? |
11:48:55 | dom96 | because Windows doesn't support symlinks |
11:49:15 | PMunch | Wait, really? |
11:50:10 | dom96 | yeah |
11:50:26 | PMunch | https://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/ |
11:50:55 | PMunch | What's the difference between a mklink /D and a ln -s link? |
11:52:18 | PMunch | Oh wait, that's only a Windows 10+ feature? |
12:06:07 | * | DarkArctic joined #nim |
12:09:16 | Yardanico | time to clean up our issues a bit again (to go under 1.2k) |
12:21:13 | * | Guest86106 is now known as awal |
12:35:27 | FromGitter | <mratsim> @Araq : https://github.com/nim-lang/Nim/issues/7337 |
12:40:13 | FromGitter | <narimiran> @mratsim how is that stuff solved in other languages? can nim adopt that? |
12:41:18 | FromGitter | <mratsim> Python has a standard lib with all crypto stuff ;) |
12:43:00 | FromGitter | <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:57 | PMunch | Hmm, maybe a new common operator (like $) that converts to seq[byte]? |
12:51:51 | * | Snircle joined #nim |
12:56:48 | FromGitter | <mratsim> C++17 added a distinct type called “byte” btw |
13:14:42 | * | qleda joined #nim |
13:23:42 | * | sz0 joined #nim |
13:45:07 | FromGitter | <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:56 | Araq | input type: openArray[byte] |
13:51:26 | Araq | output 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:55 | FromGitter | <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:47 | Araq | mratsim: there is no '$' proc for it |
16:13:13 | FromGitter | <mratsim> `$`(a: array[N, byte]) currently returns a string of number like [1, 10, 255]. |
16:14:05 | Araq | yeah, output type should probably be a 'distinct array' |
16:14:42 | Araq | but I'm replying on this RFC of yours |
16:16:00 | federico3 | what is the reason for reimplementing crypto primitives in Nim? |
16:25:46 | FromGitter | <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:35 | FromGitter | <mratsim> also the OpenSSL breakage one year ago: https://news.ycombinator.com/item?id=13284648 |
16:29:43 | FromGitter | <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:26 | federico3 | libsodium 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:31 | FromGitter | <mratsim> https://github.com/status-im/nim-secp256k1 ;) |
16:32:03 | * | sendell quit (Remote host closed the connection) |
16:33:19 | federico3 | https://github.com/nim-lang/nimble/issues/424 might be relevant to keep track of crypto libs |
16:35:49 | Araq | the only problem with my proposal is that there is no way to get an openArray[byte] from a (pointer, length) pair |
16:36:18 | Araq | but that is really needed anyway. probably yet another builtin for system.nim |
16:36:31 | FromGitter | <mratsim> we can have a overloaded hashBytes with ptr, length pair |
16:36:52 | Araq | yeah I know but that's meh :-) |
16:37:17 | Araq | eventually we also want to create an openArray from a slice |
16:37:28 | Araq | or make openarray nim's slice notion |
16:37:48 | Araq | would be nice to sort this out before proceeding with the RFC |
16:37:57 | FromGitter | <mratsim> “Illegal capture youropenarray”, I met that so often when I started ;) |
16:38:13 | Araq | that's a different problem |
16:38:24 | Araq | a much harder one. |
16:38:59 | Araq | because when I solve it by introducing a hidden copy you'd also complain :P |
16:39:45 | FromGitter | <mratsim> you bet :P |
16:40:31 | Araq | you 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:09 | Araq | that is, if the closure escapes. |
16:41:57 | FromGitter | <mratsim> I know why it doesn’t work now. I was talking about the me one year ago, even before starting Arraymancer |
16:42:33 | Araq | whether 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:57 | Araq | solution: use 'mapIt' :-) |
16:43:27 | * | JustASlacker joined #nim |
16:43:37 | Araq | well 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:23 | FromGitter | <mratsim> I like the “Buffer” type idea of euantorino, it can them be customized for needs of graphics, crypto, networking, …. |
17:56:14 | FromGitter | <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:12 | shashlick | is 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:19 | Yardanico | shashlick, 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:12 | FromGitter | <zacharycarter> aren't PEGs better than REGEXs anyway? |
18:28:22 | FromGitter | <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:53 | shashlick | well, what about software already using regex, why move to pegs, also why reimplement regex engines |
18:43:34 | Yardanico | shashlick, 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:39 | FromGitter | <zacharycarter> Just stumbled across - https://learning-rust.github.io/ |
19:00:50 | Yardanico | huh, I probably found a bug in nim's JS backend |
19:01:17 | Yardanico | in compiled JS for simple nim-regex example there's some makeNimstrLit(null) calls, but makeNimstrLit doesn't handle null |
19:01:38 | Yardanico | (it works if I manually change makeNimstrLit though). I'll try to make a small example |
19:09:12 | shashlick | Yardanico: 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:57 | PMunch | Man, when used to working with regular Nim macros the compiler is so confusing to look at :P |
19:41:59 | PMunch | I 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:19 | FromGitter | <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:23 | FromGitter | <zacharycarter> if it's a native Nim module - you avoid all of that |
19:43:45 | * | athenot joined #nim |
19:43:47 | FromGitter | <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:07 | FromGitter | <zacharycarter> shashlick^ |
19:50:00 | shashlick | i agree with that but I'd rather work on solving that problem than reimplementing libs |
19:50:12 | FromGitter | <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:03 | FromGitter | <mratsim> During the first month, every newcomer at issue building one package or the other on Windows, mac, cmak problems ... |
19:51:11 | FromGitter | <mratsim> had issues* |
19:51:32 | shashlick | @mratsim that's what I'm trying to improve with nimgen |
19:52:17 | shashlick | see some of the wrapper libs i've posted |
19:52:26 | shashlick | i'm debating whether nimgen should get smarter about cmake, make, etc. and handle that on your behalf |
19:52:40 | shashlick | so it will just be nimble install xyz and the prep happens behind the scenes |
19:52:52 | FromGitter | <mratsim> I’ve used nimgen myself ;) :https://github.com/numforge/nim-clblast |
19:53:26 | FromGitter | <zacharycarter> IMO - the best tool I've found for handling this problem is honestly Docker |
19:54:10 | FromGitter | <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:14 | FromGitter | <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:32 | FromGitter | <zacharycarter> couldn't you just emit some c/c++ code including the header? |
19:55:28 | shashlick | @mratsim - that's cool! I'll post that on the nimgen page, cool to see adoption :D |
19:55:38 | shashlick | @mratsim: how about nimfuzz which is a header only nimgen lib |
19:55:40 | FromGitter | <mratsim> yes you can, with slurp/staticRead you can probably git submodule the repo you’re wrapping |
19:55:49 | shashlick | https://github.com/genotrance/nimfuzz |
19:56:17 | FromGitter | <mratsim> interesting |
19:57:04 | shashlick | or even the nim --cincludes flag, you can point to a dir during compilation |
19:57:26 | FromGitter | <zacharycarter> but just including the header won't do anything |
19:57:29 | FromGitter | <zacharycarter> you need some code referencing it |
19:57:47 | FromGitter | <zacharycarter> so in other words - you're going to need to include it in C or C++ code |
19:59:04 | shashlick | i 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:09 | FromGitter | <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:11 | FromGitter | <mratsim> So feature request: “Allow to choose where to put the generated nim code + bindings" |
20:01:14 | shashlick | that'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:51 | shashlick | cause 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:35 | FromGitter | <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:54 | shashlick | I was just thinking about that last night when you posted the RFC |
20:03:23 | FromGitter | <mratsim> And others in other fields (biology, physics, …) might also need their own high level abstractions (finite element, lattice stuff …) |
20:03:31 | shashlick | but 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:41 | FromGitter | <mratsim> I’d rather look at Nim code ;) |
20:04:41 | shashlick | I see the general challenge though, guess having a cached copy isn't too much to ask |
20:04:53 | shashlick | i've been putting in some test cases to document but it could be better |
20:05:12 | * | athenot joined #nim |
20:05:24 | shashlick | did you see the tests folder for nimssl? i'll admit it's not been that elaborate for the other nimgen libs |
20:05:47 | FromGitter | <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:19 | shashlick | something to think about surely, let me write up an issue |
20:08:57 | * | athenot joined #nim |
20:12:13 | * | adeohluwa joined #nim |
20:13:47 | shashlick | back 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:29 | shashlick | but i'm open to inputs and appreciate it might not work for every use case |
20:15:21 | shashlick | my primary motivation is to reduce complaints about missing libs |
20:21:06 | * | nsf joined #nim |
20:21:35 | FromGitter | <zacharycarter> again - I don't think it's an easily solved problem shashlick |
20:24:36 | FromGitter | <zacharycarter> cross compilation between different host / target CPUs and OSs requires cross-compile toolchains |
20:25:05 | FromGitter | <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:54 | shashlick | are you saying building a linux binary from nim source without having a linux host? |
20:33:24 | shashlick | can you do that with pure nim modules today? say I build my app for ubuntu on my windows machine |
20:34:02 | ieatnerds | https://nim-lang.org/docs/nimc.html#cross-compilation |
20:41:56 | FromGitter | <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:03 | FromGitter | <mratsim> maybe* |
20:42:34 | FromGitter | <mratsim> 1) wrapping a static library |
20:42:38 | FromGitter | <mratsim> 4 |
20:43:22 | * | smt joined #nim |
20:45:16 | FromGitter | <zacharycarter> shashlick - yes that's what I'm getting at |
20:45:22 | FromGitter | <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:15 | shashlick | @mratsim I've categorised some of them on the nimgen page, but not to that detail |
21:03:49 | shashlick | @zacharycarter that's a tall order 🙂 |
21:04:12 | shashlick | Isn't docker really just one OS |
21:06:33 | * | yglukhov quit (Remote host closed the connection) |
21:07:06 | * | yglukhov joined #nim |
21:07:07 | FromGitter | <zacharycarter> no - docker can install whatever OS you want on an image |
21:07:26 | FromGitter | <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:30 | FromGitter | <mratsim> you can add nim-clblast as a library that links to a dynamic lib |
21:07:33 | FromGitter | <zacharycarter> might be somewhat enlightening maybe |
21:08:32 | PMunch | Is there anything like dumpTreeRepr in the compiler? |
21:08:35 | PMunch | For 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:51 | shashlick | @mratsim that's like nimbass, will do |
21:12:28 | * | qleda quit (Ping timeout: 240 seconds) |
21:12:38 | shashlick | @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:46 | GitDisc | <cavariux> Hi, anyone of you know if tuples are store in memory packed? like arrays? |
21:38:15 | PMunch | I think so |
21:38:22 | PMunch | Don't quote me on that though |
21:38:35 | PMunch | Why do you ask? |
21:39:06 | GitDisc | <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:12 | GitDisc | <cavariux> thanky you btw will try |
21:39:42 | PMunch | Aaah, that makes sense |
21:39:51 | PMunch | You could always take a look at the actual C output |
21:40:26 | GitDisc | <cavariux> ohh, that's a good idea will test it out ty |
21:40:32 | * | Vladar quit (Quit: Leaving) |
21:41:43 | PMunch | Just checked and they appear to be converted to just a regular struct |
21:42:22 | PMunch | So if you declare a tuple[hello: int, world: int] it would be converted to a C struct with two int fields |
21:43:36 | GitDisc | <cavariux> hmmm it looks like so |
21:43:57 | * | Jesin quit (Quit: Leaving) |
21:44:45 | GitDisc | <cavariux> will see if opengl complains, if so I will have to make a lot of templates |
21:44:55 | GitDisc | <cavariux> well, thank you for the help @PMunch |
21:45:00 | PMunch | No problem |
21:45:21 | PMunch | Working with Nim and C code is always a bit wonky, but once you get it working it's pretty neat |
21:46:28 | GitDisc | <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:35 | GitDisc | <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:14 | FromGitter | <zacharycarter> cavariux: opengl and Nim is tricky |
22:23:49 | FromGitter | <zacharycarter> when it comes to data structures anyway |
22:24:18 | FromGitter | <zacharycarter> I've never quite gotten packed values to work correctly - why do you need these to be packed? |
22:24:46 | FromGitter | <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:56 | FromGitter | <zacharycarter> why not just pass structs to OpenGL? |
22:25:22 | FromGitter | <zacharycarter> in my experience - this is the easier and more straightforward route to take |
22:25:34 | FromGitter | <zacharycarter> @krux02 can probably weigh in on this |
22:26:57 | FromGitter | <zacharycarter> also - why can't you use glm? |
22:27:58 | FromGitter | <zacharycarter> and can you also tell me a bit about what you're working on? :) |
22:32:08 | FromGitter | <mratsim> or use `type MyAwesomeType {.packed.} = object` |
22:37:17 | FromGitter | <zacharycarter> I remember trying that - at least I think |
22:38:40 | FromGitter | <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:09 | FromGitter | <zacharycarter> or go off your guidance on where to get started (if you can't share the code w/ me that is) |
22:40:36 | FromGitter | <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:03 | ieatnerds | can I get your guy;s quick opinion? |
22:41:33 | FromGitter | <zacharycarter> on what? |
22:42:06 | ieatnerds | say 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:39 | ieatnerds | I think the former would be better, probably easier for me to maintain too |
22:43:05 | FromGitter | <zacharycarter> are you talking about this being in the stdlib? |
22:43:56 | FromGitter | <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:33 | ieatnerds | I'm working on my own kind of psutil and just trying to figure out where I went to break thing apart at. |
22:44:42 | FromGitter | <zacharycarter> gotcha |
22:44:49 | FromGitter | <zacharycarter> I mean it's always easier to put everything into a single source file |
22:44:56 | FromGitter | <zacharycarter> but probably not advisable |
22:46:39 | ieatnerds | Right, 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:32 | FromGitter | <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:51 | ieatnerds | Sound 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:32 | GitDisc | <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:09 | GitDisc | <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:34 | FromGitter | <zacharycarter> cavariux: there's a pure Nim glm library |
23:23:20 | FromGitter | <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:28 | FromGitter | <zacharycarter> if you want - I can share plenty of example code |
23:23:58 | GitDisc | <cavariux> oh, if you don't mind I would love it |
23:24:24 | FromGitter | <zacharycarter> first of all - here's the pure Nim glm library - https://github.com/stavenko/nim-glm |
23:26:45 | GitDisc | <cavariux> damn, it's pretty complete and in pure nim hmm |
23:27:30 | GitDisc | <cavariux> would it be bad that I make my implementation? |
23:28:55 | FromGitter | <zacharycarter> I'd just use glm |
23:28:59 | FromGitter | <zacharycarter> the nim glm I mean |
23:29:32 | FromGitter | <zacharycarter> I used it for - https://github.com/zacharycarter/zengine |
23:30:15 | FromGitter | <zacharycarter> also did you see - https://github.com/jackmott/easygl ? |
23:30:18 | GitDisc | <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:29 | FromGitter | <zacharycarter> oh - thank you! |
23:31:06 | FromGitter | <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:25 | GitDisc | <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:14 | FromGitter | <zacharycarter> gotcha |
23:34:14 | GitDisc | <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:15 | FromGitter | <zacharycarter> I'm honestly using SFML currently - I'm not sure how that's going to play out with WASM |
23:34:15 | FromGitter | <zacharycarter> just the windowing stuff |
23:34:55 | GitDisc | <cavariux> with wasm you refer to webassembly? |
23:34:58 | FromGitter | <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:05 | FromGitter | <zacharycarter> yup |
23:35:30 | * | jaco60 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
23:35:31 | FromGitter | <zacharycarter> there's also - https://github.com/yglukhov/nimx |
23:35:48 | GitDisc | <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:58 | FromGitter | <zacharycarter> yeah |
23:36:28 | GitDisc | <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:35 | GitDisc | <cavariux> or what do you think, would it be useful? |
23:37:10 | FromGitter | <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:42 | FromGitter | <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:47 | GitDisc | <cavariux> oh yeah, I'm making the bindings for glew so it could be useful thanks |
23:39:00 | FromGitter | <zacharycarter> damnit... I don't know how to search IRC logs anymore for Nim |
23:39:02 | FromGitter | <zacharycarter> help anyone? |
23:39:23 | GitDisc | <cavariux> I have never used bgfx but have read about it, is it good? |
23:39:59 | FromGitter | <zacharycarter> define good haha |
23:40:09 | FromGitter | <zacharycarter> I guess it depends on your use case / goal |
23:40:14 | GitDisc | <cavariux> haha would it save you more work than it makes you do? |
23:40:42 | FromGitter | <zacharycarter> well certainly yes - but right tool for the job and all that you know |
23:40:54 | FromGitter | <zacharycarter> so if your goal is just to write a simple opengl app - it's probably overkill |
23:41:24 | FromGitter | <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:48 | GitDisc | <cavariux> hmm good point |
23:41:59 | GitDisc | <cavariux> I also saw you are rendering text in your engine, what are you using? |
23:42:05 | FromGitter | <zacharycarter> which engine? |
23:42:14 | GitDisc | <cavariux> zengine |
23:42:51 | GitDisc | <cavariux> and also frag, or are you doing it in different styles? |
23:44:04 | * | BitPuffin quit (Remote host closed the connection) |
23:44:07 | FromGitter | <zacharycarter> I'm trying to remember what I did with frag - there's quite a few ways to render fonts with OpenGL |
23:44:57 | FromGitter | <zacharycarter> you can do bitmap font rendering or use freetype fonts |
23:45:16 | FromGitter | <zacharycarter> you can do SDF font rendering |
23:45:47 | FromGitter | <zacharycarter> really depends on what your objective is |
23:46:15 | GitDisc | <cavariux> I would like to make some bindings for a font library but still don't know which |
23:46:34 | GitDisc | <cavariux> freetype looks good but I don't like it's license |
23:47:05 | FromGitter | <zacharycarter> bitmap font rendering is super simple and you won't need a license for it |
23:47:31 | FromGitter | <zacharycarter> same with SDF rendering |
23:48:41 | GitDisc | <cavariux> hmm will look into both and how they work thanks btw |
23:48:51 | FromGitter | <zacharycarter> np |
23:48:52 | GitDisc | <cavariux> will go grab something to eat but thank you for everything |
23:49:13 | GitDisc | <cavariux> do you think it's useful I'm doing all this bindings? |
23:49:14 | FromGitter | <zacharycarter> sure thing! - feel free to ping me if you need help with anything / have any questions |
23:49:33 | FromGitter | <zacharycarter> I think writing native Nim code to replace the bindings would be more beneficial :) |
23:49:51 | FromGitter | <zacharycarter> and definitely make sure bindings for what you're planning to wrap, don't already exist |
23:50:31 | FromGitter | <zacharycarter> also - you can already do a lot with Nim and its current ecosystem when it comes to gamedev |
23:50:42 | FromGitter | <zacharycarter> I don't think you should need to wrap much |
23:51:09 | FromGitter | <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:18 | FromGitter | <zacharycarter> as far as gamedev goes |
23:51:22 | GitDisc | <cavariux> yeah that's true, will try to make it more like lwjgl to make more pure nim code instead of bindings |
23:51:38 | GitDisc | <cavariux> if you could I would love to make useful bindings |
23:52:20 | GitDisc | <cavariux> gtg to eat but if you don't mind send them and I will check the logs when I come back |
23:52:23 | GitDisc | <cavariux> thank you for all |
23:53:36 | * | yglukhov joined #nim |
23:54:49 | FromGitter | <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:31 | FromGitter | <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) |