00:05:12 | * | huuskes quit (Read error: Connection reset by peer) |
00:23:39 | * | stefanos82 quit (Quit: Quitting for now...) |
00:27:42 | * | bozaloshtsh joined #nim |
00:27:42 | * | bozaloshtsh quit (Changing host) |
00:27:42 | * | bozaloshtsh joined #nim |
00:28:01 | * | PMunch quit (Remote host closed the connection) |
01:12:59 | * | NimBot joined #nim |
01:18:56 | * | terorie quit (Remote host closed the connection) |
01:59:00 | * | ng0_ joined #nim |
02:02:28 | * | ng0 quit (Ping timeout: 260 seconds) |
02:09:49 | * | dddddd quit (Remote host closed the connection) |
02:45:43 | * | laaron- quit (Quit: ZNC 1.7.1 - https://znc.in) |
02:46:38 | * | laaron joined #nim |
02:49:03 | * | xet7 quit (Quit: Leaving) |
02:56:07 | * | xet7 joined #nim |
03:15:53 | * | lritter quit (Ping timeout: 245 seconds) |
03:16:58 | * | lritter joined #nim |
03:18:53 | * | fjellfras joined #nim |
03:27:06 | skrylar[m] | @dom96 thrift is an ok format, although the lack of unsigneds is :-| |
03:27:54 | skrylar[m] | CBOR is neat and straightforward. MsgPack is fine too i guess |
03:29:09 | skrylar[m] | main win of cbor over msgpack is it can understand arrays of unknown length (in case you end up dealing with a broken system like delphi or java where you sometimes end up with aserialization interface that isn't allowed to ask how many items its about to store) and optional type tagging so you can go "this is a binary, but it's of type 7." which probably doesn't matterto almost anyone anymore, but meh. |
03:34:54 | * | lritter quit (Quit: Leaving) |
04:00:27 | * | fjellfras quit (Quit: Leaving) |
04:01:46 | * | fjellfras joined #nim |
04:05:24 | * | fjellfras quit (Client Quit) |
04:06:10 | FromGitter | <zacharycarter> thanks for sharing CBOR that does look nice |
04:06:41 | * | fjellfras joined #nim |
04:08:19 | * | fjellfras quit (Remote host closed the connection) |
04:09:24 | * | fjellfras joined #nim |
04:09:46 | * | fjellfras quit (Remote host closed the connection) |
04:10:49 | * | fjellfras joined #nim |
04:22:26 | * | fjellfras quit (Ping timeout: 248 seconds) |
04:25:22 | * | brakmic joined #nim |
04:25:56 | * | fjellfras joined #nim |
04:31:45 | * | brakmic_ joined #nim |
04:32:22 | * | brakmic quit (Ping timeout: 258 seconds) |
04:35:04 | * | nsf joined #nim |
04:39:44 | * | brakmic_ quit () |
04:39:53 | FromGitter | <Obround> Is there a way to run Nim code inside Nim? Something like python's `exec` function? |
04:59:19 | FromGitter | <zacharycarter> Kind of - using hot code reloading or shared libraries |
04:59:26 | FromGitter | <zacharycarter> but remember Nim has to be compiled - Python is interpreted |
04:59:56 | FromGitter | <zacharycarter> you can use Nimscript and execute that at runtime |
05:00:19 | FromGitter | <zacharycarter> anywho - off to work |
05:03:10 | skrylar[m] | not like 'exec' no |
05:03:58 | skrylar[m] | as zach said its sort like trying to eval c code from a c program. |
05:12:28 | * | narimiran joined #nim |
05:54:46 | * | solitudesf joined #nim |
05:55:00 | * | absolutejam4 joined #nim |
06:05:22 | * | actuallybatman quit (Ping timeout: 248 seconds) |
06:21:54 | FromGitter | <zacharycarter> skrylar[m] - did you by any chance see my message about adding BC7 to your dds loader? |
06:22:57 | FromGitter | <zacharycarter> I already did it on my end - but I'm not sure if you'd be interested in me PRing the changes o rnot |
06:24:56 | * | Trustable joined #nim |
06:34:37 | * | actuallybatman joined #nim |
06:34:38 | * | Trustable quit (Remote host closed the connection) |
06:42:46 | * | absolutejam4 quit (Ping timeout: 246 seconds) |
06:45:58 | * | Senketsu quit (Quit: WeeChat 2.5) |
06:50:18 | * | Vladar joined #nim |
06:50:19 | * | Vladar quit (Remote host closed the connection) |
06:50:29 | * | macsek1911[m] quit (*.net *.split) |
06:50:29 | * | zeroDotTwenty[m] quit (*.net *.split) |
06:50:29 | * | Swednec8 quit (*.net *.split) |
06:50:30 | * | mattisme quit (*.net *.split) |
06:50:30 | * | FromGitter quit (*.net *.split) |
06:50:30 | * | nimblepoultry quit (*.net *.split) |
06:50:30 | * | snowolf_ quit (*.net *.split) |
06:50:36 | * | skrylar[m] quit (*.net *.split) |
06:50:36 | * | narimiran[m] quit (*.net *.split) |
06:50:37 | * | BitPuffin quit (*.net *.split) |
06:50:37 | * | sentreen quit (*.net *.split) |
06:50:38 | * | zestyr quit (*.net *.split) |
06:50:38 | * | vegai quit (*.net *.split) |
06:50:42 | * | oculux quit (Quit: blah) |
06:50:48 | * | Senketsu joined #nim |
06:51:21 | * | oculux joined #nim |
06:51:23 | * | oculux quit (Client Quit) |
06:51:53 | * | oculux joined #nim |
06:52:27 | * | oculux quit (Client Quit) |
06:53:54 | * | Eyess quit (Ping timeout: 248 seconds) |
06:54:04 | * | oculux joined #nim |
06:55:21 | * | SunDwarf joined #nim |
06:57:48 | * | Vladar joined #nim |
06:59:05 | * | actuallybatman left #nim ("ERC (IRC client for Emacs 26.2)") |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:04:30 | * | gmpreussner joined #nim |
07:06:00 | * | Senketsu quit (Quit: WeeChat 2.5) |
07:07:41 | * | Senketsu joined #nim |
07:08:09 | * | Senketsu quit (Client Quit) |
07:09:29 | * | Senketsu joined #nim |
07:16:20 | * | skrylar[m] joined #nim |
07:16:20 | * | narimiran[m] joined #nim |
07:16:20 | * | BitPuffin joined #nim |
07:16:20 | * | sentreen joined #nim |
07:16:20 | * | zestyr joined #nim |
07:16:20 | * | vegai joined #nim |
07:16:46 | * | macsek1911[m] joined #nim |
07:16:46 | * | zeroDotTwenty[m] joined #nim |
07:16:46 | * | mattisme joined #nim |
07:16:46 | * | Swednec8 joined #nim |
07:16:46 | * | FromGitter joined #nim |
07:16:46 | * | nimblepoultry joined #nim |
07:16:46 | * | snowolf_ joined #nim |
07:19:30 | * | SunDwarf quit (Ping timeout: 248 seconds) |
07:21:23 | * | SunDwarf joined #nim |
07:21:50 | * | Ivo joined #nim |
07:22:16 | Ivo | Hi, the nim playground is telling me this has an indentation error, but I don't get how it's wrong T_T Can anyone explain it to me? http://ix.io/1Oy5/nim |
07:24:32 | Vladar | where's the = at the end of proc title? |
07:31:18 | Ivo | Vladar, ahhh, never "noticed" that bit of syntax before. Thankyou! |
07:31:34 | Vladar | np |
07:32:14 | * | absolutejam4 joined #nim |
07:34:49 | leorize | Ivo: when you share to ix with the playground, the link in your URL bar will also update. You can share that link instead :) |
07:37:50 | Ivo | first nim program ! https://play.nim-lang.org/#ix=1Oyc does this look pretty nymionic? |
07:38:57 | leorize | looks nice, although some changes could be made: |
07:39:08 | leorize | - make your proc take in openArray instead of seq |
07:39:20 | leorize | this will make it compatible with both seq & normal arrays |
07:39:20 | Ivo | if I'm supposed to call `isAlphaAscii` on a single char, what would be the best way to say get the char of the first letter in a string to call it on? |
07:39:43 | leorize | string[0] ? |
07:40:13 | leorize | - don't use `return` unless it's control flow semantic is required |
07:40:21 | leorize | use the built-in result variable instead |
07:40:27 | Ivo | oh that will return a char instead of a length 1 string? |
07:40:35 | leorize | yea |
07:40:36 | narimiran | $string[0] |
07:40:45 | Ivo | you need the $ then? |
07:41:11 | Ivo | I thought I might try to make a nim kata for this codewars question https://www.codewars.com/kata/58e24788e24ddee28e000053 |
07:41:21 | Ivo | so that's what the program is solving |
07:41:41 | leorize | the $ is for converting to string |
07:42:43 | leorize | Ivo: initTable is no longer required |
07:42:54 | Ivo | so string[0] gets a char and $string[0] gets a string |
07:43:30 | leorize | yea |
07:43:37 | Ivo | leorize, is it still required in 0.17? thats what codewars is currently running |
07:43:54 | * | actuallybatman joined #nim |
07:43:58 | leorize | yea, it's required in 0.17 |
07:44:01 | narimiran | 0.17?? wow |
07:44:04 | leorize | you should bug them to update to 0.20 |
07:46:31 | Ivo | would 0.17 nim code be likely to break at all on 0.20? |
07:46:57 | leorize | certainly |
07:47:14 | leorize | 0.17 is extremely old at this point |
07:47:15 | Ivo | so wouldn't have to worry about updating any existing code |
07:48:19 | leorize | 0.17 is > 2 years old at this point |
07:51:52 | Ivo | I think maybe you'd ask in https://github.com/Codewars/codewars-runner-cli/issues |
07:51:58 | leorize | Ivo: here's my modification of your snippet: https://play.nim-lang.org/#ix=1Oyd |
07:52:17 | * | Senketsu quit (Quit: WeeChat 2.5) |
07:52:55 | leorize | diff it against your original code :) |
07:53:05 | Ivo | camelCase is default casing for nim? |
07:53:20 | leorize | it's the recommended one |
07:53:25 | Ivo | hmm I guess from std library functions lol |
07:53:43 | leorize | mainly because Araq hates snake_case :p |
07:53:56 | leorize | but feel free to write your library in snake_case |
07:54:05 | Ivo | I dunno if `op[2].contains(Letters)` is canonical way to check if `op[2]` is a letter |
07:54:06 | leorize | we can use it with camelCase thanks to a certain feature anw |
07:54:35 | leorize | Ivo: use this `Letters in op[2]` |
07:54:59 | leorize | `a in b` is a syntactic sugar for `b.contains a` |
07:55:25 | Ivo | not `op[2] in Letters` ? |
07:56:03 | Ivo | `{single char} in {set of chars}` ? |
07:56:03 | leorize | it's not even correct in English |
07:56:08 | leorize | yea |
07:56:36 | Ivo | I mean `{set of chars}.contains {single char}` makes sense |
07:56:57 | narimiran | leorize: look at your line 13 |
07:57:05 | Ivo | so it should be `op[2] in Letters` right? |
07:57:09 | leorize | yea, forgot that :p |
07:57:13 | narimiran | Ivo: yep |
07:57:19 | leorize | Ivo: no, `Letters in op[2]` |
07:57:26 | Ivo | :S |
07:57:36 | narimiran | leorize: what? |
07:57:50 | leorize | if op[2] contains Letters, then logically you'd check if Letters in op[2] :p |
07:57:56 | leorize | https://play.nim-lang.org/#ix=1Oyg |
07:57:58 | leorize | I'm not kidding |
07:57:59 | Ivo | op2 is a single character |
07:58:15 | leorize | well, but it's a string |
07:58:27 | Ivo | i though string[n] is character |
07:58:33 | Ivo | no wait that's wrong |
07:58:41 | leorize | split produces seq[string] |
07:59:08 | narimiran | aaa, it's a split. i didn't read the code properly, sorry |
07:59:13 | Ivo | so you could use `op[2][0] in Letters` ? |
07:59:35 | leorize | yea, although it wouldn't change much |
07:59:53 | Ivo | well the orientation of the `in` makes 10x more sense to me as a pythoneer xD |
08:00:20 | leorize | which is probably why narimiran got tripped by it as well :p |
08:00:58 | Ivo | oh so `{func} {arg1} {arg2}` is an alternative call syntax to `{func}({arg1}, {arg2})` ? |
08:01:09 | leorize | no |
08:01:32 | Ivo | special-ish case for `inc` and `dec`? |
08:01:37 | leorize | https://nim-lang.org/docs/manual.html#procedures-command-invocation-syntax |
08:01:54 | leorize | it's more of `{func} {arg1}, {arg2}` |
08:02:23 | Ivo | oh just with the , |
08:02:36 | Ivo | so you could also do `op[2].dec` ? |
08:02:42 | leorize | yep |
08:03:50 | leorize | a lot of features in Nim is designed to make your code more readable :) |
08:04:21 | Ivo | kewl |
08:05:38 | Ivo | what concurrency programming models does nim have? |
08:05:52 | Ivo | this is a thing yet/soon ? https://nim-lang.org/docs/coro.html |
08:06:02 | leorize | it's dropped actually |
08:06:06 | FromGitter | <mratsim> just use async |
08:06:06 | leorize | we use async/await |
08:08:27 | leorize | async is a bit under-documented though |
08:08:45 | livcd | should one use nim-chronos or std async ? |
08:08:58 | Ivo | it's not mentioned in https://nim-lang.org/docs/manual.html yet? |
08:09:18 | leorize | it's not a language feature |
08:09:28 | leorize | but a library implementation :) |
08:09:46 | leorize | you'll find the docs in the asyncdispatch module |
08:09:55 | leorize | and iirc someone is writing an async tutorial |
08:11:10 | leorize | livcd: I'd use std async because it's compatible with threadpool now :p |
08:11:16 | Ivo | it says await is a keyword tho, so that should be in the statements section? |
08:11:25 | livcd | leorize: what does that mean ? :O |
08:12:17 | leorize | Ivo: it's a keyword in `{.async.}` proc |
08:12:29 | leorize | yea, we certainly needs more docs on this |
08:12:55 | Ivo | ...right, well i probably need to get more familiar with basic nim first anyways. Thank you for the help |
08:12:57 | leorize | livcd: https://github.com/nim-lang/Nim/pull/11724 |
08:13:31 | leorize | you'll now be able to await a `spawn`-ed proc |
08:14:03 | leorize | which will allow you to use both threadpool and asyncdispatch seamlessly :D |
08:14:18 | livcd | that sounds amazing? |
08:17:12 | Zevv | leorize: has not been merged to devel yet, has it? |
08:17:22 | leorize | yea :p |
08:18:33 | livcd | i just heard dom96 say instead of koch cock |
08:21:38 | * | floppydh joined #nim |
08:26:24 | * | skrylar[m] quit (*.net *.split) |
08:26:25 | * | narimiran[m] quit (*.net *.split) |
08:26:25 | * | BitPuffin quit (*.net *.split) |
08:26:25 | * | sentreen quit (*.net *.split) |
08:26:25 | * | zestyr quit (*.net *.split) |
08:26:25 | * | vegai quit (*.net *.split) |
08:27:06 | * | macsek1911[m] quit (*.net *.split) |
08:27:06 | * | zeroDotTwenty[m] quit (*.net *.split) |
08:27:06 | * | Swednec8 quit (*.net *.split) |
08:27:06 | * | mattisme quit (*.net *.split) |
08:27:06 | * | FromGitter quit (*.net *.split) |
08:27:07 | * | nimblepoultry quit (*.net *.split) |
08:27:07 | * | snowolf_ quit (*.net *.split) |
08:27:15 | dom96 | livcd, err? |
08:28:37 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
08:29:43 | livcd | dom96: maybe i am just imagining |
08:30:29 | * | laaron joined #nim |
08:30:59 | * | laaron quit (Client Quit) |
08:31:15 | * | sentreen joined #nim |
08:32:13 | * | Senketsu joined #nim |
08:32:22 | dom96 | livcd, where did you hear me say that? |
08:35:38 | * | snowolf joined #nim |
08:35:45 | * | laaron joined #nim |
08:36:15 | * | nimblepoultry joined #nim |
08:36:16 | * | macsek1911[m] joined #nim |
08:36:19 | * | mattisme joined #nim |
08:36:30 | * | vegai joined #nim |
08:36:38 | * | Swednec8 joined #nim |
08:36:52 | * | zestyr joined #nim |
08:37:02 | * | FromGitter joined #nim |
08:37:50 | * | zeroDotTwenty[m] joined #nim |
08:41:27 | * | narimiran[m] joined #nim |
08:41:27 | * | skrylar[m] joined #nim |
08:41:58 | Araq | --styleCheck:error is shipping :P |
08:42:32 | * | BitPuffin joined #nim |
08:50:12 | * | Senketsu quit (Quit: WeeChat 2.5) |
08:52:04 | skrylar[m] | @zacharycarter people are always welcome to send PRs. if they are not complete dumpster fires i accept them. |
08:52:37 | skrylar[m] | although for bc7 i suspect that's just another fourcc code so its highly likely to be accepted :p |
08:52:45 | * | Senketsu joined #nim |
08:52:47 | FromGitter | <zacharycarter> that's all it took really :P |
08:52:53 | FromGitter | <zacharycarter> okay cool I will do the PR this evening |
08:53:12 | leorize | skrylar[m]: are you still working on your gui toolkit? |
08:53:49 | skrylar[m] | leorize: very slowly |
08:54:37 | livcd | dom96: first part of the video leorize shared |
08:54:38 | * | Senketsu quit (Client Quit) |
08:54:43 | skrylar[m] | nfltk should be back in working order as of a few days ago; the haiku-based one has a working messenger system (without concurrency support), AppKit is stalled on gdk3 integration |
08:56:46 | * | Senketsu joined #nim |
08:57:21 | leorize | livcd: I don't remember sharing any video :p |
08:57:48 | livcd | leorize: oops :X gh then |
09:04:02 | * | absolutejam4 quit (Ping timeout: 248 seconds) |
09:04:37 | * | shomodj joined #nim |
09:07:11 | * | absolutejam4 joined #nim |
09:11:51 | * | brakmic joined #nim |
09:19:02 | FromGitter | <mratsim> @leorize async is compatible with threadpools but there is no scheduler/multiplexer like for goroutines that automatically distribute tasks on hardware/software threads |
09:19:38 | FromGitter | <mratsim> so you need to do it manually (not that I think it's bad, a general purpose scheduler would have a lot of overhead and be very complex to maintain) |
09:20:58 | * | abm joined #nim |
09:32:51 | FromGitter | <ahcm> is it possible to restrict an enum in the function signature? |
09:33:35 | FromGitter | <ahcm> Say one that takes Filemode but fmWrite should not be allowed |
09:35:24 | FromGitter | <mratsim> use a set or a range |
09:35:52 | leorize | well if you don't want writes, then don't take anything since only fmRead met your criteria :p |
09:35:58 | FromGitter | <mratsim> mmm set would require runtime check |
09:36:18 | FromGitter | <mratsim> range would require good ordering in the enum |
09:36:43 | leorize | the FileMode enum wasn't designed for use in set |
09:37:00 | Araq | btw this is the last week before my 2 week holidays start |
09:37:09 | FromGitter | <ahcm> I just don't want to allow overwrite, fo a DB like thing |
09:37:27 | FromGitter | <ahcm> I can raise an exception but compile time check would be so nice |
09:37:54 | leorize | FileMode enum is not designed for that so you'd have to filter it yourself |
09:38:25 | FromGitter | <ahcm> Or use my own enum, OK, THX |
09:38:33 | Zevv | I guess it's not specifically about FileMode, but more about compile time checking of enum ranges |
09:39:10 | leorize | although I gotta say the FileMode enum is certainly not Nim :p |
09:39:26 | FromGitter | <mratsim> require a static enum as input and use `static: assert forbidden notin Allowed` |
09:40:28 | * | a_b_m joined #nim |
09:40:29 | Araq | not Nim? |
09:40:33 | Araq | what do you mean? |
09:41:08 | leorize | it could be designed to use with set[T] instead of fmReadWrite |
09:41:49 | FromGitter | <mratsim> but you can't pass sets to raw C proc that expect a flag |
09:42:31 | leorize | the io module procs are high-level abstraction |
09:42:34 | FromGitter | <mratsim> I use this approach for C flags: https://github.com/numforge/laser/blob/master/laser/photon_jit/photon_osalloc.nim#L43-L72 |
09:42:46 | leorize | pretty sure there's already some conversion going on there |
09:43:05 | FromGitter | <mratsim> fmRead is also in system.nim for writeFile or (or write?) |
09:43:06 | * | solitudesf quit (Ping timeout: 272 seconds) |
09:44:24 | leorize | https://github.com/nim-lang/Nim/blob/devel/lib/system/io.nim#L428 <--- this is how it's currently done |
09:44:25 | * | abm quit (Ping timeout: 258 seconds) |
09:44:37 | * | absolutejam4 quit (Ping timeout: 245 seconds) |
09:44:47 | * | ng0_ is now known as ng0 |
09:45:38 | leorize | well but such a change to the io module is too late at this point :p |
09:45:52 | * | actuallybatman quit (Ping timeout: 245 seconds) |
09:46:49 | FromGitter | <mratsim> I'm surprised that the OS procs are parametrized by a string instead of int code |
09:47:10 | leorize | it's easier to extend without breaking changes that way |
09:47:31 | leorize | openbsd's pledge also work like that |
09:48:08 | FromGitter | <mratsim> looking at the manual: c_fdopen |
09:48:16 | FromGitter | <mratsim> http://man7.org/linux/man-pages/man3/fopen.3.html sorry |
09:48:48 | * | clyybber joined #nim |
09:48:53 | Araq | C's IO wasn't designed for efficiency or type safety |
09:49:48 | FromGitter | <mratsim> well it's IO so I guess it will be dominated by disk speed anyway |
09:51:56 | Araq | nah it's super silly when "everything is a file (but not a disk access)" |
09:58:35 | * | absolutejam4 joined #nim |
09:59:57 | * | dddddd joined #nim |
10:01:25 | clyybber | Araq: =move is starting to get really weird.. No leaks and runs as expected on CPP backend, but FATAL dangling references exist on C backend: http://ix.io/1OyA |
10:02:59 | shashlick | Wow lots of action for two days |
10:04:35 | * | Senketsu quit (Quit: WeeChat 2.5) |
10:04:47 | * | couven92 quit (Read error: Connection reset by peer) |
10:05:20 | * | couven92 joined #nim |
10:07:28 | FromGitter | <mratsim> Everything could be a function :P |
10:08:57 | Araq | well it starts with the wrong name ("it's a stream ffs") and goes downhill from there. Env vars are not "files". Command line arguments are not "files". |
10:10:17 | Araq | in fact, Windows beats Unix on its homeground as on Windows everything is a "handle" and you can waitForMultipleObjects on it |
10:10:55 | * | surma quit (Ping timeout: 250 seconds) |
10:11:07 | * | surma joined #nim |
10:13:36 | FromGitter | <mratsim> but in windows file access locks by default, which is a pain |
10:15:34 | * | absolutejam4 quit (Ping timeout: 246 seconds) |
10:17:43 | Araq | both systems are full of design bugs. But nobody designs a new "Windows like" OS. |
10:22:31 | * | brakmic_ joined #nim |
10:22:37 | * | brakmic_ quit (Remote host closed the connection) |
10:22:40 | * | brakmic quit (Read error: Connection reset by peer) |
10:23:15 | * | brakmic joined #nim |
10:28:00 | FromGitter | <kayabaNerve> Can't you lock the file lookup table? |
10:28:25 | FromGitter | <kayabaNerve> ... something like that. Basically lock the file used to access files, therefore stopping the filesystem from working? |
10:36:34 | * | fjellfras quit (Quit: Leaving) |
10:41:50 | * | stefanos82 joined #nim |
10:47:24 | * | absolutejam4 joined #nim |
10:47:37 | * | noonien quit (Quit: Connection closed for inactivity) |
10:51:58 | * | absolutejam4 quit (Ping timeout: 246 seconds) |
11:01:49 | * | a__b__m joined #nim |
11:05:26 | * | a_b_m quit (Ping timeout: 244 seconds) |
11:06:58 | * | abm joined #nim |
11:08:04 | * | laaron quit (Remote host closed the connection) |
11:09:03 | * | a__b__m quit (Ping timeout: 244 seconds) |
11:11:21 | * | laaron joined #nim |
11:11:54 | * | tjmac joined #nim |
11:15:17 | FromGitter | <ahcm> One uses existsDir for isDir? |
11:15:52 | * | a_b_m joined #nim |
11:16:39 | Araq | yeah, I think so |
11:19:13 | * | abm quit (Ping timeout: 245 seconds) |
11:26:39 | * | absolutejam4 joined #nim |
11:33:18 | * | absolutejam4 quit (Ping timeout: 272 seconds) |
11:35:50 | FromGitter | <ahcm> len returns int? Why not uint64? |
11:36:22 | * | absolutejam4 joined #nim |
11:36:23 | Araq | because it would be worse |
11:36:50 | Araq | 1. unsigned als implies "modulo semantics", usually not what I need for 'length' |
11:36:54 | Araq | *also |
11:37:23 | FromGitter | <ahcm> so x = readFile(); len(x) ? |
11:37:27 | Araq | 2. I enjoy that code like 'for i in 0 .. x.len - 3' just works |
11:37:32 | * | laaron- joined #nim |
11:39:00 | Araq | what about the 'readFile' example? who tells me that I'm not a filesystem that can have files larger than high(uint64) anyway |
11:39:58 | FromGitter | <ahcm> so if len() is restricted to in32 how do you work with bigger files/strings? |
11:40:18 | Araq | len is int, not int32 |
11:40:54 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
11:40:57 | Araq | on a 64 bit CPU, int is 64 bits |
11:41:04 | FromGitter | <ahcm> but expression 'len(data)' is of type: int |
11:41:24 | FromGitter | <ahcm> Darwin andys-mba.local 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64 |
11:41:55 | Araq | int is not int32. |
11:42:24 | FromGitter | <ahcm> so I have to cast int to BiggestInt? |
11:42:29 | * | absolutejam4 quit (Ping timeout: 258 seconds) |
11:42:40 | FromGitter | <ahcm> because just a + does not work |
11:42:50 | FromGitter | <ahcm> just trying too understand |
11:43:26 | Araq | it depends, but BiggestInt(x) might be required |
11:44:16 | FromGitter | <ahcm> i have offset : BiggestInt and then offset + len(readFile()) |
11:44:41 | FromGitter | <ahcm> Is there a better way? maybe not use BiggestInt? |
11:45:27 | narimiran | yes, use `offset: int` if you can |
11:46:03 | FromGitter | <ahcm> but Fileinfo has: size*: BiggestInt |
11:46:32 | * | laaron- quit (Quit: ZNC 1.7.1 - https://znc.in) |
11:48:00 | Araq | BiggestInt(len(readFile())) is also ok |
11:48:36 | * | leorize quit (Ping timeout: 260 seconds) |
11:49:32 | * | ng0 quit (Ping timeout: 260 seconds) |
11:50:31 | Araq | is it just me or does https://github.com/nim-lang/Nim/issues/11723 work? |
11:51:46 | * | laaron joined #nim |
11:52:43 | * | ng0 joined #nim |
11:52:55 | * | leorize joined #nim |
11:56:40 | * | ng0 quit (Client Quit) |
11:58:05 | narimiran | it is just you |
11:58:36 | narimiran | (disclaimer: my nim devel is from friday) |
12:10:44 | * | a__b__m joined #nim |
12:14:41 | * | a_b_m quit (Ping timeout: 258 seconds) |
12:15:47 | * | absolutejam4 joined #nim |
12:15:47 | clyybber | Araq: How does the danling ref detection work? I dont really understand where the refcount gets saved.. |
12:15:58 | clyybber | s/saved/stored |
12:18:52 | clyybber | I mean I cant find the code that increases or decreases the rc field |
12:20:29 | Zevv | can someone try to run a little snippet for me on windows? |
12:20:56 | * | absolutejam4 quit (Ping timeout: 268 seconds) |
12:21:19 | Zevv | http://paste.ubuntu.com/p/QhvG8d6FS2/ |
12:21:23 | Zevv | what is the output of that |
12:23:16 | clyybber | fish: Unknown command ELF\cb\ca\ca |
12:23:25 | clyybber | /tmp/nimtest (line 1): |
12:23:27 | clyybber | ELF |
12:23:41 | leorize | clyybber: https://github.com/nim-lang/Nim/blob/8513f50a8d584a36667e789059407b7ad6135878/lib/core/runtime_v2.nim#L79 |
12:24:25 | leorize | the code that modify the ref count is right above |
12:25:38 | clyybber | Oh boi, how could I have overlooked that.. I thought the nimWeakRef was only for normal refs, but in debug mode they share the same code of course |
12:25:43 | clyybber | Thanks leorize |
12:27:12 | clyybber | Tbf, I cant find them in the generated C code |
12:28:19 | Zevv | sorry, wrong snippet: http://paste.ubuntu.com/p/2XnvT9NRs2/ |
12:29:32 | clyybber | same output |
12:30:22 | clyybber | nevermind |
12:30:27 | clyybber | the output is 1 |
12:31:15 | clyybber | and the earlier snippets output is 1 too |
12:31:27 | Zevv | on windowS?! |
12:31:32 | clyybber | no, on linux |
12:31:34 | Zevv | yeah :) |
12:32:03 | Zevv | that was the point, thanks for confirming :) |
12:33:26 | alexander92 | why is the danling error so simple, doesnt it at least include an address |
12:40:13 | clyybber | I dont understand how I get a dangling ref error, when no code even touches the rc field.. |
12:40:24 | clyybber | alexander92: Yeah, that could be improved |
12:41:54 | alexander92 | is it possible you get a data corruption |
12:41:56 | alexander92 | somehow |
12:42:27 | clyybber | Hmm, but its really weird, on CPP it runs without problems |
12:42:28 | alexander92 | run it under gdb(or rr), put a watchpoint on the failing rc field |
12:42:40 | clyybber | oh, you can do that? |
12:42:54 | clyybber | thats amazing |
12:43:15 | alexander92 | (under rr you can directly reverse-continue to monitor changes in it, in gdb you have to restart and somehow hit it again, not sure how deterministic it is) |
12:43:28 | alexander92 | well, i assume its some kind of an int value, right? |
12:43:55 | clyybber | yea |
12:43:58 | alexander92 | you can put watchpoints on addresses of such primitive values and debuggers can stop on each change |
12:44:16 | alexander92 | the problem is that usually there are max 4 hardware watchpoints on most pc-s iirc |
12:44:25 | alexander92 | so you cant really watch too many things at once |
12:45:46 | alexander92 | (but i recommend https://github.com/mozilla/rr : it exposes a gdb server, so you use it exactly as gdb, but you can step/continue back and also reproduce the same run of a program many times) |
12:46:17 | alexander92 | so thats useful sometimes if its hard to guess how something is exactly changed/touched |
12:53:53 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
12:54:39 | * | laaron joined #nim |
12:58:44 | * | shomodj_ joined #nim |
13:01:17 | * | shomodj quit (Ping timeout: 245 seconds) |
13:03:14 | * | absolutejam4 joined #nim |
13:09:10 | * | absolutejam4 quit (Ping timeout: 246 seconds) |
13:10:27 | * | a_b_m joined #nim |
13:11:48 | FromGitter | <zacharycarter> I wish window had some decent debugging / profiling tools |
13:12:16 | FromGitter | <zacharycarter> non-commercial ones I mean |
13:14:13 | * | a__b__m quit (Ping timeout: 245 seconds) |
13:18:36 | skrylar[m] | there's always tracy? |
13:19:37 | skrylar[m] | https://bitbucket.org/wolfpld/tracy or https://www.hawktracer.org/ depending on use |
13:22:52 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
13:25:33 | * | laaron joined #nim |
13:25:40 | * | leorize quit (Ping timeout: 260 seconds) |
13:27:24 | FromGitter | <zacharycarter> yeah - but nothing like Valgrind or rr |
13:28:28 | * | leorize joined #nim |
13:31:17 | clyybber | zacharycarter: Maybe valgrind works in the linux subsystem? |
13:33:01 | clyybber | Hmm, no this is kinda weird: http://ix.io/1Ozo |
13:33:03 | clyybber | bbl |
13:33:06 | * | clyybber quit (Quit: WeeChat 2.5) |
13:33:45 | * | absolutejam4 joined #nim |
13:34:21 | * | PMunch joined #nim |
13:34:44 | skrylar[m] | you could always just not use windows ^_^ |
13:34:46 | * | skrylar[m] ducks for cover. |
13:41:01 | alexander92 | actually microsoft were adding interesting stuff to their mdbg |
13:41:12 | alexander92 | windbg* |
13:41:34 | alexander92 | but i havent used it iirc, as i dont use windows often |
13:56:01 | * | sniffdtek joined #nim |
14:00:51 | Araq | get some clang for windows build that supports the sanitizers |
14:01:10 | FromGitter | <zacharycarter> yeah - that's an option |
14:06:53 | Araq | there is also Dr.Memory |
14:09:20 | * | natrys joined #nim |
14:15:06 | FromGitter | <zacharycarter> that one I have used |
14:18:58 | Araq | how was it? |
14:23:58 | * | brakmic quit () |
14:25:38 | * | Senketsu joined #nim |
14:27:22 | FromGitter | <zacharycarter> pretty limited / not great - but it could very well be that if you know how to use it properly, it's more poewrful |
14:28:04 | FromGitter | <zacharycarter> https://github.com/nim-lang/Nim/issues/11718 - I used it to try to figure out what was causing this issue |
14:29:36 | Zevv | yeah, did you figure that one out in the end? |
14:31:14 | Zevv | It was quite late already when I looked into that, but I believe the offending symbol was declared static in the generated C code, so the run time linker is not able to resolve the symbol from the shared lib later |
14:31:19 | Zevv | something like that |
14:32:08 | * | jxy quit (Quit: leaving) |
14:32:13 | * | nsf quit (Quit: WeeChat 2.4) |
14:32:16 | * | Senketsu quit (Quit: Leaving) |
14:32:28 | * | jxy joined #nim |
14:33:06 | * | Senketsu joined #nim |
14:33:26 | FromGitter | <zacharycarter> I didn't |
14:33:41 | FromGitter | <zacharycarter> I gave up on using HCR for now and am instead using nimscript |
14:36:03 | Zevv | :( |
14:37:20 | * | Senketsu quit (Client Quit) |
14:37:58 | * | pydsigner quit (Ping timeout: 245 seconds) |
14:38:08 | * | pydsigner joined #nim |
14:38:26 | * | Senketsu joined #nim |
14:43:37 | * | PMunch quit (Remote host closed the connection) |
14:47:20 | * | nsf joined #nim |
14:48:03 | disruptek | wow, nim's re api looks really well thought out. who do i have to blame for this? |
14:50:46 | * | Senny joined #nim |
14:51:18 | * | Senny quit (Client Quit) |
14:51:22 | * | Senketsu quit (Quit: Leaving) |
14:54:14 | FromGitter | <mratsim> maybe the fact that there are 4 regexps in Nim :P |
14:54:25 | * | Karol37 joined #nim |
14:55:13 | FromGitter | <mratsim> oh re2 has been removed |
14:55:20 | FromGitter | <mratsim> there is also strscans |
14:55:28 | FromGitter | <mratsim> and pcre |
14:55:52 | * | alexander92 quit (Ping timeout: 245 seconds) |
14:56:10 | Karol37 | Hello all! Could anyone explain me why this code doesn't work? ("callback" message is never run) |
14:56:34 | disruptek | i thought re was pcre. |
14:56:43 | FromGitter | <mratsim> pcre is raw pcre |
14:56:52 | Zevv | re is pcre with sugar |
14:56:57 | FromGitter | <mratsim> @Karol37, what's the code? |
14:57:01 | Karol37 | the only way is to make "future.waitFor()" which I don't want to do because I don't want block main thread |
14:57:03 | disruptek | yeah, so some nimmer made re. it's nice. |
14:57:12 | Karol37 | import asyncdispatch |
14:57:20 | leorize | Karol37: don't paste on IRC |
14:57:24 | leorize | use play.nim-lang.org |
14:57:33 | Karol37 | sorry |
14:57:37 | Karol37 | I'll do that |
14:57:39 | disruptek | also, don't sweat it. |
14:57:46 | Zevv | :) |
14:58:10 | leorize | it's rather nice that we can now link to the playground :p |
14:59:22 | disruptek | it'd be cool if a bot would post a link to the playground when someone hits a button in the playground. |
14:59:33 | Karol37 | OK |
15:00:02 | leorize | it'd be too easy to spam IRC like that :P |
15:00:27 | disruptek | no one would bother. also, the bot could be a little smarter than the average bear. |
15:01:19 | Karol37 | here is the code https://play.nim-lang.org/#ix=1OzV |
15:01:30 | narimiran | disruptek: how would you prevent people from anonymously share some bad/illegal content? |
15:02:04 | disruptek | do you really think this is a practical problem? |
15:02:24 | leorize | and what if I just want to share code to friends but not the world? |
15:02:38 | disruptek | what if you do? |
15:02:48 | narimiran | leorize: you just don't click "share on IRC" button? |
15:02:58 | leorize | Karol37: you didn't run `poll()` |
15:03:08 | leorize | narimiran: oh, yea, I misread the proposal a bit :p |
15:03:29 | Zevv | Karol37: runForever() instead of while true:discard |
15:03:43 | Zevv | not that once the timer expires you get an exception |
15:03:51 | Zevv | because nothing is left in the event queue |
15:04:42 | Karol37 | so what should I do inside while loop? feature.poll(100) should do the job? |
15:05:12 | Araq | disruptek, I wrote most of re.nim and usually don't get praise for it :P |
15:05:22 | Araq | didn't you mean 'nre'? |
15:06:08 | FromGitter | <mratsim> ah right nre |
15:06:18 | disruptek | oh, that's the 4th one. |
15:06:19 | FromGitter | <alehander42> By |
15:06:24 | leorize | Karol37: just poll until the future finish |
15:06:29 | leorize | like this: https://play.nim-lang.org/#ix=1OzX |
15:06:38 | disruptek | i have only looked at re so far. |
15:07:03 | disruptek | the problem i have with most re libs is that every language is different enough that i have to look up how to do anything. |
15:07:09 | disruptek | and that's a pain in the ass. |
15:07:28 | disruptek | and re may be inuitive enough for me that it's a gamechanger. |
15:07:45 | Karol37 | leorize: thank you very much! :) It works like a charm! :) |
15:07:59 | disruptek | if i don't have to look something up, i'm about 40-50x more productive. |
15:08:13 | Karol37 | I have to read 'poll' documentation to understand it better.... :/ |
15:08:32 | disruptek | sweet. another satisfied customer. :-) |
15:10:01 | disruptek | "If you love sequtils.toSeq we have bad news for you." |
15:10:05 | disruptek | lol |
15:10:43 | disruptek | too bad that lib wasn't named seqsutils. i was rolling over here. |
15:12:45 | Karol37 | disruptek: nim has some hard parts but it is nice language overall |
15:13:03 | disruptek | yeah, i like it a lot. |
15:13:22 | * | sentreen quit (Ping timeout: 245 seconds) |
15:14:10 | * | natrys quit (Quit: natrys) |
15:15:24 | * | Senketsu joined #nim |
15:19:11 | lqdev[m] | shashlick: any news on support for unions/nested structs in nimterop? |
15:22:42 | disruptek | what i was trying to say, i guess, is that not having to lookup how to use re means that i can afford the time it takes to use it, which means it gets more use, which elevates my toolset dramatically. |
15:24:58 | Araq | well thank you. I'd still rather have working auto-completion |
15:25:01 | lqdev[m] | oh no this again `type mismatch: got <proc (vm: ptr WrenVM, text: cstring){.cdecl, gcsafe, locks: 0.}> but expected 'WrenWriteFn = proc (vm: ptr WrenVM, text: cstring){.cdecl.}'` |
15:25:08 | lqdev[m] | what am I supposed to do then!? |
15:25:35 | Araq | check for duplicate WrenVM declarations |
15:26:08 | Araq | we improved these error messages, but *shrug* they are never good enough |
15:26:21 | disruptek | working auto-completion? |
15:26:51 | Araq | disruptek, that thing that Delphi got right in 1990 |
15:26:55 | lqdev[m] | ah, that makes sense. I just made another `WrenVM` object and I was going to use `wrap.WrenVM` for the C-wrapped one |
15:27:16 | disruptek | the graph technique? |
15:27:26 | disruptek | the same algo in crosswords. :-) |
15:27:31 | Araq | it was later called "IntelliSense" |
15:28:04 | Araq | you would type in a dot and it would tell you what options are available. |
15:28:45 | Araq | you could also click on identifier and jump to its declaration, fancy stuff. |
15:28:50 | disruptek | right. i've only ever used an ide for c# code; it was probably the killer feature. |
15:29:08 | Araq | lol |
15:29:13 | disruptek | but, i dunno, i'm just a vi guy through and through. |
15:29:29 | disruptek | and i had it setup in nvim but it was just too annoying. |
15:30:04 | disruptek | iirc, intellisense even produces the code with locally-scoped variable names. |
15:30:53 | Araq | it's not a "killer feature" in 2019. |
15:30:58 | Araq | it's standard. |
15:30:59 | disruptek | i recall thinking, "if you're so damned smart, why don't you write the thing?" |
15:31:17 | disruptek | yes, but i mean that'd be the only reason i would ide. |
15:32:03 | Araq | I've yet to see a productive Vi(m) user. IME they are all living in some illusion and need a hard slap in the fact to wake up. |
15:32:16 | Araq | *in the face. |
15:32:37 | disruptek | i don't use it all that cleverly, but maybe you'll watch me stream and tell me i'm nuts sometime. |
15:32:49 | Araq | I will. |
15:33:12 | * | nsf quit (Quit: WeeChat 2.4) |
15:33:54 | leorize | I'm certain that I'm more productive in my nvim setup than VSC |
15:34:07 | leorize | that's after I wrote nim.nvim :p |
15:34:18 | disruptek | zevv can attest to the fact that if you are of a certain age, you grew up over low bandwidth text interfaces. |
15:34:22 | disruptek | that's just how you roll. |
15:34:30 | Zevv | disruptek: why me? |
15:34:43 | disruptek | i think you're a sysadmin type who uses a text editor. |
15:34:46 | Zevv | I'm not *that* old |
15:35:01 | Zevv | I do my irc over ssh on an android phone |
15:35:03 | disruptek | no, i'm saying you know what i'm talking about. |
15:35:08 | Zevv | thats pretty modern :) |
15:35:19 | disruptek | game, set, match. |
15:35:51 | Zevv | hehe. I did start at 300/1200, long ago |
15:35:52 | disruptek | if you were modern you'd be using quasseldroid or w/e. |
15:37:46 | * | absolutejam4 quit (Ping timeout: 272 seconds) |
15:41:50 | * | lritter joined #nim |
15:43:24 | * | sniffdtek quit (Remote host closed the connection) |
15:43:40 | * | sniffdtek joined #nim |
15:49:31 | disruptek | so isn't algo from a paper in the '90s? earlier? '85? surely there is a commodity implementation in C? |
15:59:34 | * | a__b__m joined #nim |
16:03:07 | * | a_b_m quit (Ping timeout: 246 seconds) |
16:03:41 | * | lqdev[m] sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/yafZlmJloDsJuNpVRHbiRdAX > |
16:03:44 | lqdev[m] | codegen bug? |
16:04:27 | lqdev[m] | maybe I forgot to include a file, or something |
16:06:51 | Araq | bug in your wrapper |
16:06:54 | Araq | most likely. |
16:08:26 | * | Karol37 quit (Remote host closed the connection) |
16:10:14 | * | Trustable joined #nim |
16:14:36 | * | leorize quit (Ping timeout: 260 seconds) |
16:14:54 | * | leorize joined #nim |
16:24:21 | * | Senketsu quit (Quit: Leaving) |
16:27:59 | * | Senketsu joined #nim |
16:28:24 | * | sentreen joined #nim |
16:35:14 | * | nullnullnull joined #nim |
16:36:00 | * | clyybber joined #nim |
16:37:45 | * | nsf joined #nim |
16:39:19 | * | sentreen quit (Ping timeout: 268 seconds) |
16:41:37 | nullnullnull | is there a way to make a thread timer to terminate the app after X seconds for example? (it will not block the user input) |
16:42:32 | clyybber | Araq: Any idea/intuition how that can happen: http://ix.io/1Ozo ? It only happens on the C backend. |
16:44:09 | * | a__b__m quit (Quit: Leaving) |
16:45:07 | leorize | unchecked nil access? |
16:45:52 | clyybber | valgrind says no |
16:46:01 | clyybber | no invalid read or write |
16:46:57 | clyybber | Nevermind, gdb watchpoint might have mislead me |
16:47:14 | clyybber | it must be something different |
16:47:38 | * | actuallybatman joined #nim |
17:05:30 | Zevv | clyybber: is this something I can reproduce? |
17:10:37 | disruptek | nullnullnull: sure, just asyncsleep. |
17:11:49 | nullnullnull | @disruptek, can u give me an example how to do it? i tried this: sleep(1000); echo ("done") |
17:12:32 | clyybber | Zevv: Yeah, but you have to checkout my branch and build nim from there.. so It's a bit of work. |
17:12:38 | Zevv | where is it? |
17:12:39 | clyybber | Also I can reproduce it on two machines |
17:12:54 | disruptek | nullnullnull: https://nim-lang.org/docs/asyncdispatch.html#sleepAsync -- sorry, i always confuse sleepAsync with asyncSleep. |
17:14:05 | nullnullnull | @disruptek, thanks mate, I will check it out |
17:14:23 | disruptek | i don't have a canonical reference for async in nim, but that's what you'll probably want to use, as it's probably closest to your ultimate code. |
17:14:23 | clyybber | This is the PR: https://github.com/nim-lang/Nim/pull/11248 , heres the reproduction code: http://ix.io/1OhF , and compile it with --newruntime |
17:14:39 | clyybber | Also, for valgrind and the like I also do -d:useMalloc |
17:15:06 | nullnullnull | @disruptek, yeah, the goal is to keep the app responding (like a timer in background to exec code) |
17:15:44 | clyybber | And now I got gdb to crash;; nice :D |
17:15:54 | Zevv | sweet |
17:16:26 | disruptek | you gotta give clyybber props for embarking on this adventure. |
17:16:33 | Zevv | "[FATAL] unpaired dealloc |
17:16:35 | Zevv | is that the one? |
17:16:40 | Zevv | [FATAL] dangling references exist |
17:16:42 | Zevv | or that |
17:16:51 | Zevv | SIGSEGV: Illegal storage access. (Attempt to read from nil?) |
17:16:53 | Zevv | or that :) |
17:17:57 | clyybber | dangling references exist |
17:18:02 | clyybber | but only on C backend |
17:18:48 | Zevv | I was running your previous ix.io snippet - this one builds and does "haha" "nonshaha" only, and valgrind is happy |
17:19:04 | clyybber | Oh, I don't know which one that i |
17:19:07 | clyybber | s |
17:19:10 | clyybber | I forgot :D |
17:19:23 | nullnullnull | hmmm "Error: undeclared identifier: 'await'" but I've already declared this: import asyncdispatch |
17:19:34 | Zevv | but with http://ix.io/1OhF I see no problems |
17:19:55 | disruptek | nullnullnull: await is only usable inside an {.async.}-annotated proc. |
17:20:23 | nullnullnull | oh |
17:20:27 | clyybber | Zevv: Yeah, I'm struggling with this one: http://ix.io/1OhF |
17:20:31 | clyybber | I posted it above |
17:20:56 | nullnullnull | @disruptek, yeah sorry I'm new to nim ;) |
17:20:57 | Zevv | than one runs just fine here on c6a119bdc |
17:21:13 | disruptek | nullnullnull: everyone had to start somewhere. ;-) |
17:21:26 | clyybber | Zevv: With 'nim c --newruntime' ? |
17:21:29 | Zevv | yes |
17:21:33 | clyybber | Huh, wth |
17:22:30 | clyybber | What about 'nim c --newruntime -d:useMalloc' ? |
17:22:45 | Zevv | same |
17:23:13 | Zevv | http://ix.io/1OAz |
17:23:50 | clyybber | Zevv Ah, thats the old snippet |
17:23:57 | Zevv | dang |
17:24:17 | clyybber | Oh, nevermind |
17:25:04 | Zevv | double checked, it *is* http://ix.io/1OhF. But ok, nevermind :) |
17:25:27 | clyybber | Oh |
17:25:42 | * | clyybber posted the wrong snippet, and is now shamefully hiding |
17:26:21 | clyybber | Thats the one: http://ix.io/1OyA |
17:26:30 | clyybber | I pasted the wrong one |
17:26:40 | Zevv | yeah, that was the one I first tested |
17:26:46 | Zevv | and gave me 3 different crashes |
17:26:57 | clyybber | All at the same time??? :p |
17:27:08 | Zevv | quantumbug |
17:27:22 | Zevv | valgrind is not happy here. |
17:27:32 | * | tjmac left #nim ("-bye") |
17:27:48 | clyybber | Zevv: With --newruntime -d:useMalloc ? |
17:27:56 | Zevv | yes |
17:28:16 | clyybber | Does valgrind say invalid read, or only leaking memory? |
17:28:42 | Zevv | only warning on conditional-jump-uninit-memory, usually red haring |
17:28:44 | Zevv | herring |
17:29:11 | Zevv | *but* since I get 2 different crashes alternating, something is up here |
17:30:56 | clyybber | Hmm, ok thats really weird |
17:31:03 | clyybber | What happens with nim cpp ? |
17:31:17 | Zevv | all is well |
17:31:32 | clyybber | Thats so fucking weird |
17:32:10 | Zevv | I'm chewing through the C code now |
17:34:50 | clyybber | I tried using gdb watchpoints on the hidden RefHeader, but it crashes after telling me the value has been set from 0 to <unreadable> |
17:35:22 | Zevv | I'm wrapping my head around the seventeen casts in that line |
17:35:34 | Zevv | it has more brackets then a lisp compiler in lisp |
17:36:23 | disruptek | careful you aren't castrated. |
17:38:04 | * | sniffdtek quit (Remote host closed the connection) |
17:38:22 | * | sniffdtek joined #nim |
17:53:44 | clyybber | bbl, Zevv I check the irclogs so pls dont hesitate to @ me |
17:53:46 | * | clyybber quit (Quit: WeeChat 2.5) |
17:53:49 | Zevv | k |
17:54:31 | * | shomodj_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:56:06 | * | laaron quit (Remote host closed the connection) |
17:56:32 | * | shomodj joined #nim |
18:03:22 | * | floppydh quit (Quit: WeeChat 2.5) |
18:10:56 | * | brakmic joined #nim |
18:11:39 | * | solitudesf joined #nim |
18:14:54 | * | brakmic_ joined #nim |
18:18:24 | * | brakmic quit (Ping timeout: 244 seconds) |
18:18:47 | * | brakmic joined #nim |
18:22:01 | * | brakmic_ quit (Ping timeout: 244 seconds) |
18:22:24 | * | absolutejam4 joined #nim |
18:36:29 | FromGitter | <Obround> Is there some way you can alias `echo` under a different name? |
18:36:40 | FromGitter | <Obround> Like `my_echo`? |
18:37:18 | kungtotte | What's your actual goal with this? This sounds a bit like an X/Y problem. |
18:38:35 | FromGitter | <Obround> I'm writing a compiler that transpiles to Nim, and echo is not called echo |
18:39:02 | * | sniffdtek quit (Remote host closed the connection) |
18:39:20 | * | sniffdtek joined #nim |
18:39:24 | skrylar[m] | Compiling to nim compiling to c 😆 |
18:40:06 | kungtotte | If you're transpiling something, why do you need to rename it anyway? If it's called print in the source language, print should map to echo in Nim shouldn't it? |
18:41:19 | FromGitter | <Obround> Yes, but I don't want echo to be a reserved keyword that does nothing... |
18:42:57 | * | sniffdtek quit (Remote host closed the connection) |
18:43:15 | * | sniffdtek joined #nim |
18:43:56 | FromGitter | <Obround> Nvm, I found a solution: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d2cc96ce190903936ef1a52] |
18:43:56 | * | sniffdtek quit (Remote host closed the connection) |
18:44:53 | * | abm joined #nim |
18:45:20 | * | leorize quit (Ping timeout: 260 seconds) |
18:52:54 | nullnullnull | guys what's wrong with this line: await sleepAsync(2000) , I'm trying to run some code in background (but the app keeps waiting for the sleep async to end) |
18:54:42 | blackbeard420 | is there a way to set --threads:on for the nim plugin in vscode? ive set "nim.buildCommand": "--threads:on c" and still no completion for anything related to threads |
19:03:00 | blackbeard420 | nevermind, added --threads:on to my nim.cfg and it works |
19:09:21 | * | sniffdtek joined #nim |
19:15:58 | * | sentreen joined #nim |
19:21:10 | Araq | Obround: 'echo' is not a keyword in Nim |
19:25:59 | nullnullnull | or how to check if thread task is complete (on background) |
19:28:51 | * | Trustable quit (Remote host closed the connection) |
19:32:29 | Zevv | damn clybber, this is quite the introduction to move semantics |
19:32:49 | Zevv | damn clybber, this is quite the introduction to move semantics |
19:45:58 | * | stefantalpalaru joined #nim |
19:46:17 | stefantalpalaru | How do I create a type alias for a ref type? |
19:46:35 | Araq | type Alias = Stuff |
19:47:06 | stefantalpalaru | It doesn't seem to work when Stuff is a ref type. |
19:47:26 | Araq | it's used 5 billion times in Nim's core |
19:47:41 | lqdev[m] | type SomeRef = ref Some |
19:48:02 | * | jjido_ joined #nim |
19:48:21 | lqdev[m] | what error are you getting? |
19:50:00 | Zevv | @clyybber: no clue yet why, but the =move at the end of the seq add is taking one too many refs of value in the C code. It sets the pointer itself to NULL instead of its contents, so the button is not moved and is still in `b` |
19:50:45 | * | brakmic quit (Read error: Connection reset by peer) |
19:51:07 | * | brakmic joined #nim |
19:51:26 | stefantalpalaru | My bad. The problem wasn't with the type alias. |
19:52:21 | * | nsf quit (Quit: WeeChat 2.4) |
19:53:10 | * | brakmic quit (Read error: Connection reset by peer) |
19:53:16 | * | brakmic_ joined #nim |
19:54:17 | Araq | shashlick, I finally did it, c2nim is free of the compiler API dependency |
19:56:20 | Zevv | @clybber: took me an hour or two to understand how it all fits together, and just now I see the C compiler is complaining about the exact same thing :) |
19:57:04 | Araq | clybber is away? |
19:57:17 | Zevv | yeah but he told me to @ him anyway since he will read up |
19:57:32 | * | brakmic_ quit (Client Quit) |
19:57:54 | * | brakmic joined #nim |
19:58:48 | Araq | ah ok |
20:00:35 | * | Obrx joined #nim |
20:02:01 | * | Obrx quit (Remote host closed the connection) |
20:02:50 | * | Obrx joined #nim |
20:04:07 | * | Obrx quit (Remote host closed the connection) |
20:04:45 | * | stefantalpalaru quit (Quit: stefantalpalaru) |
20:06:18 | Zevv | well, I see why the C code goes wrong, that is obvious now. But I can not quite follow where/how this is generated from the Nim world |
20:06:52 | * | Vladar quit (Remote host closed the connection) |
20:10:54 | shashlick | @Araq - brilliant! How did you pull that off? |
20:11:23 | * | jjido_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:19:21 | * | absolutejam joined #nim |
20:21:22 | * | absolutejam4 quit (Ping timeout: 244 seconds) |
20:31:52 | * | clyybber joined #nim |
20:33:31 | clyybber | Zevv: Amazing, thanks so much dude |
20:34:23 | clyybber | You mean the move in add_xi2... ? |
20:34:25 | Zevv | something something moveOrCopy something |
20:34:45 | Zevv | yeah. The C code gen adds an superfluous & to the **value |
20:35:36 | Zevv | c++ uses ref there, so that's one indirection less |
20:35:37 | clyybber | Yep, but even removing that doesnt seem to fix the issue |
20:35:45 | Zevv | it does for me |
20:35:57 | Zevv | if I change that, 'b' is NULL after the add |
20:36:00 | clyybber | oh, so my compile script is broken I guess |
20:36:05 | clyybber | thanks gonna try again |
20:36:32 | Zevv | if you fix it, let me know, I got a long way figuring out how it all connects togetehr, but I'm not quite there yet |
20:36:50 | clyybber | The change is in stdlib_system.nim.c:2550 right? |
20:36:52 | Zevv | I'm suspecting the genMove at injectdestructirs.nim:649 |
20:37:07 | clyybber | Zevv: I think its the C codegen |
20:37:17 | Zevv | I guess to |
20:37:34 | Zevv | its line 2563 for me |
20:37:38 | clyybber | Ah, no you are right |
20:37:39 | Zevv | eqmove__mWsu5ftDgPiIZZo1TM3y0Q(&(*(*xu).p).data[oldLen], &value); |
20:38:03 | clyybber | Its probably in injectdestructors |
20:38:13 | * | brakmic quit (Ping timeout: 246 seconds) |
20:38:19 | clyybber | Zevv: Yeah, thats at 2550 here for some reason |
20:38:36 | clyybber | also for some reason, sometimes the compile script doesnt work |
20:38:59 | clyybber | wooow |
20:39:02 | clyybber | it worked |
20:39:20 | Zevv | sweet |
20:39:28 | Zevv | root cause? |
20:39:52 | clyybber | The makeAddrExp in injectdestructors.nim:353 |
20:40:08 | Zevv | no waty |
20:40:10 | clyybber | That isnt required when the moved variable is a sink param |
20:40:18 | clyybber | since sink params are now passed by addr |
20:40:35 | Zevv | ah makes sense |
20:40:51 | clyybber | It's easy to fix, but damn I would never have caught that codegen error |
20:40:55 | clyybber | so thanks a lot :DD |
20:41:05 | Zevv | yw |
20:41:22 | * | narimiran quit (Ping timeout: 246 seconds) |
20:42:15 | Zevv | so, how long to the finish line you guess? |
20:42:32 | clyybber | Well, inheritance I need to figure out |
20:43:06 | clyybber | But maybe I'm overthinking something there, and it will just work (doubt it) |
20:43:24 | dom96 | Araq, why does packedjson have this weird JsonTree? |
20:44:48 | dom96 | also kinda doubting this will be efficient for generating JSON |
20:45:20 | Zevv | well good luck clyybber, I'm off to take a nap |
20:46:04 | clyybber | Thanks, good night |
20:46:47 | * | Serenitor joined #nim |
20:47:28 | * | brakmic joined #nim |
20:48:11 | * | brakmic quit (Read error: Connection reset by peer) |
20:48:16 | * | brakmic_ joined #nim |
20:48:42 | * | Serenitor quit (Client Quit) |
20:49:02 | * | Serenitor joined #nim |
21:00:08 | FromGitter | <brentp> does nimble install now use `-d:danger` ? or just `-d:release` ? |
21:00:25 | clyybber | Zevv: Just -d:release afaik |
21:00:40 | clyybber | Ah wrong tag |
21:00:56 | FromGitter | <brentp> but nimble will use my nim.cfg ? |
21:02:09 | FromGitter | <brentp> seem so |
21:11:07 | clyybber | Yeah it will |
21:11:08 | * | clyybber quit (Quit: WeeChat 2.5) |
21:15:59 | * | PMunch joined #nim |
21:16:34 | shashlick | @Araq - I see you pulled in all compiler code into c2nim - but now it won't build with older versions of nim |
21:17:38 | FromGitter | <mratsim> I think people can choosenim devel just for c2nim though |
21:17:41 | Araq | I doubt ast.nim etc use advanced Nim features |
21:17:54 | * | Ivo quit (Ping timeout: 248 seconds) |
21:17:55 | shashlick | well, i just tried 0.19.6 and it breaks |
21:18:09 | shashlick | compiler\pathutils.nim(13, 22) Error: cannot open file: pathnorm |
21:18:15 | FromGitter | <mratsim> c2nim is something that you only use at the beginning of a project |
21:18:21 | FromGitter | <mratsim> and you can use an older release |
21:18:40 | shashlick | perhaps c2nim can also post release binaries |
21:19:52 | Araq | shashlick, seems like an oversight to me |
21:20:10 | FromGitter | <mratsim> uh Araq, did you misunderstand me here? https://github.com/nim-lang/RFCs/issues/154 |
21:20:32 | FromGitter | <mratsim> I'm not saying to remove dereferencing |
21:20:58 | Araq | but I don't want to copy pathnorm so IMO c2nim should simply require 0.20 |
21:23:00 | Araq | mratsim: yes but what are you saying? |
21:23:29 | FromGitter | <mratsim> that for explicit dereferencing, we should have `deref` (or something else) instead of `[]` |
21:23:52 | FromGitter | <mratsim> i.e. I'm only talking about explicit dereferencing, not the implicit one for ref or ptr object fields |
21:23:54 | shashlick | in all honesty, i'd rather have seen nim expose the compiler API for the installed compiler |
21:24:06 | shashlick | then the building compiler and compiler API will be the same |
21:24:11 | shashlick | and you wouldn't see any of these issues |
21:24:24 | shashlick | then if there were any variations, c2nim could just have a when NimVersion calls |
21:24:36 | Araq | maybe but c2nim doesn't really require the Nim compiler anyway |
21:24:52 | Araq | only the renderer and when we change that, all c2nim tests could break |
21:25:03 | Araq | so it was fragile |
21:25:03 | * | jjido joined #nim |
21:25:11 | shashlick | agreed, but any tool that wants to leverage the compiler API will be built with an installed version of compiler |
21:25:36 | Araq | in general, ok, but c2nim is not "any tool" |
21:25:40 | shashlick | so letting `import compiler` just point to the `path\to\nim\compiler` would be cool |
21:26:05 | shashlick | or even `std/compiler` |
21:26:06 | Araq | that's effectively how I always built c2nim |
21:26:17 | Araq | nim c --noNimblePath --path:../nim c2nim |
21:26:43 | Araq | but then I build c2nim against devel |
21:26:49 | Araq | and the tests can be off. |
21:26:53 | Araq | been there, done that. |
21:27:05 | Araq | the new way should be better. |
21:27:34 | shashlick | why would the tests be off? |
21:27:44 | Araq | renderer.nim differences |
21:28:23 | * | shomodj quit (Ping timeout: 245 seconds) |
21:28:27 | shashlick | ok - I understand the compiler API doesn't need to get updated all the time, but only request would be to make it more backwards compatible |
21:29:07 | shashlick | cause `nimble install c2nim` failures shouldn't require a nim compiler update |
21:29:34 | shashlick | no doubt you can build and install it with latest and then use the compiler version you want, but you know what i mean |
21:30:03 | * | shomodj joined #nim |
21:32:03 | shashlick | tested with 0.20.0 and it works |
21:33:15 | dom96 | yep, no difference from packedjson |
21:33:43 | Araq | dom96, interesting, I would seriously doubt that |
21:34:32 | Araq | shashlick, so what to do? require 0.20 or ship 'pathnorm' with it? |
21:34:38 | Araq | I don't care either way |
21:34:41 | dom96 | Araq, it still alllocates twice |
21:34:56 | dom96 | well, actually far more than twice |
21:35:06 | dom96 | for each JsonNode + to generate the JSON string |
21:35:28 | shashlick | @Araq - no need for extra work now, going forward is fine |
21:35:30 | disruptek | perhaps why json is slower than xml. |
21:35:38 | Araq | maybe if you use it in some bad way, dom96 |
21:35:57 | shashlick | you could pin 8f1705509084ae47319f6fcfb131e515b134e0f1 to 0.9.15 - last version that worked with 0.19.6 |
21:36:03 | dom96 | I use it pretty naively, but I don't get how this many allocs won't cause issues |
21:36:18 | dom96 | I need to generate some binary format anyway |
21:36:27 | dom96 | which I will do with as few allocs as possible |
21:36:30 | * | sealmove joined #nim |
21:36:55 | Araq | shashlick, I don't know how to do that |
21:37:23 | dom96 | omg |
21:37:31 | dom96 | I've literally done that at least twice for c2nim |
21:37:42 | shashlick | hold, i'm testing something |
21:38:02 | Araq | dom96, yeah... guess what. I don't care |
21:38:08 | dom96 | You.Should.Always.Ping.Your.Dependencies. |
21:38:11 | dom96 | *Pin |
21:38:18 | Araq | I don't have any, anymore. |
21:38:39 | dom96 | no? Then why are we talking about installing c2nim via nimble? |
21:38:55 | Araq | dunno, ask shashlick |
21:39:26 | Araq | I'm happy with the setup now. |
21:39:48 | shashlick | @dom96 - Araq has moved all compiler API dependencies into the c2nim repo, so no longer need to install compiler API as a nimble package |
21:40:10 | shashlick | however, nim 0.19.6 binary cannot build it anymore |
21:40:27 | shashlick | so in my mind, compiling nim and API in c2nim could still conflict |
21:40:32 | dom96 | That's not a bad solution |
21:41:00 | dom96 | But it seems like you've already found issues with it :) |
21:41:14 | Araq | c2nim now requires 0.20. *shrug* |
21:41:22 | Araq | we are about to release 0.20.2 btw |
21:41:32 | shashlick | it's the same issue as before, except instead of compiler API, it is now in the codebase |
21:41:35 | Araq | and 0.20 is our LTS |
21:41:53 | shashlick | i was suggesting that `import compiler` should become `import std/compiler` which would just refer to the installed nim's compiler dir |
21:42:04 | dom96 | So now instead of changing a single commit hash you'll copy and paste Nim source code |
21:42:15 | shashlick | that way the compiling binary and the APi will be looking at the same code |
21:42:47 | Araq | dom96, hardly. c2nim only needs some way to produce Nim source code |
21:42:59 | Araq | it happens to use the compiler's AST and renderer for it |
21:43:07 | Araq | and now it has its own version of it |
21:43:09 | dom96 | and your copy of the compiler source code will have no useful Git history |
21:43:27 | dom96 | just tons of commits saying "Update compiler source code" |
21:43:46 | dom96 | and then you'll get people making changes to the compiler source code via PRs |
21:43:57 | dom96 | and you'll need to tell them "oh no, you need to do that in this other repo" |
21:44:08 | Araq | you lost me |
21:44:21 | shashlick | araq, same could have been accomplished by pinning to a specific compiler API, which is what i had done in nimgen - i was pointing to an older c2nim version |
21:44:25 | * | Senketsu quit (Quit: WeeChat 2.5) |
21:45:11 | shashlick | however, it eventually broke due to the -d:nimOldCaseObjects change |
21:45:19 | * | Senketsu joined #nim |
21:45:43 | Araq | yes. so? do you really think I don't know how c2nim works or how its nimble package was setup? |
21:46:29 | Araq | it's time we tried something new. and the current setup is new and makes sense. |
21:46:37 | shashlick | well, all i'm saying is that in the future, c2nim might break since devel compiler doesn't work with c2nim's cached version |
21:46:52 | Araq | I don't think this is how it works... |
21:46:55 | shashlick | then you will bump up the c2nim cached copy and it won't work with older versions again |
21:46:58 | disruptek | actually, that will keep it from breaking. |
21:47:08 | shashlick | well, it broke right now with 0.19.6 |
21:47:28 | Araq | yeah and you know what? |
21:47:42 | Araq | further cleanup of the compiler/*.nim files would also have prevented this |
21:47:50 | disruptek | but, going forward the c2nim logic will only change lockstep with its compiler changing. |
21:47:51 | Araq | I only did some minimal cleanup |
21:48:11 | Araq | as I said, c2nim needs *some* ast.nim + renderer.nim |
21:48:20 | shashlick | @disruptek - you are assuming that people build c2nim only with the latest compiler |
21:48:25 | Araq | it doesn't need lexer.nim, yet it depends on it |
21:48:49 | Araq | there is a bunch of stuff in there that we can eventually remove |
21:48:52 | shashlick | I see |
21:49:15 | shashlick | i was presuming it is a copy, felt that would be most maintainable |
21:50:16 | Araq | also, pathnorm is a stdlib module, new in 0.20 |
21:50:55 | Araq | at what point is c2nim allowed to use new stdlib modules? does it always need to compile with 0.19.x? :P |
21:51:40 | shashlick | hey, I have grey hair already so old is gold 😉 |
21:52:24 | shashlick | 0.19.6 is n - 1 so isn't unreasonable, but since we aren't 1.0 yet, i'll let it go |
21:55:24 | Araq | well as I said, copy pathnorm to c2nim and make c2nim compatible with 0.18. or maybe 0.16 |
21:57:10 | * | brakmic_ quit () |
21:57:24 | Araq | or clean it up so that it doesn't require pathnorm |
21:57:25 | shashlick | should it just go in the root dir? |
21:57:41 | shashlick | okay let me see |
21:57:53 | Araq | compiler / pathnorm probably |
21:58:36 | Araq | but if you patch it, also patch .travis.yml so that an old Nim is installed |
21:58:45 | Araq | good night |
22:00:37 | shashlick | nope, not trivial since we also need relativePath which is new in os |
22:00:47 | shashlick | well, let me see |
22:03:58 | * | sniffdtek quit (Remote host closed the connection) |
22:09:13 | * | absolutejam quit (Ping timeout: 245 seconds) |
22:12:29 | FromGitter | <Varriount> Araq: Is there anything preventing short string optimization? |
22:13:31 | Araq | varriount: no, but since string literals do not allocate/copy anymore either with --newruntime I doubt SSO is necessary |
22:14:10 | FromGitter | <Varriount> What about for token/parser code? |
22:16:24 | shashlick | Araq - doesn't seem trivial - you need `/` which pulls in a bunch of code |
22:17:28 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:17:33 | Araq | what about it? you can use setLen(x, 0) and reuse the memory |
22:22:03 | FromGitter | <mratsim> oh literals don't allocate, nice. |
22:26:25 | * | nullnullnull quit (Remote host closed the connection) |
22:35:45 | AlexMax | Is getting rid of an old version of nim with choosenim just a matter of rm -rf ~/.choosenim/toolchains/nim-<ver>/? |
22:36:42 | PMunch | Pretty sure |
22:42:54 | * | Senketsu quit (Quit: WeeChat 2.5) |
22:43:43 | * | Senketsu joined #nim |
22:47:33 | * | solitudesf quit (Ping timeout: 245 seconds) |
22:58:10 | * | Senketsu quit (Quit: WeeChat 2.5) |
22:58:57 | * | Senketsu joined #nim |
23:01:48 | * | NimBot joined #nim |
23:10:26 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
23:27:08 | * | Serenitor quit (Quit: Leaving) |
23:50:42 | * | stefanos82 quit (Quit: Quitting for now...) |