00:09:29 | * | krux02_ joined #nim |
00:09:59 | * | Hideki_ joined #nim |
00:11:45 | * | krux02 quit (Ping timeout: 240 seconds) |
00:14:48 | * | Hideki_ quit (Ping timeout: 256 seconds) |
00:21:14 | * | Trustable quit (Remote host closed the connection) |
00:28:02 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
00:31:25 | * | Hideki_ joined #nim |
00:42:40 | * | disrupteq joined #nim |
00:45:25 | FromDiscord | <Simula> is there a way to define a symbol from a nimble file? I want a task that defines debug |
00:45:26 | * | abm quit (Quit: Leaving) |
00:45:50 | FromDiscord | <Simula> wait i'm dumb |
00:46:46 | FromDiscord | <Varriount> Hm, anyone know if Rust has runtime interfaces like Go, or anything equivalent? |
00:48:06 | * | dwdv quit (Ping timeout: 265 seconds) |
00:54:56 | leorize | wrong channel :P |
00:58:22 | * | smitop joined #nim |
01:03:16 | * | sekao joined #nim |
01:19:48 | * | Hideki_ quit (Remote host closed the connection) |
01:20:02 | * | Hideki_ joined #nim |
01:21:56 | * | Hideki_ quit (Remote host closed the connection) |
01:27:00 | * | letto quit (Quit: Konversation terminated!) |
01:28:56 | * | letto joined #nim |
01:29:43 | * | krux02_ quit (Remote host closed the connection) |
01:46:39 | FromDiscord | <slymilano> There's still a bug where I have to pass threads:on to the compiler, but running through nimble doesn't pass in the options properly |
01:47:12 | leorize | use a project.nim.cfg to do that |
01:47:39 | FromDiscord | <slymilano> do you have an example? |
01:49:52 | FromGitter | <awr1> https://github.com/nim-lang/Nim/issues/2457 |
01:49:53 | disbot | ➥ Iterate items in reversed order |
01:50:01 | FromGitter | <awr1> kinda wish a reverse iterator was in the stdlib, but w/e |
02:04:15 | FromGitter | <awr1> is there something in strutils for like... a getting from the beginning of a string to a certain substring (and excluding it?) |
02:04:40 | FromGitter | <awr1> like a `"foobarbaz".upTo("bar") == "foo"` |
02:05:56 | FromDiscord | <flywind> you can use `parseUntil` in parseutils |
02:06:39 | FromGitter | <awr1> thanks |
02:08:18 | sekao | i'm trying to get a "view" into a seq that doesn't require any copying (like slices do). i think someone here said it was possible with iterators...is that right? i've never found an example that does this |
02:09:29 | sekao | it would be ideal to just get a ref seq that pointed to a part of a seq |
02:13:40 | disrupteq | iterate over indices. |
02:22:58 | * | Tanger quit (Read error: Connection reset by peer) |
02:24:18 | sekao | i think i can write the iterator but i am not sure how to "apply" that to my seq to produce the view into it |
02:27:42 | disruptek | the same way you apply a single index to view a member of the seq... |
02:30:44 | * | thomasross quit (Read error: Connection reset by peer) |
02:30:45 | * | thomasross_ joined #nim |
02:31:07 | * | thomasross_ is now known as thomasross |
02:33:29 | sekao | i would get a single index via `mySeq[0]`, so you mean pass the iterator where the 0 is? |
02:41:11 | sealmove | https://github.com/sealmove/testify is finished |
02:45:48 | * | chemist69 quit (Ping timeout: 256 seconds) |
02:47:29 | * | chemist69 joined #nim |
02:49:32 | * | sekao quit (Remote host closed the connection) |
03:00:19 | * | Irregulator quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
03:11:58 | * | muffindrake quit (Ping timeout: 245 seconds) |
03:14:23 | * | muffindrake joined #nim |
03:16:50 | * | dadada quit (Ping timeout: 240 seconds) |
03:18:05 | * | dadada joined #nim |
03:18:30 | * | dadada is now known as Guest12859 |
03:19:20 | * | smitop quit (Quit: Connection closed for inactivity) |
03:50:17 | * | ftsf quit (Quit: Leaving) |
04:09:50 | * | deepend_ is now known as deepend |
04:09:56 | * | nsf joined #nim |
04:21:14 | * | Irregulator joined #nim |
04:54:48 | * | sealmove quit (Quit: WeeChat 2.7.1) |
05:19:30 | FromDiscord | <slymilano> having issues using params in my db_sqlite query: https://pastebin.com/1tQvw7S6 |
05:20:52 | FromDiscord | <slymilano> I'm having some issues using a simple LIKE param in my query. If I hardcode the value between the `%VALUE%` symbol it works fine. https://pastebin.com/wbGwQ3bJ |
05:23:56 | leorize | ah you can't really do it like that |
05:25:29 | leorize | since the string will be properly quoted and escaped, it'd result in something like this: `'%'your string here'%'` which will expose your string as sql |
05:25:33 | leorize | fun times :) |
05:26:26 | * | NimBot joined #nim |
05:26:55 | leorize | to do it correctly, simply do a concatenation |
05:27:13 | leorize | I think for sqlite you do it like this: '%' || ? || '%' |
05:27:59 | FromDiscord | <slymilano> thank you, i'll do a string concat |
05:29:52 | leorize | https://play.nim-lang.org/#ix=2emW |
05:31:31 | FromDiscord | <slymilano> awesome thank you! |
06:16:19 | Guest12859 | hi |
06:16:25 | * | Guest12859 is now known as dadada |
06:16:39 | dadada | I've another testcase similar to the bug I recently found |
06:16:44 | dadada | https://play.nim-lang.org/#ix=2emZ |
06:17:12 | dadada | mratsim helped me to find a workaround, maybe there's one here too |
06:17:58 | dadada | it says 'teststring[0 .. 1]' cannot be assigned to , though it works with manually written code |
06:18:38 | dadada | but when I macro writes the left part of the assignment op it doesn't work |
06:22:48 | dadada | it works when you change the slice to an intlit |
06:31:50 | * | muffindrake quit (Quit: muffindrake) |
06:32:02 | * | muffindrake joined #nim |
06:35:58 | * | narimiran joined #nim |
06:41:14 | dadada | s/I macro/a macro |
06:46:15 | * | dddddd quit (Ping timeout: 265 seconds) |
06:51:15 | FromGitter | <awr1> is genotrance in here? |
06:55:29 | narimiran | @awr1 he goes by the name shashlick when here |
06:55:44 | FromGitter | <awr1> ah i forgot |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:05:09 | * | gmpreussner joined #nim |
07:10:24 | * | Irregulator quit (Read error: Connection reset by peer) |
07:33:04 | * | tdog joined #nim |
07:46:32 | * | PMunch joined #nim |
07:48:13 | Araq | dadada, you need to generate a call to '..', I think |
07:48:54 | dadada | Araq: I'll try, did you see the other similar issue I raised here a day or so ago? |
07:52:06 | PMunch | Speaking of bugs raised here a day ago. Should I report this Araq, or is it known? https://play.nim-lang.org/#ix=2enf |
07:52:36 | dadada | mratsim provided a workaround for it, but the issues are probably related |
07:52:39 | Araq | report bug on github |
07:52:55 | Araq | I don't read everything on IRC anymore |
07:53:15 | Araq | when I'm around it's likely I've read it but I don't read the logs, no time |
07:54:56 | Araq | mratsim: the priorities are yours to set but remember that only 'showstopper' means "to be fixed for the upcoming release" |
07:59:52 | dadada | Araq: I tried it with a call to .. and now I get 'teststring[`..`(0, 1)]' cannot be assigned to ... did you mean something else? |
08:00:25 | Araq | no, that's what I meant |
08:00:33 | Araq | so now you need to show me your macro I guess |
08:01:19 | dadada | well, just as I'm clicking on the share button on playground, the thing crashed :-( I have to write it again |
08:03:32 | dadada | 2nd writing of the macro done: https://play.nim-lang.org/#ix=2enh |
08:08:05 | Araq | well |
08:08:20 | Araq | na[0..1] = "da" is really `[]=` |
08:08:47 | Araq | and not "assignment to []" |
08:19:43 | dadada | Araq: ok, I'm probably really annoying you know, (knowing that you are the guru of nim), but in my understanding my macro t ignores the argument na (which I just put there for making the macro work), and everything (meaning: t na) gets expanded to teststring[`..`(0,1)] which is confirmed by the compilers "'teststring[`..`(0, 1)]' cannot be assigned to" message, since it can only know that it can't be assigned |
08:19:50 | dadada | to, if it has first expanded to it |
08:19:57 | dadada | s/you know/you now ... |
08:30:43 | dadada | btw. I meant guru as a compliment, hopefully it came across |
08:32:08 | PMunch | The problem is that what you're doing is basically the second case here: https://play.nim-lang.org/#ix=2enq |
08:32:29 | PMunch | So Nim will extract the substring first, then try to assign to that substring, which doesn't work |
08:34:42 | dadada | ah, so is there any way to get around this...? |
08:36:37 | dadada | the macro does work when returning an index instead of a slice/substring |
08:38:02 | * | JustASlacker joined #nim |
08:38:09 | JustASlacker | so |
08:38:13 | JustASlacker | I have a strange problem |
08:38:21 | JustASlacker | Error: cannot open 'strformat' |
08:39:13 | PMunch | dadada, hmm, not sure TBH |
08:39:30 | PMunch | JustASlacker, nim --version? |
08:39:42 | JustASlacker | Nim Compiler Version 0.17.2 (2018-02-05) [Linux: amd64] |
08:40:11 | narimiran | JustASlacker: you're 4 versions behind |
08:40:15 | JustASlacker | oh noes |
08:40:17 | dadada | JustASlacker: I'm curious, why would you use such an old version of nim? |
08:40:36 | JustASlacker | I did curl https://nim-lang.org/choosenim/init.sh -sSf | sh |
08:40:57 | PMunch | 4 versions? He's 11 versions behind :P |
08:41:33 | PMunch | JustASlacker, when? |
08:41:35 | JustASlacker | mhh |
08:41:46 | PMunch | What does `choosenim update stable` do? |
08:41:54 | JustASlacker | there seems to be a conflict, the ouput of chooesenim is Switched to Nim 1.0.4 |
08:43:36 | Araq | JustASlacker, please install Nim via the other documented means if choosenim causes trouble |
08:44:13 | JustASlacker | It looks like /usr/bin/nim is old |
08:44:29 | JustASlacker | .nimble/bin/nim is recent |
08:44:41 | dadada | JustASlacker: just rm -f /usr/bin/nim |
08:45:00 | dadada | /usr/bin is probably first in your PATH and when you call nim that takes priority |
08:45:22 | JustASlacker | yeah, did apt remove nim |
08:45:32 | JustASlacker | not sure when I installed that via apt ... |
08:45:43 | JustASlacker | must have been drunk or something |
08:47:05 | JustASlacker | anyway, thanks for the helps |
08:47:30 | PMunch | No problem |
08:47:34 | JustASlacker | loving nim so far |
08:47:40 | PMunch | Great :) |
08:48:02 | JustASlacker | gotta get used to the fact I cant edit the compiled files, tho. |
08:48:06 | JustASlacker | years of python ruined me |
08:48:33 | PMunch | What do you mean? |
08:48:35 | JustASlacker | had a problem with a nim script but couldnt access source repository |
08:48:46 | PMunch | Ah |
08:48:46 | JustASlacker | because I wasnt in the VPN |
08:49:08 | JustASlacker | that was kinda awkward |
08:49:17 | PMunch | Maybe nimcr would help a bit |
08:49:42 | PMunch | I use it for Nim scripts that I have created for simple tasks on my linux machine, similar to what I would do in Python |
08:49:49 | JustASlacker | oh, funky |
08:50:48 | JustASlacker | thx, that looks good. |
08:50:52 | JustASlacker | gonna try that |
08:51:30 | PMunch | For simple scripts it's pretty neat |
08:51:57 | dadada | maybe there could be a special wrapper that wraps a nimcompiler with the source files and the compiled binary into a special executable file, it could contain an image or archive of the sources that could be mounted to a directory with a fuse filesystem and be edited there as usual, then there could be a special command line argument for that wrapper/binary like --recompile that compiles from the edited |
08:52:03 | dadada | sources and changes the wrapped binary |
08:53:14 | dadada | nimcr is good! |
08:53:54 | PMunch | dadada, that sounds complicated.. |
08:55:03 | dadada | PMunch: it can be done with standard linux command line tools, I believe, the biggest downside would be the resulting file size |
08:55:30 | JustASlacker | probably still less than go builds |
08:57:49 | PMunch | To be fair though you could probably achieve world domination with standard linux command line tools, doesn't mean it's easy :P |
08:58:22 | dadada | PMunch: not easy, but not that hard either, it's pretty amazing what you can do with some shell skills alone :P |
08:58:42 | dadada | it all depends on your knowledge |
08:58:50 | PMunch | Oh trust me, I know |
08:58:58 | PMunch | Spend most of my day in a Linux shell :P |
08:59:23 | dadada | so do I :-) |
08:59:31 | * | actuallybatman quit (Ping timeout: 255 seconds) |
09:07:53 | * | Vladar joined #nim |
09:21:07 | * | floppydh joined #nim |
09:28:15 | * | solitudesf- quit (Remote host closed the connection) |
09:29:12 | * | solitudesf joined #nim |
09:37:24 | * | dwdv joined #nim |
09:45:19 | PMunch | Hmm, is there a way to make a code-block in docs use Nim syntax highlighting? |
09:49:50 | Araq | ..code-block:: nim |
09:53:46 | PMunch | Doesn't work.. |
09:54:25 | Araq | it works for me |
09:54:28 | lqdev[m] | wasn't it `.. code-block:: nim`? |
09:54:36 | lqdev[m] | like, with the space after `..` |
09:54:39 | PMunch | https://uploads.peterme.net/2020-03-16-105419_661x247_scrot.png |
09:54:45 | lqdev[m] | also Nim's RST parser supports markdown code blocks |
09:54:54 | PMunch | Same result.. |
09:55:47 | PMunch | Wowzer, wind is picking up here.. I can barely see the house across the street for all the snow |
09:57:07 | PMunch | https://uploads.peterme.net/2020-03-16-105650_829x208_scrot.png |
09:57:10 | PMunch | That's the code |
09:57:24 | PMunch | (not sure why I screenshot that instead of pasting it..) |
09:58:27 | PMunch | With markdown syntax it worked |
09:59:07 | Araq | PMunch, not enough indentation, you need at least 3 spaces after ::nim\n |
09:59:16 | Araq | it's an RST gotcha |
09:59:28 | Araq | no wonder markdown is winning :-) |
09:59:47 | PMunch | What, that is three spaces.. |
10:00:21 | Araq | then maybe 4, who knows |
10:00:23 | lqdev[m] | afaik, that's 2 spaces. |
10:00:29 | PMunch | Tried up to 5.. |
10:00:34 | Araq | and you also need a newline more |
10:00:42 | Araq | :: nim\n\n |
10:00:53 | Araq | and one to end the block |
10:02:07 | PMunch | It needed one before the block.. |
10:02:19 | lqdev[m] | damn |
10:02:30 | lqdev[m] | Araq: why is Nim using RST instead of Markdown? |
10:02:35 | PMunch | And a space after the .. |
10:02:49 | lqdev[m] | PMunch: told ya about the space |
10:03:06 | PMunch | http://ix.io/2enA/nim |
10:03:08 | PMunch | This works |
10:03:16 | PMunch | Yeah, but only that didn't work.. |
10:03:30 | PMunch | I had already tried with a space before asking |
10:10:39 | dadada | does markdown support all features of rst? |
10:13:21 | lqdev[m] | no, it has a different syntax |
10:13:34 | lqdev[m] | but overall I don't think the feature set differs that much |
10:15:11 | dom96 | This is IMO one great example why markdown is superior |
10:16:09 | PMunch | Links are the big one for me |
10:17:28 | PMunch | [this](peterme.net) is so much better than `this<peterme.net>`_ (and yes I had to google how to do that in RST, I always do..) |
10:17:51 | dom96 | you also need a space before the < in rst IIRC |
10:18:06 | PMunch | Damn it! I was wondering about that :P |
10:18:25 | PMunch | The docs I found had a line-break there because of page-reflow.. |
10:19:12 | Araq | anyhow we DO SUPPORT RST |
10:19:15 | Araq | out of the box |
10:19:20 | Araq | er |
10:19:25 | Araq | anyhow we DO SUPPORT markdown! |
10:19:41 | Araq | so use it and stop complaining |
10:19:55 | PMunch | Oh yeah, I'm not complaining about Nim. I'm just complaining about RST :P |
10:20:18 | dadada | do you support one of the markdown flavors? or just the original markdown? |
10:20:40 | dom96 | do we support markdown in the docs? |
10:22:53 | PMunch | Some markdown works |
10:24:52 | axion | Can the sequtils procedures be used on arrays too or just sequences? I'm looking for a way to efficiently map over the elements of an array var and modifying the values in-place |
10:25:55 | lqdev[m] | some of them can be |
10:26:06 | lqdev[m] | check ones that accept `openArray` as arguments |
10:26:39 | lqdev[m] | most of them can |
10:27:43 | axion | Cool, thanks. |
10:28:29 | * | krux02 joined #nim |
10:29:03 | Araq | dom96, yeah we do |
10:29:17 | dom96 | nice |
10:30:01 | PMunch | Not sure if it's documented anywhere though.. |
10:40:25 | axion | is there anything built in that will replace the contents of an array starting at some index, with the contents of another small array? |
10:42:04 | dadada | axion: something like this https://play.nim-lang.org/#ix=2enM |
10:42:05 | dadada | ? |
10:44:06 | axion | AH I didn't realize you could use slices like that. Thanks again |
10:44:30 | dadada | as long as you don't use a macro to create the slice, then it fails :-) as I recently found out |
10:44:47 | PMunch | Well you can use it to create the slice |
10:45:16 | dadada | PMunch: I think I tried that and it failed, but let me try again |
10:46:42 | axion | i suppose there isn't anything like available for sparse writing, like a[1,4-6,9] = [1,2,3,4,5] ? |
10:47:17 | PMunch | dadada, I mean this works: https://play.nim-lang.org/#ix=2enP |
10:47:30 | dadada | PMunch: yeah, you're right I also tried that now, and it does work |
10:48:01 | PMunch | axion, no for that you would need some kind of macro |
10:48:06 | PMunch | To split it up into pieces |
10:49:06 | FromGitter | <alehander92> its possible in theory |
10:49:07 | dadada | so let me correct my statement into: as long as you don't use a macro to create the code that tries to access a slice of an identifier by a macro, it works |
10:52:59 | dadada | s/of an identifier/of an array |
10:54:44 | Araq | slices have nothing to do with it really, it's simply []= vs [] |
10:55:10 | * | lritter joined #nim |
10:55:52 | dadada | then why does quote do: array[0] work while quote do: array[0..2] does not? |
10:58:21 | Araq | because a[0] uses the builtin [] which returns a 'var T' |
10:58:34 | Araq | and a[0..2] uses a custom []= instead |
10:58:50 | Araq | well |
10:59:05 | Araq | a[0..2] = value uses the custom []= |
10:59:12 | Araq | and a[0..2] uses a custom [] |
11:02:02 | dadada | well, hopefully support for what I need can be added to the custom [] |
11:07:00 | * | smitop joined #nim |
11:09:00 | PMunch | Well there is no string slice type that [] could return |
11:09:22 | Araq | sure it could return var openArray[char] |
11:09:29 | PMunch | Wait, could it? |
11:09:47 | Araq | and it probably should but we're waiting for the RFC dealing with better checking for openarrays |
11:09:51 | PMunch | I didn't think openArray could be returned |
11:10:03 | Araq | Nim evolves :P |
11:10:26 | Araq | but yeah, currently you can't unless you're in system.nim iirc |
11:10:41 | * | abm joined #nim |
11:12:37 | PMunch | Ah.. |
11:12:42 | PMunch | Yeah because this doesn't work: https://play.nim-lang.org/#ix=2enU |
11:13:17 | PMunch | Wait.. That proc was never called.. |
11:17:33 | dadada | well, then I'm putting my programs into system.nim , great that there's finally a workaround :-) |
11:18:32 | FromGitter | <alehander92> what happened with custom system.nim btw |
11:18:39 | FromGitter | <alehander92> a bit offtopic :P |
11:18:57 | PMunch | dadada, include system.nim :P |
11:23:33 | dadada | PMunch: if only it was this easy |
11:23:56 | * | federico3 left #nim ("http://quassel-irc.org - Chat comfortably. Anywhere.") |
11:23:59 | * | federico3 joined #nim |
11:24:12 | PMunch | What are you trying to do anyways? |
11:26:22 | dadada | it's a secret project right now, I can't tell you much besides, that I'll probably release it as FOSS when done :D |
11:26:52 | FromGitter | <alehander92> oh no that's the new bio manhatan project right |
11:26:54 | dadada | seriously though I'm developing a bunch of convenience tools for nim |
11:27:47 | dadada | and as you know I'm a noob here, so I'm only making slow but steady progress in this |
11:28:39 | dadada | let's just say that I want nim to be even easier to use than it already is |
11:29:28 | FromGitter | <alehander92> but then we need to add features |
11:29:30 | FromGitter | <alehander92> to make it hard again |
11:29:53 | FromGitter | <alehander92> :) no, seriously sounds good, ok |
11:30:24 | dadada | alehander92: more features doesn't equal being harder to use, it depends, but I know what you mean, actually I'm also adding features :D |
11:33:14 | dadada | I've one subproject of this project, that is really promising, but needs a lot of thought to get it right, it will do no good to write the code in a few days, it's really a specification that I'm writing currently |
11:35:28 | * | okcc joined #nim |
11:37:24 | dadada | does disruptek stream today? |
11:40:59 | * | couven92 joined #nim |
11:43:02 | FromGitter | <alehander92> yeah, it depends how well they interact |
11:43:03 | FromGitter | <alehander92> i guess |
11:43:13 | FromGitter | <alehander92> disruptek is in the usa, it should be still early |
11:49:05 | Araq | narimiran, my fix works and the tests remain green, can you believe it? |
11:51:48 | * | couven92 quit (Ping timeout: 256 seconds) |
11:57:27 | axion | Can someone help me with type parameters? I've been trying for days to understand them, and I'm not sure what I'm doing wrong. |
11:59:08 | dadada | I'll try, do you have a testcase? |
11:59:12 | axion | In this code, I would like to learn how to constrain the types for the `z` and `w` procs, such that line 32 is a static error rather than a runtime error. https://play.nim-lang.org/#ix=2eoa |
12:01:27 | * | kungtotte quit (Read error: Connection reset by peer) |
12:02:16 | * | kungtotte joined #nim |
12:03:00 | dadada | sry, I feel someone else will have to help you, and they wilL! |
12:03:09 | PMunch | Hmm, I have some annoying bug with converters |
12:03:43 | PMunch | It tries to apply a `converter toNimNode(x: NimNode): NimNode`, why would that ever happen? |
12:03:56 | * | Vladar quit (Quit: Leaving) |
12:04:00 | axion | dadada: Thanks anyway. |
12:04:09 | FromGitter | <dawkot> axion: https://play.nim-lang.org/#ix=2eoa |
12:04:19 | FromGitter | <dawkot> whoops |
12:04:50 | FromGitter | <dawkot> https://play.nim-lang.org/#ix=2eob |
12:06:14 | axion | Ah so you';re unioning a type class right in the parameter section. Interesting. Is there any other way to do this apart from defining all combinations as separate types? This is a contrived example, and I actually have many types, but each function takes a specific configuration. |
12:06:36 | FromGitter | <dawkot> Also it was never a runtime error |
12:07:07 | axion | Well nim check didn't catch it. Only when I executed it did it give me an OOB error |
12:08:06 | PMunch | Can also be done like this if you want to check for any Vec[I]: https://play.nim-lang.org/#ix=2eoe |
12:08:15 | PMunch | Not only those you have defined aliases for |
12:08:58 | PMunch | Might be a prettier way to do that though.. |
12:10:00 | axion | I see |
12:10:56 | PMunch | You can at least put it in a template: https://play.nim-lang.org/#ix=2eog |
12:12:10 | dadada | those are nice examples of Nim code IMO |
12:12:35 | PMunch | And you don't have to specify the static[int] part as that is defined for the type: https://play.nim-lang.org/#ix=2eoh |
12:13:57 | * | nsf quit (Quit: WeeChat 2.7) |
12:15:52 | PMunch | And you can throw in a touch of error checking: https://play.nim-lang.org/#ix=2eoi |
12:17:44 | axion | The only thing I don't like is it produces a stack trace from the template, rather than the echo line. I would rather than line stand out in the stack rather than implementation details |
12:25:04 | PMunch | Well it starts on the echo line.. |
12:25:17 | PMunch | The shows the call to z, then the call to minimalCardinality |
12:26:15 | axion | Is there even a way to make this be caught with nim check? let x = [1,2,3]; echo x[42] ? I get no warnings or errors until I actually run the binary |
12:26:39 | PMunch | Run the binary? |
12:26:45 | PMunch | You should get an error when you compile it |
12:27:03 | axion | compilation produces no warnings/errors. running the resulting binary is when the error occurs |
12:27:41 | axion | oh hmm, maybe my setup is messed up |
12:27:58 | PMunch | Not the code that I shared.. That stops during compilation |
12:28:32 | PMunch | Vim with nimlsp even highlights that there is an error on the echo line |
12:29:23 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
12:29:37 | axion | ah i'm using nim.nvim and i guess it only shows warnings/errors from `nim check`. |
12:29:44 | axion | and nim check doesn't catch this error |
12:30:20 | PMunch | It does when I run it.. |
12:30:39 | PMunch | http://ix.io/2eol |
12:30:52 | axion | as mentioned, just the 2 lines above |
12:31:20 | PMunch | Oooh, sorry |
12:32:17 | PMunch | Yeah that stops on compilation for me, but nim check doesn't detect it |
12:32:38 | axion | Is there any way to get nim check to be more aggressive for cases like this? |
12:33:21 | FromGitter | <alehander92> axion yeah i think i've wondered about this case |
12:33:59 | FromGitter | <alehander92> not sure, it can't be that complicated to catch cases for [index=> const] |
12:34:47 | * | Lord_Nightmare joined #nim |
12:36:01 | * | Hideki_ joined #nim |
12:39:08 | lqdev[m] | axion: the problem with nim check is that it doesn't generate any code, only checks it semantically. because of that, many checks are simply not made |
12:40:33 | * | Kaivo joined #nim |
12:43:40 | okcc | i think i'm quitting |
12:43:45 | axion | Ah ok makes sense |
12:44:34 | dadada | okcc: quitting what? |
12:48:49 | okcc | i have stuck in that for a couple of days, i'm being killing, T_T .. |
12:49:26 | okcc | https://paste.ofcode.org/mEjtLxLFXJKt5zymnuJ9Kb |
12:50:05 | FromDiscord | <Recruit_main70007> whats the issue? |
12:52:36 | PMunch | What is it supposed to do? |
12:53:13 | okcc | i can get it work (sniffing on xevents), but it'll stuck at "cleanupAndQuit" proc, and i found it's actually blocking at line 20 -> XCloseDisplay(display), that's ridiculous, https://tronche.com/gui/x/xlib/display/XCloseDisplay.html |
12:53:36 | PMunch | Why are you trying to catch a SIGTERM? |
12:53:44 | PMunch | and a SIGINT for that matter |
12:54:38 | okcc | for cleaning up x related things, which is suggest in their official docs |
12:55:51 | okcc | there's a mistake in comment at line 49, it's not in a thread now |
12:56:31 | lqdev[m] | I suggest that you use signal trapping mechanisms such as `sigwait`, they're much better than signal callbacks. mainly because you don't need to resort to global state |
12:57:21 | lqdev[m] | example: https://github.com/liquid600pgm/pomod/blob/master/src/pomod.nim#L197 |
12:57:56 | okcc | lqdev: okay, truely grateful for your advises, but that's not the thing that drives me crazy |
12:58:02 | lqdev[m] | idk if there's a `sigpoll`, `man sigpoll` doesn't exist :( |
12:58:48 | PMunch | okcc, by the way this won't work with "nim c -r" proxyexe gets the signal and does weird things |
12:59:45 | lqdev[m] | PMunch: that's why you have to use `sighold` to prevent it from catching the signal |
12:59:53 | lqdev[m] | works with SIGUSR1 and SIGUSR2 |
13:00:11 | okcc | i can just manually call XCloseDisplay(display) before quit, but it'll blocking forever so that the process cannot quit, meanwhile it starts eating a single core of my cpu |
13:00:52 | okcc | guys i'm appreciate for all of your comments, but the true problem is the XCloseDisplay T_T |
13:00:54 | lqdev[m] | I can't see anything about XCloseDisplay being able to block in the X11 docs |
13:01:03 | lqdev[m] | so this is weird |
13:01:07 | okcc | yes, it's abnormal |
13:01:12 | PMunch | I'm seeing the same issue okcc |
13:01:42 | okcc | it'll have no problem in pure C code i guess |
13:02:12 | FromGitter | <alehander92> you should look at the resulting C code from nim imho |
13:02:30 | FromGitter | <alehander92> it's probably not that different from the equivalent pure invocation of the function |
13:03:02 | okcc | that's a way to debug this code, thanks, alehander92 |
13:03:18 | PMunch | Hmm, maybe it throws a SIGINT and it goes into a loop? |
13:04:19 | PMunch | Nope, that wasn't it.. |
13:04:46 | PMunch | Tried to change it to onSignal SIGUSR2 and sent that to the process. It started the close but it never completed.. |
13:04:49 | Araq | okcc: use --stackTrace:off |
13:05:13 | Araq | and also -d:noSignalHandler |
13:07:19 | PMunch | xlib is always such a joy.. |
13:08:05 | okcc | okay, thanks you all and Araq, i'll try and give the results back here, and our nim community it so enthusiastic, i cannot keep myself of not being a part of it |
13:08:39 | PMunch | What is it that you're trying to do with this by the way? |
13:08:57 | okcc | it's all about goldendict and emacs |
13:08:58 | PMunch | I've been playing around with xlib quite a bit myself as I'm making my own WM |
13:09:17 | okcc | awesome, it' cool |
13:09:33 | okcc | let me tell you the story |
13:10:10 | dadada | PMunch: what WM? is the project still active? Nim? |
13:13:14 | okcc | i like the ctrl+c following ctrl+c global hotkey in goldendict for translating the word currently in clipboard, however, it's conflict with emacs (EX: in nim-mode, ctrl+c -- ctrl+c will compile and run cuurent nim file), so i decide to sniff the xevents for capturingthe hotkey and do the right thing according to the current focus window, so i can use emacs shortcut freely |
13:13:17 | dadada | disruptek comments on comments, and some nice words about Araq https://www.twitch.tv/disruptek/clip/MushyCourageousMomTakeNRG?filter=clips&range=all&sort=timehttps://www.twitch.tv/disruptek/clip/MushyCourageousMomTakeNRG?filter=clips&range=all&sort=time |
13:13:51 | * | silvernode joined #nim |
13:15:51 | * | smitop quit (Quit: Connection closed for inactivity) |
13:16:15 | Araq | yeah I heard it. it's a valid point of view but in the end the problem is that comments are ignored by the compiler so you can never be sure it's up to date |
13:17:07 | dadada | "nice words about Araq" , I think I need to clarify that I was joking there, I don't endorse his words, but I know he was also joking |
13:17:37 | Araq | sure, no worries, I know disruptek, we're friends |
13:18:14 | PMunch | dadada, it's called PiMo, but it isn't done yet so the source is closed for now. It's still active in the sense that I still tinker with it from time to time and have ideas I want to implement. And yes, it's all written in Nim :) |
13:18:48 | dadada | PMunch: what else is special about this WM? |
13:19:47 | FromGitter | <alehander92> yes, i still think a reasonable amount of comments is good to have into more mature codebases |
13:20:05 | FromGitter | <alehander92> especially inline comments are kinda obvious to change or not when one changes the code around them |
13:20:19 | * | silvernode quit (Ping timeout: 260 seconds) |
13:21:17 | FromGitter | <alehander92> and its not hard to imagine tooling for it, e.g. commit hook which asks you "are those comments related to those changed in diff lines still valid" |
13:21:36 | FromGitter | <alehander92> if they're not touched or something |
13:23:13 | dadada | a favor more comments ... they should be put next to the code they conern and be updated when the code is updated ... |
13:23:18 | dadada | concern |
13:25:23 | PMunch | Hmm, dadada, mind if we take this in #nim-offtopic? I started typing things out and it became pretty long :P |
13:25:35 | PMunch | Or a PM for that matter |
13:25:42 | PMunch | But just in case anyone else wa wondering |
13:25:55 | dadada | I never mind a PM |
13:26:40 | * | silvernode joined #nim |
13:31:26 | disruptek | if the comments are out of date, update the comments. |
13:31:43 | disruptek | that's almost verbatim from my, uh, comments. |
13:32:02 | disruptek | so you maintain two pieces of "code." |
13:35:04 | disruptek | big deal. only one set of code can have bugs. the other set serves to provide a bug-free statement of intent. |
13:35:41 | * | silvernode quit (Ping timeout: 246 seconds) |
13:36:05 | disruptek | otherwise, when you detect a bug with your eyes, you have to decrypt intent by grasping the entire surface. |
13:37:01 | disruptek | we already know that bugs exist and more are made with every commit. |
13:37:11 | Araq | hey... |
13:37:21 | disruptek | so comments are a cheap reusable contribution against bugs. |
13:37:39 | disruptek | write once, read many. |
13:38:09 | * | shadowbane quit (Quit: Konversation terminated!) |
13:39:50 | disruptek | so i hit 50 followers and i cannot find a single thing in the twitch ui that has changed. |
13:40:13 | * | nsf joined #nim |
13:40:23 | disruptek | the latency mode is still set to "low latency". |
13:40:36 | FromGitter | <alehander92> disruptek remember me when you become president |
13:40:56 | disruptek | pass. |
13:41:18 | FromGitter | <alehander92> maybe for the better with the size of this army |
13:43:30 | disruptek | this was a pointless goal. 😠 |
13:44:08 | disruptek | i'm not giving twitch money and no one else should, either. |
13:44:32 | disruptek | buy emotes? give me a break. |
13:45:38 | * | shadowbane joined #nim |
13:49:16 | disruptek | lol you "buy" emotes and then for every $0.02 you waste, twitch takes >$0.01. what the hell are we doing here, people? |
13:50:17 | disruptek | why would anyone want to provide charity when a for-profit company owned by amazon will take >50% in "administrative costs"? |
13:50:29 | disruptek | the world has gone mad. |
13:50:47 | disruptek | please don't be stupid. |
13:52:41 | FromDiscord | <Kiloneie> That is dumb. |
13:53:24 | FromDiscord | <Kiloneie> Anyone got a clue on what happened on friday ? I swear the graph had more than 0 there. |
13:53:24 | FromDiscord | <Kiloneie> https://cdn.discordapp.com/attachments/371759389889003532/689109060045373479/anomaly.PNG |
13:53:45 | disruptek | channel points could be interesting, though. it rewards investment and doesn't cost anyone anything. |
13:54:17 | disruptek | what does that mean? |
13:55:02 | FromDiscord | <Kiloneie> If you mean me and my graph, it says 0 views on my channel on friday 13th, last friday... |
13:55:23 | FromDiscord | <Kiloneie> Did something happen ? It's weird... |
13:56:22 | disruptek | i have streamed for 135hrs and have 35k mins watched. |
13:56:32 | Araq | Corona happened |
13:56:52 | FromDiscord | <Kiloneie> xD okay |
13:57:58 | FromDiscord | <Kiloneie> My last 2 videos have finally climbed my chart. Im still here D:... |
13:58:43 | disruptek | maybe i should go back to focusing on simpler content. i feel like people that join the channel do so to ask about my wallpaper and not nim. |
13:59:27 | FromDiscord | <Kiloneie> If anyone got any ideas how to make a patreon page good, do @ me please :). It's as basic as it can be right now. |
13:59:50 | * | silvernode joined #nim |
13:59:56 | disruptek | i dunno what that means. |
14:03:08 | FromGitter | <alehander92> disruptek i thought you just stream about life, coding and random stuff |
14:03:15 | FromGitter | <alehander92> i didnt know there is a goal, man |
14:06:54 | Araq | disruptek for president is the goal, what else |
14:07:32 | dadada | hate that you can't remove the top bar in vscode, generally I like this IDE |
14:08:51 | Zevv | dadada: http://zevv.nl/div/tape.jpg |
14:09:37 | lqdev[m] | dadada: which top bar? |
14:09:54 | dadada | Zevv: heh |
14:10:15 | dadada | lqdev[m]: the one with the filename in it and the x button on the upper right |
14:11:27 | narimiran | dadada: fullscreen mode? |
14:11:31 | narimiran | zen mode? |
14:11:59 | dadada | narimiran: I'm in fullscreen mode, and I also tried zen mode, the top bar doesn't go away, I want the whole window to be used by the editor |
14:12:06 | dadada | whole screen |
14:14:43 | lqdev[m] | huh, I don't have the titlebar o.O |
14:14:49 | lqdev[m] | ah right, I disabled them in i3 |
14:15:12 | lqdev[m] | dadada: check the "Title Bar Style" setting |
14:15:38 | lqdev[m] | you can save at least a few pixels by setting it to `custom` |
14:17:23 | dadada | tried it, looks almost identical, maybe my eyes aren't tuned for seeing minor pixel changes |
14:17:32 | dadada | thanks for the hint though |
14:18:11 | silvernode | time to work on space_nim again |
14:18:23 | * | Hideki_ quit (Remote host closed the connection) |
14:18:24 | silvernode | I don't have to go to work this time. I have all day to work on it |
14:19:08 | * | Hideki_ joined #nim |
14:20:10 | * | Hideki_ quit (Remote host closed the connection) |
14:20:22 | * | Hideki_ joined #nim |
14:20:39 | * | dddddd joined #nim |
14:23:48 | JustASlacker | https://www.mobygames.com/game/space-nim |
14:26:01 | axion | What is wrong here? https://play.nim-lang.org/#ix=2eoS |
14:26:06 | disruptek | i stream wallpaper. |
14:26:21 | * | Zectbumo joined #nim |
14:26:47 | * | JustASlacker quit (Quit: Leaving) |
14:26:53 | narimiran | axion: do `o: var (Vec[N] or Mat[N])` |
14:27:20 | narimiran | btw, why does everybody roll their own matrices and vectors? :) |
14:27:44 | * | nullwarp_ is now known as nullwarp |
14:27:46 | PMunch | That's what the cool kids do nowadays I guess |
14:27:47 | axion | ecause the existing ones are either mathematically incorrect in subtle ways, or inefficient for my use case |
14:27:56 | narimiran | axion: which ones are those? |
14:28:23 | narimiran | and what is incorrect with them? their authors should be notified, IMO! |
14:28:38 | axion | vmath, linalg, and a few others i've looked at. i work for a game studio and it took us 10 years to write one in another language suitable for us, so i'm porting it :) |
14:28:41 | dadada | agree with narimiran here |
14:28:51 | narimiran | axion: try `neo` or `arraymancer` |
14:29:18 | narimiran | `neo` was great for my usecase |
14:29:22 | disruptek | mitems |
14:30:06 | dadada | disruptek: I crave your music, please stream :-) |
14:30:25 | disruptek | i stream music. |
14:31:34 | axion | plus, i really need DQ support in a non-consing fashion, and it ties in heavily our existing V4 and Q codes |
14:32:10 | disruptek | mmm Dairy Queen. |
14:33:50 | axion | I'm not sure why indie game developers neglect dual quaternions so much. They are incredibly useful for more than just IK/skinning, since they take half the storage and cheaper to compute transformations than a matrix, whenever you don't need non-uniform scale |
14:34:01 | * | Serenitor joined #nim |
14:35:11 | * | Serenitor quit (Client Quit) |
14:35:31 | * | Serenitor joined #nim |
14:38:07 | disruptek | !last leorize |
14:38:08 | disbot | leorize left 12#disruptek 40 hours ago and last spoke 740 hours ago |
14:39:15 | disruptek | back to streaming wallpaper and tunes. |
14:39:19 | disruptek | ~stream |
14:39:19 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
14:40:27 | PMunch | Documentation for my macroutils module done, now just to write some tests |
14:40:43 | dadada | PMunch: what's that module doing` |
14:40:44 | dadada | ? |
14:40:56 | PMunch | Magic |
14:41:18 | dadada | I was expecting that |
14:41:26 | PMunch | https://uploads.peterme.net/macroutils.html |
14:42:51 | dadada | PMunch: that's very useful, thanks |
14:44:00 | PMunch | I certainly hope it will be |
14:45:08 | FromGitter | <alehander92> i think the extract thing is most important |
14:45:27 | FromGitter | <alehander92> it really brings a missing piece in nim's macros iirc |
14:49:07 | dadada | sameTree is a nice too |
14:49:58 | FromGitter | <alehander92> that's it, after the oil field norway now invests into macro infrastructure |
14:53:28 | dadada | PMunch: why is the example for Building trees written with a proc and not a macro in the doc? |
14:53:52 | dadada | or is that an error in the doc? |
14:54:10 | PMunch | Because I don goofed |
14:54:14 | PMunch | Yeah it's an error |
14:54:16 | * | jholland__ joined #nim |
14:54:39 | PMunch | Thanks for spotting it |
14:54:50 | PMunch | That snippet was ripped from a longer macro I used for testing |
14:54:50 | dadada | dude, you're doing great work, keep it going |
14:54:51 | * | Serenitor quit (Quit: Leaving) |
14:55:16 | * | filcuc joined #nim |
14:56:45 | dadada | PMunch: it's fantastic, you're the hero of the day |
14:57:02 | PMunch | Haha, don't over hype it now :P |
14:57:16 | dadada | seriously it's wickedly good |
14:59:53 | dadada | should be standard part of Nim, and superQuote maybe should simply be the new quote |
15:02:12 | dadada | it can't be overhyped, because it's sick |
15:09:26 | * | Vladar joined #nim |
15:13:01 | * | Mortir joined #nim |
15:18:20 | * | Hideki_ quit (Remote host closed the connection) |
15:19:20 | Mortir | Hey |
15:19:21 | * | Hideki_ joined #nim |
15:19:49 | Mortir | Are there any plans on allowing tabs? |
15:19:53 | Yardanico | no |
15:20:18 | PMunch | You can use tabs with a source filter |
15:20:21 | PMunch | But please don't |
15:20:23 | Yardanico | well yeah, but pls don't :P |
15:20:50 | PMunch | Couldn't be arsed to write all that many tests atm, and I'm heading out now so here you go! https://github.com/PMunch/macroutils |
15:21:22 | PMunch | Here is my test file if you want to see more about how to use it: http://ix.io/2epg |
15:21:29 | PMunch | PRs welcome |
15:21:43 | Mortir | Ok. |
15:22:10 | dadada | Mortir: you can set your editor to write spaces when you hit tab |
15:23:40 | axion | Why is `if` --> `iff` typo'd in the manual and stdlib about 1,000 times? :) |
15:23:45 | Yardanico | it's not a typo |
15:23:47 | * | Hideki_ quit (Ping timeout: 250 seconds) |
15:23:53 | Yardanico | https://en.wikipedia.org/wiki/If_and_only_if |
15:24:03 | Yardanico | it's been discussed in at least 2-3 PRs to nim stdlib |
15:24:45 | axion | I would strognly suggest a terminology legend in the manual since this is not so well known, and often computing terms are so overloaded anyway |
15:25:02 | Yardanico | https://github.com/nim-lang/Nim/pull/10935 https://github.com/nim-lang/Nim/pull/5732 https://github.com/nim-lang/Nim/pull/1482 |
15:25:03 | disbot | ➥ Typo fix in strutils. |
15:26:09 | * | okcc quit (Quit: Leaving) |
15:29:22 | * | Mortir left #nim (#nim) |
15:37:31 | narimiran | didn't we already "fix" those, just to prevent future questions? |
15:38:12 | FromGitter | <alehander92> axion its a math term |
15:38:29 | FromGitter | <alehander92> but otherwise i agree with legend and i dont agree with 'fix" |
15:38:31 | FromGitter | <alehander92> iff != if |
15:38:31 | * | Trustable joined #nim |
15:38:45 | FromGitter | <alehander92> and people ask about it anyway, so it's all good |
15:39:38 | axion | Yeah, even mathematical texts and papers you have to carefully read the terminology legend, since especially in math, operators and terms are overloaded like crazy |
15:40:05 | FromGitter | <alehander92> yeah, but `iff` isn't really overloaded imho, it's basically `<=>` |
15:40:57 | FromGitter | <alehander92> but a legend is useful for many terms: compilation(not transpilation), side effects, and all kinds of others terms with |
15:41:05 | FromGitter | <alehander92> different interpretations |
15:41:07 | axion | Who am I to know it is what you say and not a typo without formal documentation? |
15:41:25 | disruptek | you are a programmer, that's who. |
15:41:36 | FromGitter | <alehander92> what is "formal documentation" |
15:41:45 | axion | A programmer would question everything, because other programmers wrote it :) |
15:41:49 | narimiran | @alehander92 so why is IFF necessary in the docs? |
15:42:06 | narimiran | can you show me one example when IFF is correct and IF is incorrect? |
15:42:08 | FromGitter | <alehander92> well it gives you additional information |
15:42:24 | narimiran | no it does not |
15:42:33 | narimiran | in theory it does, in practice no |
15:42:37 | narimiran | we're not robots |
15:42:52 | FromGitter | <alehander92> a >= b if a > b is true ⏎ a >= b iff a > b is false |
15:43:10 | narimiran | example from our docs, please |
15:43:25 | FromGitter | <alehander92> well, they mean different things man |
15:43:37 | narimiran | yeah, i know the difference |
15:43:46 | FromGitter | <alehander92> a happens if b and ⏎ a happens if b and only then |
15:43:52 | PMunch | Hmm, ..code-blocks apparently doesn't work on GitHub.. |
15:43:55 | FromGitter | <alehander92> it seems obvious to me the second one is more useful |
15:44:03 | FromGitter | <alehander92> in both theory and practical sense |
15:44:05 | narimiran | i'm telling you that all instances i've found in the docs were the "wrong usages" of IFF |
15:44:28 | FromGitter | <alehander92> well incorrect usages have to be fixed |
15:44:33 | Araq | enough people do not understand 'iff' so we shouldn't fight it and replace it by 'if' |
15:44:41 | FromGitter | <alehander92> but that's like saying why use `>` if we have `>=` |
15:44:44 | FromGitter | <alehander92> imho |
15:45:18 | PMunch | I just used iff in the documentation I wrote for macroutils.. |
15:45:20 | FromGitter | <alehander92> but you maintain the docs, so you guys know better, just wanted to point out that a bit of pedancy is nothing strange for a docs full with very precise type/effect signatures |
15:45:57 | axion | I think there's quite a difference between a symbol that cannot be disambiguated with natural language typographical errors, and a string of text that can. |
15:46:07 | axion | Without a legend of course |
15:46:10 | PMunch | But oh my, when I was writing my beginners guide to programming in Nim (don't think I actually ever released that) I had to work so hard not to call anything but vars for variables. |
15:46:22 | PMunch | Just speaking of overloaded terms |
15:46:57 | FromGitter | <alehander92> axion well yeah, a legend is ok |
15:47:24 | FromGitter | <alehander92> and again, not only for that: most docs assume their particular definitions of many terms/names |
15:48:29 | narimiran | https://nim-lang.github.io/Nim/os.html#cmpPaths%2Cstring%2Cstring what does a regular nim user lose if we replace this IFF with IF? |
15:48:46 | narimiran | does they suddenly don't understand how 'cmp' works and what it does? |
15:49:35 | narimiran | "oh, it returns 0 for same, negative for smaller, positive for larger. but, what if somebody is hiding from me?" |
15:50:05 | Araq | narimiran, agreed and now let's move on, we have plenty of things to do |
15:50:23 | FromGitter | <alehander92> but if you look at the line in isolation, each line brings more meaning |
15:50:37 | FromGitter | <alehander92> `0 iff pathA == pathB` : i dont even need to look at the others, thats the only case it returns 0 |
15:51:33 | narimiran | yeah, i can be as pedantic as the next guy (and i sometimes/often am, to the joy of my girlfriend and others), but also there are times when you need to be pragmatic |
15:51:47 | FromGitter | <alehander92> but not in a language spec/manual |
15:52:00 | * | Hideki_ joined #nim |
15:52:17 | FromGitter | <alehander92> i mean let's have `proc existsDir(dir: string): bool {.gcsafe, extern: "nos$1", tags: [ReadDirEffect], ⏎ ⏎ ``` raises: [].}` and then wondef if `iff` is too much :D``` [https://gitter.im/nim-lang/Nim?at=5e6fa0b0ebf3c06f30525130] |
15:52:58 | FromGitter | <alehander92> of course, its not a big deal if you change it, i just dont think its a big deal to leave it as well |
15:53:03 | narimiran | how about `iff x <= z or y <= z`? what if i stopped reading before `or`? |
15:54:07 | FromGitter | <alehander92> i agree, this argument wasnt great, but it's not really padentry too |
15:54:12 | FromGitter | <alehander92> which reminds me of a new RFC guys |
15:54:18 | FromGitter | <alehander92> `iff a > b:` in functions |
15:54:34 | FromGitter | <alehander92> which ensures that no other paths in the branch tree result in the same value |
15:54:37 | FromGitter | <alehander92> oh yeah |
15:55:49 | * | nsf quit (Quit: WeeChat 2.7) |
15:56:02 | * | Hideki_ quit (Ping timeout: 246 seconds) |
15:56:08 | FromGitter | <alehander92> must write donald knuth to collect my turing award |
15:59:39 | Yardanico | lol |
16:00:31 | FromDiscord | <treeform> Hey can you guys help me out with a simple macro? So I am in side a macro I want to see if the expression I have will compile with $(expression) has a string function, otherwise do my own thing. I tried it with `if compiles($(n[i])):` but that checks the $ of the node, how can I check if $ of what node is compiles. |
16:01:01 | Araq | easiest way is to not check it inside your macro |
16:01:08 | Yardanico | well the easiest would be probably parseStmt, but it's not really the clean one |
16:01:15 | Araq | but make your macro emit the 'when compiles' check |
16:01:18 | Yardanico | ah, wait, im wrong |
16:01:34 | FromDiscord | <treeform> Araq, neat, ill try that. |
16:03:12 | Araq | hmm plus 1111 cases, that can't be good |
16:09:19 | shashlick | !last awr1 |
16:09:20 | disbot | awr1 never seen. |
16:13:30 | * | sealmove joined #nim |
16:22:30 | leorize | disruptek: am I summoned? :p |
16:23:07 | disruptek | can't remember. sorry! 🤣 |
16:24:49 | disruptek | i got a clash between an enum Injection and, probably another enum Injection defined elsewhere. the compiler reported it as `undefined`. |
16:25:36 | * | Hideki_ joined #nim |
16:27:13 | shashlick | disruptek: last doesn't work on gitter users? |
16:27:35 | disruptek | !last alehander92 |
16:27:35 | disbot | alehander92 spoke in 12#nim 31 minutes ago |
16:27:57 | shashlick | !last awr1 |
16:27:58 | disbot | awr1 never seen. |
16:28:08 | leorize | !last treeform |
16:28:08 | disbot | treeform spoke in 12#nim 26 minutes ago |
16:28:14 | FromDiscord | <Recruit_main70007> can we use it from discord? |
16:28:19 | leorize | it seems to work? |
16:28:19 | disruptek | sure. |
16:28:27 | FromDiscord | <Recruit_main70007> !last Albus70007 |
16:28:27 | shashlick | https://irclogs.nim-lang.org/16-03-2020.html#06:55:44 |
16:28:28 | disbot | Albus70007 never seen. |
16:29:00 | FromGitter | <Albus70007> whats my name in gitter? |
16:29:09 | FromDiscord | <Recruit_main70007> hmmm |
16:29:12 | leorize | !last Albus70007 |
16:29:12 | disbot | Albus70007 spoke in 12#nim 11 seconds ago |
16:29:43 | FromDiscord | <Recruit_main70007> makes sense, last time i spoke in gitter was very long ago |
16:31:07 | disruptek | !last slymilano |
16:31:07 | disbot | slymilano never seen. |
16:31:20 | disruptek | !last Guest12859 |
16:31:21 | disbot | Guest12859 never seen. |
16:31:45 | disruptek | it looks like maybe it crashed and lost a few minutes of data. |
16:31:58 | disruptek | !last sealmove |
16:31:58 | disbot | sealmove joined 12#nim 18 minutes ago and last spoke 72 days ago |
16:32:30 | disruptek | i don't bother to rewrite the data on every change, so... |
16:32:49 | disruptek | !last Simula |
16:32:50 | disbot | Simula never seen. |
16:32:57 | disruptek | strange. |
16:34:13 | * | tane joined #nim |
16:35:48 | disruptek | i dunno what's going on. |
16:39:07 | * | nsf joined #nim |
16:42:07 | * | sagax quit (Ping timeout: 255 seconds) |
16:44:33 | FromGitter | <alehander92> in gitter we all see 7 |
16:44:42 | disruptek | that's a lucky number. |
16:44:56 | FromGitter | <alehander92> instead of color code i guess (i remember somebody else said that) |
16:45:02 | FromDiscord | <Recruit_main70007> not for nothing in my name |
16:46:50 | * | Hideki_ quit (Ping timeout: 240 seconds) |
16:48:26 | leorize | the gitter bot can't deal with irc colors |
16:48:31 | leorize | same as with NimBot |
16:50:15 | axion | How do i type a parameter to be a slice of a specific ordinal type and have a default range value? |
16:50:36 | leorize | HSlice[T] |
16:50:50 | leorize | Slice[T] to be precise |
16:52:43 | axion | Yeah I tried that, but even though my parameter is [T: float32] it requires the caller to specify the correct type suffix. Is there a way around that? |
16:54:57 | leorize | what's your function prototype? |
16:55:18 | leorize | oh and Nim can't infer param that precise yet |
16:55:45 | axion | proc foo*[T: float32](o: var MArray, range: Slice[T]) = |
16:55:53 | leorize | use Slice[float32] |
16:56:58 | axion | Well that'd be the same thing, but I agree. I'd like to be able to call it as o.foo(1..5) and have it treat that as a float range if possible |
16:58:25 | * | Zectbumo quit (Remote host closed the connection) |
17:00:44 | * | floppydh quit (Quit: WeeChat 2.7.1) |
17:11:38 | * | Vladar quit (Ping timeout: 240 seconds) |
17:12:03 | * | Vladar joined #nim |
17:26:25 | * | actuallybatman joined #nim |
17:44:35 | * | a_b_m joined #nim |
17:44:44 | * | a_b_m quit (Client Quit) |
17:47:20 | * | abm quit (Ping timeout: 246 seconds) |
17:58:02 | * | narimiran quit (Ping timeout: 240 seconds) |
18:04:31 | * | narimiran joined #nim |
18:05:13 | * | NimBot joined #nim |
18:07:43 | * | shadowbane quit (Quit: Konversation terminated!) |
18:08:34 | * | shadowbane joined #nim |
18:10:58 | * | shadowbane quit (Client Quit) |
18:12:24 | * | shadowbane joined #nim |
18:12:43 | shashlick | @leorize - please comment on https://github.com/nimterop/nimterop/issues/99 |
18:12:46 | disbot | ➥ a better proposal for mapping C enums ; snippet at 12https://play.nim-lang.org/#ix=2eq4 |
18:13:26 | Araq | does Nimble support --nimExe? |
18:14:30 | * | shadowbane quit (Client Quit) |
18:15:13 | * | shadowbane joined #nim |
18:16:06 | leorize | shashlick: it'd not be too deterministic |
18:16:30 | leorize | for example if you handle repeats by: const ResourceLimitWarning = ExceptionType.WarningException |
18:16:47 | leorize | then when someone tries to $ResourceLimitWarning, they get "WarningException" |
18:17:02 | leorize | that's not something anyone would expects |
18:18:30 | shashlick | Araq: nope, it just uses findExe("nim") |
18:18:39 | leorize | then if you go all const for enums with duplicates, then $ResourceLimitWarning will print an int instead |
18:18:47 | leorize | while some other enum will print a string |
18:19:26 | shashlick | leorize: well, the current implementation is the latter, so going to the former is an improvement |
18:19:29 | leorize | I'd say that C enums just don't fit Nim's model |
18:20:18 | leorize | I'd prefer how enum are represented in nim with nimterop to be upfront |
18:21:03 | leorize | either you go: everything mapped to nim enum, or you go everything mapped to distinct cint |
18:21:22 | leorize | you can give people the option, though I'm not sure if that's the best |
18:21:31 | shashlick | hmm |
18:21:48 | * | Vladar quit (Quit: Leaving) |
18:21:56 | shashlick | I'm not sure if the current distinct int method is really so bad |
18:22:07 | leorize | if you found duplicates in "mapped to nim enum" mode, just abort, using a const to walkaround is just confusing to people |
18:22:54 | shashlick | mapping to Nim enum mainly gives readability if an enum is printed |
18:22:58 | shashlick | what else does it buy us? |
18:23:30 | leorize | use as array index if enum don't have holes? |
18:25:03 | leorize | it basically gives us nothing more |
18:26:25 | shashlick | i don't think it is too much work but it will require spawning another nim process to get this cleaned up |
18:26:43 | shashlick | plus the distraction from all the other things nimterop still needs to get done |
18:27:08 | * | so quit (*.net *.split) |
18:27:15 | leorize | imo this doesn't worth the time |
18:27:19 | * | so joined #nim |
18:27:31 | leorize | maybe you can outline how should it be implemented and just leave it there as PR welcome |
18:27:39 | leorize | or just abandon the idea because it's kinda useless |
18:28:42 | shashlick | okay will link to this discussion |
18:28:45 | shashlick | thanks for your thoughts |
18:30:12 | FromGitter | <dumjyl> duplicate enum values in c are often used to make up for lack of `low` and `high` and map just fine to nim enums once those are stripped. llvm/clang for example. |
18:30:51 | shashlick | how would an automated tool know which one(s) to strip |
18:32:07 | FromGitter | <awr1> hello |
18:32:28 | shashlick | hey @awr1, good timing |
18:32:28 | leorize | then there are also people who use enums as a way to specify flags that should be or-ed toghether |
18:34:13 | * | Zectbumo joined #nim |
18:34:15 | FromGitter | <awr1> yeah it might be preferable to keep it as an option, to do the enum transformation |
18:34:36 | shashlick | we also lose the formula but i don't think that's really a problem |
18:34:45 | * | Hideki_ joined #nim |
18:35:44 | FromGitter | <awr1> how do you think you might relay which values belong to which enums to the macro? |
18:36:01 | FromGitter | <awr1> attach pragmas to the consts? |
18:36:13 | leorize | the consts have names |
18:37:11 | shashlick | might have to collate all enum consts into blocks by enum and have multiple calls to the macro for each enum |
18:37:30 | shashlick | the macro would have to print out the results in a way to be easily parsable by toast |
18:38:01 | leorize | or, you can have a nim macro that generates all of this |
18:38:14 | leorize | like cenum EnumName: <enum values> |
18:38:22 | leorize | then call nim with --expandMacro:cenum |
18:38:30 | shashlick | but toast is runtime |
18:38:31 | leorize | bam you got the file without depending on cenum :) |
18:38:34 | FromGitter | <awr1> i was thinking that you could peform the macro after `toast` is done |
18:38:35 | shashlick | we still need to spawn nim |
18:39:00 | shashlick | toast needs to be standalone as well, some users prefer that to the compile time API |
18:39:08 | * | Hideki_ quit (Ping timeout: 246 seconds) |
18:39:14 | leorize | that's what --expandMacro is for |
18:39:39 | leorize | you use it and get the expanded stuff, then you can just remove the imports |
18:40:42 | * | leorize quit (Quit: WeeChat 2.7.1) |
18:40:54 | shashlick | expandMacro gives you code that can be compiled into toast and run at runtime? |
18:43:14 | FromGitter | <awr1> in regard to using bitor'd C enums as sets: there is a weird idea i'm thinking of |
18:44:28 | FromGitter | <awr1> the enum types could be all a part of a certain typeclass, and then you could have a special func that gives you set-like syntax but returns a `cint` or w/e |
18:44:41 | FromGitter | <awr1> (this func would be constrained to that typeclass) |
18:45:10 | leorize[m] | shashlick: as long as you don't use gensym, then yes |
18:45:34 | shashlick | Do you have some example code? |
18:52:38 | * | Zectbumo quit (Remote host closed the connection) |
18:53:10 | * | Zectbumo joined #nim |
18:53:30 | FromGitter | <awr1> @shashlick something like this? https://play.nim-lang.org/#ix=2eqj |
18:54:49 | FromGitter | <awr1> (idk how you get procs to work with `{}` syntax, like how it's used for sets and `toTable`) |
19:00:45 | shashlick | @awr1: what is this to solve? https://github.com/nimterop/nimterop/issues/159? |
19:00:48 | disbot | ➥ Enums that refer to other enum values fail ; snippet at 12https://play.nim-lang.org/#ix=2eqn |
19:00:58 | shashlick | @leorize: do you have an example of using --expandMacro |
19:05:23 | * | opal quit (Ping timeout: 240 seconds) |
19:09:11 | FromGitter | <awr1> as a way to allow people to use bitor'd enums for libraries. i guess it doesn't have to be set syntax, and i suppose one can also just implement `or`, `and`, `xor` etc. |
19:09:33 | FromDiscord | <mratsim> I use a Flag |
19:10:00 | shashlick | we could add it to https://github.com/nimterop/nimterop/blob/master/nimterop/types.nim#L29 |
19:10:16 | FromDiscord | <mratsim> see: https://github.com/numforge/laser/blob/master/laser/photon_jit/photon_osalloc.nim#L52-L61 |
19:10:23 | shashlick | but will need to setup combos of every enum with every other enum, so makes no sense |
19:10:25 | FromDiscord | <mratsim> I'm pretty sure you already saw that code |
19:10:43 | * | opal joined #nim |
19:11:02 | shashlick | @mratsim: what's your opinion on https://github.com/nimterop/nimterop/issues/99 |
19:11:03 | disbot | ➥ a better proposal for mapping C enums ; snippet at 12https://play.nim-lang.org/#ix=2eq4 |
19:11:47 | FromGitter | <awr1> well wouldn't that be a use for using the type class? |
19:12:45 | FromDiscord | <mratsim> I don't see how to automate the `or` enums so that they use a separate Flag type |
19:23:16 | federico3 | https://github.com/cheatfate/asyncpg is this project dead? |
19:24:42 | * | Zectbumo quit (Remote host closed the connection) |
19:26:52 | FromDiscord | <Lantos> wow nimx is actually sick |
19:27:06 | FromDiscord | <Lantos> Just ran the hello world on ubuntu & android |
19:28:24 | * | silvernode_ joined #nim |
19:32:05 | FromGitter | <brentp> with jester, I want to match `/a/a/a/` , `/a/b/c/`, `/a/x/y/z/2`, etc. do I need a regexp for this?http://github.com/nim-lang/Nim/wiki/Tutorial:-Creating-a-(micro)-service-flask |
19:33:09 | dom96 | try `get "/a/@path"` |
19:33:19 | dom96 | might work, but also might not :) |
19:33:37 | FromGitter | <brentp> that doesn't work, unfortunately |
19:33:48 | dom96 | then yes, you need a regex |
19:33:52 | FromGitter | <brentp> that only works for `/a/b/` |
19:34:35 | * | nsf quit (Quit: WeeChat 2.7) |
19:37:15 | * | silvernode_ quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
19:39:04 | FromGitter | <brentp> regex works. thanks |
19:40:10 | * | silvernode_ joined #nim |
19:41:00 | * | tdog quit (Ping timeout: 256 seconds) |
19:49:55 | disruptek | !last narimiran |
19:49:56 | disbot | narimiran joined 12#nim 105 minutes ago and last spoke 73 hours ago |
19:50:05 | Yardanico | !last yardanico |
19:50:06 | disbot | Yardanico spoke in 12#nim-offtopic 2 hours ago |
19:50:11 | Yardanico | huh |
19:50:14 | disruptek | ... |
19:53:17 | disruptek | ~stream |
19:53:18 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
20:03:13 | FromDiscord | <Kenran> is twitch slow today? it isn't really loading anything for me right now |
20:03:46 | * | PMunch quit (Ping timeout: 246 seconds) |
20:07:48 | * | natrys joined #nim |
20:15:02 | * | filcuc quit (Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/) |
20:16:49 | * | PMunch joined #nim |
20:30:44 | * | shadowbane quit (Remote host closed the connection) |
20:40:13 | * | sagax joined #nim |
20:48:23 | * | Hideki_ joined #nim |
20:49:09 | axion | How do i get at one of the bounds of a slice? |
20:51:19 | FromGitter | <kaushalmodi> use the .high or .low |
20:52:58 | * | Hideki_ quit (Ping timeout: 256 seconds) |
21:00:17 | FromGitter | <alehander92> dont be a sad fella |
21:01:35 | * | narimiran quit (Ping timeout: 246 seconds) |
21:06:31 | axion | there doesn't seem to be an generic for those on Slice |
21:10:58 | axion | Maybe I'm doing something wrong? I get this: https://gist.github.com/mfiano/f17eb5ee0bea4a0af1c53d1418eb2e9c |
21:13:17 | solitudesf | its a and b fields for slice bounds |
21:14:03 | shashlick | Araq: what proc in the compiler reduces an expression into a value for a const? https://github.com/nimterop/nimterop/issues/99#issuecomment-599687131 |
21:14:04 | disbot | ➥ a better proposal for mapping C enums ; snippet at 12https://play.nim-lang.org/#ix=2eq4 |
21:16:09 | Araq | shashlick: semfold or vm.nim |
21:16:51 | * | ptdel joined #nim |
21:17:02 | shashlick | nifty - awesome having the full compiler available within toast |
21:21:27 | * | natrys quit (Quit: natrys) |
21:25:29 | axion | is there an idiom for iterating over the indices rather than elements of a container? I feel this can be written better if I knew the language well: for i in 0..obj.len-1: ... |
21:26:25 | FromGitter | <kaushalmodi> there are pair iterators available |
21:27:10 | axion | right, but that seemed wrong to me, since i only need the first part of the pair, and can't do just the first part, so i'd have an unused identifier |
21:27:22 | axion | maybe that's more idiomatic even though it introduces an unused thing? |
21:28:23 | FromGitter | <kaushalmodi> axion: https://play.nim-lang.org/#ix=2er8 |
21:28:28 | FromGitter | <kaushalmodi> use the _ for the unused |
21:28:41 | axion | ah ok, thanks |
21:29:10 | FromGitter | <kaushalmodi> if you wish, you can wrap that in your custom iterator to that you don't need the `, _` piece |
21:29:43 | Araq | dunno, use for i in low(x)..high(x) |
21:29:51 | axion | Yeah I probably will. Just trying to sketch out the user API first and learning bits of the language in the process (my first project here) |
21:32:35 | axion | I don't know if I ever thanked you Araq, but thank you for your incredible devotion to the project (and all the other contributors too). I've tried about 2 dozen languages over the years, and everything has brought me back to my 2 decades of Lisp, except this one is making me not want to go back :) |
21:32:57 | FromGitter | <kaushalmodi> axion: https://play.nim-lang.org/#ix=2era (indices iterator) |
21:33:12 | FromGitter | <kaushalmodi> > I don't know if I ever thanked you Araq, but thank you for your incredible devotion to the project ⏎ ⏎ +1! |
21:41:12 | Araq | ah thanks :-) |
21:44:34 | shashlick | Araq: what should I set PSym to in proc getConstExpr(m: PSym, n: PNode; g: ModuleGraph): PNode |
21:46:48 | shashlick | i constructed a const ast and have a newModuleGraph but am wondering what the m: PSym should refer to |
21:54:56 | * | Zectbumo joined #nim |
21:58:38 | FromGitter | <awr1> ah so you're just going to leverage the compiler const folding mechanism directly |
21:59:33 | * | shadowbane joined #nim |
22:00:00 | Araq | shashlick: it's the module you're compiling |
22:00:34 | * | silvernode_ quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
22:02:04 | * | Skaruts joined #nim |
22:02:45 | Skaruts | is there some way to turn an instance of an object to a unique string that can serve as an ID? |
22:03:17 | * | Trustable quit (Remote host closed the connection) |
22:03:25 | FromGitter | <awr1> @Skaruts like a hash? |
22:03:31 | Araq | you can cast a ref object to an id via cast[int](myref) |
22:03:33 | Skaruts | yea, I guess |
22:03:42 | Araq | but objects themselves have no identity |
22:03:51 | Skaruts | gonna try that |
22:03:57 | Araq | do NOT use addr/unsafeAddr, it never works for that |
22:04:46 | * | filcuc joined #nim |
22:05:19 | FromGitter | <awr1> if you want to do a hash instead of a int'd ref, you will have to implement the hash proc https://nim-lang.org/docs/hashes.html |
22:05:30 | Skaruts | I stay away from pointers anyway :) |
22:05:46 | Skaruts | seems to work nicely |
22:08:06 | shashlick | @awr1: yep |
22:09:12 | Skaruts | is the result of casting the ref always gonna be unique though? |
22:10:21 | PMunch | Hmm, should we add a toOption proc (or maybe even a converter?) from ptr/ref types to options? They can be cast as they are now as the underlying Option[ptr T] is just a nil check on the type. But it would be cool to formalise this. |
22:11:07 | Araq | Skaruts: no, the refs can be collected and re-used |
22:12:41 | Skaruts | hmm... I guess that won't be a problem, but gonna keep it in mind |
22:13:20 | * | filcuc quit (Remote host closed the connection) |
22:13:22 | FromGitter | <dumjyl> https://nim-lang.org/docs/options.html#option%2CT already does that I think. |
22:14:39 | * | filcuc joined #nim |
22:15:13 | PMunch | Oh cool |
22:15:19 | PMunch | Nice |
22:24:52 | * | PMunch quit (Quit: leaving) |
22:27:02 | * | filcuc quit (Ping timeout: 256 seconds) |
22:27:16 | * | solitudesf quit (Ping timeout: 246 seconds) |
22:29:11 | * | tane quit (Quit: Leaving) |
22:38:37 | * | zahary joined #nim |
22:50:15 | federico3 | why is monotime in a dedicated module and not in times? |
22:53:29 | federico3 | how can I convert a varargs to a seq? |
22:54:04 | krux02 | federico3, probably with toSeq |
22:54:14 | krux02 | but it does copy all elements |
22:55:06 | axion | is there a reason clamp takes separate parameters for its bounds, unlike say rand which uses a slice? |
22:55:27 | krux02 | axion: probably not a very good one. |
22:56:08 | krux02 | maybe because it is a port of a `clamp` function from a different programming language that does not have slices. |
22:56:31 | krux02 | I also don't have very good experience with slices on floating point numbers. |
22:58:21 | axion | i see. noticing some inconsistencies learning the stdlib and just curious |
22:58:39 | krux02 | yea there are quite a few inconsistentcies in the stdlib. |
22:58:43 | krux02 | sorry for that. |
22:58:52 | krux02 | It just happens when a lot of people contribute. |
22:59:59 | krux02 | for me personally I prefer to not work with slices, as my brain internal representation gets confused weather ``0..10`` is a type or a value. |
23:00:31 | krux02 | but that is just me. |
23:01:07 | krux02 | I don't really have a strong opinion here. |
23:01:34 | * | lritter quit (Ping timeout: 246 seconds) |
23:02:35 | krux02 | axion: what is your use case for Nim? What made you learn about it? |
23:03:44 | * | disrupteq quit (Ping timeout: 246 seconds) |
23:04:05 | krux02 | I am just curious why people are using Nim, and for what they are using it. |
23:04:51 | axion | Oh, a ton of reasons. zacharycarter told me about it a couple years ago, and had my eye on it since, but only been using it for about a month now. I really value a language that is both expressive and concise, because at the end of the day, the only thing that matters, is getting ideas working quickly. with Nim, there isn't the 2-language problem in doing that. |
23:09:42 | axion | arguably, where i came from didn't have the problem either. However, I have a lot of bad to say about nearly 2 decades of using Common Lisp I'd rather not flood off-topic nonsense with :) |
23:13:13 | axion | As for what I plan on using it for, well I'm mostly aa game developer, so we'll see after I finish porting my huge stack over :) |
23:17:27 | axion | The one thing about Nim that I think is a little rough around the edges, is the tedium involved in writing what would be 30 seconds and 2 lines of a Lisp macro, turning into an hour and 100 lines of nodes to represent Nim's AST for the same concept. There isn't much to be done with that, since it isn't homiconic, but I do believe macro writing could be a lot less painful. |
23:20:19 | shashlick | Do you have examples |
23:22:42 | axion | Not off hand. Clyybber was helping me port a 3 line Lisp macro the other day and he came up with about 50 lines of a node tree that was still incomplete by the time we gave up. I haven't written many macros yet out of fear I'll get too dissuaded and stop using Nim in my early stages of learning :) |
23:23:13 | FromDiscord | <Rika> Macros become very large very quickly |
23:23:45 | shashlick | I'm pretty lazy and use quote and parseStmt |
23:25:26 | rayman22201 | there have been some good helper libraries to help writing macros that have come about through the life of nim. Also tricks like shashlick mentioned :-) |
23:26:27 | rayman22201 | Nim macros will never be as concise as lisp of course, but I agree, there is always room for improvement. |
23:26:37 | axion | It might be worthwhile to aggregate that list of libraries and tricks online somewhere, because I really do think this is one area that needs to get a little more closer to the expressiveness of Lisp |
23:26:42 | shashlick | i prefer nim code looking like nim rather than some crazy data structure |
23:26:44 | axion | Any help would go a long way |
23:27:13 | shashlick | but no doubt, it is working great to use the AST in nimterop since i'm doing an ast -> ast translation |
23:27:30 | krux02 | axion, I agree macros could be improved in Nim. Still there is nothing like typed macros in other languages. |
23:28:55 | axion | Yeah I like that a lot. |
23:29:02 | rayman22201 | yeah, nothing comes close to Nim here |
23:29:04 | krux02 | I can only compare Nim macros to emacs-lisp macros. Never used common lisp. |
23:29:35 | krux02 | I think it is not too different though. |
23:29:44 | shashlick | folks, would really appreciate some help with testing the new backend for nimterop - anyone interested please ping |
23:30:21 | krux02 | axion: Btw I also use nim for game development |
23:30:36 | krux02 | or better said, I used to, currently I am fixing bugs in Nim. |
23:32:18 | krux02 | if you care about the two language problem, I fixed that for game development. |
23:32:28 | krux02 | write your shaders in Nim |
23:32:56 | krux02 | import nim modules and use it in a shader |
23:33:56 | krux02 | and most importantly, access variables from the outer scope in a shader, as if the shader was a lambda expression with closure. |
23:34:26 | krux02 | https://github.com/krux02/opengl-sandbox |
23:36:20 | krux02 | I didn't update the project for quite some time now though. |
23:37:16 | krux02 | It is still alive though, as I don't know anything better to quickly write small efficient custom renderers quickly in. |
23:38:50 | federico3 | krux02: it does not seems so |
23:41:28 | FromGitter | <awr1> what are rust's macros even like? i looked their documentation in comparison and i don't quite get what is going on |
23:41:40 | rayman22201 | Krux02, your work on fixing bugs in Nim is greatly appreciated btw <3 |
23:42:06 | FromGitter | <awr1> nim's is actually pretty straightforward if you're familiar with the concept of an AST |
23:45:20 | FromGitter | <awr1> RE: shaders: what i have kinda sorta wanted to do for a while is create a compiler for a Nim DSL that produces SPIRV/DXIR |
23:45:23 | FromGitter | <awr1> but meh |
23:50:31 | * | disrupteq joined #nim |
23:51:42 | * | adnanyaqoobvirk joined #nim |
23:54:52 | * | silvernode_ joined #nim |
23:55:00 | * | silvernode_ quit (Client Quit) |