00:00:10 | FromGitter | <timotheecour> oh btw is @leorize and @alaviss the same person ? |
00:00:14 | leorize | yes |
00:00:25 | leorize | the thing that I don't get is how on Haiku, threads are faster :P |
00:00:27 | * | elijahr joined #nim |
00:00:52 | * | pbb joined #nim |
00:01:41 | dadada | leorize: I used compilesettings with success now, yet nimcacheDir is empty, other settings tend to work ... |
00:01:46 | FromGitter | <timotheecour> maybe the selector implementation is not up to par on haiku; idk whether it’s nim’s implementation or haiku issue |
00:01:58 | dadada | leorize: could it be because I use defaults? |
00:02:09 | leorize | no idea then :/ |
00:02:26 | leorize | timotheecour: on haiku we use the poll interface (that's the only one here anyway) |
00:02:29 | dom96 | The main problem with threads is that they are costly |
00:02:42 | dom96 | how many threads can you actually create on Linux/Windows/BSD? |
00:02:46 | FromGitter | <timotheecour> @dadada i fixed it recently see https://github.com/nim-lang/Nim/pull/14277 |
00:02:48 | disbot | ➥ fix https://github.com/nim-lang/Nim/issues/14275 querySetting(nimcacheDir) works even if implicitly set |
00:03:05 | dom96 | It would be interesting to see some actual benchmarks for this |
00:03:36 | leorize | dom96: you can create a decent amount, more than the amount of fd you can create on a typical system :) |
00:03:50 | zacharycarter | should read that blog post I linked to dom96 |
00:03:55 | leorize | I guess on haiku it's just faster because this is the OS where everything happens in threads :p |
00:04:20 | FromGitter | <timotheecour> Well, again, you can combine threads and async |
00:04:53 | leorize | I can, but I wanna establish a baseline |
00:05:36 | * | mumble quit (Quit: Going offline, see ya! (www.adiirc.com)) |
00:05:43 | * | pbb quit (Excess Flood) |
00:05:49 | leorize | I wrote a small pseudo-http client that opens around 100 connections and pull 200Mb from them |
00:05:51 | FromGitter | <timotheecour> well poll is fundamentally not as efficient as something like kqueue (or even epoll or window’s equiivalent) |
00:07:19 | dom96 | surely if threads is all you need we wouldn't have all these fancy async mechanisms in the OS :P |
00:08:46 | leorize | well I'm revamping their http library |
00:09:01 | FromGitter | <timotheecour> it’s basically O(1) vs O(n) for epoll vs poll. eg see https://jvns.ca/blog/2017/06/03/async-io-on-linux--select--poll--and-epoll/ |
00:09:19 | leorize | and it'll be funny when I set out to rewrite this in async and the current threaded version is fasetr :P |
00:09:23 | leorize | faster* |
00:15:59 | FromDiscord | <Gary M> Nim tables aren't contiguous memory right? |
00:16:16 | leorize | maybe I'm not doing async right in C :/ |
00:16:39 | leorize | gah, I need better numbers, my benchmark is underperforming too much |
00:18:16 | * | pbb joined #nim |
00:21:48 | dom96 | leorize: write it in Nim? |
00:22:00 | FromGitter | <timotheecour> @leorize i think what you need is wait_for_objects.h |
00:22:50 | FromGitter | <timotheecour> IIUC that’s the haiku way, and selectors.nim should add a `when defined(haiku)` that uses that |
00:26:33 | FromGitter | <timotheecour> and now I have a question for you :) regarding flaky tests/stdlib/tfdleak.nim, I’ve noticed the test actually fails about 25% of the time on windows; eg simply instrument tfdleak.nim and simply do the 1st check only `leakCheck(f.getOsFileHandle, "system.open()”)` and run in a loop; guaranteed failure |
00:26:37 | * | fredrikhr quit (Read error: Connection reset by peer) |
00:26:44 | * | lritter quit (Quit: Leaving) |
00:27:59 | FromGitter | <timotheecour> I’m thinking the `getHandleInformation(f.Handle, addr flags) != 0` test has false positives and maybe isn’t the right test |
00:30:06 | FromGitter | <timotheecour> @Gary M look at tables.nim implementation, it uses a `seq` so of courses uses contguous memory but the indexes are hashed |
00:32:45 | FromGitter | <timotheecour> (basically it uses open addressing, no linked lists) |
00:32:54 | * | konvertex quit (Ping timeout: 240 seconds) |
00:38:55 | leorize[m] | dom96: a bit slower in nim |
00:39:36 | leorize[m] | @timotheecour: that api is useless for actual async work, it doesn't remember what events you want to wait for :) |
00:40:17 | leorize[m] | I think there might be a huge overhead in their poll implementation |
00:43:22 | leorize[m] | re: tfdleak: yea that might create false positives, but I don't really know if there's any better way |
00:46:24 | FromGitter | <timotheecour> on windows, Handle’s are not inheritable by default so IMO there’s no leak to child, and these are 100% false positives |
00:47:06 | FromGitter | <timotheecour> also there are other bugs i found, where u mismatched Handle for FileHandle (but that’s probably unrelated to that bug) |
00:47:25 | FromGitter | <timotheecour> maybe i can send a PR and u can review it since u have more contxt than others |
01:01:29 | FromDiscord | <exelotl> Tried adding for loops to strformat... I almost got there but then it got late :( |
01:06:24 | leorize[m] | @timotheecour: handle being equal to filehandle is intentional |
01:06:55 | leorize[m] | also native handles are not inheritable by default, but handles created via ISO/POSIX APIs are inheritable by default |
01:07:06 | FromGitter | <timotheecour> i think it’s a bug! Handle.sizeof should be int.sizeof but FileHandle.sizeof should be int32.sizeof |
01:07:09 | leorize[m] | HANDLE is int32, and FileHandle is int/cint |
01:07:14 | leorize[m] | either way it doesn't really matter |
01:07:22 | leorize[m] | HANDLE is smaller than FileHandle |
01:07:42 | leorize[m] | it's already promoted automatically |
01:08:25 | leorize[m] | and on LE architectures trimming int64->int32 should only chomp the later unused 32bits |
01:08:50 | FromGitter | <timotheecour> well signature should be correct, it can lead to bugs even if no currently any bugs form it: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/get-osfhandle?view=vs-2019 shows you’re using it wrong :) |
01:09:36 | FromGitter | <timotheecour> and in fact contradicts what’s in lib/windows/winlean.nim ; anyway I’ll fix this in a PR |
01:10:00 | FromGitter | <timotheecour> `HANDLE is smaller than FileHandle` that’s not true |
01:10:10 | FromGitter | <timotheecour> opposite, on 64 bit |
01:10:21 | leorize[m] | uhmm, how come I'm using it wrong? |
01:10:37 | leorize[m] | the signature is pretty much placebo, it's using header |
01:11:00 | leorize[m] | well but do fix it please :P |
01:11:32 | FromGitter | <timotheecour> it’s not placebo, things get’s cast , so no C warnings, and u’ll never know if a true bug creeps in with wrong signature. |
01:11:36 | FromGitter | <timotheecour> i will :) |
01:11:36 | * | zacharycarter quit (Ping timeout: 272 seconds) |
01:11:42 | disruptek | actually, polling is sometimes faster for io. |
01:12:57 | disruptek | simple because interrupts become a bottleneck at high loads. |
01:13:43 | leorize | the problem is that it's not matching my observations :P |
01:13:47 | FromGitter | <timotheecour> @leorize reading though https://discuss.haiku-os.org/t/developer-documentation-for-async-networking/3427/7 it shows that `wait_for_objects` is what should be most performant for haiku (and it’s more general than `poll`) ; it’s the “best effort equivalent” of osx’s kqueue (even if not as good since u have to feed fd’s each time) ; I’ll bet 10$ it’s faster than threads |
01:15:00 | * | Guest38665 quit (Remote host closed the connection) |
01:15:18 | leorize | maybe it's faster, though I do know that the kernel implementation of it uses poll |
01:15:38 | leorize | the problem is that I have to register the fds again each time I call it |
01:16:06 | * | ptdel joined #nim |
01:17:18 | leorize | maybe I can memcpy() the array everytime I call it, but that just sounds slow |
01:17:29 | honger | Hey guys, I have a question (strictly out of curiosity), was there a conscious decision made to write everything with American-style spelling (ie Color vs Colour, Gray vs Grey etc) when developing some of the libraries? Or is it just generally easier to use american spelling because so much code uses it that it's kinda standard? |
01:17:36 | leorize | well there's only one way to find out :P |
01:18:14 | leorize | honger: I don't think there is |
01:18:41 | FromDiscord | <Rika> Libraries are made by many people, no? |
01:18:47 | leorize | maybe American-English is more popular than English-English? |
01:19:19 | honger | Yeah, makes sense. We use Colour in Australia, but it's actually becoming unnatural to type it that way :P |
01:19:42 | FromDiscord | <KingDarBoja> I prefer the british flavour |
01:20:04 | disruptek | the accent is sexy, sure. |
01:21:30 | FromGitter | <timotheecour> > maybe I can memcpy() the array everytime I call it, but that just sounds slow ⏎ ⏎ Increasing my bet to 30$ ; cmon, context switch dwarfs memcpy (plus, not even sure you need memcpy, u could keep it in memory and update the array as needed after each event) |
01:22:37 | leorize | the events field is overridden by the events that happened for every call |
01:23:03 | leorize | meaning that for events that didn't happen on that one call, you're going to have to re-apply the masks |
01:23:39 | leorize | but I'll give it a go |
01:26:28 | leorize | yep, the tests code suggest that memcpy is the flow to use this |
01:26:33 | leorize | guess I can't avoid that |
01:30:28 | * | Hideki joined #nim |
01:30:48 | FromGitter | <timotheecour> (if this works, IMO shd be long to stdlib, eg `ioselects/selectors_haiku.nim`); ⏎ isn’t only the `object_wait_info[i].events` where i is returned by `wait_for_objects`the only event that gets modified? |
01:30:49 | * | Hideki is now known as Guest28479 |
01:31:23 | leorize | ofc not :) |
01:31:37 | leorize | else how would you distinguish between events you registered and events that happened? |
01:32:10 | leorize | also wait_for_objects work like poll(), it returns the number of events happened |
01:32:15 | leorize | not where it happened |
01:32:46 | leorize | would be inefficient if only one event is returned at a time |
01:35:03 | * | ftsf joined #nim |
01:35:57 | * | chemist69 quit (Ping timeout: 272 seconds) |
01:36:54 | * | Guest28479 quit (Ping timeout: 240 seconds) |
01:37:28 | * | dddddd quit (Remote host closed the connection) |
01:37:35 | * | chemist69 joined #nim |
01:41:28 | FromGitter | <timotheecour> okok |
01:46:09 | * | ryan_ joined #nim |
01:48:47 | * | honger quit (Ping timeout: 260 seconds) |
01:51:25 | * | ryan_ is now known as gonger |
02:00:16 | * | zacharycarter joined #nim |
02:00:51 | zacharycarter | stream's back up - https://www.twitch.tv/zachary_carter - probably will only be on for another hour or two |
02:02:36 | leorize | @timotheecour: and the results are in, same speed, if not slower |
02:02:47 | leorize | pulling in my profiler now |
02:05:34 | * | zacharycarter quit (Read error: Connection reset by peer) |
02:05:43 | * | mono joined #nim |
02:06:44 | * | zacharycarter joined #nim |
02:07:54 | * | monokrom quit (Ping timeout: 240 seconds) |
02:12:07 | * | muffindrake quit (Ping timeout: 260 seconds) |
02:14:13 | * | muffindrake joined #nim |
02:25:23 | * | ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
02:31:27 | * | theelous3 quit (Read error: Connection reset by peer) |
02:44:38 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
02:45:14 | * | pbb joined #nim |
02:49:10 | FromDiscord | <codic> If I have stdin.readLine, the left and right arrow keys output `^[[D` and `^[[C` respectively. how can i change this to actually move the cursor? Also can I make the up and down keys do nothing? this also applies to other languages but at the moment i need a solution for nim, thanks in advance |
02:52:47 | FromDiscord | <Rika> it's somewhat complicated my ide |
02:52:49 | FromDiscord | <Rika> (edit) 'ide' => 'idea' |
02:52:54 | FromDiscord | <Rika> for that |
02:53:32 | FromDiscord | <Rika> i'd say switch the console into raw mode and do it yourself like how linenoise does it but you'd need to learn what `termios` does |
02:53:45 | FromDiscord | <Rika> and it'd only work on linux afaik |
02:53:49 | FromDiscord | <Rika> or unix-likes |
02:54:17 | FromDiscord | <codic> this tool is gonna be for linux only anyways |
02:54:42 | FromDiscord | <codic> but how do i use the raw console mode? |
02:54:48 | FromDiscord | <codic> And hwat did linenoise do? |
02:54:50 | FromDiscord | <codic> what* |
02:54:55 | FromDiscord | <Rika> start reading up on this xd https://linux.die.net/man/3/termios and https://nim-lang.org/docs/termios.html |
02:55:10 | FromDiscord | <codic> latter, sure |
02:55:24 | FromDiscord | <codic> former, nope, I have `man termios` at my hands |
02:55:28 | FromDiscord | <codic> wait what |
02:55:33 | FromDiscord | <codic> why is the Synopsis c code |
02:55:39 | FromDiscord | <codic> Nvm |
02:55:48 | FromDiscord | <codic> Mixed it up with the description xd |
02:56:18 | FromDiscord | <codic> aaaaaaaaaaaaaaaargh forget it |
02:56:21 | FromDiscord | <Rika> not sure if this would be needed too https://linux.die.net/man/4/console_ioctl |
02:56:41 | FromDiscord | <codic> o no |
02:57:09 | FromDiscord | <codic> also, i've filed a phabricator report for the solus repositories to update nim https://dev.getsol.us/T8979↵Hopefully they do it soon |
02:58:04 | FromDiscord | <codic> Wait, is this easier to do with c? |
02:58:11 | FromDiscord | <codic> if so I could write a library and `importc` it |
02:58:14 | * | zacharycarter quit (Ping timeout: 256 seconds) |
02:59:10 | FromDiscord | <Rika> no |
02:59:15 | FromDiscord | <codic> aw |
02:59:17 | FromDiscord | <Rika> did you see the link i sent |
02:59:22 | FromDiscord | <Rika> > and https://nim-lang.org/docs/termios.html |
02:59:25 | FromDiscord | <codic> yes |
02:59:36 | FromDiscord | <Rika> its the same exact api for c afaik |
02:59:37 | FromDiscord | <codic> it's just a wrapper around the c termios |
02:59:40 | FromDiscord | <codic> yeah |
02:59:48 | FromDiscord | <Rika> why would it be easier in C then |
03:01:55 | FromDiscord | <codic> dunno |
03:02:03 | FromDiscord | <codic> something like this? https://stackoverflow.com/questions/10463201/getch-and-arrow-codes |
03:02:33 | FromGitter | <timotheecour> @leorize how many threads, and how many concurrent connections? I’d assume you should start seeing some advantage over threads for n > threshold |
03:02:46 | FromDiscord | <codic> Combined with something like this for impelmenting getch? https://gist.github.com/def-/58c3374c23f120e31872 |
03:03:13 | FromDiscord | <Rika> you just found how to make the terminal raw |
03:03:23 | FromDiscord | <codic> oh |
03:03:58 | FromDiscord | <Rika> make sure to copy the whole functions, if you dont, you might fuck up someone's console |
03:04:42 | FromDiscord | <codic> Does nim have something like pass? |
03:04:58 | FromDiscord | <codic> So i could do something like `if condition: pass` and that will just do absolutely nothing if condition is there |
03:05:08 | FromDiscord | <Rika> discard |
03:05:22 | disruptek | WHERE ARE THE GOATS |
03:05:22 | FromDiscord | <Rika> you can have a bare discard and itll act like pass |
03:05:35 | FromDiscord | <Rika> did you check up your ass? |
03:05:41 | FromDiscord | <codic> sent a code paste, see http://ix.io/2m5f |
03:05:48 | FromDiscord | <Rika> you definitely can |
03:05:50 | FromDiscord | <codic> and keep doing the ch thing for each character |
03:05:52 | FromDiscord | <codic> > did you check up your ass? |
03:05:53 | FromDiscord | <codic> lmao |
03:05:53 | FromDiscord | <Rika> except |
03:05:59 | FromDiscord | <Rika> ch is not all characters |
03:06:02 | FromDiscord | <Rika> its just one |
03:06:05 | FromDiscord | <codic> yeah |
03:06:08 | FromDiscord | <codic> But i could do |
03:06:24 | FromDiscord | <Rika> so that would be first "\e" then "[" then "[" then "A" or "D" |
03:06:25 | * | zacharycarter joined #nim |
03:07:42 | FromDiscord | <codic> Oh↵`for t in "^[[A]".split(""): if ch == t: discard` |
03:07:57 | FromDiscord | <codic> but the problem with that is that i am fine with `[` or `A`/`D` or `]` |
03:07:57 | FromDiscord | <Rika> what |
03:08:11 | FromDiscord | <codic> so that'd discard those as well, preventing input |
03:08:12 | FromDiscord | <codic> hm |
03:08:21 | FromDiscord | <Rika> https://nim-lang.org/docs/terminal.html#cursorForward%2CFile%2Cint |
03:08:31 | FromDiscord | <Rika> i know what you were gonna ask |
03:08:46 | FromDiscord | <codic> frick me |
03:08:51 | FromDiscord | <codic> Well |
03:08:57 | FromDiscord | <codic> Anyways, the problem is the char by char thing |
03:09:14 | FromDiscord | <codic> So if someone said `An idiot, indeed` for example, the `A` would get cut out |
03:09:21 | FromDiscord | <codic> and get replaced by the cursor moving backwards |
03:10:02 | FromDiscord | <Rika> https://github.com/de-odex/linenoise-nim/blob/master/src/linenoise.nim#L599 |
03:10:46 | * | zacharycarter quit (Ping timeout: 260 seconds) |
03:10:58 | FromDiscord | <codic> o |
03:11:12 | FromDiscord | <codic> linenoise, wonder what that even is |
03:11:17 | * | gonger quit (Remote host closed the connection) |
03:11:35 | FromDiscord | <Rika> https://github.com/antirez/linenoise |
03:11:42 | * | gonger joined #nim |
03:11:55 | FromDiscord | <codic> ah |
03:12:19 | FromDiscord | <codic> aanyways i see a lot of `of *n*.char` but no `of FORWARD.char` or similar. :| |
03:12:42 | FromDiscord | <Rika> dude |
03:13:09 | FromDiscord | <Rika> https://github.com/de-odex/linenoise-nim/blob/master/src/linenoise.nim#L651-L671 |
03:13:17 | FromDiscord | <Rika> there is no FORWARD character |
03:13:31 | FromDiscord | <Rika> its a sequence of characters, so you need to handle that differently |
03:13:38 | disruptek | leorize: this is where i am on the mangle fiasco: http://ix.io/2m5g/c |
03:13:58 | * | gonger is now known as burgor |
03:13:59 | FromDiscord | <codic> Ahhhhhhhhhhhh |
03:14:01 | FromDiscord | <codic> Thank you! |
03:14:10 | FromDiscord | <codic> That should prove quite useful.. |
03:15:02 | FromDiscord | <Rika> read the code 😛 |
03:15:21 | FromDiscord | <Rika> there are comments (not by me, by the original linenoise author) so it should be easier |
03:15:49 | * | zacharycarter joined #nim |
03:20:37 | * | zacharycarter quit (Ping timeout: 264 seconds) |
03:23:49 | FromDiscord | <codic> you are the author of the nim linenoise? |
03:31:53 | FromDiscord | <Rika> uh, translator |
03:31:54 | FromDiscord | <Rika> yes |
03:42:15 | * | Trustable quit (Remote host closed the connection) |
03:42:39 | * | elijahr quit (Quit: Textual IRC Client: www.textualapp.com) |
03:44:03 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
03:44:27 | * | nekits6 quit (Read error: Connection reset by peer) |
03:44:55 | * | nekits joined #nim |
03:47:22 | * | pbb quit (Remote host closed the connection) |
03:48:57 | * | pbb joined #nim |
03:48:57 | * | pbb quit (Client Quit) |
03:50:52 | * | zacharycarter joined #nim |
03:52:01 | * | pbb joined #nim |
03:55:02 | leorize[m] | @timotheecour: 100 concurrent connections spanned over an equal amount of threads |
03:55:07 | leorize[m] | one thread per connection |
03:55:15 | * | zacharycarter quit (Ping timeout: 260 seconds) |
03:55:23 | leorize[m] | this is an issue within Haiku itself |
03:55:50 | leorize[m] | a ton of lock contention in the kernel for every select/poll/wait_for_object :p |
03:57:21 | * | solitudesf joined #nim |
04:02:18 | * | rockcavera quit (Remote host closed the connection) |
04:06:01 | * | supakeen quit (Quit: WeeChat 1.9.1) |
04:06:44 | * | supakeen joined #nim |
04:09:40 | * | ptdel joined #nim |
04:46:24 | FromDiscord | <FromIRC> Uptime - 1 day, 14 hours, 23 minutes, 12 seconds, 808 milliseconds, 963 microseconds, and 105 nanoseconds |
04:46:24 | FromDiscord | <Yardanico> !status |
04:48:20 | * | ptdel quit (Remote host closed the connection) |
04:58:23 | Prestige | Does the bot keep crashing or something @Yardanico? |
04:59:41 | FromDiscord | <Rika> no hes just checking |
05:03:27 | leorize | it has been up since yesterday and nothing is crashing :) |
05:10:12 | Prestige | nice |
05:23:48 | * | mwbrown quit (Ping timeout: 256 seconds) |
05:34:32 | * | narimiran joined #nim |
05:40:12 | FromGitter | <Willyboar> Good morning |
06:22:06 | * | mwbrown joined #nim |
06:29:14 | FromDiscord | <Yardanico> You too |
06:31:48 | * | silvernode joined #nim |
06:32:02 | silvernode | Good morning |
06:34:21 | silvernode | I decided to take a break on my space game. I was thinking inside of a box which made progress difficult. Now I am working on a package manager wrapper to help me learn Nim in a different way. Working with command line arguments, reading files, etc. |
06:36:10 | silvernode | I am looking to find out what documentation to read about taking cmdLine arguments. Basically I want: ./myProg -i tmux , which would install tmux. |
06:38:19 | Yardanico | silvernode: if you're fine with third-party dependencies, use cligen :) |
06:38:39 | Yardanico | if not, use https://nim-lang.org/docs/parseopt.html |
06:38:58 | silvernode | Yardanico: I am fine with third party deps but only as a last resort. |
06:39:23 | silvernode | lol I was going to ask about parseopt, I had that in my clipboard ready to be linked here |
06:39:42 | FromGitter | <Willyboar> there is also https://github.com/docopt/docopt.nim |
06:39:42 | silvernode | Seems like it is a good starting point. I am just trying to understand what the docs are telling me |
06:39:51 | Yardanico | @Willyboard it's a third party dep too :) |
06:40:04 | FromGitter | <Willyboar> yeap but is an option :P |
06:40:14 | Yardanico | and it wasn't updated in 1 year |
06:40:28 | Yardanico | silvernode: you need to have your own config object where you store the values you got from the parseopt iterator |
06:40:32 | Yardanico | getopt I mean, it's the simplest way |
06:41:05 | silvernode | Yardanico: Sounds complicated, ha |
06:41:09 | Yardanico | well it's not :) |
06:41:21 | silvernode | I always have problems like this in programming where I don't understand simple stuff |
06:41:23 | Yardanico | if that's complicated for you, use cligen :P |
06:41:55 | silvernode | I always go for the complicated way since I feel like there is more value in learning that way |
06:41:56 | FromGitter | <Willyboar> cligen is powerfull but for me is pain in the a** |
06:42:05 | supakeen | I think this `pty.nim` I'm writing might be a future PR for stdlib. |
06:42:12 | supakeen | If I get my shit in order. |
06:42:14 | Yardanico | supakeen: to the fusion you mean |
06:42:23 | Yardanico | https://github.com/nim-lang/fusion :P |
06:42:23 | supakeen | The fusion? |
06:42:45 | supakeen | Oh that's nice, is stdlib being split out from the language? |
06:43:00 | Yardanico | fusion is something like an extended stdlib |
06:43:03 | Yardanico | extended distribution |
06:43:04 | supakeen | Ah. |
06:43:13 | Yardanico | but some libs might move from stdlib to it |
06:43:15 | * | silvernode quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
06:43:17 | Yardanico | likt htmlparser already did |
06:43:20 | supakeen | That sounds like a good plan. |
06:43:27 | Yardanico | (it's still in stdlib, but it's also in fusion) |
06:43:34 | supakeen | I'd love it if stdlib can grow separately from nim. |
06:43:46 | * | silvernode joined #nim |
06:43:54 | supakeen | (I'd also prefer if all stdlib lives in std/* but that's probably just me) |
06:44:13 | supakeen | (Perhaps changing import to first look in std/*). |
06:44:36 | Yardanico | supakeen: well you can already use "std" for almost all packages |
06:44:37 | FromGitter | <nothratal> is there a difference in calling echo in this two versions? ⏎ ⏎ ```let x = 3 ⏎ ⏎ echo "x=" & $x ⏎ echo "x=", x``` ⏎ ⏎ I mean performance-wise for example [https://gitter.im/nim-lang/Nim?at=5ebe3a5528b53131490859a5] |
06:44:39 | Yardanico | or for all |
06:44:39 | * | ryan_ joined #nim |
06:45:37 | Yardanico | @nothratal well if you really care about performance use stdout.write :) |
06:45:43 | Yardanico | echo flushes stdout after each write |
06:46:10 | FromDiscord | <Rika> afaik no |
06:46:13 | Yardanico | and between these two versions I don't think there'd be a lot of difference, echo basically outputs all arguments it was given |
06:46:18 | Yardanico | @Rika ? echo does |
06:46:22 | FromDiscord | <Rika> i mean |
06:46:24 | FromDiscord | <Rika> not to you |
06:46:26 | FromDiscord | <Rika> to noth |
06:46:42 | FromGitter | <nothratal> @Yardanico that |
06:46:52 | supakeen | Yardanico: Anyways I'd love the idea of keeping `std/*` the smallest it can possibly be with non-changing things in there (such as encoding, hashing, perhaps some data structures) and having fusion take care of changing things such as http servers and html parsing indeed. |
06:47:10 | Yardanico | well fusion is immutable though |
06:47:17 | Yardanico | in the sense that packages won't get removed from it |
06:47:19 | Yardanico | for backwards compat |
06:47:22 | FromDiscord | <Rika> what does that mean |
06:47:23 | FromDiscord | <Rika> ah i see |
06:47:24 | * | burgor quit (Ping timeout: 265 seconds) |
06:47:28 | supakeen | Perhaps it's even possible to describe the std/* APIs and be able to select which stdlib to use when installing but eh that's probably too much. |
06:47:38 | Yardanico | and if you do breaking changes to the package you'll add it as "packagename2" to fusion |
06:47:41 | FromDiscord | <Rika> thats too much lmao] |
06:47:42 | supakeen | Yardanico: Of course, but it allows for more rapid changes than having to wait for a new nim release. |
06:47:49 | supakeen | I'll read up on it nonetheless. |
06:48:01 | Yardanico | supakeen: well yeah that's true, it's supposed to just be a nimble package |
06:48:05 | FromDiscord | <Rika> i'm not sure if i like the packagename2 thing |
06:48:16 | supakeen | Anyways, writing my pty wrapper has been fun some more work on compatibility and testing to be done. |
06:48:18 | * | PMunch joined #nim |
06:48:30 | supakeen | Learning this {.importc.} stuff. |
06:48:52 | FromDiscord | <Rika> @nothratal, echo uses $ on any argument that is not a string, not sure if the concat. operator is used but that's minor compared to the dollar operator |
06:49:18 | Yardanico | well it uses $ on string too, but $ on string is a no-op anyway :) |
06:49:24 | Yardanico | I don't think it uses & though |
06:49:28 | Yardanico | lemme check in the compiler |
06:49:47 | FromDiscord | <Rika> it probably just does a stdout.write for each |
06:49:54 | FromDiscord | <Rika> which *might* be faster? dunno |
06:51:55 | Araq | it used to make a big difference but with arc it doesn't |
06:52:26 | Araq | but it doesn't use & so that the file's buffering mechanism gets to do the work |
06:52:43 | * | silvernode quit (Ping timeout: 265 seconds) |
06:53:01 | Araq | in theory that's better because a file buffer should know best when to flush |
07:02:14 | * | dadada quit (Ping timeout: 240 seconds) |
07:26:31 | * | AshlyeGraam joined #nim |
07:34:08 | * | AshlyeGraam quit (Ping timeout: 256 seconds) |
07:36:40 | * | gokr joined #nim |
07:43:23 | * | Trustable joined #nim |
07:49:03 | * | liblq-dev joined #nim |
07:50:53 | * | Trustable quit (Remote host closed the connection) |
08:03:23 | FromGitter | <nothratal> @all thanks for the clarification! |
08:03:44 | FromDiscord | <Rika> rest in peace the random guy pinged in discord |
08:03:53 | FromDiscord | <Rika> yardanico: did you look into this bug? |
08:07:42 | * | zacharycarter joined #nim |
08:08:25 | FromGitter | <bung87> distinct string `.string` using same pointer? |
08:12:23 | * | zacharycarter quit (Ping timeout: 260 seconds) |
08:12:30 | FromGitter | <alehander92> @bung87 hmmm! translating typescript async to other async? |
08:12:52 | FromGitter | <nothratal> as I read from the documentation: *.cfg-files for configuration should not used anymore, instead I should use nimscript. The documentation mentoins in which order the *.nims are loaded and overwritten. I also read that the *.nimble-file is a nimscript file. So if I build via nimble, is the order of loading *.nims the same? Can I still overwrite parts of the *.nimble with other *.nims? |
08:12:55 | alehander92 | morniing |
08:13:18 | FromGitter | <bung87> @alehander92 I can't recall, you are replying to what? |
08:14:20 | alehander92 | <3 |
08:14:25 | alehander92 | sorry! to async missing |
08:14:28 | FromGitter | <bung87> I checked a issue related to asyncjs ,found replaceReturn recursively |
08:14:29 | alehander92 | question |
08:14:34 | alehander92 | but i wonder if its going well |
08:14:41 | alehander92 | is it breaking |
08:15:03 | FromGitter | <bung87> it will replace inner block result |
08:15:26 | alehander92 | yeah |
08:15:34 | alehander92 | and i think it might break some templates |
08:15:47 | alehander92 | but this *might be* a fundamental problem with async i think |
08:16:10 | alehander92 | sorry, i lied |
08:16:15 | alehander92 | replacing block returns should be fixable |
08:16:19 | FromGitter | <bung87> and then I check `asyncmacro` it using more complixy logic to find the return statement. |
08:17:00 | FromGitter | <bung87> so current approach will not work as expected. |
08:18:12 | alehander92 | you're right !!! |
08:18:23 | alehander92 | they should probably share that approach |
08:18:40 | alehander92 | i'll take a look when i have time for that |
08:18:58 | FromGitter | <bung87> yeah, maybe just replace some ident share same logic. |
08:19:21 | alehander92 | yeah |
08:19:25 | alehander92 | but this approach with replacing |
08:19:38 | alehander92 | still has one problem |
08:19:44 | alehander92 | it's great for 95% of cases |
08:19:50 | alehander92 | but in macro/templates generation |
08:20:01 | alehander92 | you get new `return` which is not replaced |
08:20:06 | * | fredrikhr joined #nim |
08:20:18 | alehander92 | so that's why `template return` sounds like a cool idea |
08:20:24 | FromGitter | <bung87> any statements has nested block will not work... |
08:20:24 | alehander92 | even if probably too radical |
08:21:30 | FromGitter | <bung87> ok, now I move to db issues |
08:21:55 | alehander92 | yeah, this is probably true |
08:22:00 | alehander92 | but what i am saying is |
08:22:03 | alehander92 | even with asyncmacro |
08:22:09 | alehander92 | we still have one more case to handle |
08:22:22 | alehander92 | which cant be solved with asyncjs or asyncmacro approach |
08:24:04 | FromGitter | <bung87> oh, I got it |
08:25:24 | alehander92 | because asynmacro seems to add |
08:26:14 | alehander92 | `retFutureSym`.complete |
08:26:32 | alehander92 | so if a macro adds a `return`, it doesnt properly add the completion call |
08:26:41 | alehander92 | maybe we can add `areturn` |
08:26:43 | alehander92 | for macros |
08:26:50 | alehander92 | so they can make the right thing |
08:27:04 | alehander92 | areturn would invoke a template which expands to the complete + return |
08:27:46 | PMunch | nothratal, the nims/cfg files are compiler options. The .nimble file is a project description. Typically you wouldn't really mix the two and have one project.nims and one project.nimble file in your project |
08:28:55 | * | dadada joined #nim |
08:29:18 | * | dadada is now known as Guest18967 |
08:31:06 | PMunch | Hmm, had an idea yesterday as I was walking the dog by the way. I'm considering to add support in nimlsp for specifying extra syntax rules for nimscript files. |
08:31:53 | FromGitter | <bung87> @alehander92 so, alleast we can solve asyncjs problem first , then handle another problem.. |
08:32:57 | * | Guest18967 is now known as dadada |
08:33:04 | PMunch | My Vim install recognises .nimble files as Nim (probably to get syntax highlighting), but this also starts NimLSP for the file. So when I save the file NimLSP will tell be that it's full of errors, because it doesn't know about the stuff that gets appended to the script before it's run and the defines that are set. |
08:33:05 | dadada | any inbuilt procs for finding out the OS name and maybe some other general information about the users system? |
08:33:11 | dadada | ie. to detect that I'm running Fedora |
08:33:15 | dadada | or at least which Linux kernel |
08:33:26 | PMunch | Maybe something in here: https://nim-lang.org/docs/distros.html |
08:33:50 | * | konvertex joined #nim |
08:33:53 | PMunch | dadada ^ |
08:34:08 | dadada | PMunch: looks very basic, but it's something! thanks |
08:34:27 | FromDiscord | <Elegant Beef> Is it possible to get a typedesc's field names and types? |
08:34:53 | PMunch | So the idea is to have a way to tell NimLSP how to modify the file before it passes it to nimsuggest, and to be able to define flags |
08:34:56 | FromDiscord | <Elegant Beef> Guess should mention this is for macro |
08:35:03 | PMunch | @Elegant Beef, should be possible with getImpl |
08:35:40 | FromDiscord | <Elegant Beef> ah so nim node parsing 😄 |
08:36:45 | FromDiscord | <Elegant Beef> This is perfect though so thanks! 😄 |
08:36:54 | PMunch | Yes https://play.nim-lang.org/#ix=2m5T |
08:37:06 | PMunch | Just be aware of distinct types |
08:37:16 | FromDiscord | <Elegant Beef> Huh? |
08:37:51 | PMunch | https://play.nim-lang.org/#ix=2m5V |
08:38:43 | FromDiscord | <Elegant Beef> Ah i see |
08:38:53 | PMunch | So you need an extra call: https://play.nim-lang.org/#ix=2m5W |
08:40:33 | FromGitter | <bung87> "The application must finalize every prepared statement in order to avoid resource leaks", so what's the meanning of prepare? if it could not be resued? |
08:40:46 | FromGitter | <bung87> https://sqlite.org/c3ref/finalize.html |
08:41:07 | PMunch | You can prepare a statement and then call it multiple times |
08:42:00 | PMunch | Preparing the statement probably runs the query optimiser and creates an efficient binary representation of your query. Then you can call this many times with little overhead |
08:42:04 | FromGitter | <bung87> also make sure it finalize in the end? |
08:42:20 | PMunch | And finalize them at the end of your program to free up the memory it uses |
08:42:22 | PMunch | I assume |
08:43:17 | FromGitter | <bung87> so when I provide such a api, then end developer must call finalize himself, as I dont know when it not be used |
08:43:26 | PMunch | Yes |
08:43:38 | PMunch | Most likely |
08:43:49 | PMunch | Although you could try to use finalisers |
08:44:55 | FromDiscord | <Elegant Beef> Is there a way to only accept Objects? |
08:45:29 | FromGitter | <bung87> ok , thanks ! |
08:46:45 | FromDiscord | <Rika> beef, ??? |
08:46:47 | FromDiscord | <Rika> what do you mean |
08:47:02 | FromDiscord | <Elegant Beef> Only accept object types |
08:47:21 | FromDiscord | <Elegant Beef> in a proc |
08:48:05 | alehander92 | bung87 yes, right! but i cant now |
08:48:08 | alehander92 | ill do it later |
08:48:24 | FromDiscord | <Rika> https://play.nim-lang.org/#ix=2m5X @Elegant Beef this? |
08:48:49 | FromDiscord | <Elegant Beef> That was simpler than i though |
08:48:51 | FromDiscord | <Elegant Beef> I feel daft |
08:49:19 | FromDiscord | <Rika> xd |
08:49:29 | FromDiscord | <Elegant Beef> That takes an instantiated object |
08:49:36 | FromDiscord | <Elegant Beef> I mean a Object Type |
08:49:43 | PMunch | Hmm, I don't think so |
08:49:47 | FromDiscord | <Elegant Beef> Ah |
08:49:51 | PMunch | Because what you're actually getting is a symbol |
08:50:02 | FromDiscord | <Rika> https://play.nim-lang.org/#ix=2m5Y xdddd @Elegant Beef |
08:50:21 | FromDiscord | <Rika> now the proc is compile time though |
08:50:22 | PMunch | @Rika, that works? |
08:50:29 | FromDiscord | <Rika> try running it |
08:50:32 | PMunch | He's using it for a macro |
08:50:37 | FromDiscord | <Rika> run it |
08:50:51 | PMunch | Huh |
08:50:56 | PMunch | Well I'll be damned |
08:51:13 | FromDiscord | <Elegant Beef> Damn thanks rika |
08:51:17 | FromDiscord | <Rika> xd |
08:51:28 | FromDiscord | <Rika> compile time only of course |
08:51:34 | FromDiscord | <Elegant Beef> Well macro means it's fine |
08:51:41 | FromDiscord | <Elegant Beef> Bit issue is distinc objects |
08:51:46 | FromDiscord | <Rika> nim generics are intense |
08:51:48 | FromDiscord | <Elegant Beef> big issue distincs* |
08:51:53 | FromDiscord | <Elegant Beef> Holy shit |
08:51:55 | FromDiscord | <Elegant Beef> I cant spell at 3am |
08:52:18 | FromDiscord | <Elegant Beef> Cause i can do ` | distinct` but it's going to accept any i assume |
08:52:32 | FromDiscord | <Elegant Beef> So guess i just check the syms |
08:52:43 | FromDiscord | <Rika> https://play.nim-lang.org/#ix=2m5Z |
08:52:48 | FromDiscord | <Rika> xdddddddddddd |
08:53:03 | FromDiscord | <Rika> object doesnt accept distinct |
08:53:12 | FromDiscord | <Elegant Beef> What? |
08:53:34 | FromDiscord | <Rika> typedesc[object] wont accept a typedesc if it's a distinct int |
08:53:45 | FromDiscord | <Elegant Beef> But your example just did |
08:53:47 | FromDiscord | <Rika> so you add the or distinct |
08:53:53 | FromDiscord | <Rika> read the signature |
08:53:57 | FromDiscord | <Elegant Beef> Yea line 11 |
08:54:02 | FromDiscord | <Elegant Beef> I dont want ints to be accepted |
08:54:05 | PMunch | But then it accepts any distinct type :P |
08:54:06 | FromDiscord | <Rika> and it doesnt |
08:54:14 | FromDiscord | <Rika> i dont understand what you want |
08:54:15 | FromDiscord | <Elegant Beef> ent gets accepted |
08:54:28 | PMunch | He wants typedesc[object or distinct[object]] |
08:54:32 | FromDiscord | <Rika> if you dont want ent then remove the `or distinct` in l6 |
08:54:37 | FromDiscord | <Rika> ah |
08:54:41 | FromDiscord | <Rika> then do that |
08:54:51 | FromDiscord | <Elegant Beef> Well i mean if i knew to do that i wouldnt have asked 😛 |
08:55:12 | PMunch | @Rika, that doesn't work :P |
08:55:36 | FromDiscord | <Rika> im testing out |
08:55:48 | FromDiscord | <Rika> i dont think its possible xd |
08:56:09 | FromDiscord | <Rika> one moment |
08:56:10 | PMunch | Me neither |
08:56:26 | PMunch | Maybe with a concept :P |
08:56:30 | FromDiscord | <Elegant Beef> I can always just exit and complain |
08:56:32 | FromDiscord | <Rika> nothing i try works xd |
08:56:47 | FromDiscord | <Elegant Beef> Or not support distincts |
08:57:05 | FromDiscord | <Rika> just read the string and check if the type is a primitive (given an array of them xd) |
08:57:12 | PMunch | @Elegant beef, just an assert is probably fine |
08:57:17 | FromDiscord | <Rika> the name of the type as a string, i mean |
08:57:29 | PMunch | When compiling a macro it's all compile-time anyways |
08:57:41 | FromGitter | <bung87> during exec prepared when error occurs should I finalize it? |
08:57:54 | PMunch | You don't have to |
08:57:56 | alehander92 | bless ya PMunch |
08:58:03 | PMunch | alehander92, huh? |
08:58:05 | alehander92 | what do you need concepts for |
08:58:08 | * | bacterio joined #nim |
08:58:16 | FromGitter | <bung87> ok |
08:58:34 | PMunch | Haha, you don't. I was just trying to hint at a way it might be possible to do it :P |
08:59:33 | FromDiscord | <FromIRC> Uptime - 1 day, 18 hours, 36 minutes, 21 seconds, 20 milliseconds, 935 microseconds, and 540 nanoseconds |
08:59:33 | FromDiscord | <Yardanico> !status |
09:00:47 | PMunch | @bung87, look at preparing a statement as getting a closure. You call it with some parameters, then you can call this closure how many times you want, and when you're done with it you need to free it (this is done automatically by the GC in Nim, and is what I was talking about with finalisers) |
09:01:06 | * | couven92 joined #nim |
09:01:37 | * | fredrikhr quit (Disconnected by services) |
09:01:42 | * | couven92 is now known as fredrikhr |
09:02:35 | * | theelous3 joined #nim |
09:02:55 | * | fredrikhr quit (Read error: Connection reset by peer) |
09:03:24 | * | fredrikhr joined #nim |
09:20:53 | FromGitter | <bung87> but gc doesnot automaticlly call finalise |
09:21:04 | PMunch | Yes it does |
09:21:30 | PMunch | Whet the memory is reclaimed |
09:21:52 | FromGitter | <bung87> emm, so every db_* could make prepare proc closure? |
09:23:00 | PMunch | They don't have to be closures, but yeah that should be possible |
09:27:09 | FromGitter | <bung87> ok, I just unify the apis for now, may have further work to do with it. |
09:28:07 | * | salewski joined #nim |
09:29:23 | salewski | Can someone help him? https://github.com/StefanSalewski/gintro/issues/72 |
09:29:24 | disbot | ➥ running example code gives me "cannot open file: gintro/gtk " |
09:29:39 | FromGitter | <bung87> how does gc know to call `finalise`, is `finalise` just wipe the memory? |
09:30:38 | PMunch | What do you mean how does it know? |
09:30:45 | PMunch | When you create the object you set the finaliser |
09:31:04 | PMunch | And then Nim stores that for when it frees the memory |
09:31:22 | PMunch | And calls it before actually calling free on the memory |
09:31:27 | * | salewski quit (Client Quit) |
09:33:57 | FromGitter | <bung87> I mean sqlite's c api `finalise` |
09:35:33 | PMunch | Oh no, you would have to wrap it in a Nim object and create a Nim finaliser that calls the SQL finalise |
09:36:08 | * | Faulander joined #nim |
09:36:37 | Faulander | hi guys, long time since i needed help. but now i struggle here: Error: unhandled exception: Failed to parse '2020-05-04T08:24:51+02:00' with format 'yyyy-MM-dd'. Parsing ended but there was still input remaining [TimeParseError] |
09:37:31 | PMunch | Seems obvious enough |
09:37:42 | PMunch | The T08:24:51+02:00 part doesn't match your format |
09:38:05 | Faulander | i don't get why fileInfo(file).lastWriteTime identifies itself as time, but delivers a complete datetime. |
09:38:22 | PMunch | What do you mean? |
09:39:02 | FromGitter | <bung87> oh Nim's finaliser, have not try use this feature. |
09:40:02 | Faulander | proc parse(input, f: string; tz: Timezone = local(); loc: DateTimeLocale = DefaultLocale): DateTime |
09:40:02 | Faulander | first type mismatch at position: 1 |
09:40:02 | Faulander | required type for input: string |
09:40:02 | Faulander | but expression 'lastModDate' is of type: Time ---- BUT if you echo it, it's a full datetime expression like the one i postet above |
09:41:51 | PMunch | Ah, "Time" is a point in time |
09:41:56 | PMunch | It includes the date |
09:42:27 | Faulander | yes, i guessed so. but i cannot compare a datetime with that time |
09:43:10 | Faulander | that's why i tried to parse the "Time" into a datetime |
09:43:10 | PMunch | No, for that you either need to convert the DateTime into a Time with toTime |
09:43:20 | PMunch | Or you need to create a DateTime object from the Time object |
09:43:33 | Faulander | the second one is ecactly what i tried |
09:43:49 | PMunch | Probably by creating a DateTime object initialised to the epoch and then adding the Time to it as a Duration |
09:44:15 | Faulander | i will try to first aproach |
09:44:36 | Faulander | just convert the datetime to time with toTime |
09:50:03 | PMunch | Hmm curious, I compiled my TinyWM with --gc:none, and --gc:arc |
09:50:09 | PMunch | The --gc:arc version is smaller |
09:56:45 | * | dddddd joined #nim |
09:56:56 | FromDiscord | <kodkuce> @dom96 your nimbox too does not support true color right |
10:02:24 | dom96 | don't remember |
10:02:37 | * | chemist69 quit (Ping timeout: 272 seconds) |
10:03:34 | FromDiscord | <kodkuce> .cache/nim/withTermbox_d/@m..@s..@[email protected]@[email protected]@snimbox.nim.c:13:10: fatal error: termbox.h: No such file or directory |
10:03:36 | * | chemist69 joined #nim |
10:03:54 | FromDiscord | <kodkuce> 😦 |
10:07:24 | FromDiscord | <kodkuce> oh i needed termbox package on my system not nimble thingy |
10:07:36 | * | sunwukong joined #nim |
10:12:02 | Yardanico | PMunch: magic :P |
10:12:10 | Yardanico | also there's a few other things you can use to make your binary even smaller |
10:12:28 | Yardanico | --panics:on (defects will not be catchable), -d:noSignalHandlers (no default signal handlers obviously) |
10:14:44 | Yardanico | of course -d:danger --opt:size |
10:15:03 | Yardanico | also --passC:"-flto" --passL:"-flto" |
10:16:03 | PMunch | lto made quite a big change |
10:16:21 | PMunch | panics:on and noSignalHandlers didn't do much |
10:16:31 | PMunch | But this is TinyWM, so not exactly the largest thing to begin with |
10:16:44 | Yardanico | you can also try adding --os:any -d:posix |
10:16:57 | Yardanico | idk if it will compile then though |
10:17:27 | PMunch | Hmm no: Error: system module needs: nimLoadLibrary |
10:18:11 | Yardanico | hmm lemme see |
10:18:33 | Yardanico | also try adding -d:linux |
10:19:01 | PMunch | Same error |
10:19:26 | Yardanico | you can try a crazy thing |
10:19:28 | PMunch | The code by the way, if you want to try for yourself: http://ix.io/2m6k |
10:19:30 | Yardanico | include system/dyncalls |
10:19:43 | Yardanico | hmm lemme try :) |
10:22:00 | Yardanico | well I didn't have success with os any |
10:22:04 | Yardanico | but it gets to 16kb (dynamically linked) |
10:22:09 | Yardanico | 14392 bytes |
10:22:32 | Yardanico | clang makes the binary 5kb smaller than GCC - with gcc it's 18584 |
10:22:36 | dadada | hey |
10:22:55 | dadada | vscode was great for me at the beginning, but now with a lot of nimsources in my project it is becoming real slow |
10:23:11 | dadada | seems like nimsuggest is the bottleneck a lot of the time |
10:23:14 | Yardanico | dadada: idk really, nim extension in vscode has been failing for me lately (I mean nimsuggest integration) |
10:23:24 | PMunch | Yardanico, yeah I got 19K with GCC |
10:23:27 | PMunch | stripped of course |
10:23:32 | Yardanico | PMunch: with clang it's even smaller :) |
10:23:51 | Yardanico | "wc file" to count individual bytes, because "du -sh" can't always report properly |
10:24:27 | Yardanico | what's funny is that I get the exact same size wit arc and none |
10:24:30 | Yardanico | gc:arc and gc:none |
10:24:49 | PMunch | 18576 |
10:24:50 | Yardanico | byte-to-byte similar |
10:24:59 | Yardanico | PMunch: nim c -d:danger --gc:arc --opt:size --cc:clang --passC:"-flto" --passL:"-flto" pafa.nim |
10:25:05 | Yardanico | although I'm on clang 10 |
10:25:13 | Yardanico | with GCC 9.3 |
10:25:39 | Yardanico | ah right I forgot panics and signal handlers |
10:25:48 | PMunch | With --gc:none: 18496 |
10:25:57 | PMunch | nim c -d:release -d:danger --gc:none --panics:on -d:noSignalHandlers --opt:size --passC:"-flto" --passL:"-flto" tinywm |
10:25:59 | Yardanico | ah nvm, even with panics and no signal handlers it's the same |
10:26:10 | Yardanico | PMunch: you don't need -d:release on the commandline anymore btw :) |
10:26:13 | Yardanico | on nim 1.2.0 or higher |
10:26:22 | PMunch | What? |
10:26:24 | Yardanico | ? |
10:26:44 | Yardanico | see my forum post https://forum.nim-lang.org/t/5878 |
10:26:45 | Yardanico | and replies |
10:26:46 | PMunch | 14472 with clang |
10:27:05 | PMunch | Ah, danger implies release |
10:27:15 | Yardanico | yeah, don't put danger or release in the config though |
10:27:39 | Yardanico | https://github.com/nim-lang/Nim/issues/14272 :P |
10:27:41 | disbot | ➥ -d:release -d:danger don't work as expected in user configs ; snippet at 12https://play.nim-lang.org/#ix=2leZ |
10:28:03 | PMunch | Yeah I've noticed that |
10:32:35 | * | Vladar joined #nim |
10:36:52 | FromDiscord | <kodkuce> hmm @dom96 https://pastebin.com/bdV2vrxu is your termbox broken i dont detect any mouse events |
10:37:39 | FromGitter | <bung87> does the Nim repo ci check could be faster? |
10:37:48 | Yardanico | well it was already optimized a lot |
10:38:15 | Yardanico | you have to understand it checks 5 different OSes (and both i386 and x86_64 on linux) and tests the whle Nim test suite and all important packages |
10:38:47 | FromGitter | <bung87> not as I expected, this is the slowest as I know.. |
10:42:06 | * | ryan_ quit (Read error: Connection reset by peer) |
10:46:57 | Yardanico | @bung87 maybe it just hung up |
10:47:05 | Yardanico | you mean in https://github.com/nim-lang/Nim/pull/14356 ? |
10:47:06 | disbot | ➥ add SqlPrepared api fix https://github.com/nim-lang/Nim/issues/13559 |
10:47:08 | Yardanico | ah it only was opened 20 minutes ago |
10:47:20 | Yardanico | it finishes in 30-50 minutes usually |
10:47:56 | FromGitter | <bung87> ok , that's sounds .. fine |
10:48:04 | Yardanico | well you have to understand how many tests there are |
10:48:34 | Yardanico | if you count with "cloc" (so lines of code without empty lines or comments), it's 100 thousand of lines of Nim code |
10:48:36 | Yardanico | in "tests" directory |
10:48:44 | FromGitter | <bung87> yeah, I know it will test agains OSs, make it take longer |
10:49:06 | * | filcuc joined #nim |
10:49:34 | Yardanico | it tests against Linux (i386 x86_64), macOS x86_64, Windows x86_64, NetBSD x86_64, OpenBSD x86_64 |
10:49:50 | Yardanico | @Clyybber yay you managed to fix it?! |
10:52:13 | * | FromDiscord quit (Remote host closed the connection) |
10:52:22 | * | FromDiscord joined #nim |
10:52:24 | Yardanico | foh no fromdiscord crashed |
10:53:10 | FromDiscord | <Rika> ?? |
10:53:13 | Yardanico | ? |
10:53:26 | Yardanico | it autorestarts on crash anyway |
10:53:33 | Yardanico | 9 seconds downtime |
10:54:07 | dom96 | what error did it crash with? |
10:54:18 | PMunch | So you've gotta be quick if you want to trash talk the Discord users? |
10:54:26 | Yardanico | yep |
10:54:36 | Yardanico | dom96: I posted in offtopic, websocket closed and then dimscord got into infinite recursion for some reason |
10:55:31 | * | Trustable joined #nim |
10:56:53 | * | fredrikhr quit (Read error: Connection reset by peer) |
10:57:23 | * | fredrikhr joined #nim |
10:57:23 | dom96 | cool, as long as it crashes and can restart that's perfect |
10:57:30 | dom96 | NimBot has been running that way for years :D |
10:58:00 | Yardanico | dom96: one problem is that it's still not running on the nim vps because there's not enough memory to compile devel (yes I need it for some async pragma stuff to work properly) |
10:58:11 | Yardanico | and cross-compilation kinda fails because it's ubuntu 16.04 and glibc 2.24 |
10:59:00 | Yardanico | I'll try to cross-compile with zig (hehe) |
10:59:10 | Yardanico | to target glibc 2.24 |
11:00:11 | dom96 | Yardanico, just need to enable swap |
11:00:36 | Yardanico | well I don't have the privileges to do that :P |
11:00:48 | dom96 | or yeah, you can cross compile |
11:00:53 | dom96 | or use WSL? or a vm |
11:00:59 | Yardanico | I'm on Linux anyway |
11:01:20 | Yardanico | let's see if it works |
11:01:52 | dom96 | yeah, so just copy it to the VPS |
11:02:05 | Yardanico | well I already do the same for my own VPS with scp |
11:02:09 | Yardanico | so yeah, I'll try now |
11:03:33 | Yardanico | oh it actually seems to work lol |
11:04:24 | Yardanico | will restart the bridge now |
11:04:35 | * | FromDiscord quit (Remote host closed the connection) |
11:04:57 | * | FromDiscord joined #nim |
11:04:58 | Yardanico | done |
11:05:05 | Yardanico | @Yardanico 123 |
11:05:12 | Yardanico | yeah seems to work fine, all praise Zig /s |
11:05:45 | Yardanico | That's the command I use to cross-compile btw https://github.com/Yardanico/ircord/blob/master/zig-compile-vps.sh |
11:06:08 | Yardanico | -O2 because it was crashing with SIGILL on the VPS without it |
11:08:56 | Yardanico | not that it needs speed anyway, it typically uses 0-1% CPU anyway (as it should be, praise async) |
11:12:52 | dom96 | if you're on linux then why do you need to cross compile? |
11:12:59 | Yardanico | dom96: my glibc is newer than on the VPS |
11:13:05 | dom96 | ahh |
11:13:32 | FromDiscord | <kodkuce> i think i am tarded, duno how to get mouse event in this termbox |
11:14:00 | FromDiscord | <kodkuce> i even tryed adding nb.inputMode = inpMouse |
11:14:04 | FromDiscord | <kodkuce> but still nothing |
11:19:35 | dom96 | Check out the source for my deauther |
11:19:44 | dom96 | When I created it mouse input worked |
11:21:17 | FromDiscord | <kodkuce> lol |
11:21:51 | FromDiscord | <kodkuce> i am uber tard i was compiling old file and was whole time getting old output and was like wtf xD |
11:25:26 | * | Hideki_ joined #nim |
11:30:05 | * | Hideki_ quit (Ping timeout: 256 seconds) |
11:31:37 | * | hoijui joined #nim |
11:36:06 | Araq | Yardanico, just compile on your VPS |
11:36:17 | Yardanico | Araq: my VPS is running arch linux :DD |
11:36:30 | Yardanico | but it's fine, I cross-compiled and it runs on the nim vps now |
11:37:21 | Araq | but thanks for reminding me why people care about cross-compiling. gosh, Linux is such a piece of ... |
11:37:43 | * | SvetaBilya joined #nim |
11:37:58 | * | filcuc quit (Remote host closed the connection) |
11:37:58 | * | abm joined #nim |
11:38:32 | * | dddddd quit (Ping timeout: 260 seconds) |
11:39:57 | * | filcuc joined #nim |
11:40:39 | * | dddddd joined #nim |
11:41:02 | * | SvetaBilya quit (Client Quit) |
11:41:57 | PMunch | Hmm, not great: http://ix.io/2m6I |
11:46:32 | * | cgfuh joined #nim |
11:49:32 | * | sunwukong quit (Quit: Leaving) |
11:59:08 | FromDiscord | <Zed> how supported is nim on the pi? |
12:01:13 | FromDiscord | <Rika> why would it not be well supported |
12:01:23 | FromDiscord | <Rika> a raspberry pi runs linux does it not |
12:01:27 | FromDiscord | <Rika> ah well its arm |
12:01:27 | Yardanico | it does |
12:01:31 | Yardanico | well it works on arm |
12:01:37 | FromDiscord | <Rika> but it's still a valid c target yeah |
12:01:38 | Yardanico | there are even nightly binary builds for arm/arm64 |
12:01:45 | FromDiscord | <Zed> i installed nim on my pi and it was a 0.17 release or something |
12:01:50 | Yardanico | well that's from repos |
12:01:53 | FromDiscord | <Rika> that's because you didnt use choosenim |
12:01:54 | FromDiscord | <Rika> xd |
12:01:54 | Yardanico | download from https://github.com/nim-lang/nightlies/releases |
12:02:08 | Yardanico | if your distro is aarch64 (not the kernel, the DISTRO), use arm64 |
12:02:24 | Yardanico | otherwise armv7 |
12:02:27 | FromDiscord | <Zed> lol, well i guess ill be using nim lol |
12:02:53 | Yardanico | download this one, it's for 1.2 stable branch https://github.com/nim-lang/nightlies/releases/tag/2020-05-07-version-1-2-75abd4d |
12:03:10 | Yardanico | you still need to have a C compiler installed of course |
12:03:29 | FromDiscord | <Zed> awesome, will do |
12:06:01 | * | supakeen quit (Quit: WeeChat 1.9.1) |
12:06:16 | * | Hideki_ joined #nim |
12:06:44 | * | supakeen joined #nim |
12:07:34 | * | rockcavera joined #nim |
12:09:56 | FromGitter | <bung87> `PASS: PackageFileParsed C (1374.84 sec)` I have a suggestion , output the each package test time costs |
12:10:14 | Yardanico | there is |
12:11:01 | Yardanico | "PASS: https://github.com/treeform/chroma C ( 5.76 sec) PASS: https://github.com/status-im/nim-chronicles C (33.80 sec)" etc |
12:11:25 | Yardanico | btw "PASS: https://github.com/status-im/nim-bncurve C (609.08 sec)" |
12:11:38 | Yardanico | I know it takes so long because it runs some calculation heavy tests without -d:release or -d:danger |
12:11:42 | Yardanico | is that ok? |
12:11:48 | Yardanico | 10 minutes for a single package :P |
12:12:16 | Yardanico | @bung87 PackageFileParsed is just the end result, it's a sum of all time spent on all packages, you have to see the messages before it |
12:12:48 | FromGitter | <bung87> oh , I didnot aware that |
12:14:16 | FromGitter | <bung87> almost each package less than 50s , did not aware it grow as that big number |
12:15:05 | Yardanico | https://github.com/nim-lang/Nim/pull/14358 |
12:15:07 | disbot | ➥ Use `nimble test` for bncurve |
12:15:08 | FromGitter | <bung87> lemme take a look at https://github.com/status-im/nim-bncurve |
12:15:18 | Yardanico | it's not bncurve's fault |
12:15:28 | Yardanico | see my pr |
12:15:47 | narimiran | Yardanico: so you want to replace one slow test with multiple tests (including that one)? |
12:15:54 | Yardanico | it wasn't slow |
12:16:00 | Yardanico | well it was because of no -d:release and stuff |
12:16:12 | narimiran | ok, add `-d:release` |
12:16:23 | Yardanico | why not test the whole package? |
12:16:32 | narimiran | because it will become too slow |
12:16:42 | narimiran | look at the whole file, it is not the only such example |
12:16:53 | Yardanico | it'll still be quite fast, I checked locally too |
12:17:12 | Yardanico | the only test in bncurve which takes a big amount of time is tvectors.nim |
12:17:24 | Yardanico | all others are fast enough |
12:17:27 | narimiran | ok |
12:17:34 | narimiran | what is the speedup? |
12:18:01 | narimiran | can you test also other slow packages to see if `-d:release` helps there? |
12:18:05 | Yardanico | it should take around 6-10x less time to complete |
12:18:06 | Yardanico | narimiran: ok |
12:18:16 | narimiran | if so, add it to the same PR |
12:19:56 | FromGitter | <bung87> why imptant package testing using custom command, instead of just using nimble test. |
12:20:02 | Yardanico | because not all packages have that |
12:20:03 | narimiran | i just told you |
12:20:09 | Yardanico | and even if they do, it can become too slow as narimiran said :) |
12:20:25 | Yardanico | well nim-unicodedb takes a minute because it uses nimble test but runs tests without -d:release or -d:danger |
12:21:05 | narimiran | do `nim c -d:release -r tests/tests` |
12:21:17 | narimiran | as that is (without release) what `nimble test` does for that package |
12:21:24 | Yardanico | yeah I know, although maybe it's better to just PR upstream? |
12:21:28 | FromGitter | <bung87> but your pr just remove custom command... |
12:21:38 | Yardanico | @bung87 because it didn't have -d:release or -d:danger |
12:21:42 | Yardanico | and their own nimble test task has that |
12:22:02 | narimiran | Yardanico: this way it will be faster (to merge and reap the benefits) |
12:22:06 | Yardanico | ah okay |
12:22:15 | FromGitter | <bung87> ok,that's just important_packages.nim problem. |
12:24:12 | FromGitter | <bung87> wait and see how much time your pr reduce :P |
12:24:26 | Yardanico | it'll reduce around 500 seconds for important packages 1 |
12:24:43 | narimiran | that's huge! |
12:25:01 | FromGitter | <bung87> thats life saving |
12:25:10 | Yardanico | narimiran: that's my point, idk why no one noticed it :D |
12:25:19 | narimiran | @bung87 that's exaggeration |
12:25:22 | Yardanico | a package taking 600 seconds to test |
12:25:34 | FromGitter | <bung87> hhh |
12:25:41 | Yardanico | hmm I guess it's better if I sort all package results by the time to easier see |
12:25:55 | narimiran | Yardanico: i don't know either how i missed it, because i've spent some time in trying to make packages faster.... |
12:26:32 | FromGitter | <bung87> atleast this problem should send a mail to core team. |
12:26:51 | narimiran | @bung87 what are you talking about? are you trolling? |
12:27:28 | * | Hideki_ quit (Ping timeout: 246 seconds) |
12:27:58 | narimiran | Yardanico: here's a quick list of the slowest: nim-unicodedb, Prologue, nitter, nim_websitecreator, nim-chronos, nim-brainfuck, (bncurve), Arraymancer |
12:28:08 | FromGitter | <bung87> eg .mail content as "ci testing take so long about 30minutes" |
12:28:19 | narimiran | ok, you're trolling |
12:28:37 | alehander92 | eh, doesn't sounds insane |
12:29:06 | alehander92 | but i think CI-s have time limits |
12:29:07 | alehander92 | also |
12:29:14 | dom96 | yeah, what, that doesn't sound like trolling to me |
12:29:25 | narimiran | btw, the current bottleneck is testing windows build |
12:29:28 | FromGitter | <bung87> I dont meat to that |
12:29:48 | narimiran | it takes ~45 minutes, while others are in 25-30min range |
12:30:07 | FromGitter | <bung87> its almost like a web site log level warning, error |
12:30:36 | narimiran | but we are aware of the usual times the CIs take. it's not like this was some sudden spike |
12:31:06 | narimiran | so: nothing unexpected happened here, just Yardanico realizing how to speed up one test |
12:31:36 | Yardanico | narimiran: is brainfuck actually slow? |
12:31:48 | Yardanico | ah yeah seems so, hmm |
12:31:51 | FromGitter | <bung87> ok |
12:32:16 | narimiran | i just opened one CI result and copied the slowest ones there. there's some noise in the result, but you already know that :) |
12:32:40 | Yardanico | narimiran: the thing is - it takes 2ms to run on my PC :D |
12:32:45 | Yardanico | I mean the tests/compile.nim |
12:32:50 | Yardanico | not 58 seconds |
12:33:19 | narimiran | does `-d:release` help? |
12:33:32 | Yardanico | help with what? it's already 2ms |
12:33:39 | narimiran | oh, without it? |
12:34:00 | Yardanico | same |
12:34:06 | narimiran | add `-d:release` to your PR there, maybe it will help with CIs |
12:34:09 | Yardanico | ah ok |
12:35:09 | narimiran | (and try to push all the changes at once, not one by one - that will help CIs too :)) |
12:35:14 | Yardanico | ah yeah ok, sorry |
12:35:25 | Yardanico | I will see where I else I can add -d:release |
12:40:06 | Yardanico | narimiran: I made a short nim program to sort by time, https://gist.github.com/Yardanico/1d3db505ed9df79f03fdf96bef686a5d |
12:40:10 | Yardanico | these are the ones which take more than 10s |
12:41:51 | narimiran | :) |
12:41:54 | * | filcuc quit (Ping timeout: 240 seconds) |
12:42:29 | narimiran | nim program? real programmers would write vim macro to do that :D :P |
12:42:35 | Yardanico | :D |
12:42:41 | Yardanico | and I wrote it in nano XD |
12:44:36 | FromGitter | <Vindaar> @Yardanico: damn, ggplotnim is way too fast. I think I need to include all recipes as tests :P |
12:45:18 | * | zacharycarter joined #nim |
12:46:30 | Yardanico | we can't do anything about nitter btw, it actually takes that long to compile, but it's fine i guess |
12:46:53 | * | ftsf quit (Quit: Leaving) |
12:52:00 | Yardanico | narimiran: I don't think I can change a lot of stuff, I also changed fidget, prologue, unicodeplus, can I push ? :P |
12:52:08 | * | filcuc joined #nim |
12:53:14 | Yardanico | hmm I will wait for important_packages to finish on my last commit |
12:54:23 | narimiran | yeah you can push, and i can cancel the CIs for the previous commit |
12:55:47 | Yardanico | i don't like how you can't see github action CI logs until the task finished |
12:56:01 | * | dadada quit (Ping timeout: 264 seconds) |
12:56:15 | narimiran | can't you? i can |
12:56:25 | Yardanico | it doesn't work for me for some reason :D |
12:56:40 | Yardanico | ok it finished for ubuntu |
12:57:08 | Yardanico | I pushed |
12:57:37 | Yardanico | you can cancel all tests except important packages I guess |
12:57:46 | * | dadada joined #nim |
12:58:04 | Yardanico | wait fsck |
12:58:10 | * | dadada is now known as Guest67097 |
12:58:25 | Yardanico | I forgot to git add fidget, now you can cancel :P |
12:58:32 | Yardanico | I don't think there are any more packages worth changing really |
12:58:40 | * | narimiran thumb up |
12:59:37 | Yardanico | i didn't do any PRs (I mean merged) to nim repo in 2 years |
12:59:42 | Yardanico | xd |
12:59:52 | narimiran | glad to have you back :) |
13:01:20 | * | waleee-cl joined #nim |
13:05:30 | narimiran | btw, Yardanico, did you see i've sent you a PM? :) |
13:09:31 | narimiran | @Vindaar any chance you could push a new release of ggplotnim? i think our CIs pick the latest tagged version.... |
13:15:03 | FromGitter | <Vindaar> oh, damn I forgot |
13:15:04 | FromGitter | <Vindaar> 1 min |
13:17:59 | FromGitter | <Vindaar> @narimiran done |
13:18:04 | narimiran | thanks! |
13:33:02 | * | Hideki joined #nim |
13:33:18 | * | Hideki quit (Remote host closed the connection) |
13:33:55 | * | Hideki joined #nim |
13:34:18 | * | Hideki is now known as Guest90512 |
13:34:58 | * | Guest90512 quit (Remote host closed the connection) |
13:45:29 | * | Guest67097 quit (Ping timeout: 265 seconds) |
13:49:04 | * | zacharycarter quit (Ping timeout: 272 seconds) |
13:49:55 | * | zacharycarter joined #nim |
13:54:41 | * | dadada joined #nim |
13:55:04 | * | dadada is now known as Guest70849 |
13:58:16 | PMunch | Hmm, this gc_ms.nim crash is bothering me a bit.. |
13:58:35 | PMunch | This is with --gc:markandsweep by theway |
14:02:37 | * | filcuc quit (Ping timeout: 264 seconds) |
14:05:22 | * | Vladar quit (Quit: Leaving) |
14:07:16 | PMunch | Hmm, just got my PR to Unbound merged |
14:07:31 | PMunch | So soon I can move my Unbound Nim plugin to use the new master branch :) |
14:09:46 | PMunch | Hmm, maybe I should try ARC/ORC. How confident are we that it will work? Push to prod ready? |
14:09:53 | Yardanico | kinda :D |
14:09:58 | Yardanico | it'll be prod ready when ORC works with the compiler |
14:10:01 | Yardanico | that's the goal |
14:10:11 | Yardanico | just help test stuff with arc/orc and report bugs |
14:10:26 | PMunch | So I shouldn't try to run our companies latest project with it then :P |
14:10:37 | Yardanico | btw: nimlsp won't work with orc because nimsuggest doesn't really work with it rn (even if you insert all needed nosinks pragmas to callbacks) |
14:10:41 | Yardanico | I tried :) |
14:10:55 | PMunch | Ah, good to know |
14:19:26 | FromGitter | <bung87> am thinking using multiple threads make the packages tests more faster? |
14:19:44 | Yardanico | CIs don't have a lot of cores |
14:20:31 | FromGitter | <bung87> ok, so that make just logically |
14:20:33 | * | sacredfrog quit (Quit: ZNC 1.7.5 - https://znc.in) |
14:21:39 | * | NimBot joined #nim |
14:26:54 | * | sacredfrog joined #nim |
14:27:23 | FromDiscord | <kodkuce> can i use case statemnent to match 2 stuff with option to second stuff sometimes be anything like * it 🙂 |
14:27:38 | Yardanico | case statements are _not_ pattern matching raelly |
14:27:40 | Yardanico | really* |
14:27:48 | Yardanico | try https://github.com/andreaferretti/patty or https://github.com/alehander92/gara |
14:27:53 | Yardanico | for pattern matching |
14:28:26 | FromDiscord | <kodkuce> ye but its just a tuple |
14:28:44 | FromDiscord | <kodkuce> i can do case statment plus if in each row but that kinda beh too |
14:28:51 | Yardanico | so use patty or gara |
14:29:38 | PMunch | Aha, it seems like my fix might've worked after all |
14:29:45 | PMunch | I was just running the wrong docker container.. |
14:32:12 | * | Hideki joined #nim |
14:32:35 | * | Hideki is now known as Guest48120 |
14:34:31 | * | narimiran quit (Ping timeout: 246 seconds) |
14:35:42 | * | fredrikhr quit (Read error: Connection reset by peer) |
14:36:12 | * | fredrikhr joined #nim |
14:39:24 | * | fredrikhr quit (Remote host closed the connection) |
14:39:44 | * | fredrikhr joined #nim |
14:43:38 | * | Guest48120 quit (Remote host closed the connection) |
14:47:31 | * | letto joined #nim |
14:49:03 | * | sagax quit (Ping timeout: 260 seconds) |
14:50:25 | * | lritter joined #nim |
14:55:37 | * | exelotl joined #nim |
14:57:50 | alehander92 | `case` can be extended in theory |
14:57:54 | alehander92 | but i doubt it would happen |
14:59:56 | * | sagax joined #nim |
15:00:09 | FromGitter | <kaushalmodi> In unicode.nim, for many (not all) procs, I see these pragmas: ⏎ ⏎ ```proc isTitle*(c: Rune): bool {.rtl, extern: "nuc$1", procvar.} =``` ⏎ ⏎ 1) Why is the exported `isTitle` prefixed with "nuc" (what does that string mean?) ... [https://gitter.im/nim-lang/Nim?at=5ebeae7849a1b73184789027] |
15:01:17 | Yardanico | 1) "nim unicode" I guess 2) procvar https://github.com/nim-lang/Nim/issues/2172 3) for nimrtl I guess :P |
15:01:24 | FromGitter | <kaushalmodi> Then for `isAlpha` proc, it has the `noSideEffect` pragma too: ⏎ ⏎ ```proc isAlpha*(s: string): bool {.noSideEffect, procvar, rtl, extern: "nuc$1Str".} =``` ⏎ ⏎ I am curious how to know when to use or not use such pragmas [https://gitter.im/nim-lang/Nim?at=5ebeaec4ecc55a312d050b7d] |
15:01:40 | Yardanico | noSideEffect is when you mark your proc as having no side effects |
15:01:47 | Yardanico | like accessing global variables |
15:03:20 | FromGitter | <kaushalmodi> Yardanico: I understood that, but the adding of noSideEffect doesn't seem consistent |
15:03:36 | FromGitter | <kaushalmodi> e.g. the `isAlpha` for Rune doesn't have it, but the `isAlpha` for string has it |
15:03:40 | Yardanico | well not everything is consistent :) |
15:03:47 | Yardanico | they probably weren't created at the same time |
15:03:49 | Yardanico | check git blame |
15:03:54 | FromGitter | <kaushalmodi> hmm, ok |
15:04:58 | FromGitter | <kaushalmodi> Regarding procvar, then, it should be safe to just remove it from the unicode (and other) stdlibs? |
15:05:00 | FromGitter | <kaushalmodi> https://github.com/nim-lang/Nim/issues/2172#issuecomment-383296306 |
15:05:07 | Yardanico | i don't know :P |
15:05:08 | FromGitter | <kaushalmodi> @Araq ^ |
15:05:44 | Yardanico | well there's only 21 usages of procvar in the whole repo |
15:05:48 | FromGitter | <kaushalmodi> I was going to start working on a small PR for that isTitle thing, but then I don't know which pragmas are needed vs not |
15:05:50 | Yardanico | actually a bit less |
15:05:59 | FromGitter | <kaushalmodi> locally, that proc works fine without any pragmas |
15:06:07 | * | hoijui quit (Quit: Leaving) |
15:06:31 | FromGitter | <kaushalmodi> ref: https://github.com/nim-lang/Nim/issues/14348#issuecomment-628850897 |
15:07:17 | Yardanico | well one thing is that I think that this isTitle is not the most efficient version |
15:07:51 | FromGitter | <iffy> I'm getting `config.nims(16, 19) Error: undeclared identifier: 'absolutePath'` but I thought nimscript included the `os` module? |
15:08:12 | Yardanico | no, you need to import it |
15:08:19 | Yardanico | well not really actually |
15:08:24 | Yardanico | if you're on devel, update to latest devel |
15:08:30 | Yardanico | it was removed and then added back because of backwards compat |
15:08:33 | FromGitter | <iffy> I'm on 1.0.6 |
15:08:40 | Yardanico | why not 1.2? :) |
15:08:41 | FromGitter | <kaushalmodi> Yardanico: Oh well, I'll just drop that effort and add it to my notes.. may be my future self will need that |
15:08:56 | Yardanico | well it's ok @kaushalmodi, I'm not the one who'll judge your PRs :) |
15:09:13 | FromGitter | <iffy> Because I'm in the middle of releasing stuff on 1.0.6 and didn't want to upgrade until I finished my other stuff |
15:09:26 | FromGitter | <iffy> Even importing os, it still fails |
15:10:15 | FromGitter | <bung87> @kaushalmodi I saw your comment, you code should break earlier when it false, and not split whole text |
15:10:41 | FromGitter | <bung87> other parts just fine |
15:10:44 | FromGitter | <kaushalmodi> @bung87 I did implement many return falses |
15:10:56 | FromGitter | <kaushalmodi> without splitting into words, I cannot tell if each word is a title |
15:13:55 | FromGitter | <bung87> ok |
15:14:17 | FromGitter | <kaushalmodi> @bung87 take this for example "This is a NOT a title" |
15:14:50 | FromGitter | <kaushalmodi> or even "This Is Not A title" <-- here isTitle will fail only at the last word |
15:15:41 | FromGitter | <bung87> I think you can make it faster |
15:15:50 | FromGitter | <kaushalmodi> I am happy to learn |
15:15:59 | FromGitter | <kaushalmodi> please comment with a faster version in that issue thread |
15:17:07 | FromGitter | <kaushalmodi> that makes me think.. do we have a profiling macro or something in stdlib? |
15:17:35 | FromGitter | <kaushalmodi> something like: ⏎ ⏎ ```timeIt: ⏎ # my code``` [https://gitter.im/nim-lang/Nim?at=5ebeb28e0e8a3131e4c2c953] |
15:22:07 | FromGitter | <iffy> Even on latest devel, absolutePath isn't defined in config.nims... is that expected? |
15:22:21 | * | letto quit (Quit: Konversation terminated!) |
15:22:35 | FromGitter | <iffy> (whether I `import os` or not) |
15:23:33 | * | dddddd quit (Remote host closed the connection) |
15:23:40 | FromGitter | <kaushalmodi> @iffy Related: https://github.com/nim-lang/Nim/issues/14142 |
15:25:04 | FromGitter | <kaushalmodi> @iffy absolutePath is working for me in config.nims |
15:25:12 | FromGitter | <kaushalmodi> I am on latest devel |
15:25:20 | FromGitter | <kaushalmodi> @iffy How are you installing devel? |
15:25:25 | FromGitter | <iffy> choosenim |
15:25:33 | FromGitter | <kaushalmodi> do nim --version |
15:25:40 | FromGitter | <kaushalmodi> I bet it's still pointing to 1.2.x |
15:25:43 | FromDiscord | <kodkuce> hmm if i incres int bilion times will it crash cuz 32bit haas max value 2,147,483,647 or what |
15:25:57 | Yardanico | depends on if you compile it with -d:danger or not |
15:26:02 | FromGitter | <iffy> oh, it's still pointing to 1.0.6... weird |
15:26:19 | FromDiscord | <kodkuce> am testing on nimble playground and it just goes up form 2,147,483,647 no error |
15:26:31 | Yardanico | how are you testing? |
15:26:34 | FromGitter | <kaushalmodi> My travis started failing recently because of a change in "real" nim devel.. the choosenim installed devel was stale |
15:26:35 | FromDiscord | <kodkuce> meyeb wikipedia wrong adn 2,147,483,647 is not max |
15:26:41 | FromGitter | <kaushalmodi> so I stopped using choosenim on travis |
15:26:54 | Yardanico | "int" in nim is platform-dependent, and on playground it's 64-bit because it's a 64-bit docker image |
15:27:04 | Yardanico | if you want to test for 32-bit int, use "int32" |
15:27:17 | FromGitter | <kaushalmodi> @iffy https://github.com/kaushalmodi/std_vector/commit/3f9cfbea5819a8d8095f59177e892b3dc5cdf9a9 |
15:27:25 | Yardanico | with -d:release you'll get "Error: unhandled exception: over- or underflow [OverflowDefect]" |
15:27:39 | Yardanico | with -d:danger it'll run forever |
15:27:56 | Yardanico | because -d:danger disables range checks |
15:28:03 | shashlick | @kaushalmodi - consider using https://gist.github.com/genotrance/fb53504a4fba88bc5201d3783df5c522 for travis |
15:28:06 | Yardanico | (it's called danger for a reason) |
15:28:14 | FromDiscord | <kodkuce> oh |
15:28:24 | Yardanico | so as I said, playground is 64-bit |
15:28:27 | FromDiscord | <kodkuce> i thinked int was default 32 on evrtyhing |
15:28:30 | Yardanico | no |
15:28:39 | Yardanico | max value of int64 is 9223372036854775807 btw |
15:28:39 | FromDiscord | <kodkuce> ok got it pls dont hurt me |
15:29:02 | FromGitter | <kaushalmodi> shashlick: Your gist also uses choosenim |
15:29:13 | FromGitter | <kaushalmodi> does that install the "real" devel version? |
15:29:14 | shashlick | ya but it handles all the cases |
15:29:23 | FromDiscord | <kodkuce> Error: type mismatch: got <int64> but expected 'int' |
15:29:28 | Yardanico | show code |
15:29:30 | FromDiscord | <kodkuce> on nimplayground |
15:29:41 | FromGitter | <kaushalmodi> my issue was that choosenim was still installing 1.3.1 when the actual devel was on 1.3.3 |
15:29:43 | Yardanico | that usually happens when you're trying to add int64 to an int or something |
15:29:49 | FromDiscord | <kodkuce> didnet you say int is playtform specifc |
15:29:49 | shashlick | you need to provide the --latest flag |
15:29:58 | Yardanico | @kodkuce it is, but show the code |
15:30:09 | FromGitter | <kaushalmodi> shashlick: ok |
15:30:17 | shashlick | https://github.com/dom96/choosenim/blob/master/changelog.markdown#060---06032020 |
15:30:37 | FromGitter | <kaushalmodi> will update my travis soon, btw that gist should probably go to the Nim wiki |
15:30:51 | FromDiscord | <kodkuce> https://play.nim-lang.org/#ix=2m80 |
15:30:56 | shashlick | i use it for all my projects and for choosenim and nimble as well |
15:30:58 | FromDiscord | <kodkuce> have to put int64 |
15:31:00 | shashlick | disruptek also uses |
15:31:02 | FromDiscord | <kodkuce> so it works |
15:31:07 | Yardanico | @kodkuce yes of course |
15:31:18 | Yardanico | because 9223372036854775807 won't fit in int32 |
15:31:19 | FromDiscord | <kodkuce> but you say its platform dependant |
15:31:22 | Yardanico | it is |
15:31:29 | FromDiscord | <kodkuce> but if i type just int |
15:31:29 | Yardanico | but nim code is cross-platform and not arch-specific usually |
15:31:37 | Yardanico | so you can't just make an "int" with "9223372036854775807" |
15:31:39 | FromDiscord | <kodkuce> shoudnet it bee int64 by default |
15:31:40 | Yardanico | because int might be 32-bit |
15:31:46 | Yardanico | on 32-bit architectures |
15:31:50 | Yardanico | hence you have to specify int64 _explicitly_ |
15:31:56 | Yardanico | so it actually works on 32-bit architectures as well |
15:32:43 | FromDiscord | <kodkuce> so on 32bit arch if i put just int and rech 32bit max it will crash and if i do same on 64bit it will continue ? |
15:32:52 | FromGitter | <iffy> okay, latest nim lets me `import os` and use `absolutePath` |
15:33:04 | Yardanico | @kodkuce yes |
15:33:20 | Yardanico | on 64-bit it'll continue until it hits 9223372036854775807 |
15:33:24 | dom96 | kodkuce: shashlick: IMO it's a very bad idea to be testing against a moving target like `devel` |
15:34:48 | FromGitter | <kaushalmodi> dom96: It helps catch stuff not caught by nim CI |
15:35:10 | shashlick | i have had no issues with chasing devel - i've opened several bugs because of it |
15:35:13 | FromGitter | <kaushalmodi> and also help update the packages in sync with devel as a lot of folks (at least I am) use just the devel version |
15:35:20 | shashlick | plus i'm writing libraries which need to run across the board |
15:35:29 | shashlick | for a binary, yes it might be less useful |
15:35:32 | FromDiscord | <kodkuce> Yard good to know 🙂 |
15:35:43 | FromGitter | <kaushalmodi> dom96: Also I need features from devel that are not in stable |
15:35:49 | FromGitter | <kaushalmodi> like the new `--backend` switch |
15:36:14 | dom96 | If I'm someone creating PRs against your repo it will be pretty frustrating to get a CI failure because devel changes |
15:36:16 | dom96 | *changed |
15:36:36 | Yardanico | well it would be dumb to _only_ test against devel, yes |
15:36:39 | dom96 | kaushalmodi: then you should depend on a commit hash |
15:36:41 | Yardanico | unless you actually use features which are only on devel |
15:36:51 | shashlick | i've been doing it for a few years now and only occasionally run into failures because devel was broken |
15:37:04 | shashlick | i want PR writers to know that their code caused a failure with devel |
15:37:06 | dom96 | yes, occasional != never |
15:37:07 | FromGitter | <kaushalmodi> same here, devel is not "that breaking" for me |
15:37:20 | FromGitter | <kaushalmodi> more often, the stable lacks the stuff I like in devel |
15:38:05 | dom96 | if you consciously want to do it then do it, but don't suggest it to other without a big warning |
15:38:10 | dom96 | *others |
15:38:22 | shashlick | the travis script i shared doesn't force you to |
15:38:22 | dom96 | CI builds should be reproducible |
15:38:41 | shashlick | the yml file is controlled by the user and that's where the versions to test are set |
15:39:34 | shashlick | what does devel have to do with reproducibility |
15:39:57 | dom96 | everything? If I run the CI build today then I'll get whatever `devel` points to now |
15:40:07 | dom96 | if I do it tomorrow then where it points to will change |
15:40:20 | shashlick | but the whole point of CI is to test something specific |
15:40:27 | shashlick | i want to test my code with latest devel |
15:40:37 | FromGitter | <iffy> I run most of my packages against stable and devel, but only fail the build for failures on stable |
15:41:10 | * | tane joined #nim |
15:41:27 | dom96 | iffy: that sounds like a good compromise |
15:42:02 | disruptek | i switched to devel ci on a separate branch recently. |
15:42:08 | disruptek | we don't have enough stable releases, imo. |
15:42:21 | FromGitter | <iffy> hmm... at least I *thought* I did that. Now that I'm looking, I don't see that logic fork in there anymore |
15:42:29 | FromGitter | <kaushalmodi> I strive to have my stuff working for future stable, so I report a bug report if it's something that needs fixing in nim |
15:43:28 | FromGitter | <kaushalmodi> It's basically "playing catch-up vs being proactive" |
15:44:08 | dom96 | The problem IMO is that you are conflating two different objectives under one CI |
15:44:24 | dom96 | One objective is to test your package for bugs and issues. |
15:44:27 | dom96 | The other is to test Nim |
15:44:50 | FromGitter | <kaushalmodi> exactly :) |
15:45:17 | FromGitter | <kaushalmodi> It's trivial to add devel to the testing |
15:45:30 | disruptek | nimph only builds with 1.0 but only runs against 1.3, where it runs excruciatingly slowly. |
15:45:38 | disruptek | what should i be using for ci? |
15:45:39 | FromGitter | <kaushalmodi> it stable fails, I fix my project. If devel breaks, I review the breaking commit and open an issue on nim |
15:46:29 | dom96 | Yes, if you can get it so that PRs are not blocked by `devel` failing then I would be happy with it |
15:46:43 | dom96 | But from what I can tell shashlick's config does not do that |
15:46:54 | shashlick | the yml file is just an example like i said |
15:46:56 | disruptek | it does. |
15:47:07 | shashlick | it is the shell script that does all the work |
15:47:12 | dom96 | It all comes down to me making a contribution to a project, if I open a PR I don't want to get false failures because devel has a bad day |
15:47:35 | shashlick | like I said, it is extremely rare for me |
15:49:20 | disruptek | dom96: start with opening a pr. |
15:49:28 | shashlick | I agree that not everyone needs to sign up for devel testing but the fact is that marking the build as successful and ignoring devel failures only makes life harder when a new stable comes out |
15:49:31 | disruptek | then we can talk about what a bad experience you've had. |
15:51:32 | shashlick | anyway, choosenim for example is still built and tested with 1.0.6 |
15:51:45 | dom96 | shashlick, I just think that a lot of people will not consider this and just blindly copy and paste that config, or maybe even worse "I want devel, I don't care about the stable versions, let me just remove the stable versions and use devel only" |
15:52:06 | shashlick | that's fine since it is a binary release, but anyone wanting to making a PR now and tries 1.2.0 or devel might not have a good time |
15:52:12 | disruptek | you're right, we should find a way to punish these assholes. |
15:52:19 | dom96 | but yeah, in the grand scheme of things it probably doesn't matter much |
15:52:26 | FromGitter | <kaushalmodi> come on guys.. enough bike shedding |
15:52:43 | disruptek | bike shedding when we have no bikes is par for the nim course, dontcha know? |
15:52:46 | shashlick | i think devel has gotten a lot better at not breaking since the CI is not bypassed as much |
15:52:58 | FromGitter | <kaushalmodi> btw has anyone done something like this: https://gitter.im/nim-lang/Nim?at=5ebeb226eb9b6f3162250da6 |
15:53:27 | FromGitter | <kaushalmodi> disruptek: I am thinking you would already have such a `timeIt:` like macro |
15:53:42 | Yardanico | he has golden |
15:53:45 | Yardanico | !repo golden |
15:53:46 | disruptek | i cannot read gitter atm, but i am (nominally) maintaining criterion. |
15:53:53 | FromGitter | <kaushalmodi> yes, that's why I asked him |
15:54:04 | disruptek | !repo criterion |
15:54:05 | disbot | https://github.com/LemonBoy/criterion.nim -- 9criterion.nim: 11Statistic-driven micro-benchmark framework 15 38⭐ 4🍴 |
15:54:21 | disruptek | if that looks like what you want, open issues on my fork, please. |
15:54:28 | FromGitter | <kaushalmodi> sure |
15:54:29 | FromGitter | <kaushalmodi> thanks |
15:54:30 | shashlick | need some ascii art for bikeshedding |
15:54:46 | Yardanico | in IRC |
15:54:48 | Yardanico | 10 lines |
15:54:51 | shashlick | @kaushalmodi - i made a timeit for nimterop testing |
15:55:06 | FromGitter | <kaushalmodi> really? same name? :) |
15:55:15 | disruptek | 🚲🏠 |
15:55:19 | shashlick | https://github.com/nimterop/nimterop/blob/master/tests/timeit.nim |
15:55:33 | FromGitter | <kaushalmodi> I want to get to testing the nimterop#head but my work stuff is close to a delivery |
15:55:40 | shashlick | since the binary isn't available cross platform |
15:55:55 | FromDiscord | <Recruit_main707> this new bridge looks way better |
15:55:56 | shashlick | no rush - @jyapayne's fix is about to be merged |
15:55:56 | dom96 | sooo what's everybody working on this fine weekend? |
15:56:06 | shashlick | i'm in the middle of adding var support |
15:56:47 | disruptek | ~nimconf is missing a landing page for advertisement. |
15:56:47 | disbot | nimconf: 11missing a landing page for advertisement. |
15:57:01 | dom96 | true |
15:57:09 | dom96 | Anyone got good design skills? |
15:57:29 | disruptek | @willyboar |
15:57:42 | * | ptdel joined #nim |
15:59:13 | * | ptdel quit (Client Quit) |
16:00:54 | shashlick | I'm planning on making my conf detection in nimterop a module |
16:01:07 | shashlick | So that others can use it |
16:01:10 | * | narimiran joined #nim |
16:01:16 | shashlick | Anyone invoking Nim will need it |
16:02:45 | shashlick | Itching to work on c++ support in nimterop but trying to focus on stability, performance and bug fixes |
16:13:35 | PMunch | dom96, I'm working on embedding NimScript in projects, and writing an article or two about it |
16:13:59 | dom96 | PMunch, cool |
16:15:25 | PMunch | Oh yeah, we should have a landing page for NimConf |
16:15:42 | PMunch | What kind of technical solution are we using for it by the way? |
16:16:20 | PMunch | If it's going to be one continuous stream with multiple people dropping in and out I think we should have some graphics to go with it as well |
16:16:25 | disruptek | i hope we use twitch. i will write some kinda chat/voip integration if so. |
16:16:28 | PMunch | For stuff like when we are changing |
16:17:03 | PMunch | And will it only be presentations? QA session? Panel debate? |
16:17:22 | dom96 | QA session would be cool |
16:17:28 | PMunch | Yeah |
16:17:38 | dom96 | We should create some sort of collaborative committee and invite anyone that wants to help organise IMO |
16:17:51 | PMunch | I mean I guess each presenter could do a QA after their talks |
16:18:07 | PMunch | I assumed something like that was already in place :P |
16:18:10 | dom96 | yeah, but a QA session with various core devs/contributors could be cool too |
16:18:28 | Yardanico | you can have it in mumble almost every day :D |
16:18:31 | PMunch | Yeah that's what I was thinking |
16:18:37 | dom96 | narimiran, you around? Thoughts about above suggestion? |
16:19:03 | PMunch | Yardanico, but this will be with video, and the questions will be more IDK condensed? |
16:19:04 | narimiran | i like the suggestion :) |
16:19:10 | PMunch | Would be easier to watch afterwards |
16:19:25 | PMunch | Instead of listening to hundreds of hour of mumble recordings :P |
16:20:05 | PMunch | Oh well, I need to jump in the shower |
16:20:34 | dom96 | the question becomes, what platform to have the chat room for us on? |
16:20:41 | dom96 | Discord? IRC? Telegram |
16:23:06 | disruptek | twitch already supports irc, and i'm sure there's a discord bridge, too. |
16:23:38 | dom96 | I mean for our discussions |
16:23:41 | Yardanico | but how you will organize different speakers? disruptek |
16:23:44 | dom96 | around how to organise the conf |
16:24:10 | FromGitter | <kaushalmodi> dom96: there is github discussions |
16:24:23 | dom96 | no... it needs to be real-time |
16:24:31 | dom96 | and not so in the open |
16:24:40 | FromGitter | <kaushalmodi> Zoom video chat |
16:24:45 | dom96 | unless anyone has any problems, I'll create a Discord channel |
16:25:04 | disruptek | i don't use discord, but go for it. |
16:25:28 | dom96 | maybe Yardanico can set up a bridge :P |
16:25:32 | Yardanico | haha |
16:25:36 | Yardanico | I will |
16:25:44 | Yardanico | it's just a matter of adding 4 more lines to the config |
16:28:16 | dom96 | okay, created #nimconf on Discord and IRC |
16:28:28 | dom96 | anyone that is interested in helping organise, join |
16:30:08 | * | FromDiscord quit (Remote host closed the connection) |
16:30:24 | * | FromDiscord joined #nim |
16:30:25 | Yardanico | added it to the bridge, #nim-conf :P |
16:34:52 | dom96 | no, #nimconf |
16:34:58 | dom96 | I already registered it :P |
16:36:16 | * | liblq-dev quit (Ping timeout: 258 seconds) |
16:37:27 | * | FromDiscord quit (Remote host closed the connection) |
16:37:40 | * | FromDiscord joined #nim |
16:38:10 | * | liblq-dev joined #nim |
16:38:18 | Araq | omg, #nimconf, it's inconsistent with our other chanels, we will all gonna die |
16:39:03 | FromDiscord | <mratsim> please use #nim-conf :/ |
16:39:29 | Yardanico | ;( |
16:40:54 | Araq | lol |
16:42:13 | dom96 | too late |
16:42:19 | dom96 | it's #nimconf :P |
16:42:38 | dom96 | It makes more sense too since we will refer to the Nim conference as NimConf |
16:45:31 | * | Vladar joined #nim |
16:52:21 | Araq | so ... I'm about to write an RFC that `==` for 'ref' should be deprecated. but before I do that I am asking for feedback here |
16:53:03 | Araq | Nim almost got it right with 'isNil(x)' which is a very different operation from 'x == y' |
16:53:16 | supakeen | == for ref has weird semantics that you don't expect. |
16:53:25 | supakeen | It could use a separate method or operator. |
16:53:50 | Araq | well it has the usual refence equality semantics, Python does the same |
16:53:56 | dom96 | keep `==` for refs and add `===` that has the same semantics as for non-refs j/k |
16:53:58 | Araq | *reference |
16:54:25 | disruptek | it's the source of the table/ref-key/hash bug, but i thought == nil became idiomatic kinda recently. |
16:54:52 | Araq | disruptek, that is true but the problem is also that equality is hard. |
16:55:20 | Araq | whenever I use '==' on refs inside the compiler, I'm conciously aware that it's really what I want |
16:55:50 | Araq | but it's so dangerous that I don't want it as a default |
16:55:54 | disruptek | maybe `is` becomes a runtime operator. |
16:56:12 | Araq | I'm not asking for a new operator |
16:56:43 | supakeen | Sorry, that's what I meant you have to very clear that you're doing == on a ref. |
16:56:56 | supakeen | And if you're that clear on it, it's fine to use something more clear instead. |
16:57:01 | disruptek | how does equality work on the ref, then? |
16:57:13 | Araq | disruptek, it simply doesn't compile |
16:57:22 | Araq | you need to introduce your own like |
16:57:35 | Araq | proc `==`(a, b: PSym): bool = refEquality(a, b) |
16:58:15 | Araq | (everything I said equally applies to .closure procs) |
17:00:47 | disruptek | so anyway, give me another operator. |
17:01:00 | Araq | for what? |
17:01:07 | disruptek | refEquality(a, b) |
17:05:38 | * | silvernode joined #nim |
17:12:41 | * | filcuc joined #nim |
17:14:59 | wgetch | is there a simpler way to convert a Table[A,B] to OrderedTable[A,B] without an explicit copy loop? (toOrderedTable expects a seq of tuple pairs, not a Table) |
17:15:05 | * | Guest70849 is now known as dadada |
17:15:20 | dadada | is there some way to force nim to rebuild everything? |
17:15:26 | Yardanico | -f |
17:15:31 | dadada | thanks |
17:15:31 | Yardanico | or --forceBuild if you like longer names |
17:18:02 | dadada | hmm, still doesn't rebuild everything apparently, and now I'm just confused |
17:18:15 | Yardanico | nimterop? |
17:18:43 | dadada | no, my own application, it's probably some temp file stuff that's wrong |
17:19:12 | * | Trustable quit (Remote host closed the connection) |
17:21:31 | FromDiscord | <exelotl> What's wrong with == for ref? |
17:22:00 | Araq | https://github.com/nim-lang/RFCs/issues/224 |
17:23:14 | Araq | wgetch, no and it'll always be slow. better start with an OrderedTable |
17:23:26 | Araq | exelotl: read my rfc |
17:24:32 | leorize | is this gonna be expanded to ptr? |
17:25:29 | Araq | I dunno, 'ptr' is low level "I know what I'm doing" |
17:25:37 | wgetch | interesting. thank you |
17:26:05 | Araq | leorize, but you can argue either way, I don't mind doing the same for 'ptr' |
17:32:23 | * | Hideki joined #nim |
17:32:46 | * | Hideki is now known as Guest12857 |
17:37:04 | * | Guest12857 quit (Ping timeout: 272 seconds) |
17:39:20 | * | filcuc quit (Ping timeout: 256 seconds) |
17:39:21 | FromGitter | <Willyboar> @disruptek i am here |
17:40:12 | FromGitter | <Willyboar> I am away from pc for the weekend |
17:41:03 | FromGitter | <Willyboar> Only mobile.. do you want something? |
17:43:17 | FromGitter | <kaushalmodi> Araq: From an earlier discussion on gitter, I learned that the procvar pragma is relic of the past. Would it be safe to remove the procvar pragma use in these instances: http://ix.io/2m8K |
17:43:28 | FromGitter | <kaushalmodi> If they should not be removed, what does that pragma do? |
17:44:45 | leorize | I think it's safe to remove them now |
17:44:53 | leorize | you can grep the compiler for procvar |
17:45:15 | FromGitter | <kaushalmodi> above: I grepped the whole repo.. but may be I should relax that regex in there |
17:45:16 | leorize | if there's no more than just the code to recognize it, you can probably remove it |
17:46:24 | FromGitter | <kaushalmodi> In manual.rst, there is ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ebed57028b53131490a0586] |
17:46:33 | FromGitter | <kaushalmodi> but what does implying procvar mean :) |
17:47:52 | FromGitter | <kaushalmodi> in compiler/, I see `wProcVar` and `sfProcVar`, but I don't know the compiler code at all to make any sense out of those |
17:48:20 | * | PMunch quit (Quit: leaving) |
17:50:28 | FromGitter | <kaushalmodi> ok, I am not the first one to go down this rabbit hole :) https://github.com/nim-lang/Nim/issues/12975 |
17:55:54 | leorize | you can remove the code |
17:56:02 | leorize | from what I'm seeing here sfProcVar is no-op |
17:56:19 | leorize | ie. no code check for it |
17:57:40 | FromGitter | <kaushalmodi> I'll send a PR to remove it from stdlib and tests. I am not comfortable touching compiler, etc |
18:10:33 | disruptek | finally. |
18:10:38 | disruptek | stupid mesa. |
18:11:49 | leorize | got your new gpu? |
18:12:17 | disruptek | had upgraded mesa by a single 0.1.0 (one minor) and it broke. |
18:12:28 | disruptek | semver for the mfw. |
18:13:03 | leorize | mesa don't use semver |
18:13:03 | FromDiscord | <kodkuce> there no add at pos for seq ? |
18:13:13 | leorize | it's called `insert()` |
18:15:04 | disruptek | all the more reason to shit on semver. |
18:15:13 | disruptek | i'm the idiot for assuming it was a thing. |
18:16:20 | dadada | if someone can make nimsuggest faster in vscode, you'll be kind of an idol for me |
18:18:34 | leorize | disruptek's IC work when done might do just the trick |
18:18:52 | disruptek | har har har |
18:22:10 | dadada | how far is he/you! |
18:22:16 | dadada | inquiring minds want to know |
18:24:17 | disruptek | ~stream |
18:24:18 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
18:24:30 | disruptek | come watch the failures accumulate. |
18:24:57 | * | filcuc joined #nim |
18:29:36 | FromGitter | <bung87> dadada is it very slow? |
18:32:54 | * | solitudesf- joined #nim |
18:35:37 | * | solitudesf quit (Ping timeout: 264 seconds) |
18:38:25 | * | solitudesf- is now known as solitudesf |
18:38:40 | exelotl | if someone can make nimsuggest faster in vscode, you'll be kind of an idol for me |
18:39:09 | exelotl | oops I didn't mean to copy that message >_< |
18:39:52 | * | jason joined #nim |
18:40:15 | * | jason is now known as Guest16294 |
18:40:31 | * | Guest16294 is now known as jasonjones |
18:42:00 | FromDiscord | <exelotl> irc exelotl is not very competent... |
18:45:53 | * | jasonjones quit (Quit: Leaving) |
18:54:24 | * | Vladar quit (Remote host closed the connection) |
18:55:05 | leorize | lol |
18:56:01 | * | filcuc quit (Ping timeout: 264 seconds) |
18:59:13 | * | dddddd joined #nim |
19:13:17 | * | Jesin quit (Quit: Leaving) |
19:19:00 | * | Jesin joined #nim |
19:23:03 | FromDiscord | <kodkuce> is freenode down? |
19:30:46 | Prestige | nope |
19:33:45 | * | bok joined #nim |
19:35:37 | bok | Hi, I am getting this error: "missing closing ' for character literal" despite the fact the I seem to have it? here is the line in quaestion: (left, right): '─', |
19:37:14 | dom96 | is that utf-8? |
19:37:21 | dom96 | you can't have utf 8 in a character literal |
19:37:25 | bok | ah |
19:37:35 | bok | that would be the issue |
19:37:41 | bok | thanks |
19:49:39 | * | filcuc joined #nim |
19:56:35 | * | hoijui joined #nim |
20:09:09 | FromDiscord | <kodkuce> progress on my tmux + Micro = vsmicro 🙂 https://media.discordapp.net/attachments/371759389889003532/710946895287287859/tmuxmicroALPHA.webm |
20:09:23 | * | opal quit (Ping timeout: 240 seconds) |
20:09:51 | Prestige | Nice @kodkuce |
20:11:22 | FromDiscord | <kodkuce> its still alpha like 0.001 version, and hopfully by end of summer micro will get lsp so should have autocomplete |
20:11:54 | FromGitter | <kaushalmodi> kodkuce: What are your demonstrating in that? |
20:12:30 | FromGitter | <kaushalmodi> Is that whole thing made in Nim? If so, what is the relationship between that and tmux? |
20:13:31 | FromDiscord | <kodkuce> nothing really just some junk ugly code, only thing i am atm writing in nim is that side << dir browser with option to send to tmux to open in tab of big pane |
20:13:46 | * | bebarker joined #nim |
20:14:48 | FromDiscord | <kodkuce> i am just gluing stuff, tough i would love to know how to make myself term editor, but anyway i like micro so am binding stuff together to make nice dev setup |
20:14:59 | bebarker | What are the memory requirements of compiling nim and nim programs in general? Is it typically not a problem on the Raspberry Pi line of computers, for instance (1-4GB RAM)? I've used a few heavily typed languages (e.g. Haskell) that do not fare well on such platforms. |
20:15:36 | * | Trustable joined #nim |
20:15:39 | FromDiscord | <kodkuce> dont think its big but i am newb 🙂 |
20:16:03 | FromGitter | <kaushalmodi> bebarker: I compiled few dummy programs using nim on my phone using Termux, but that's about it |
20:16:11 | FromGitter | <kaushalmodi> it all worked fine |
20:16:21 | FromGitter | <kaushalmodi> I know some folks here using nim on RPi too |
20:16:22 | dom96 | bebarker, depends what you're compiling, if you want to compile the Nim compiler then you usually run out of ram on an RPI |
20:17:08 | bebarker | dom96, ok, thanks - that's good info, though unfortunate. Still, we'll keep getting more RAM in future generations I imagine.. |
20:17:49 | Yardanico | bebarker: you can always add swap |
20:18:09 | * | opal joined #nim |
20:18:13 | Yardanico | dom96: some rpi have 2gb or 4gb of ram |
20:18:14 | bebarker | Yeah, guess i'll give it a try on my pinebook pro |
20:18:23 | Yardanico | for nim compiler ~1 gb is enough I think |
20:18:23 | FromGitter | <kaushalmodi> bebarker: you an try downloading pre compiled nim binaries for RPi (armv6 I believe?) from here: https://github.com/nim-lang/nightlies/releases/download/2020-05-15-version-1-2-d2d401c/nim-1.2.1-linux_armv6.tar.xz |
20:18:34 | Yardanico | armv7 will work as well |
20:18:43 | Yardanico | or even arm64 if they have an arm64 distro |
20:18:57 | FromGitter | <kaushalmodi> ok, this link has all: https://github.com/nim-lang/nightlies/releases/tag/2020-05-15-version-1-2-d2d401c |
20:18:58 | Yardanico | (most rpi cpus are actually aarch64 - arm64, but official distro is armv7) |
20:19:14 | bebarker | my experience with other languages is that certain libraries will stress the compiler/typechecker more than the compiler code itself (for self-hosted languages like Nim) |
20:19:27 | Yardanico | bebarker: yeah it's true for nim |
20:19:29 | FromDiscord | <Rika> huh? |
20:19:39 | FromDiscord | <Rika> i mean huh regards the distro thing |
20:19:40 | Yardanico | nim compiler doesn't make use of stuff like macros, generics, etc |
20:19:48 | Yardanico | @Rika don't ask me, ask the rpi guys |
20:19:54 | * | filcuc quit (Ping timeout: 240 seconds) |
20:20:19 | bebarker | @Rika yeah it is unfortunate :-( not sure what is up with that |
20:20:30 | Yardanico | you can use community distros |
20:20:40 | bebarker | (but the Pinebook Pro does have a 64bit os) |
20:21:36 | bebarker | so assuming i make it past the first hurdle, any libraries that come to mind that might be particularly good examples of using a lot of memory to compile? |
20:21:55 | Yardanico | bebarker: I don't know of any libs which would actually use more memory than the compiler for compilation |
20:22:03 | bebarker | OK |
20:22:15 | Yardanico | you also have to consider the C compilation step, it uses memory as well |
20:22:32 | * | silvernode quit (Ping timeout: 256 seconds) |
20:25:46 | FromDiscord | <Elegant Beef> So i do have to ask did someone already make a macro to automate constructor creation? |
20:26:15 | FromDiscord | <Elegant Beef> I mean i did it last night/today but just curious, as it was a nice macro learning but want to see if someone has a nicer version |
20:26:28 | FromDiscord | <Rika> wdym nicer tho |
20:26:32 | FromDiscord | <Elegant Beef> <https://github.com/beef331/constructor> |
20:26:42 | FromDiscord | <Elegant Beef> If you notice i use strings to specify the variables |
20:27:34 | FromDiscord | <Rika> i dont understand the usage |
20:27:54 | FromDiscord | <Rika> `bool indicates exporting` exporting what |
20:28:07 | FromDiscord | <Elegant Beef> exporting the created constructor proc |
20:28:35 | FromGitter | <kaushalmodi> Elegant Beef: how is it different from the default `foo = Foo()` |
20:28:35 | FromDiscord | <Elegant Beef> This creates a proc that takes those values that iuse in the next line and put them in `awesome` and `coolInt` |
20:28:50 | FromDiscord | <Elegant Beef> It doesnt used name params |
20:28:52 | FromDiscord | <Rika> you're required to pass in the variables or something |
20:29:21 | FromDiscord | <Rika> cant you do varargs[untyped] |
20:29:57 | FromGitter | <kaushalmodi> Elegant Beef: May be you need to update the README on what your package does or makes easier compared to the in built object construction |
20:32:17 | FromGitter | <kaushalmodi> start by why you would use the constructor package vs https://play.nim-lang.org/#ix=2m9P |
20:40:42 | * | hoijui quit (Quit: Leaving) |
20:43:06 | FromGitter | <iffy> Is there a way to add an additional config file to be read? A config file that's not in the normal places. Something like `nim c --config:path/to/my/config.nims thing.nim` |
20:43:49 | FromDiscord | <Elegant Beef> There i think it's better now |
20:45:54 | Yardanico | @iffy well I don't know about that, but nim also will try to read configs from ~/.config/nim/config.nims |
20:45:59 | Yardanico | and ~/.config/nim/nim.cfg |
20:47:00 | FromGitter | <iffy> Right; my use case is: one of the libraries I'm using has a config.nims with several params (paths to static libraries to link in, --threads:on, etc...) and I'd like to use the existing file instead of duplicating it |
20:47:23 | FromGitter | <iffy> I don't want a global config change |
20:50:35 | FromGitter | <iffy> I suppose I could move the config.nims up to a shared-parent directory... though in this case that seems to broad of a change |
20:50:47 | FromGitter | <iffy> *too |
20:53:06 | FromGitter | <kaushalmodi> you can `include` the config file |
20:53:27 | * | xet7 quit (Quit: Leaving) |
20:53:47 | FromGitter | <kaushalmodi> I maintain my global config.nims file in a repo and then I git pull and include it in other project repos: https://github.com/kaushalmodi/std_vector/blob/master/config.nims |
20:54:09 | FromGitter | <kaushalmodi> that way, my global config is effective on travis too |
20:55:52 | FromGitter | <kaushalmodi> note that I need that git pull only on travis. Locally that global config lives in the usual ~/.config/nim/ |
20:58:07 | * | clemens3 quit (Ping timeout: 246 seconds) |
21:01:00 | * | narimiran quit (Ping timeout: 272 seconds) |
21:09:44 | * | solitudesf quit (Quit: Leaving) |
21:12:02 | FromGitter | <bung87> `proc alloc*[T](self:typedesc[Buffer],size:int,fill = none(T)): Buffer =` |
21:12:24 | FromGitter | <bung87> I want do something like this , this not work |
21:12:44 | Yardanico | what exactly doesn't work there? |
21:13:16 | FromGitter | <bung87> none is proc T is generic |
21:13:27 | FromGitter | <bung87> `Error: cannot instantiate: 'T'` |
21:14:42 | Yardanico | but how did you call it? |
21:14:58 | Yardanico | you should call it like alloc[int32](Buffer, 15) |
21:14:58 | * | filcuc joined #nim |
21:16:50 | FromDiscord | <Rika> you cant infer a generic from a default |
21:16:53 | FromGitter | <bung87> let me check |
21:17:18 | FromDiscord | <Rika> or rather that signature doesnt give any info |
21:17:31 | FromDiscord | <Rika> are you sure its not Buffer[T]? |
21:18:04 | FromGitter | <kaushalmodi> @bung87 hmm, this works: https://play.nim-lang.org/#ix=2m9Z |
21:18:33 | FromGitter | <bung87> give generic `first type mismatch at position: 2` |
21:19:56 | * | liblq-dev quit (Quit: WeeChat 2.8) |
21:26:55 | FromGitter | <bung87> so simple solution will not possible. |
21:28:23 | * | leorize quit (Ping timeout: 240 seconds) |
21:34:40 | FromDiscord | <KrispPurg> Yardanico, the infinite recursion will be fixed in the next few commits to devel, I'll either use an interval for 2 secs. |
21:35:17 | Yardanico | nice |
21:36:00 | FromDiscord | <KrispPurg> Also, @Technisha Circuit have you seen my message on github? |
21:40:08 | FromGitter | <Nickiel12> @Yardanico have you had a chance to look at why libvlc hasn't been working? |
21:40:19 | Yardanico | i fixed it, on linux at least |
21:40:20 | Yardanico | it works fine |
21:40:33 | FromGitter | <Nickiel12> 1) 1.0? |
21:40:33 | Yardanico | you need to maybe place libvlc.dll with all its dependencies in the same folder as the binary |
21:40:58 | FromGitter | <Nickiel12> ok, I will try that |
21:41:21 | * | exelotl quit (Remote host closed the connection) |
21:42:01 | * | exelotl joined #nim |
21:42:01 | FromGitter | <Nickiel12> I am still getting this error https://gist.github.com/Nickiel12/0b03ca834f2132a6f74afde08a162853 |
21:42:18 | Yardanico | ah not 0.1.0 |
21:42:20 | Yardanico | install latest libvlc |
21:42:28 | Yardanico | I didn't tag it |
21:42:52 | Yardanico | remove that 0.1.0 install and do nimble install libvlc@#master |
21:43:59 | * | exelotl quit (Client Quit) |
21:44:19 | FromGitter | <Nickiel12> same error |
21:44:35 | * | exelotl joined #nim |
21:44:46 | Yardanico | did you remove .nimble\pkgs\libvlc-0.1.0\ folder? |
21:44:49 | Yardanico | and then tried again? |
21:44:56 | Yardanico | I mean after installing newer libvlc |
21:44:57 | FromGitter | <Nickiel12> no, i will try |
21:47:07 | * | filcuc quit (Ping timeout: 246 seconds) |
21:47:13 | FromGitter | <Nickiel12> it had the same error, I have updated the gist with the output |
21:47:28 | FromGitter | <Nickiel12> do I need to update nimterop? |
21:47:36 | Yardanico | no i think I was using 0.5.2 just fine |
21:47:58 | Yardanico | I honestly don't have a lot of experience with nimterop and how to debug it, and I don't have a dev environment set up on windows :( |
21:48:13 | FromGitter | <Nickiel12> ok |
21:48:33 | FromGitter | <Nickiel12> you said to put the .dll with the binary, but it won't compile |
21:48:52 | FromGitter | <kaushalmodi> @Nickiel12 You can ask the nimterop questions directly on https://gitter.im/nimterop/Lobby |
21:49:07 | FromGitter | <Nickiel12> what should I ask? |
21:49:40 | FromGitter | <kaushalmodi> I don't know.. whatever is not working with nimterop |
21:49:46 | FromGitter | <Nickiel12> ok |
21:50:10 | FromGitter | <kaushalmodi> you are start by showing the compile error and steps to reproduce that issue |
21:50:19 | FromGitter | <Nickiel12> ok |
21:52:04 | FromDiscord | <Technisha Circuit> How do i use my compiler of choice for Nim? |
21:52:12 | * | filcuc joined #nim |
21:52:14 | Yardanico | depends on what C compiler it is |
21:52:19 | FromDiscord | <Technisha Circuit> Wdym? |
21:52:22 | Yardanico | ?? |
21:52:30 | Yardanico | wdym "my compiler of choice"? |
21:52:41 | FromDiscord | <Technisha Circuit> What do you meant what C compiler it is? |
21:53:04 | FromDiscord | <Technisha Circuit> > wdym "my compiler of choice"?↵Like how would i use clang instead of gcc for example |
21:53:10 | FromDiscord | <Technisha Circuit> Clang is only an example |
21:53:12 | Yardanico | --cc:clang |
21:53:15 | Yardanico | clang is a C compiler |
21:53:19 | FromDiscord | <Technisha Circuit> Okay, thanks |
21:55:27 | Yardanico | you can see all supported compilers there https://github.com/nim-lang/Nim/blob/devel/compiler/extccomp.nim |
21:55:35 | Yardanico | also some compilers mimic the existing ones |
21:55:41 | Yardanico | like emscripten and "zig cc" mimic clang |
21:55:54 | Yardanico | because they're based on clang :) |
21:56:01 | FromDiscord | <Technisha Circuit> Thanks! |
21:57:26 | FromGitter | <kaushalmodi> Technisha Circuit: Are you on devel? |
21:57:32 | Yardanico | are you a devil?! |
21:57:46 | bebarker | Looks like Nim built ok on the Pinebook Pro, and according to this, only took < 200MB of RAM to build: |
21:57:47 | bebarker | CC: nimble.nim |
21:57:47 | bebarker | Hint: [Link] |
21:57:47 | bebarker | Hint: 143115 LOC; 41.522 sec; 180.082MiB peakmem; Release build; proj: /home/brandon/workspace/Nim/dist/nimble/src/nimble.nim; out: /home/brandon/workspace/Nim/bin/nimble [SuccessX] |
21:57:56 | Yardanico | that's for nimble |
21:58:00 | Yardanico | there's much more output before that |
21:58:04 | FromDiscord | <Technisha Circuit> > Technisha Circuit: Are you on devel?↵Wdym? |
21:58:04 | bebarker | ah ok |
21:58:47 | FromGitter | <kaushalmodi> Technisha Circuit: hehe, that probably answered it :) I meant: Are you building nim from devel branch? |
21:58:48 | bebarker | one thing i wasn't sure about - I had a binary install of the latest Nim compiler before building, but build_all.sh still seems to download the C sources |
21:59:03 | Yardanico | bebarker: yes |
21:59:05 | Yardanico | for bootstrapping |
21:59:42 | bebarker | Maybe i don't understand, Yardanico - I thought Nim was self-hosting, so it would only need bootstrapping if you don't have a Nim compiler |
22:00:25 | Yardanico | bebarker: it needs to do that to ensure that csources still work |
22:00:30 | Yardanico | you can always do ./koch boot |
22:00:37 | FromGitter | <kaushalmodi> Technisha Circuit: The reason I asked that question is because this was added few days back: https://github.com/nim-lang/Nim/commit/c64db68f0b2ff8e0f94baa583b94fd9409c77057 |
22:01:11 | bebarker | Yardanico, ah gotcha, thanks for the pointer |
22:04:17 | * | q4 joined #nim |
22:04:24 | * | filcuc quit (Ping timeout: 258 seconds) |
22:22:28 | * | cgfuh quit (Quit: WeeChat 2.7.1) |
22:38:32 | * | tane quit (Quit: Leaving) |
22:50:24 | * | pbb quit (Remote host closed the connection) |
22:51:40 | * | pbb joined #nim |
22:54:52 | * | q4 left #nim ("Free web-based IRC: https://www.cloud.webchat.ovh") |
22:59:20 | * | Jesin quit (Quit: Leaving) |
23:01:36 | * | Jesin joined #nim |
23:03:11 | * | abm quit (Quit: Leaving) |
23:04:55 | Prestige | Just found out about the Nim conference, that's exciting |
23:11:58 | FromDiscord | <exelotl> Whenever I add a NimNode to a seq[NimNode] it gets cloned...? Is that correct behaviour? Can I make it not get cloned? |
23:12:30 | * | exelotl quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
23:13:33 | shashlick | NimNode is a ref though |
23:20:00 | dadada | could I make the members of an object/ref unaccessible within the same module? |
23:20:16 | dadada | so you would have to go through a proc? |
23:20:27 | FromGitter | <timotheecour> @cooldome are you herre? |
23:22:04 | FromDiscord | <exelotl> shashlick: ah, it specifically happens if the NimNode came from parseStmt |
23:27:23 | Prestige | dadada: not sure but could you just extract that out into another file? |
23:27:54 | dadada | Prestige: ya, I just want a different solution for convenience |
23:28:04 | dadada | sure I now the idiomatic way to do this |
23:28:28 | dadada | ... okay different question: can all vars be deleted by the programmers/nim |
23:28:47 | dadada | or is there a way to create a var that can never be deleted until the program exits? |
23:30:54 | Prestige | dadada: Are you trying to have a member of an object not take up memory or something? |
23:31:46 | dadada | Prestige: I'm trying to create a unique object within a module (not from outside), that should never get deleted |
23:32:09 | dadada | I set myself this challenge |
23:39:28 | disruptek | just create a compile-time var. |
23:39:40 | disruptek | they cannot be redefined because stupid. |
23:44:27 | FromDiscord | <Rika> dadada: a singleton? |
23:45:13 | * | xet7 joined #nim |
23:45:46 | dadada | Rika: yes, I don't use that name, because they have a bad image, I call them by different names and hope nobody mentions what I really mean on IRC :-( |
23:46:38 | disruptek | kinky. |
23:47:44 | disruptek | var singleton {.compileTime.} = "goatse" |
23:52:26 | FromDiscord | <Rika> dadada: that just makes it impossible to understand what you mean, does it not |
23:56:17 | dadada | Rika: you have to be cryptic, if you don't want to repeat certain endless discussions on the internet |
23:56:42 | * | xet7 quit (Remote host closed the connection) |
23:57:06 | FromDiscord | <KingDarBoja> lolwut? |
23:57:11 | dadada | Rika: google singletons and you'll find a million opinions why they're bad, and I've used them with success (but rarely), so who's right? |
23:57:12 | * | xet7 joined #nim |
23:57:17 | FromDiscord | <KingDarBoja> https://refactoring.guru/design-patterns/singleton |
23:57:24 | FromDiscord | <KingDarBoja> 😛 |
23:58:40 | FromDiscord | <Rika> if that endless discussion happens, it is not the failure of the asker, but the moderators |