00:01:28 | * | dddddd quit (Remote host closed the connection) |
00:06:55 | CodeVance | https://atilanevesoncode.wordpress.com/2018/06/12/myths-programmers-believe/ |
00:12:14 | FromGitter | <Varriount> @kaushalmodi Believe it or not, the identifier equivalence rules work quite well. |
00:13:26 | CodeVance | I like the case-insensitive underscore-less idents |
00:17:45 | * | yglukhov[i] joined #nim |
00:19:12 | * | CodeVance left #nim (#nim) |
00:20:22 | * | rockcavera joined #nim |
00:22:12 | * | yglukhov[i] quit (Ping timeout: 256 seconds) |
00:36:23 | * | shashlick1 joined #nim |
00:36:54 | * | shashlick quit (Quit: shashlick) |
00:37:33 | * | shashlick1 quit (Client Quit) |
00:37:54 | * | shashlick joined #nim |
00:44:12 | * | yglukhov[i] joined #nim |
00:48:57 | * | yglukhov[i] quit (Ping timeout: 264 seconds) |
00:49:10 | * | gangstacat joined #nim |
00:55:29 | * | shashlick quit (Quit: shashlick) |
00:55:53 | * | shashlick joined #nim |
00:56:38 | * | shashlick quit (Client Quit) |
00:57:18 | * | shashlick joined #nim |
00:57:51 | FromGitter | <kaushalmodi> @Varriount I didn't get the context.. I was just repeating the rules as in the manual. |
01:02:09 | * | shashlick quit (Client Quit) |
01:05:23 | * | shashlick joined #nim |
01:06:25 | * | floppydh quit (Ping timeout: 260 seconds) |
01:08:50 | * | floppydh joined #nim |
01:11:04 | FromGitter | <Varriount> @kaushalmodi Ah, ok. |
01:18:32 | FromDiscord | <lotzz> anyone have some info on where i could find good info for what to do with .nims files? |
02:00:57 | shashlick | you can run .nims files with `nim e file.nims` |
02:01:13 | shashlick | https://nim-lang.org/docs/nims.html |
02:09:59 | * | donlzx joined #nim |
02:13:09 | FromDiscord | <lotzz> alright thanks for the link |
02:42:01 | * | Jesin joined #nim |
02:45:06 | * | CodeVance joined #nim |
02:45:47 | * | yglukhov[i] joined #nim |
02:46:12 | * | CodeVance quit (Client Quit) |
02:50:21 | * | yglukhov[i] quit (Ping timeout: 256 seconds) |
03:22:12 | * | NimBot joined #nim |
03:31:03 | * | endragor joined #nim |
03:49:42 | * | shashbot joined #nim |
03:52:07 | * | shashbot quit (Remote host closed the connection) |
03:54:42 | * | skrylar quit (Remote host closed the connection) |
04:10:08 | * | shashbot joined #nim |
04:28:12 | * | rauss quit (Read error: Connection reset by peer) |
04:28:47 | * | rauss joined #nim |
04:36:59 | shashbot | @genotrance has renamed the channel from "nim" to "general" |
04:44:58 | * | shashbot quit (Remote host closed the connection) |
04:48:11 | * | CodeVance joined #nim |
04:55:41 | * | miran_ joined #nim |
05:01:05 | CodeVance | Is it true that for a method to work you need to import the base method? |
05:01:26 | * | xkapastel quit (Quit: Connection closed for inactivity) |
05:03:57 | * | shashbot joined #nim |
05:05:46 | * | Vladar joined #nim |
05:30:20 | * | shashbot quit (Remote host closed the connection) |
05:30:35 | * | shashbot joined #nim |
05:32:25 | * | CodeVance quit (Ping timeout: 260 seconds) |
05:33:56 | * | yglukhov[i] joined #nim |
05:37:57 | * | yglukhov[i] quit (Ping timeout: 240 seconds) |
05:39:37 | * | nsf joined #nim |
05:52:24 | * | jjido joined #nim |
05:55:48 | * | shashbot quit (Remote host closed the connection) |
05:56:12 | * | shashbot joined #nim |
05:57:47 | * | zahary joined #nim |
06:02:19 | * | zahary quit (Client Quit) |
06:03:33 | * | miran_ quit (Quit: Konversation terminated!) |
06:04:36 | crptck_ | I'm super new to Nim. Excited to jump in. |
06:06:35 | shashbot | welcome 🙂 |
06:53:28 | * | Hotkeys quit (Quit: Connection closed for inactivity) |
06:54:50 | shashbot | Interesting - https://volt.ws/lang |
07:03:35 | * | crptck_ quit () |
07:20:36 | * | donlzx quit (Quit: Leaving) |
07:28:33 | * | PMunch joined #nim |
07:29:40 | * | xkapastel joined #nim |
07:30:31 | * | dddddd joined #nim |
07:40:58 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
07:53:54 | * | yglukhov[i] joined #nim |
07:55:29 | * | floppydh quit (Quit: WeeChat 2.1) |
07:55:51 | * | floppydh joined #nim |
07:55:51 | * | yglukhov[i] quit (Read error: Connection reset by peer) |
07:55:55 | * | yglukhov_ joined #nim |
08:01:13 | user0 | Hello. Is there any `iterable` concept/type in the standard? |
08:02:00 | user0 | If not what conditions must an iterable type satisfy? |
08:02:27 | user0 | ah nvm it's x.high() and x.low() is x |
08:02:39 | user0 | typeof*() |
08:02:45 | user0 | disregard me |
08:03:10 | * | gmpreussner_ quit (Ping timeout: 265 seconds) |
08:03:33 | user0 | Just tell me what's the equivalent to C++'s decltype please |
08:04:17 | * | gmpreussner_ joined #nim |
08:05:17 | user0 | name |
08:06:16 | * | zahary joined #nim |
08:11:30 | PMunch | user0, for something to be iterable you generally need an "iterator" |
08:11:50 | PMunch | Although some general purpose ones exists |
08:13:56 | PMunch | And what are you trying to do with decltype? |
08:14:01 | PMunch | What is your goal |
08:16:38 | user0 | I'm just making a table for unionfind |
08:16:40 | user0 | https://pastebin.com/gS54vxtr |
08:17:48 | user0 | Basically when creating a concept, I need to check decltype high x is decltype x |
08:18:09 | user0 | decltype((high x )+ 1) is decltype(x) |
08:18:17 | user0 | low* |
08:20:38 | * | zahary quit (Quit: Leaving.) |
08:20:39 | FromGitter | <alehander42> yeah |
08:20:41 | FromGitter | <alehander42> what you want is |
08:21:07 | FromGitter | <alehander42> ```type ⏎ A = concept a, type T ⏎ a.high is T ⏎ a.low is T ⏎ # ..``` [https://gitter.im/nim-lang/Nim?at=5b20d3f232618e705eb64d85] |
08:21:25 | FromGitter | <alehander42> but for iterators a better way would be to directly showcase the usage |
08:23:10 | user0 | ^can you elaborate? |
08:24:06 | FromGitter | <alehander42> ```type ⏎ Iterable[T] = concept x ⏎ for value in x: ⏎ type(value) is T``` ⏎ ⏎ (I found it on github by @Yardanico , credits to him) [https://gitter.im/nim-lang/Nim?at=5b20d4a6cf3b245b2cfa5f69] |
08:25:17 | FromGitter | <alehander42> this is probably also more correct, as one doesn't require 'high' or 'low' for type to be Iterable |
08:25:53 | FromGitter | <alehander42> what you do to make a type iterable is define ⏎ ⏎ ```iterator items(t: MyType): ElementType = ⏎ ... yield stuff``` [https://gitter.im/nim-lang/Nim?at=5b20d51182b1b355c953b038] |
08:26:58 | user0 | Okay, this is really nice. I just hope that it doesn't increase compile time by checking each of type(value) is T |
08:28:11 | FromGitter | <alehander42> no, it works on compile time, so it just checks that the concept "expressions" typecheck correctly |
08:28:49 | FromGitter | <alehander42> so the length of x doesn't matter, just the once-computed type of a value yielded by it |
08:29:38 | user0 | Thank you. It was very informative. |
08:33:14 | FromGitter | <alehander42> no problem, feel free to ask more if things are ucnlear :D |
08:34:12 | * | Pisuke joined #nim |
08:35:59 | * | MyMind quit (Ping timeout: 268 seconds) |
08:39:32 | PMunch | Good to see you got it sorted :) |
08:41:47 | * | pydsigner is now known as _ |
08:41:57 | * | _ is now known as pydsigner |
08:49:23 | * | Calinou quit (Quit: http://quassel-irc.org - Discuter simplement. Partout.) |
08:58:34 | FromGitter | <narimiran> https://www.reddit.com/r/programming/comments/8qqwrh/learn_programming_with_nim_a_beginners_tutorial/ |
08:59:28 | FromGitter | <narimiran> as always: upvotes for visibility, comments for initializing the discussion :) |
09:07:57 | * | gmpreussner_ quit (Ping timeout: 256 seconds) |
09:08:51 | * | gmpreussner_ joined #nim |
09:08:57 | FromGitter | <gogolxdong> How to server staticDir with Jester ? |
09:09:32 | * | sz0 joined #nim |
09:09:53 | * | yglukhov_ quit (Ping timeout: 248 seconds) |
09:11:34 | * | Calinou joined #nim |
09:12:29 | * | krux02 joined #nim |
09:16:44 | * | yglukhov[i] joined #nim |
09:19:23 | FromGitter | <tim-st> Does someone has an idea how much work would it be to extend nimscript to support full pure nim like the python interpreter? |
09:19:47 | FromGitter | <tim-st> I'm wondering if this would be better than incremental compilation |
09:21:15 | FromGitter | <tim-st> (with pure nim I define all modules from "pure" directory also `os`) |
09:23:10 | krux02 | tim-st: that is a bit complicated, especially the interface to C functions |
09:23:57 | FromGitter | <alehander42> I've thought about that, but not because compilation: it would make a powerful repl easier |
09:24:05 | FromGitter | <tim-st> My idea was to compile one single binary "nimStdLib.exe" that has all procs from all modules exported. Can nimscript call it? |
09:24:28 | krux02 | you cannot call from an interpreted language into C functions, when you don't know the declaration of the C function at compile time of the interpreter |
09:24:34 | FromGitter | <Vindaar> @narimiran nice! upvoted :) |
09:26:03 | FromGitter | <tim-st> krux02: do you have a very small example? |
09:26:10 | krux02 | nope |
09:26:20 | FromGitter | <alehander42> well, I am not sure how the nimscript vm works, but this should be technically possible |
09:26:28 | FromGitter | <tim-st> yes, I think so too |
09:26:37 | krux02 | you neet do know the calling convention in binary to understand this |
09:28:00 | krux02 | so before you argue on how this could or should be done, pleas learn about all the different calling conventions of all targets of the C language |
09:28:21 | FromGitter | <narimiran> @Vindaar thanks :) |
09:28:41 | FromGitter | <tim-st> krux02: I assumed the user compiles this file on his own target architecture |
09:28:44 | krux02 | including ARM, x86, powerpc, etc |
09:29:10 | krux02 | the user compiles what? |
09:29:20 | FromGitter | <tim-st> the "nimStdLib" binary |
09:30:11 | krux02 | well you could make interfaces for all functions in stdlib |
09:30:27 | krux02 | but that would not enable you at all to call into other libraries |
09:32:20 | FromGitter | <tim-st> hm, ok, have a feeling though, that it works^^ |
09:32:32 | FromGitter | <tim-st> *could work |
09:34:30 | krux02 | well you can always make pull requests that allow more stuff from the stdlib to work in the VM |
09:35:31 | FromGitter | <tim-st> I just dont know how this goes on the low level like `os`. But python developers got it working to have all functions in an interpreted language. in nim some of these dont work |
09:35:46 | krux02 | I would like to vent out my frustration again: the range type as first argument for the primitive array is a bad idea |
09:58:05 | FromGitter | <tim-st> I now found nimScript has `exec(command: string)` so that would work exactly like I assumed |
10:00:08 | FromGitter | <tim-st> (at least in a worst case that could be implemented this way) |
10:01:20 | FromGitter | <mratsim> @miran I still have to say that your tutorial is awesome |
10:01:53 | FromGitter | <mratsim> The presentation is top notch |
10:02:21 | FromGitter | <mratsim> I think the font should be larger, at least 16px or 18px. |
10:15:54 | FromGitter | <narimiran> @mratsim thank you very much for your kind words! |
10:17:06 | FromGitter | <narimiran> i'm a big fan of large font sizes, but i was afraid i might overdo it, so i have settled for the way it is now. but if other people want larger font, i will be very happy to provide it :) |
10:20:05 | * | yglukhov[i] quit (Ping timeout: 240 seconds) |
10:21:47 | FromGitter | <mratsim> https://www.smashingmagazine.com/2011/10/16-pixels-body-copy-anything-less-costly-mistake/ |
10:22:15 | Yardanico | I really dislike font size on Hackernews :D |
10:22:19 | Yardanico | it's sooooo small |
10:22:34 | FromGitter | <mratsim> I’m on the fence between 18 and 19px fonts for my new blog :P |
10:25:29 | FromGitter | <ephja> changing the minimum size on firefox doesn't do anything for me on that site |
10:25:40 | dom96 | Don't use pixel sizing for your fonts :P |
10:25:40 | * | yglukhov[i] joined #nim |
10:26:22 | FromGitter | <narimiran> @Yardanico i read HN on 140% zoom |
10:26:58 | FromGitter | <ephja> nevermind |
10:27:06 | FromGitter | <ephja> was it changed to 16px? |
10:27:14 | FromGitter | <narimiran> @dom96 my font size is set as 1em, which should be 16px. i guess i should increase it to 1.125em (18px) |
10:27:30 | FromGitter | <ephja> I guess. that looks alright |
10:27:39 | FromGitter | <narimiran> what do others think about increasing it? |
10:28:20 | Yardanico | well, there's a lot of empty space on the left and on the right of the text |
10:28:27 | * | elrood joined #nim |
10:28:33 | Yardanico | of course that's good for reading |
10:28:45 | Yardanico | but for me it's fine, maybe make it .5 pixels bigger |
10:28:52 | FromGitter | <narimiran> @Yardanico we had that discussion on/about nim forum - don't maximize your browser!! :D |
10:28:55 | FromGitter | <ephja> it depends on the window width |
10:29:08 | Yardanico | @narimiran why not? :P |
10:29:24 | FromGitter | <narimiran> waste of space :) |
10:30:42 | FromGitter | <ephja> for text at least |
10:31:16 | FromGitter | <narimiran> when i have my browser maximized, it is a 3-column setup: on the left are bookmarks, in the center is the content, and on the right are the currently open tabs (this is in vivaldi, which allows for these kinds of customization) |
10:31:39 | dom96 | narimiran: yeah, I would increase it a bit |
10:31:52 | dom96 | btw guys, $50 off 50 stickers on Sticker Mule: https://ctt.ac/9a7Mb+ |
10:32:01 | dom96 | So you can get 50 Nim stickers for $19 |
10:32:30 | FromGitter | <narimiran> so the content once again is not 1920px wide, but maybe something like 1400px |
10:33:12 | FromGitter | <narimiran> @dom96 thanks, will increase it once i get home. btw, now you have my blessing to tweet about it :) |
10:35:39 | FromGitter | <narimiran> btw, i have no experience with html/css, so my style.css is basically copy-pasted some template and i changed/deleted some values. if any of you has an idea how to make it better - let me know, and/or submit a PR |
10:35:58 | dom96 | ugh, stickermule makes it far too difficult to share designs |
10:42:17 | dom96 | https://forum.nim-lang.org/t/3918 |
10:44:58 | dom96 | narimiran: tweeted :) |
10:45:31 | Yardanico | nim twitter squad, go and re-tweet! |
10:46:59 | FromGitter | <Vindaar> done :) |
10:47:51 | FromGitter | <narimiran> "brilliant"? now i'm blushing! |
10:48:07 | * | user0 quit (Ping timeout: 245 seconds) |
10:50:34 | * | user0 joined #nim |
10:57:51 | FromGitter | <tim-st> I now took a deeper look at nimscript and it should be possible to support complete? "pure" directory without too much work, especially because much of `os` is already implemented in system/nimscript and most problems are missing `when nimvm` checks e.g. parts of `strutils` doesnt work with nimscript, when I have more time I try to fix some parts, I think an interpreter based on nimscript for pure nim only would be |
10:57:51 | FromGitter | ... enough for most modules and would evaluate very quickly like python |
11:06:50 | FromGitter | <dandevelo> Is there any slurp/staticRead alternative that will read the file into an array instead of a string? |
11:07:59 | FromGitter | <mratsim> you have to slurp it and then parse the string with a macro which accepts a static[string] input |
11:08:28 | FromGitter | <mratsim> or a template, just make sure to assign the result to a const if using a template |
11:08:43 | FromGitter | <ephja> compile time proc? |
11:09:08 | FromGitter | <dandevelo> Yes, need this at compile time |
11:09:22 | FromGitter | <dandevelo> This is a binary file that I am reading |
11:09:25 | FromGitter | <ephja> but you need to generate an array of the correct size |
11:09:38 | FromGitter | <dandevelo> Yes, that's also a concern |
11:09:41 | * | yglukhov[i] quit (Remote host closed the connection) |
11:10:22 | * | yglukhov[i] joined #nim |
11:11:57 | FromGitter | <mratsim> unless you meant you wanted to put the file in an array of chars? |
11:12:19 | FromGitter | <mratsim> I’m pretty sure static string are arrays of char and not heap-allocated. |
11:12:43 | FromGitter | <dandevelo> @mratsim that's right, I need to read a file into a uint8 array at compile time |
11:13:10 | FromGitter | <dandevelo> create a const array out of that file |
11:13:12 | FromGitter | <mratsim> anyway macro getSize(x: static[string]): static[int] = x.len will give you the size at compile-time |
11:13:21 | * | xet7 joined #nim |
11:13:36 | * | sz0 quit (Quit: Connection closed for inactivity) |
11:14:27 | * | yglukhov[i] quit (Ping timeout: 240 seconds) |
11:15:02 | FromGitter | <mratsim> and `macro foo(x: static[string]): untyped = var r: seq[uint8]; for i in x.len: r.add x[i]` should get you started |
11:15:23 | FromGitter | <mratsim> compile time seq are transformed into const array |
11:18:20 | * | yglukhov[i] joined #nim |
11:20:00 | FromGitter | <dandevelo> @mratsim would foo be called together with staticRead? |
11:20:37 | FromGitter | <mratsim> foo(staticRead(“yourfile”)) |
11:22:03 | FromGitter | <mratsim> edited: for i in 0..x.len |
11:22:11 | FromGitter | <mratsim> not for i in x.len |
11:22:24 | FromGitter | <mratsim> ..<* |
11:25:02 | * | xet7 quit (Remote host closed the connection) |
11:25:24 | * | xet7 joined #nim |
11:37:51 | FromGitter | <ephja> I usually use '0 .. x.high' instead of '0..<x.len' or '0..x.len - 1' |
11:42:50 | krux02 | I use 0 ..< x.len |
11:43:08 | krux02 | I try to completely ignore the existence of `high` and `..` |
11:43:13 | krux02 | makes my life easier |
11:43:38 | krux02 | question does anybody know how I get the two bounds of a range type? |
11:44:22 | FromGitter | <ephja> low/high? |
11:46:33 | krux02 | hmm, seems that I can't just ignore high entirely |
11:47:11 | Vindaar | krux02: why do you want to ignore high? |
11:48:59 | FromGitter | <mratsim> you need YourEnum.low .. YourEnum.high for enum as well |
11:54:25 | FromGitter | <ephja> there should also be a `..<`proc that creates a slice now that '<foo' is deprecated |
11:56:43 | FromGitter | <ephja> might as well just create a patch |
11:59:29 | FromGitter | <ephja> "template `..<`(a, b: untyped): untyped" "a shortcut for 'a .. (when b is BackwardsIndex: succ(b) else: pred(b))'. " 🤔 |
12:03:35 | FromGitter | <ephja> perpetual confusion |
12:07:41 | FromGitter | <dandevelo> @mratsim how would r be accessed outside the macro? |
12:08:14 | FromGitter | <mratsim> result = r |
12:09:15 | FromGitter | <dandevelo> wouldn't result be a nimnode? |
12:10:16 | FromGitter | <dandevelo> r is a seq but result is a nimnode if I got this right |
12:10:33 | FromGitter | <mratsim> that should work |
12:11:32 | FromGitter | <mratsim> you might get away with {.compileTime.} proc instead of a macro now that I thing about it. |
12:11:40 | FromGitter | <mratsim> think* |
12:12:44 | * | Snircle joined #nim |
12:14:31 | m712 | is there a way i can have a poll-like timeout on asyncnet.recvLine? |
12:17:44 | m712 | or maybe a way i can kill a thread manually |
12:21:44 | FromGitter | <ephja> asyncdispatch.withTimeout? it uses sleepAsync |
12:22:17 | FromGitter | <mratsim> you need a ..< x.len otherwise you’ll get an out of bounds |
12:22:21 | FromGitter | <mratsim> but yes |
12:22:45 | FromGitter | <mratsim> you miss the back quote arount the r in the result line |
12:23:06 | FromGitter | <mratsim> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b210ca9ebf21755ca2e2713] |
12:23:32 | FromGitter | <mratsim> let resources can be const |
12:24:48 | FromGitter | <mratsim> btw from a style/convention I prefer to use seq[byte] instead of seq[uint8] for binary blobs |
12:25:03 | * | clyybber joined #nim |
12:34:54 | FromGitter | <kaushalmodi> @narimiran +1 on increasing font size. |
12:35:30 | FromGitter | <kaushalmodi> @ephja Yeah, I prefer foo.high too. |
12:35:47 | FromGitter | <oskca> @narimiran wonderful work 👍 |
12:39:14 | FromGitter | <dandevelo> @mratsim I am wondering why the generated array is an int array instead of a byte/uint8 array |
12:39:49 | FromGitter | <dandevelo> NIM_CONST tyArray_mpdT9bBCsID6miIJlQmYP9ag resources = {((NI) 83), ⏎ ((NI) 65), ⏎ ((NI) 114), ⏎ ((NI) 0), [https://gitter.im/nim-lang/Nim?at=5b21109386343c3a3201220a] |
12:40:03 | FromGitter | <mratsim> ugh, NimVM bug I guess >_> |
12:40:50 | FromGitter | <oskca> hi every one and @mratsim @dom96 can you have a look at the type mangling issue (https://github.com/dom96/nim-opencv/issues/9) I submitted yesterday, I got stuck recently |
12:41:11 | FromGitter | <mratsim> I remember struggling while trying to creat Int16Lit at compile time |
12:41:51 | FromGitter | <mratsim> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b21110f86343c3a320123ec] |
12:41:57 | FromGitter | <mratsim> argh |
12:42:07 | FromGitter | <mratsim> wait a sec I’m proposing a workaround |
12:42:57 | dom96 | oskca: hrm, there might be a pragma that solves this. |
12:43:01 | dom96 | maybe {.bycopy.}? |
12:43:12 | dom96 | Try adding 'bycopy' to the TScalar pragmas |
12:43:20 | FromGitter | <mratsim> @dandevelo ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b211167a0161836cb17b4df] |
12:43:47 | FromGitter | <mratsim> not sure if it works but who knows |
12:44:00 | FromGitter | <oskca> ok |
12:44:34 | FromGitter | <oskca> @dom96 i'll give it a try |
12:45:34 | dom96 | @narimiran: your post is doing well :D |
12:46:06 | FromGitter | <oskca> well, it works |
12:46:36 | FromGitter | <oskca> but how? why is `TPoint` is ok, and `TScalar` needs `bycopy`? |
12:49:52 | * | dom96 needs some help here: https://www.reddit.com/r/programming/comments/8qk6w4/fo_an_experimental_language_which_adds_generics/e0lb4jc/ |
12:50:10 | dom96 | People have their own random definitions of what a "transpiler" is |
12:51:03 | dom96 | oskca: AFAIK the Nim compiler decides whether to pass by copy or not. So for FFI you need to tell it to use bycopy. For TPoint we are just getting lucky, nowadays c2nim adds {.bycopy.} to everything (or maybe it's some other pragma that has the same effect) |
12:51:09 | dom96 | In any case, the opencv wrapper is pretty old |
12:51:13 | dom96 | PRs welcome |
12:51:22 | FromGitter | <mratsim> don’t argue on that >_> |
12:52:25 | FromGitter | <oskca> @dom96 I get it, thank you very much 😃 |
12:53:10 | FromGitter | <oskca> I'm doing an opencv3 wrapper, when i'm done, i'll send the PR 😄 |
12:53:24 | FromGitter | <dandevelo> @mratsim can't seem to make it work |
12:53:41 | dom96 | mratsim: why? |
12:53:49 | FromGitter | <mratsim> it’s a lost cause |
12:54:00 | dom96 | It's not |
12:55:28 | FromGitter | <mratsim> @dandevelo the easiest would be for the rest of our processing pipe to also accept string as if they were seq\[uint8\] seq\[byte\] |
12:56:07 | FromGitter | <mratsim> @dom96 then you have to try to find an argument by authority. From a well known dev (like LLVM dev …) |
12:56:51 | dom96 | Wikipedia seems like a good authority |
12:58:38 | FromGitter | <mratsim> apparently Cython compiles to C as well: http://cython.org/ |
12:59:13 | FromGitter | <mratsim> Ocaml too: https://github.com/bvaugon/ocamlcc |
12:59:34 | FromGitter | <mratsim> lots of example here - https://github.com/dbohdan/compilers-targeting-c |
12:59:45 | shashbot | oskca: have you considered nimgen for the opencv wrapper? |
12:59:46 | Yardanico | @mratsim cython compiles to C but uses Python's C API a lot |
13:00:21 | dom96 | Apparently people don't consider C low-level |
13:00:23 | dom96 | oh well |
13:00:28 | FromGitter | <mratsim> well the only point to demonstrate is that C is at a lower level of abstraction than Nim, Python or Ocaml |
13:01:48 | FromGitter | <ephja> didn't our BDFL dislike the term "transpilation"? :p |
13:02:13 | dom96 | yes |
13:02:16 | dom96 | I dislike it too |
13:02:34 | * | Vladar quit (Quit: Leaving) |
13:02:40 | dom96 | Tempted to write a blog post about this now |
13:02:54 | FromGitter | <mratsim> maybe for once you’ll get first place of HN |
13:03:05 | dom96 | lol yep |
13:03:16 | FromGitter | <oskca> @shashbot i'll give it a try, but currently I'm doing it using c2nim |
13:03:40 | FromGitter | <mratsim> just give a shout out to all those other langs so that they get ready for a nice flame war |
13:04:39 | FromGitter | <alehander42> yeah, this different abstraction level thing is very subjective |
13:04:44 | * | noonien joined #nim |
13:04:50 | FromGitter | <ephja> trying not to ping the BDFL too much, but maybe he has enabled pings for "BDFL" 😝 |
13:04:54 | FromGitter | <narimiran> @kaushalmodi ok, will increase it. btw, have you seen that `case` is now unindented? :) |
13:05:04 | FromGitter | <narimiran> @oskca thank you! |
13:05:30 | FromGitter | <alehander42> e.g. if you compile C to Nim, what would that be according to the transpiler-people ? :D |
13:05:56 | FromGitter | <mratsim> conversion |
13:06:35 | FromGitter | <ephja> inverted transpilation! |
13:07:09 | FromGitter | <mratsim> computer + translation = compilation? |
13:08:49 | shashbot | oskca: nimgen simply automates c2nim, generates wrappers on the fly based on a config file |
13:08:51 | FromGitter | <alehander42> makes sense :D |
13:08:54 | FromGitter | <mratsim> (https://files.gitter.im/nim-lang/Nim/YD4j/2018-06-13_15-08-20.png) |
13:09:04 | * | xkapastel quit (Quit: Connection closed for inactivity) |
13:09:31 | FromGitter | <mratsim> apparently it comes from French and Latin (compilare) that means pillage/plunder. |
13:09:38 | FromGitter | <alehander42> hah, weird |
13:10:19 | FromGitter | <mratsim> As a French, compilation means collection for me (like “une compilation de documents” for a curated collection of documents) |
13:10:47 | FromGitter | <kaushalmodi> @narimiran Yes, no one might have, but I did notice that change in case statements :) Yay for consistency/adherence with the style in Nim source/manual! 👍 |
13:10:57 | FromGitter | <alehander42> yeah, we kinda have that in bulgarian too, e.g. compilation of musical hits |
13:11:28 | FromGitter | <mratsim> oh yeah we use “compilation de CDs” for music collections as well |
13:11:34 | * | DarkArctic__ quit (Quit: Leaving) |
13:11:43 | FromGitter | <mratsim> well used to use, now there is spotify and Deezer |
13:11:48 | * | DarkArctic joined #nim |
13:12:49 | Araq | the transpiler people cannot explain why C is "compiled". after all, according to "common wisdom" (which is utter nonsense) C is close to assembler |
13:12:51 | FromGitter | <alehander42> yeah I wonder if one day we'll have CD stores with people browsing through very old school discs for their hipster cd players |
13:14:12 | FromGitter | <alehander42> on the other hand would you say that python, ruby etc are compiled? I would agree with such a classification |
13:14:40 | Araq | but you never hear them say "C is transpiled to assembler" and so they don't believe their own fairy tales about different levels of abstractions |
13:15:08 | Araq | Python and Ruby are interpreted. |
13:15:43 | FromGitter | <alehander42> well, they are compiled and their bytecode is interpreted |
13:15:53 | FromGitter | <alehander42> hypothetically one could interpret the C code of Nim too |
13:16:14 | FromGitter | <alehander42> (which reminds me, cling is cooool) |
13:16:41 | FromGitter | <mratsim> anyway, I find arguing semantics a complete waste of time |
13:18:29 | FromGitter | <dandevelo> Sorry to interrupt the transpiled discussion. Should I open an issue for this bug? https://gist.github.com/dandevelo/7a742d06c74c46ba67a141db1905d990 |
13:19:18 | FromGitter | <data-man> Is LuaJIT a transpiler? :) |
13:19:28 | elrood | the distinction is pretty easy, actually. transpilation is commonly used to describe the process of transformation from one human-written language into another. compilation is from one language you'd write manually to machine-code |
13:19:55 | Araq | assembler is a human-written language. |
13:20:12 | Araq | dandevelop: yeah, report it |
13:20:28 | elrood | of course that's not a clear-cut distinction, and with cpus running more of a vm than directly executing machine-code it gets watered down even more |
13:20:47 | elrood | but if you want to see the difference, you can. if you prefer to not see it, you can do that too |
13:21:12 | Araq | it's a deeply problematic distinction, GCC produces assembler as text files, at least it used to do that for years |
13:21:32 | FromGitter | <mratsim> wow: this feels like the reactions that could happen after “Gotos considered harmful” - https://www.reddit.com/r/programming/comments/8qk6w4/fo_an_experimental_language_which_adds_generics/e0kv6p2/ |
13:21:44 | elrood | nim transpiles to a language which needs a completely independent toolchain and which is widely used in programming independently. thus transpiler |
13:21:48 | Araq | then you can change it so that it directly produces the machine code |
13:22:25 | elrood | it's fine if you want to dislike the distinction and call nim compiled. nobody will lynch you for that. but people beg to differ and have other opinions |
13:22:31 | Araq | now what? Was C transpiled and then it got compiled? dubious. |
13:23:08 | elrood | if you insist, c is transpiled to assembly and then compiled, but there the point starts to become moot |
13:23:38 | Araq | is Nim's LLVM backend enough to make Nim a "compiled" language? |
13:24:13 | elrood | if you implement eg. a llvm-based to first generate llvm-ir, does it compile or transpile? you can lose yourself in that thought |
13:24:26 | FromGitter | <mratsim> LLVM has more features than C so LLVM is a higher-level language than C (think Tail Call Optimization) so C Uppile to LLVM IR |
13:26:04 | * | nsf quit (Quit: WeeChat 2.1) |
13:27:16 | * | Vladar joined #nim |
13:28:26 | FromGitter | <ephja> how do you quantify the feature amount? |
13:28:46 | FromGitter | <mratsim> you don’t, that’s completely subjective |
13:29:38 | FromGitter | <mratsim> Funnily I posted that just 3 hours ago in #nim-offtopic: http://wiki.c2.com/?BlubParadox ⏎ ⏎ > As long as our hypothetical Blub programmer is looking down the power continuum, he knows he's looking down. Languages less powerful than Blub are obviously less powerful, because they're missing some feature he's used to. But when our hypothetical Blub programmer looks in the other direction, up the power continuum, he |
13:29:38 | FromGitter | ... doesn't realize he's looking up. What he sees are merely weird languages. He probably considers them about equivalent in power to Blub, but with all this other hairy stuff thrown in as well. Blub is good enough for him, because he thinks in Blub. ⏎ > You can't trust the opinions of the others, because of the Blub para ... [https://gitter.im/nim-lang/Nim?at=5b211c4270d89b3a31935902] |
13:30:32 | dom96 | Araq: Apparently C is actually high-level |
13:30:51 | dom96 | btw compilation of hits is also an English thing |
13:30:51 | FromGitter | <mratsim> high-level == not machine code |
13:31:24 | elrood | you know languages can be high-level and low-level at the same time? abstractions are not orthogonal to providing access to hardware features |
13:31:25 | dom96 | elrood: That's not how it is defined on Wikipedia |
13:31:45 | elrood | of course it isn't, ask three people and you'll get five definitions |
13:32:21 | elrood | choose your own one of them and live happily ever after. it's not as if this was an argument with a solution or a correct or incorrect answer |
13:32:23 | shashbot | Wikipedia makes it even more fun - https://en.m.wikipedia.org/wiki/Source-to-source_compiler |
13:32:26 | shashbot | So a transpiler is a compiler |
13:32:33 | user0 | I think having namespaces would be nice |
13:32:45 | dom96 | mratsim: that's hilarious lol |
13:33:10 | FromGitter | <ephja> not even 2 definitions per person? |
13:33:13 | FromGitter | <mratsim> Blub or not machine code? |
13:33:19 | FromGitter | <ephja> not too bad then |
13:33:21 | dom96 | mratsim: Blub |
13:33:26 | FromGitter | <mratsim> =) |
13:33:30 | dom96 | We now need a programming language called Blub |
13:33:45 | dom96 | for ultimate lolz |
13:35:29 | FromGitter | <mratsim> it can be a Nim DSL ;) |
13:37:04 | FromGitter | <ephja> do we have a DSL for creating DSLs? |
13:37:33 | * | user0 quit (Quit: user0) |
13:42:36 | dom96 | oh cool, somebody submitted miran's tutorial to HN |
13:42:55 | dom96 | and it's on the front page :O |
13:42:56 | * | user0 joined #nim |
13:43:01 | * | user0 quit (Client Quit) |
13:43:40 | FromGitter | <Varriount> @dom96 Can this PR be merged? One of the checks failed, however I think it has something to do with the environment. https://github.com/nim-lang/Nim/pull/8002 |
13:44:09 | PMunch | dom96, shows up on the top of the list for me :) |
13:44:32 | FromGitter | <mratsim> yes, top page for me too |
13:45:09 | FromGitter | <alehander42> yeah for me too |
13:45:27 | dom96 | yep, just moved up there |
13:46:32 | PMunch | Interesting, the guy who posted it doesn't have anything in his GitHub about Nim |
13:47:21 | FromGitter | <alehander42> but he has a hunch about viral tutorial content! |
13:47:47 | FromGitter | <mratsim> the account was created 4 days ago |
13:48:24 | * | dom96 submits to lobste.rs |
13:49:33 | dom96 | 24 people on nim-lang.org because of this :) |
13:49:39 | dom96 | at this very moment |
13:49:48 | dom96 | Nice job @narimiran! |
13:49:49 | FromGitter | <mratsim> how many are playing snake? |
13:50:31 | dom96 | oops |
13:50:36 | dom96 | looks like Snake isn't online |
13:51:16 | subsetpark | Varriount: don't you want to use runnableExamples for that sort of thing? |
13:51:19 | FromGitter | <mratsim> it works for me |
13:51:22 | dom96 | huh, the server is running |
13:52:03 | FromGitter | <narimiran> @dom96 congratulate me when we see lots of new users here and on the forum ;) |
13:52:31 | dom96 | mratsim: are you sure? Are you connected to the server? |
13:52:31 | FromGitter | <mratsim> when you see a lot of new bugs and feature requests and question about v1 ;) |
13:52:48 | FromGitter | <mratsim> maybe not, I just quit |
13:53:05 | dom96 | what I mean is, can you see "1 users playing right now" |
13:53:07 | dom96 | or something |
13:53:25 | dom96 | The game will work happily with no server connection |
13:53:38 | dom96 | but the high scores won't be synced |
13:53:55 | FromGitter | <mratsim> ah, I see. Well I quit anyway ;) |
13:54:13 | dom96 | hm |
13:54:51 | dom96 | well, restarting helped |
13:54:52 | dom96 | strange |
13:55:10 | dom96 | Guess after 3 weeks of uptime something gets messed up :) |
13:56:18 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
13:59:29 | livcd | you did not post it to HN right ? |
13:59:44 | dom96 | I didn't, no. |
14:00:35 | livcd | sorry I meant miran :D |
14:01:10 | * | zahary_ joined #nim |
14:01:14 | * | zahary_ is now known as zahary |
14:01:19 | dom96 | @narimiran: do you have analytics on this? |
14:01:36 | livcd | opinions about office 365 being rewritten in TS and compiled to native code ? |
14:02:03 | dom96 | My opinion "lolwtf are they smoking?" |
14:02:06 | elrood | oh, that wasn't just a joke? |
14:02:08 | PMunch | livcd, we talked about this in #nim-offtopic earlier today :P |
14:02:20 | livcd | oh there's even nim-offtopic now |
14:02:35 | PMunch | Basically concluded that it's Microsoft/Dell/Intels plot to sell more machines to run the bloated JS apps :P |
14:03:00 | PMunch | livcd, nim-offtopic has been a thing for quite a while |
14:05:51 | PMunch | "That is the clearest, most succinct explanation of variables, types and mutability I’ve ever read." - People seem to like the tutorial :) |
14:08:52 | shashbot | we need to add all these beginner tutorial links to the http://nim-lang.org documentation page |
14:09:12 | FromGitter | <alehander42> is this going to change? "The default value of strings and sequences is nil" |
14:09:32 | FromGitter | <alehander42> I remember something about changing it but I might be mistaken |
14:09:51 | dom96 | alehander42: yep |
14:10:07 | FromGitter | <alehander42> amazing tutorial, I haven't looked at it until now, do you plan on continuing it with more advanced concepts? |
14:10:07 | dom96 | in fact, it's already changed AFAIK |
14:10:20 | FromGitter | <alehander42> oh nice |
14:10:35 | FromGitter | <alehander42> this is great, also I can't wait for the smarter init for tables / etc |
14:10:53 | * | Snircle joined #nim |
14:13:40 | elrood | btw, does anybody know if that guy who wanted to use nim on his tiny arm developer board a few days ago had any success? |
14:15:21 | * | Perkol joined #nim |
14:15:48 | clyybber | alehander42 using nil or isNil on strings or seqs is going to be an error in the future |
14:16:58 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
14:19:50 | * | miran joined #nim |
14:20:16 | PMunch | elrood, haven't heard anything from him. But I know federico3 has gotten things like this working |
14:20:47 | * | shashlick quit (Quit: shashlick) |
14:21:12 | FromGitter | <narimiran> @dom96 i don't have analytics, unfortunately |
14:21:28 | * | shashbot quit (Remote host closed the connection) |
14:21:47 | * | shashlick joined #nim |
14:21:56 | FromGitter | <narimiran> @livcd: i didn't post it on HN, don't know if this is a suitable topic for them (it is too basic, no?) |
14:22:49 | FromGitter | <narimiran> @alehander42 i have a TODO note to change that part about nil once it hits the stable version. (that's why i wanted them to release 0.18.2 / 0.19) |
14:23:40 | federico3 | elrood: what board is it? |
14:24:50 | FromGitter | <alehander42> @narimiran great |
14:25:00 | elrood | federico3, i believe he mentioned it being named tomu or something alike a couldn't quite decide whether it was running an M3 or M0, but was on very constrained memory |
14:25:40 | PMunch | @narimiran, they seem to enjoy it :) |
14:25:53 | PMunch | Lot's of comments and upvotes |
14:27:06 | PMunch | Currently at the top of the page even |
14:27:20 | * | PMunch quit (Quit: Leaving) |
14:27:20 | federico3 | ah - it's an M0 with 8KB of RAM. More than enough, Nim should work fine |
14:27:20 | * | endragor quit (Remote host closed the connection) |
14:30:26 | Perkol | How do I declare untyped variable? |
14:30:50 | Araq | you don't, it's only a metatype for the macro system. |
14:33:50 | * | afiskon left #nim (#nim) |
14:35:18 | elrood | federico3, any special strings you had to pull to make things work? |
14:36:32 | Perkol | I just need to create buffer for readData from streams module |
14:40:28 | Yardanico | dom96, we have 160 users on our discord server btw :) |
14:40:39 | Yardanico | (I mean not online, but overall count) |
14:40:43 | dom96 | great |
14:41:54 | FromDiscord | <ephja> didn't know I had been assigned a role |
14:42:45 | FromDiscord | <Yardanico> @ephja I did it now (just so we have enough moderators here) |
14:44:48 | * | shashlick quit (Remote host closed the connection) |
14:45:39 | FromDiscord | <ephja> ok |
14:45:47 | Yardanico | dom96, by the way, do we have irc guidelines for users? |
14:45:48 | FromDiscord | <ephja> that's a fancy name for your role |
14:46:24 | dom96 | Yardanico: "Be nice. Don't ask to ask. Don't paste >3 lines." |
14:46:40 | Yardanico | dom96, I just want to add a pinned message to discord too |
14:46:48 | Yardanico | (kinda the same as "rules") |
14:47:03 | dom96 | Just let people know that it's relayed to IRC |
14:47:07 | dom96 | To be nice |
14:47:14 | dom96 | and to use pastebin instead of pasting code into Discord |
14:47:34 | dom96 | since our bot can't handle this fundamental feature (I still find that ridiculous :P) |
14:47:48 | * | shashlick joined #nim |
14:48:48 | Yardanico | dom96, I'll try to search if there's a discord-irc bridge which handles that :) |
14:49:16 | FromGitter | <tim-st> @ Araq: where is the body implementation "builtin" implemented for these procs: https://github.com/nim-lang/Nim/blob/devel/lib/system/nimscript.nim ? |
14:50:48 | FromGitter | <tim-st> oh, saw it already in the commit history |
14:54:01 | miran | anybody wants to write a response here? https://www.reddit.com/r/coding/comments/8qsrlm/nim_basics/ |
15:00:41 | federico3 | elrood: on which device? Usually it's a matter of using the right C compiler, disabling GC, adding the stacktrace shim... |
15:01:14 | Yardanico | dom96, ugh, now there's a link to discord from nim-basics tutorial |
15:01:28 | Yardanico | I really need to think how to solve this muli-line problem |
15:01:37 | Yardanico | but I can't find a bridge which supports paste services |
15:01:52 | miran | Yardanico: yeah, somebody has sent a PR. shouldn't i merge it? |
15:02:07 | Yardanico | miran, it's okay |
15:02:10 | miran | btw, font-size is now increased, as per the public opinion |
15:12:56 | FromGitter | <tim-st> I see nimscript is limited to iterations ("Error: interpretation requires too many iterations") can I increase the limit? |
15:13:15 | Araq | tim-st: if you use nimscript via the API, yes. |
15:13:24 | Araq | if you use it in the compiler, no. |
15:13:33 | Araq | the compiler needs protection against endless loops |
15:13:49 | Araq | and making this a compiler switch would produce language dialects. |
15:14:37 | FromGitter | <tim-st> I use manually via nim e file.nims |
15:22:25 | Araq | oh that could be special cased to allow infinite loops indeed. |
15:23:40 | FromGitter | <tim-st> ok, I'm interested in extending this to support full pure nim, but have to read a bit into it to get `times` and network supported |
15:24:02 | Araq | many tried ... :P |
15:24:30 | FromGitter | <tim-st> really? is there no way? how do python guys did this? |
15:24:53 | FromGitter | <tim-st> maybe even use javascript or something as a workaround |
15:24:59 | Araq | misleading question. |
15:25:12 | FromGitter | <brentp> is there documentation on (new?) nimscript api? I assume this is to facilitate embedding nimscript? |
15:25:19 | Araq | Python's VM wasn't designed to run Python's AST to AST transformations at compiletime |
15:25:23 | FromGitter | <hoangphuoc25> I'm trying to use nim to interact with postgresql. From what i found db_postgres doesn't implement connection pool at all. Is there anyway to work around this? |
15:25:30 | Araq | Nim's VM was. |
15:25:46 | shashlick | @brentp: https://nim-lang.org/docs/nimscript.html, https://nim-lang.org/docs/nims.html |
15:25:49 | Araq | you can bold the FFI support onto Nim's VM, there is code for that |
15:25:51 | FromGitter | <tim-st> I have the guess that nimscript would skip long compile times, that's what I need |
15:26:31 | shashlick | @tim-st: i've been tracking this somewhat - https://github.com/nim-lang/Nim/issues/7383 |
15:26:44 | FromGitter | <brentp> @shashlick, that doesn't look like an api. |
15:27:43 | FromGitter | <tim-st> @ shashlick thanks I saw it but some tests are wrong I think, e.g. `math` doesnt work in nimscript |
15:28:20 | FromGitter | <tim-st> oh, these are other test cases |
15:28:23 | FromGitter | <tim-st> will read this^^ |
15:28:29 | shashlick | math mostly works, there's a few calls that don't |
15:28:52 | FromGitter | <tim-st> all c calls dont work, there a quite a few |
15:29:57 | * | clyybber quit (Ping timeout: 240 seconds) |
15:30:05 | FromGitter | <tim-st> I think the few procs in system.nim could easily be made quivalent using slower workarounds then e.g. `streams` and others and additionally all libs based on `streams` would work |
15:30:12 | FromGitter | <tim-st> *equivalent |
15:30:44 | * | sz0 joined #nim |
15:30:54 | FromGitter | <tim-st> also `export` doesnt work |
15:30:58 | shashlick | I had done some work on math, let me dig it up. i did add some test cases for ospaths /tests/newconfig/tfoo.nims |
15:31:18 | FromGitter | <mratsim> Congrats on reaching first place in /r/programming @miran |
15:31:58 | miran | thanks @mratsim! and thanks for writing your insightful comments there - they might attract the more experienced guys |
15:32:04 | FromGitter | <tim-st> it's a pitty that I cant test the kostya benchmark in ninmscript because of iteration limitation, otherwise I had a first guess on execution time |
15:32:16 | miran | dom96, Araq: should i add my beginners' tutorial to the nim-lang.org? |
15:32:55 | FromGitter | <mratsim> @tim-st the kostya bench are broken anyway >_>. |
15:33:17 | FromGitter | <tim-st> no, matmul works, but not in nimscript |
15:33:29 | Yardanico | dom96, I'll probably make a temporary limit to FromDiscord to handle only messages up to 500 chars and replace newlines by ⏎ |
15:33:41 | Yardanico | And I'll create a discord-irc bridge in nim (it's not that hard because discord has web hooks) |
15:33:47 | FromGitter | <mratsim> well matmul benchmark allows Julia to use Fortran |
15:33:47 | shashlick | @tim-st: https://gist.github.com/genotrance/97aa4f2417165caa35779a9653b27111 |
15:34:19 | shashlick | I was putting together test cases for all math functions in nimscript and found a few that didn't work |
15:35:02 | FromGitter | <mratsim> @tim-st this is as fast as Julia or D Mir GLAS in pure Nim - https://github.com/mratsim/Arraymancer/blob/master/benchmarks/integer_matmul.nim |
15:35:03 | shashlick | yardanico: why not make some PRs in matterbridge instead |
15:35:11 | Yardanico | shashlick, I don't know Go |
15:35:27 | shashlick | if you know Nim, Go is easy |
15:35:36 | FromGitter | <tim-st> shashlick: nice, looks good, I think nimscript can be a big player for nim, compile times is the biggest downside of nim |
15:36:01 | Yardanico | @tim-st nim compile-times are still higher than a lot of other compiled-to-native languages |
15:36:08 | FromGitter | <mratsim> the matmul benchmark should use integers and not double to avoid library defaulting to BLAS. |
15:36:09 | Yardanico | and they will get even better with incremental compilation |
15:36:43 | FromGitter | <tim-st> @mratsim ok thanks, I meant to get first guess on nimscript vs python and if work on nimscript would be sufficient because of this |
15:37:13 | Yardanico | oh look at that, we already have a discord library for nim! |
15:37:13 | Yardanico | https://github.com/Krognol/discordnim |
15:37:26 | shashlick | @tim-st: the lines commented out in test.nims are the procs that don't work |
15:39:10 | FromGitter | <tim-st> @ yardanico: incremental compilation is good, but I still think interpretion would be faster for testing your code, because if you change a small thing in your code it doesnt get patched but needs recompilation, unless the incremental compilation is very clever, more than one part of the code will be recompiled, and thus it will consume more time than interpretion from my first guess |
15:39:24 | miran | now i see that somebody posted a link to the tutorial two hours ago on HN! |
15:39:28 | FromGitter | <tim-st> @ shashlick: ok, thanks! |
15:39:51 | miran | and it is on the 2nd place!? OMG WTF |
15:39:56 | Yardanico | miran, ? |
15:40:00 | Yardanico | ah, HN |
15:40:03 | Yardanico | @tim-st but that's very hard to maintain |
15:40:29 | Yardanico | miran, it got even more comments than on reddit already lol |
15:41:01 | miran | i might be too late to join that discussion.... |
15:41:06 | miran | what a time to be alive :) |
15:41:32 | FromGitter | <mratsim> lol |
15:41:49 | FromGitter | <mratsim> let’s how many people mentions Rust on HN :P |
15:43:06 | miran | but hitting the front page on HN! i thought that is an impossible task |
15:45:46 | FromGitter | <mratsim> I think it’s for you @dom96: https://news.ycombinator.com/item?id=17304009 |
15:47:24 | FromGitter | <tim-st> @ Yardanico: maybe with an early version with incremental comp. support we could test some examples that work for inc. comp. and nimscript and then regard the pros and cons (for small code base, big codebase, different operation systems, compilers, etc); tbh I'm not sure which one is better, at least both are better than having it not ;) |
15:52:26 | * | Perkol quit (Quit: Leaving) |
15:52:55 | * | nimtestbot joined #nim |
15:53:19 | nimtestbot | Hello! this is a test GTK IRC client i wrote using gintro and nim |
15:53:41 | nimtestbot | It seems to work so far |
15:53:55 | m712 | ^ this is me |
15:54:47 | Yardanico | m712, you can also use #nim-offtopic for this (so you can have more freedom in your messages like colored IRC messages, etc) |
15:55:00 | Yardanico | m712, good luck to your irc client :) |
15:55:04 | nimtestbot | oh, okay then. Thanks |
15:55:30 | nimtestbot | It was a simple test to see if I could make it work; won't really go anywhere :) |
15:55:47 | * | nimtestbot quit (Client Quit) |
15:56:07 | shashlick | where does it say: "the compiler is in development and some important features are still missing" in our FAQ? |
15:57:13 | Araq | the FAQ used to say that |
15:57:20 | Araq | no idea if it still does |
15:57:30 | m712 | grep |
15:57:37 | Yardanico | dom96, it seems that I already can use discordnim for our bridge (it's trivial to implement paste services and things like that), but I don't know how stable it is |
15:57:49 | dom96 | Yardanico: Ship it :D |
15:57:59 | m712 | also, nim.vim doesn't really like it if you use threading code; is there a place i can set the compiler flags? |
15:58:13 | shashlick | how come the faq isn't linked from any page? or am i missing it |
15:58:16 | m712 | it yells about system.Channel and system.Thread not existing |
15:58:33 | Yardanico | m712, yes, create nim.cfg in your project's folder |
15:58:39 | Yardanico | or in source folder (if you have that) |
15:58:57 | Yardanico | and put "--threads:on" in there |
15:59:32 | shashlick | araq: why do we say that important features are missing? you can build perfectly capable apps. is that really something a user needs to see? sounds like a Nim language designer opinion to me |
16:00:09 | Araq | remove it from the FAQ. |
16:00:17 | Araq | this was written when Nim lacked closures. |
16:00:23 | m712 | Yardanico: okay, thank you |
16:01:10 | m712 | Yardanico: woohoo thanks a lot |
16:03:00 | * | yglukhov[i] quit (Ping timeout: 256 seconds) |
16:06:28 | * | Trustable joined #nim |
16:08:28 | shashlick | does the changelog only capture changes since the last release? where are the older changes saved? |
16:09:17 | Yardanico | shashlick, in git history? :) |
16:09:33 | Yardanico | also you can check the changelog for 0.18.0 on nim website |
16:13:53 | dom96 | Nim website posts have all the changelogs |
16:17:30 | shashlick | cool |
16:17:36 | shashlick | do we have a success stories page? |
16:18:32 | * | zahary1 joined #nim |
16:18:43 | * | krux02 quit (Quit: Leaving) |
16:20:39 | shashlick | feedback requested => https://gist.github.com/genotrance/02069f6836e71117af367e574a17ba8f |
16:24:10 | Yardanico | dom96, discord-irc bridge already works :D join #nim-web (idk why I chose this channel name), and #discord-only on discord |
16:24:21 | Yardanico | but of course I just copied some code from twitchrelay to quickly make a prototype |
16:26:25 | Yardanico | but I will probably use webhooks for sending messages (because they allow to create "fake" users, like matrix-irc bridge does on matrix side) |
16:29:33 | dom96 | hmmmm |
16:29:34 | dom96 | "Nim is really great, but they absolutely have to hit v1.0 by the end of year. I'm not sure if the devs realize how important this is to the user community." |
16:29:39 | dom96 | https://news.ycombinator.com/item?id=17304534 |
16:29:45 | * | dom96 starts sweating profusely |
16:29:56 | miran | dom96: i just have read that and i agree with it |
16:30:08 | * | floppydh quit (Quit: WeeChat 2.1) |
16:31:02 | miran | let's go! 0.19, bugfixes, 1.0rc, more bugfixes, 1.0! :) |
16:31:29 | shashlick | dom96: can you comment on the FAQ update I am proposing? related to this 1.0 deal |
16:32:46 | dom96 | shashlick: sounds good to me |
16:35:39 | FromGitter | <dandevelo> I have a byte array defined as a const. Is there any way to get addr of that array to pass to a C function? |
16:36:15 | shashlick | dom96: https://github.com/nim-lang/website/pull/94 |
16:37:16 | dom96 | Araq: Please review ^ |
16:38:38 | federico3 | shashlick: do you read me in query? |
16:39:12 | shashlick | federico3: I'm not sure what you mean... |
16:40:09 | federico3 | shashlick: 1:1 messages in IRC.. I was giving you some detailed feedback |
16:40:47 | shashlick | hmm, nope cause I am using matterbridge |
16:43:54 | shashlick | federico3: feel free to comment on the PR, I'll update |
16:45:36 | Yardanico | what would be the best paste service to be used programmatically? |
16:45:42 | Yardanico | (for discord-nim bridge)? ix.io? |
16:45:45 | Yardanico | *discord-irc |
16:46:15 | shashlick | yardanico: https://github.com/genotrance/snip/blob/master/src/snip/gist.nim#L73 |
16:46:28 | Yardanico | shashlick, thanks |
16:46:28 | shashlick | save you two minutes |
16:58:39 | * | hphuoc25 joined #nim |
17:00:19 | hphuoc25 | AFAIK db_postgres doesn't implement connection pool. Is there any way to work around it? What other options do I have to work with postgres? |
17:01:12 | * | sz0 quit () |
17:02:48 | dom96 | You might be able to make use of this: https://github.com/cheatfate/asyncpg |
17:03:15 | dom96 | and/or implement a connection pool and make a Nimble package or contribute it to the stdlib :) |
17:05:29 | hphuoc25 | I see. Thanks |
17:05:58 | * | thomasross quit (Remote host closed the connection) |
17:06:04 | * | thomasross_ joined #nim |
17:13:09 | * | nsf joined #nim |
17:14:18 | * | skrylar joined #nim |
17:15:59 | * | yglukhov[i] joined #nim |
17:18:02 | * | cryptocat1094 joined #nim |
17:31:20 | * | yglukhov[i] quit (Remote host closed the connection) |
17:35:45 | * | xkapastel joined #nim |
17:37:22 | * | zahary1 quit (Quit: Leaving.) |
17:38:35 | * | PMunch joined #nim |
17:39:58 | * | zahary1 joined #nim |
17:40:20 | * | jjido joined #nim |
17:40:58 | FromGitter | <kaushalmodi> I am liking the new `--nep1:on` switch! |
17:41:13 | * | hphuoc25 quit (Remote host closed the connection) |
17:44:44 | FromGitter | <kaushalmodi> What's the best way to upgrade Nimble packages? looks like `nimble install foo` auto-upgrades? |
17:45:10 | elrood | federico3, only just caught your reply. any device really. i'd bet nim and embedded system developers would appreciate a writeup about your experiences |
17:45:11 | dom96 | yep |
17:45:16 | FromGitter | <kaushalmodi> would be nice to have an `update` switch though so that users looking for it know that it exists |
17:45:30 | FromGitter | <kaushalmodi> internally it can alias to install |
17:45:36 | miran | +1 |
17:46:24 | FromGitter | <kaushalmodi> And the `install` help should also be updated.. |
17:46:36 | FromGitter | <kaushalmodi> "Installs a list of packages." -> "Installs/updates a list of packages." |
17:47:27 | FromGitter | <kaushalmodi> I was doing `nimble --help | grep update` and even `nimble --help | grep upgrade`, and found nothing.. so pinged here. |
17:47:58 | shashlick | open an issue, let's see what dom96 says |
17:49:32 | FromGitter | <kaushalmodi> So this exists.. https://github.com/nim-lang/nimble/issues/169 |
17:49:52 | FromGitter | <kaushalmodi> That means that `install` doesn't actually update? |
17:50:27 | * | zahary1 quit (Quit: Leaving.) |
18:02:36 | * | der quit (Remote host closed the connection) |
18:02:54 | * | derlafff joined #nim |
18:05:37 | * | yglukhov[i] joined #nim |
18:10:03 | * | yglukhov[i] quit (Ping timeout: 256 seconds) |
18:11:53 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:23:11 | * | zahary quit (Quit: Connection closed for inactivity) |
18:23:25 | * | geocar joined #nim |
18:31:47 | * | sz0 joined #nim |
18:38:33 | * | PMunch quit (Remote host closed the connection) |
18:50:14 | * | Perkol joined #nim |
18:53:54 | FromGitter | <tim-st> I compared nimscript to python2 and overall python is 6 times quicker, but especially on str.count() python was quicker; I think it would be quite interesting though and could give big benefits for quick testing; btw for recursion nimscript is much better |
18:55:17 | FromGitter | <tim-st> here was python file: https://pastebin.com/PTuHw2Re |
18:55:56 | FromGitter | <tim-st> here nim: https://pastebin.com/BEY1vfe8 |
18:57:02 | * | yglukhov[i] joined #nim |
18:57:18 | Araq | python specializes plenty of stuff |
18:57:31 | Araq | you can do the same with Nim's VM API |
18:57:38 | Araq | override procs so they run natively |
18:57:47 | Araq | the example shows how to do that. |
18:58:07 | FromGitter | <tim-st> that would be super awesome. would this also work for `times`? |
18:58:13 | dom96 | hrm, somebody spammed choosenim's analytics ~2 days ago :( |
18:58:38 | Araq | `times`? |
18:58:49 | * | zahary joined #nim |
18:58:50 | Araq | the stdlib module? sure. |
18:58:51 | FromGitter | <tim-st> module |
18:59:03 | FromGitter | <tim-st> currently nimscript cant use it |
18:59:48 | FromGitter | <tim-st> if this would work, than all stdlib could be supported, and compilation would only be needed one time as final binary and testing code would be much quicker |
18:59:50 | * | jxy quit (Quit: leaving) |
18:59:51 | Yardanico | dom96, a lot of fake requests? :( |
19:00:10 | dom96 | yes |
19:00:20 | FromGitter | <ephja> "please no fake requests" |
19:00:22 | dom96 | same IP though |
19:00:29 | dom96 | so should be easy to filter out |
19:01:02 | * | yglukhov[i] quit (Ping timeout: 245 seconds) |
19:03:38 | Araq | tim-st: that's just not realistic at all but I need to go. |
19:04:01 | Araq | incremental compilation is far superior to this. in practice. |
19:04:16 | FromGitter | <tim-st> hm, ok, thx |
19:12:25 | FromGitter | <mratsim> @dandevelo A bit late but I’m pretty sure const have no address. |
19:12:39 | FromGitter | <mratsim> even if they are arrays |
19:12:57 | Araq | unsafeAddr should work on these |
19:13:31 | FromGitter | <mratsim> so const are uncluded in the .data section? interesting. |
19:13:43 | FromGitter | <mratsim> I had a feeling they were always inlined. |
19:25:05 | * | FromGitter quit (Remote host closed the connection) |
19:25:06 | * | oprypin quit (Quit: Bye) |
19:25:24 | * | FromGitter joined #nim |
19:25:32 | * | oprypin joined #nim |
19:35:04 | * | nsf quit (Quit: WeeChat 2.1) |
19:41:27 | * | cavariux joined #nim |
19:41:41 | * | zahary quit (Quit: Leaving.) |
19:42:33 | cavariux | Hi, does anyone know a correct way to embed a small image in a nim file? I have been doing a char array with data from bin2c but had no success |
19:44:48 | * | krux02 joined #nim |
19:45:00 | FromGitter | <mratsim> So Nim is making waves in /r/Julia? https://www.reddit.com/r/Julia/comments/8qu8rt/how_do_nim_and_julia_relate_to_each_other/ |
19:45:21 | FromGitter | <mratsim> declared is to check that a variable exist |
19:45:35 | FromGitter | <kaushalmodi> that part I understood.. defined gets confusing |
19:45:41 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b2174648864a936cc85dc9d] |
19:45:50 | Yardanico | cavariux, you can just do const data = readFile("pathtomyfile") |
19:45:51 | FromGitter | <kaushalmodi> ah! |
19:46:13 | FromGitter | <mratsim> now the part I don’t understand is that within a function sometimes you have to use declared but you can’t use defined *shrugs* |
19:46:32 | FromGitter | <kaushalmodi> thanks.. I am getting false for those 4 echoes and that explains |
19:46:39 | FromGitter | <kaushalmodi> wait |
19:46:45 | FromGitter | <kaushalmodi> shouldn't it be true for all? |
19:46:49 | FromGitter | <kaushalmodi> am still confused |
19:47:13 | FromGitter | <kaushalmodi> Can you give an example snippet where `defined` would return true |
19:49:19 | Yardanico | @kaushalmodi as far as I understand defined(x) is for compiler defines |
19:49:23 | Yardanico | like you do -d:ssl |
19:49:31 | Yardanico | it's checked by defined(ssl) |
19:50:01 | * | Perkol quit (Quit: Leaving) |
19:51:58 | Yardanico | because -d:ssl is a shorthand for -define:ssl |
19:52:02 | Yardanico | *--define:ssl |
19:53:41 | * | Vladar quit (Quit: Leaving) |
19:53:57 | * | noonien quit (Quit: Connection closed for inactivity) |
19:54:59 | shashlick | kaushalmodi: what are you trying to accomplish? |
19:55:48 | * | cavariux quit (Quit: WeeChat 2.1) |
19:56:10 | fvs | can i get the index of a seq as in Python's: [obj1, obj2, obj3].index[obj2] = 1 |
19:56:49 | fvs | working with a sequence of objects |
19:56:56 | Yardanico | fvs, https://nim-lang.org/docs/system.html#find,T,S |
19:57:06 | Yardanico | !eval echo @[1, 2, 3].find(2) |
19:57:08 | NimBot | 1 |
19:58:49 | fvs | == doesn't work on objects, right? |
19:59:14 | * | jjido joined #nim |
19:59:44 | FromGitter | <Yardanico> it does |
20:00:17 | * | Trustable quit (Remote host closed the connection) |
20:00:22 | FromDiscord | <awr> if you're dynamically loading a shared lib "libsomething.so" made in nim, is it necessary to do anything with nimrtl directly or will calling NimMain() on "libsomething.so" fine enough |
20:01:36 | FromDiscord | <awr> *is calling |
20:02:44 | Yardanico | fvs, it does work |
20:03:06 | FromDiscord | <awr> @kashaulmodi you want declared() not defined() i think |
20:03:37 | FromDiscord | <awr> defined() is for stuff from nim.cfg and compiler args() |
20:03:42 | fvs | thanks Yardanico, appreciate the quick responses. |
20:03:57 | Yardanico | fvs, there's a generic == implementation in system.nim for tuples and objects |
20:04:11 | FromDiscord | <awr> declared() is for variables from the nim code |
20:04:11 | Yardanico | but it only will work if all fields in object have == operator available |
20:04:42 | * | zahary joined #nim |
20:04:45 | FromGitter | <kaushalmodi> @Yardanico Thanks! That was a good example.. and also somehow the docs in system.nim made more sense this time |
20:04:53 | * | zahary quit (Client Quit) |
20:05:29 | FromGitter | <kaushalmodi> @shashlick (not sure if this will ping you in IRC from Gitter): Just solving one more random Nim question at a time: https://scripter.co/notes/nim/#defined :) |
20:05:46 | Yardanico | @kaushalmodi actually you don't even have to use @ to ping people from IRC |
20:06:09 | FromGitter | <kaushalmodi> oh, cool :) Will keep that in mind next time |
20:06:45 | * | DarkArctic_ joined #nim |
20:07:31 | FromDiscord | <awr> also Yadarnico and cavariux i don't think you can do `const data = readFile("...")`, you do `const data = staticRead("...")` instead |
20:07:53 | FromDiscord | <awr> unless something has changed recently |
20:08:07 | Yardanico | I tried it and it works :P |
20:08:52 | Yardanico | !eval const data = readFile("in.nim"); echo data |
20:08:53 | NimBot | Compile failed: Error: unhandled exception: cannot open: in.nim [IOError]↵Compilation Failed |
20:10:06 | * | DarkArctic quit (Ping timeout: 265 seconds) |
20:11:30 | * | DarkArctic_ quit (Ping timeout: 260 seconds) |
20:12:04 | shashlick | @kaushalmodi: no worries, was just trying to understand what the use case was |
20:13:59 | * | mzigora joined #nim |
20:18:47 | FromDiscord | <awr> well it does work |
20:19:55 | FromDiscord | <awr> maybe readFile() is an alias for staticRead() now idk |
20:20:20 | * | fvs is now known as fvs_afk |
20:23:32 | FromGitter | <kaushalmodi> awr: Looks like `staticRead` is a compile-time version of `readFile`? https://nim-lang.org/docs/system.html#staticRead,string |
20:23:58 | Yardanico | @kaushalmodi well it was for a long time |
20:24:22 | FromGitter | <kaushalmodi> *was*? Time to generate local docs I guess... |
20:24:57 | FromGitter | <mratsim> Reposting because it was buried - vote and comment - https://www.reddit.com/r/Julia/comments/8qu8rt/how_do_nim_and_julia_relate_to_each_other/ |
20:25:16 | Yardanico | @kaushalmodi it is still usable |
20:26:34 | FromGitter | <alehander42> ok |
20:27:57 | FromGitter | <kaushalmodi> looks like I am going down another rabbit hole :P.. `koch web` fails |
20:28:02 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b217e52202c8f71f5ff878a] |
20:28:50 | FromGitter | <dandevelo> @Araq @mratsim unsafeAddr doesn't seem to work for conts |
20:29:19 | Yardanico | should it? |
20:29:40 | FromGitter | <Yardanico> 123 |
20:32:41 | FromGitter | <dandevelo> Is there any way I should approach this? I tried unsafeAddr because I wanted to pass a Nim array (declared as const) to a C function accepting a pointer |
20:39:37 | FromGitter | <kaushalmodi> interesting.. that times_examples assertion passes only in UTC timezone :P |
20:40:18 | FromGitter | <kaushalmodi> that test needs `putEnv("TZ", "UTC")` |
20:41:23 | FromGitter | <mratsim> @dandevelo use a global var. |
20:42:13 | FromGitter | <mratsim> it will be allocated in the data section and you can take its address |
20:43:40 | FromGitter | <mratsim> Unfortunately there is no write-tracking otherwise we could do: `var MyAlmostCOnst {.writes: [].} = static(myCompileTimeExpression)` |
20:53:10 | dom96 | haha https://news.ycombinator.com/item?id=17306761 |
20:53:10 | * | find0x90 joined #nim |
20:54:08 | * | cryptocat1094 quit (Quit: WeeChat 1.6) |
20:57:49 | * | find0x90_ joined #nim |
20:58:39 | mzigora | @dom96 LOL, Walter Bright very proud of his creation |
20:59:03 | mzigora | as the creator of nim do you see any disadvantages in nim? |
20:59:27 | * | find0x90 quit (Ping timeout: 240 seconds) |
20:59:35 | dom96 | I didn't create Nim :) |
20:59:40 | FromGitter | <ephja> lol |
20:59:44 | FromGitter | <dandevelo> @mratsim I tried to use a var. The generated code looks ugly: ⏎ ⏎ N_LIB_PRIVATE N_NIMCALL(void, unknown_resourcesInit000)(void) { ⏎ nimfr_("resources", "resources.nim"); ⏎ // resource* = [ ... [https://gitter.im/nim-lang/Nim?at=5b2185c0fd5b835b2d59741d] |
21:00:00 | FromGitter | <ephja> probably not serious, but who knows |
21:00:11 | mzigora | oh snap :) always see you posting on HN about it so assumed wrongly |
21:00:18 | FromGitter | <zetashift> I think it's just friendly banter of WalterBright else he wouldn't be in that thread |
21:01:43 | FromGitter | <dandevelo> @mratsim @Araq another thing I was thinking of was to declare the const array in C and use importc in Nim but from what I know Nim is unable to import C consts. Is this correct? |
21:02:32 | FromGitter | <mratsim> C consts have to be imported into nim var |
21:02:43 | * | yglukhov[i] joined #nim |
21:03:20 | FromGitter | <dandevelo> @mratsim so Nim can import a C const in a var? |
21:04:22 | FromGitter | <mratsim> yeah, there is a feature request to import C const into Nim const but it’s hard to find with Github search |
21:06:09 | FromGitter | <dandevelo> @mratsim so it is not possible today, only a feature request, right? |
21:07:03 | FromGitter | <dandevelo> If the C file contains this: const unsigned char resources[] = { ⏎ 0x53,0x41,0x72,0x00,0xcd,0x01,0x00,0x00 } how would this be imported as a Nim var? |
21:07:05 | * | yglukhov[i] quit (Ping timeout: 240 seconds) |
21:08:21 | * | find0x90_ quit (Quit: find0x90_) |
21:08:37 | FromGitter | <mratsim> var resources: array[8, cuchar] {.importc.} I think? |
21:09:00 | FromGitter | <mratsim> let me try |
21:14:36 | FromDiscord | <awr> does the "D" in D stand for "Disadvantages" /s |
21:15:06 | FromGitter | <mratsim> @dandevelo: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b21895a37a2df7bed3a7fa0] |
21:15:28 | FromGitter | <mratsim> importc_const.c is: ⏎ `const unsigned char resources[] = {0x53,0x41,0x72,0x00,0xcd,0x01,0x00,0x00};` |
21:16:57 | FromGitter | <mratsim> @awr C evolved from the B language, D evolved from the C language |
21:20:01 | * | miran quit (Ping timeout: 248 seconds) |
21:20:33 | FromGitter | <zetashift> D is a nice language, I find Nim nicer |
21:20:52 | FromGitter | <zetashift> and I still am baffled how Go got so popular |
21:20:54 | FromGitter | <dandevelo> @mratsim thanks! that worked! The only thing that needs to be known here in advance is the size of the array |
21:21:27 | FromDiscord | <awr> Go intended to attract C++ people but instead attracted ruby people |
21:21:54 | FromGitter | <mratsim> @zetashift: money (as in marketing) + Google Clout (and not Google Cloud :D) |
21:24:06 | FromGitter | <dandevelo> @zetashift I can tell you why Go was attractive for me: for many years it was the only high level language that would let me build a cross-platform app as a single binary. Coming from a C/C++ background, Go felt so productive when writing web apps that don't need any runtime or other dependencies to be installed in order to run on a server |
21:24:38 | shashlick | Go amazes me too, it has so many interesting libs that have come up quite quickly |
21:24:52 | FromDiscord | <awr> i think I learned about Nim from the D forum |
21:25:00 | shashlick | the syntax doesn't bother me since it is quite C like but i remember running into limitations all the time |
21:25:23 | FromGitter | <mratsim> When I look at Go and Javascript I am under impression that 90% of the devs are doing web stuff |
21:26:38 | shashlick | i built one tool in go and then immediately jumped ship to Nim when I discovered it, much more Pythonic which I prefer and of course much much more expressive |
21:27:08 | FromGitter | <dandevelo> And Go also has a great eco-system. Just an example: if you want to bundle all your html/css/imgs/js with the Go binary, there are plenty of options to do that easily: https://tech.townsourced.com/post/embedding-static-files-in-go/ |
21:27:15 | FromDiscord | <awr> my first impressions of Nim were probably "ew, pythonic syntax" but then i got used to it |
21:27:31 | FromGitter | <dandevelo> It is still hard to do the same with Nim at this time as the ecosystem is not that developed |
21:27:51 | FromGitter | <mratsim> in Rust* |
21:28:41 | shashlick | well, that's the thing, if you like Ruby, you will like Crystal, i didn't like ruby as much as I did Python, so Nim is much more appealing from that point of view |
21:28:55 | shashlick | and I never liked C++, Java, too verbose so I correspondingly don't like Rust |
21:29:10 | shashlick | if i'm not being forced, I will pick the language that *feels* comfortable |
21:29:52 | FromDiscord | <awr> you do C/C++ for such a long time, you start thinking its syntax is actually sensible and totally not verbose |
21:30:08 | shashlick | @dandevelo: the thing is that the C ecosystem is huge so Nim's not really that limited, it's why i've spent as much time as I have with nimgen wrappers |
21:31:15 | shashlick | and nim/nimble/c2nim makes it so easy |
21:31:59 | FromGitter | <mratsim> in the mean time in /r:/programming, java releases underwhelming features: https://able.bio/DavidLandup/new-features-in-java-10--21tl3ie ⏎ ⏎ 1) Local-variable type inference ⏎ 2) Change in Java garbage collecting ⏎ 3) Root Certifications ... [https://gitter.im/nim-lang/Nim?at=5b218d4e82b1b355c955b19c] |
21:32:06 | FromGitter | <dandevelo> @shashlick: true, but there are still some rough edges for now: e.g: you can't import a C const into a Nim const. And when it comes to existing libraries Go still has an advantage today, you can find pretty much a library for anything you want today and that it is still not the case with Nim. It will take some time but it will get there. |
21:32:32 | FromDiscord | <awr> @dandevelo "It’s a command line application that you pass a directory path to and it generates a .go file with your assets embedded in it." |
21:32:38 | FromGitter | <mratsim> you can’t find a neural network library in Go, but there is one in Nim :D |
21:32:42 | FromDiscord | <awr> i think i'll take `staticRead()` instead... |
21:32:58 | FromGitter | <dandevelo> @awr try doing staticRead for a directory structure |
21:33:54 | FromGitter | <dandevelo> @mratsim luckily the Nim community has people like you so we can have that :D Thank you for your work! |
21:34:09 | shashlick | but I disagree with that logic - i'd rather use an established C library and wrap it and get my work done than write whole new libs for my language |
21:34:38 | shashlick | no doubt there's many cool Go libs but there's tons more C code to leverage |
21:34:52 | FromGitter | <dandevelo> @shashlick - that's what I am saying for Go - you don't need to write new libs - they exist already |
21:35:59 | shashlick | someone did and I believe that was a waste of time if a corresponding C lib already existed |
21:36:21 | FromGitter | <dandevelo> That *if* is essential there :) |
21:36:23 | shashlick | cause you have to count all the effort in dev, test, maintenance, support, quality |
21:36:50 | FromGitter | <mratsim> Many C libraries are dead though |
21:36:50 | shashlick | no doubt and part of the reason is that few people used C to build web apps, so you see some good stuff there |
21:37:08 | FromDiscord | <awr> how do you work with directory structures for this go thing |
21:37:26 | FromGitter | <dandevelo> Go is an easier language to pick than C so you will find a lot more people contributing to Go projects than C projects |
21:37:42 | shashlick | anyway, long story short, I prefer leverage and reuse and Nim has a huge ecosystem to easily leverage |
21:38:00 | shashlick | i'd like to see more fixes/improvements in c2nim to handle C++ code |
21:38:10 | FromDiscord | <awr> does it just create an object or something with other objects representing folders and byte arrays representing files |
21:38:10 | shashlick | then we have even more libs to pick |
21:38:12 | FromGitter | <mratsim> for example, when looking for a fast big int library at Status we first settled on ttmath - https://github.com/status-im/nim-ttmath, then after usage we had too many issues (mostly with C++ “non-trivial” destructors) |
21:38:48 | FromGitter | <mratsim> and after checking a bit more, I saw absolutely no test in the lib apart from “add” even though it’s recommended everywhere. |
21:39:17 | FromGitter | <mratsim> and it’s been there for more than 5 years. |
21:39:46 | FromGitter | <Vindaar> @dandevelo @mratsim I've been poking the VM in the last hour to figure out why the `quote do` produces `nkLitInt` instead of respecting the type of the sequence. By now at least I understand enough to inject the correct kind. But in a super hacky way :P |
21:40:22 | FromDiscord | <awr> or implement it as a tree or w/e |
21:40:58 | FromGitter | <dandevelo> @Vindaar sounds good! |
21:41:01 | shashlick | i'd work on improving c2nim but don't think I have the expertise |
21:41:11 | FromGitter | <zetashift> @dandevelo Oh Go has a lot of upsides, but for some projects I don't think it's the right fit yet people seem to come up with glorious ways to do it anyway because it's so easy to work with I guess |
21:41:27 | FromGitter | <mratsim> expertise in Nim is acquired. A year ago I knew nothing ... |
21:41:32 | shashlick | but ya, there will be some dead libs in C world for sure |
21:42:05 | shashlick | it's a question of mindset, i don't do well in the world of compilers and parsers and too lazy to learn now |
21:42:14 | FromGitter | <dandevelo> @zetashift I like Go but I really want to replace it with Nim in the future for all my apps. Can't do that now but I am looking forward to the day I will be able to |
21:42:30 | FromGitter | <mratsim> I think Go will have troubles to just get a Tensor library working. The lack of generics is just killing it for any kind of numerical computing |
21:42:50 | FromGitter | <dandevelo> Yep, generics is a big win for Nim when compared to Go |
21:43:20 | FromGitter | <zetashift> isn't one of Go's biggest drawback except generics that it has a really iffy C ffi? |
21:44:01 | FromGitter | <mratsim> there is overhead but as far as I know it deos the job. |
21:44:05 | FromGitter | <mratsim> does* |
21:44:36 | FromGitter | <zetashift> probably if you want Nim to occupy the Go-space, you'd want to improve the "cloud" ecosystem |
21:44:49 | FromGitter | <dandevelo> true that |
21:45:30 | * | find0x90 joined #nim |
21:45:31 | FromGitter | <dandevelo> If Nim can dominate these: https://www.techempower.com/benchmarks/ more people will start paying attention |
21:46:42 | FromGitter | <mratsim> I believe in dom96 and 2vg |
21:47:01 | FromGitter | <mratsim> Nim really has a community of performance magicians |
21:47:17 | shashlick | we need a lib that can generate code out of web APIs |
21:47:35 | shashlick | openapi / swagger |
21:48:09 | shashlick | will bring a lot of the web into the nim ecosystem |
21:49:36 | FromGitter | <dandevelo> Yes, things like aws sdk for nim would definitely attract more people to the language |
21:50:36 | shashlick | One other interesting idea is to wrap Go |
21:50:38 | * | find0x90 quit (Quit: find0x90) |
21:50:48 | FromDiscord | <treeform> aws and gcloud sdk are needed |
21:51:31 | FromDiscord | <treeform> i kind of use gcloud sdk in nim through process open shell calls. |
21:54:04 | dom96 | :D |
21:58:01 | FromGitter | <dandevelo> For myself, I am trying to learn more about Nim (if it wasn't obvious yet from my questions here :P) so that I can also contribute to the ecosystem. I admire all people releasing libraries that make it easier to use Nim for various scenarios. At the same time I believe I should not wait only for others to improve the ecosystem, I should also put in the work myself. |
21:58:10 | * | brainproxy quit (Ping timeout: 256 seconds) |
21:58:48 | FromGitter | <zetashift> I still need to take the drug that is called metaprogramming |
22:01:06 | * | DarkArctic_ joined #nim |
22:03:09 | FromGitter | <mratsim> Beware, there is no facility to help you away from it :P |
22:06:02 | shashlick | @dandevelo: it's funny you say that, cause I've spent almost two decades coding and haven't had to make a single library since most of the stuff I needed already existed. That's been different with Nim, have found some way to be useful beyond my own projects, working on a greater goal than my own. |
22:07:51 | shashlick | frankly, it's annoying when I go on a tangent due to some Nim issue or limitation and have to get my hands dirty or whatever, but extremely rewarding and a great experience working with such talented people |
22:08:22 | FromGitter | <mratsim> haha ^ exactly how I felt when dealing with static |
22:09:17 | FromGitter | <Vindaar> @dandevelo I'm still pretty new to Nim's ecosystem, too. Before that I hadn't released any libraries etc. either. And at the beginning I was sort of scared of releasing a library with "ugly code". But I came to realize that's stupid. Yeah, my code may not be perfect, but hey, at least library xy exists now! :) |
22:09:34 | FromGitter | <dandevelo> @Vindaar that's the spirit! |
22:09:59 | FromGitter | <Vindaar> and the bonus: with that attitude learning is a lot quicker :D |
22:10:11 | FromGitter | <dandevelo> 100% agree |
22:17:04 | shashlick | All hail the great Nim for giving us this little playground to play in |
22:17:52 | FromGitter | <mratsim> wow, Nim had +30 stars today |
22:23:56 | FromGitter | <zetashift> Ain't a well placed post on popular tech news sites just wonderful |
22:26:11 | * | mzigora quit (Quit: Leaving) |
22:28:09 | * | kinkinkijkin quit (Quit: Leaving) |
22:33:18 | * | xet7 quit (Remote host closed the connection) |
22:40:03 | Araq | vindaar: there is semmacrosanity to annotate the types back |
22:40:11 | Araq | probably the error is somewhere in there |
22:42:12 | FromGitter | <Vindaar> Araq: ah, thanks! that looks promising :) |
22:43:53 | * | brainproxy joined #nim |
23:06:49 | * | thomasross_ is now known as thomasross |
23:29:32 | * | find0x90 joined #nim |
23:30:39 | * | find0x90 quit (Client Quit) |
23:32:28 | * | Jesin quit (Quit: Leaving) |
23:37:10 | * | Jesin joined #nim |
23:39:23 | * | krux02 quit (Remote host closed the connection) |
23:40:52 | * | thomasross quit (Remote host closed the connection) |
23:41:10 | * | thomasross joined #nim |
23:43:01 | * | elrood quit (Quit: Leaving) |
23:43:38 | * | rockcavera quit (Remote host closed the connection) |
23:52:12 | * | rockcavera joined #nim |