<< 19-02-2019 >>

00:01:19*rnrwashere quit (Remote host closed the connection)
00:01:44*rnrwashere joined #nim
00:03:04*rnrwashere quit (Remote host closed the connection)
00:03:10*rnrwashere joined #nim
00:08:03*rnrwashere quit (Remote host closed the connection)
00:08:23*rnrwashere joined #nim
00:15:34*vlad1777d quit (Ping timeout: 250 seconds)
00:24:17*leorize joined #nim
00:30:46*chimez joined #nim
00:33:02*rnrwashere quit (Remote host closed the connection)
00:35:53*chimez quit (Quit: chimez)
00:37:18*rnrwashere joined #nim
00:41:40*rnrwashere quit (Remote host closed the connection)
00:41:56*abm quit (Quit: Leaving)
01:02:15*rnrwashere joined #nim
01:02:21*zachk quit (Quit: Leaving)
01:06:41*rnrwashere quit (Ping timeout: 244 seconds)
01:12:11FromGitter<Varriount> @arnetheduck What exploits? Windows has the behavior of loading dlls from the executable directory, and that doesn't seem to be too bad.
01:28:49*rnrwashere joined #nim
01:30:23*rnrwashere quit (Remote host closed the connection)
01:30:35*rnrwashere joined #nim
01:35:48FromGitter<arnetheduck> the directory of the executable is often user-writable (`$HOME/bin`) so it's very easy to drop a libc-replacement in there without the user noticing, and the way loading works on unix is that the first claim on a symbol name wins (memcpy, whatever).. it's a powerful debugging technique but also easy to exploit..
01:37:03FromGitter<arnetheduck> windows has this behavior and is known for its stellar security record, right?
01:38:09FromGitter<arnetheduck> (specially pre-user-access-control which for all intents and purposes is the equivalent of `sudo cp`)
01:43:16*rnrwashere quit (Remote host closed the connection)
01:55:23*rnrwashere joined #nim
01:58:19*stefanos82 quit (Remote host closed the connection)
02:08:24*zyklon joined #nim
02:23:35*arecaceae quit (Remote host closed the connection)
02:23:53*arecaceae joined #nim
02:29:10*rnrwashere quit (Remote host closed the connection)
02:30:58*rnrwashere joined #nim
02:40:06*rockcavera quit (Remote host closed the connection)
02:41:10*rnrwashere quit (Remote host closed the connection)
02:57:48*rnrwashere joined #nim
02:59:06*dddddd quit (Remote host closed the connection)
03:02:31*banc quit (Quit: Bye)
03:02:34*qxxxb joined #nim
03:23:18*rockcavera joined #nim
03:24:27*banc joined #nim
03:25:19*Cthalupa joined #nim
03:35:49*rnrwashere quit (Remote host closed the connection)
03:37:41*rnrwashere joined #nim
03:43:04*thomasross joined #nim
03:44:55*thomasross quit (Read error: Connection reset by peer)
03:45:15*chimez joined #nim
04:02:52*nsf joined #nim
04:08:12*noeontheend quit (Ping timeout: 246 seconds)
04:36:35*rnrwashere quit (Remote host closed the connection)
04:44:47*rnrwashere joined #nim
05:04:29*Marumoto joined #nim
05:09:17*rnrwashere quit (Remote host closed the connection)
05:15:21*leorize quit (Remote host closed the connection)
05:28:52*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
05:33:39*Ven`` joined #nim
05:42:18*Ven`` quit (Ping timeout: 250 seconds)
05:47:41*chimez quit (Quit: chimez)
06:11:15*narimiran joined #nim
06:22:15FromGitter<Varriount> @arnetheduck That assumes the eventually directly is the first place looked at.
06:22:52FromGitter<Varriount> On Windows, it's the last part searched, out of a set list.
06:29:39*vlad1777d joined #nim
06:41:16*sealmove joined #nim
06:48:37sealmoveZevv: hi
06:49:48*leorize joined #nim
06:50:51*chimez joined #nim
06:50:56*chimez quit (Client Quit)
07:02:45*krux02 joined #nim
07:09:50*NimBot joined #nim
07:33:49sealmovehow can I convert everything I pass to a template (untyped) to a string?
07:34:19krux02$
07:34:31sealmoveoh
07:34:37krux02well it depends
07:34:45krux02you want the sourcecode as $?
07:34:51krux02or the value as a string
07:34:54krux02$ is for value
07:35:03sealmovei want source..
07:35:29*Vladar joined #nim
07:35:52sealmovebtw greetings from Greece, you met my friend at FOSDEM
07:36:05krux02there is also astToStr
07:36:16krux02cool
07:36:22krux02who was your friend?
07:36:30krux02who is your friend?
07:36:41sealmovestrToStr works nicely, ty
07:37:00krux02strToStr didn't know about that one
07:37:01sealmoveHermes. He said you talked in metro
07:37:13sealmoveastToStr I meant ><
07:37:14sealmovesorry
07:37:20sealmovehaha
07:37:28krux02cool
07:37:43krux02right at the beginning of fosdem?
07:37:47krux02before I got there?
07:38:42sealmovedon't know..
07:38:54krux02doesn't matter
07:39:00sealmoveyeah, anyway
07:39:08sealmovehe liked u :P
07:39:43sealmovetoo bad I couldn't be there too, but it was exam period, and he missed 1 exam
07:40:47krux02cool
07:40:55krux02good to hear
07:43:01krux02sealmove: and he talked with about Nim and then you tried it out?
07:45:30sealmoveno, I've been around for maybe a year now? had the nickname "rect0x51" but changed. He knew about Nim from me and heard you talking about Nim.
07:53:59krux02cool
07:54:45*kapil____ joined #nim
07:55:21*chimez joined #nim
08:00:00*gmpreussner quit (Quit: kthxbye)
08:04:36*gmpreussner joined #nim
08:04:54*Vladar quit (Remote host closed the connection)
08:13:00*qxxxb quit (Quit: WeeChat 1.9.1)
08:23:20*PMunch joined #nim
08:25:50*rnrwashere joined #nim
08:27:17*Ven`` joined #nim
08:27:17*Ven`` quit (Client Quit)
08:30:40*rnrwashere quit (Ping timeout: 268 seconds)
08:32:04sealmoveNim/config/nim.cfg seems to be using some special language?
08:39:13PMunchWell it's a config file
08:39:18PMunchSo it uses the config format
08:39:31PMunchBut you can use a .nims file as wel IIRC
08:39:51PMunchnim-lang.org/docs/nims.html
08:40:21PMunchgithub.com/nim-lang/Nim/wiki/Using-nimscript-for-configuration
08:41:19ZevvHi sealmove
08:42:38Zevvhow is the bash coming along? Mine can now do rosetta code's bash fizzbuzz :)
08:42:55Zevvno clue why I'm doing this, but it keeps me off the streets, which is good
08:45:30sealmoveoh nice haha. well, I did some more thinking and what I'd really love is to have a very convenient way to interface with the shell (set env variables, read exit codes etc). osproc module does a lot, but maybe a nice macro library could help Nim and shell talk to each other more nicely
09:00:47ZevvIf you don't mind doing things synchronously it should be pretty trivial, indeed some glue around osproc should suffice
09:01:40sealmoveos module basically. I realized nimscript doesn't even import osproc.
09:02:10sealmoveyeah, everything is already there. just want to make a nimscript DSL
09:02:31Zevvit's just executing programs and reading the return values. What would be very slick though, is doing async integration with pipes.
09:02:37sealmovethin macro wrappers around many procs from os module
09:02:54Zevvso you have a nim proc spewing out data, which you can pipe through a few commands, and the back into another nim function and out again
09:03:16Zevvgen_data() | `sort` | echo
09:04:19Zevv`tail -f /var/log/messages` | process_logs()
09:04:23sealmovethat would be cool yeah, but out of my league atm...
09:04:55sealmovealso it's not supported by nimscript I think, so it would have to be normal Nim
09:06:24Zevvyeah, that kind of limits the possibilities
09:06:44Zevvnimscript is good for nim, but bad at interfacing with the rest of the world
09:09:08*floppydh joined #nim
09:09:41*neceve joined #nim
09:22:37sealmovewhat I have in mind is very very similar to how Nim/config/nim.cfg works
09:24:14sealmovewho parses that file?
09:35:20sealmovefound it, it's Nim/compiler/nimconf.nim
09:35:47sealmovehow about making something similar but more general, as an extension to Nimscript, for more convenient scripting syntax?
09:37:30*abm joined #nim
09:41:04PMunchWell you do have nim-lang.org/docs/parsecfg.html
09:41:11PMunchWhich is what it uses IIRC
09:44:04sealmoveI think it's different
09:47:30sealmoveparsecfg is for ini-style config files. Nim/config/nim.cfg uses other style which is essentially a DSL implemented in Nim/compiler/nimconf.nim, and it's very nice because it has macros that wrap stuff from os and ospath and seems very powerful. I think a variation of it could be used with Nimscript, but that file imports stuff that Nimscript can't import, so it has to be adjusted, and some stuff that are being
09:47:31sealmovereused in it will probably have to be re-implemented for Nimscript.
09:57:56*lritter joined #nim
09:57:58sealmovewell, nimconf.nim is very specific for the needs of nim compiler configuration, but we can extend this idea and make a useful mini-language for scripting
10:08:35PMunchI like the idea!
10:10:56sealmovereally? :)
10:11:55PMunchYeah, bash scripts are one of the few things I can't use Nim for comfortably :)
10:12:19PMunchWith this and nimcr it could be very simple to drop Nim in there instead
10:12:36FromGitter<mratsim> I sense the bikeshedding of nimble tasks, nims nimscript, and config coming :P
10:13:18sealmovePMunch this is precisely what I am hoping for
10:13:37*fanta7531 joined #nim
10:18:19FromGitter<alehander42> ohh
10:18:27FromGitter<alehander42> @narimiran i found out my error
10:18:44FromGitter<alehander42> i just started my nimnode with quote: and then tried to add to it
10:18:48*dddddd joined #nim
10:18:49*dom96_w joined #nim
10:18:51FromGitter<alehander42> but it doesnt create nnkStmtList
10:18:53AraqI use Nim programs instead of Nim scripts
10:18:56FromGitter<alehander42> so it results in invalid stuff
10:19:12FromGitter<alehander42> can we somehow have a better error for this
10:19:29Araqcompilation doesn't slow me down and I can't be bothered with what parts of os.nim NimScript supports
10:19:33FromGitter<alehander42> or maybe make quote: produce stmtlist by default
10:19:39FromGitter<alehander42> but this would be wrong maybe
10:20:09FromGitter<alehander42> just a better error would make sense, or at least a hint, because its very non obvious
10:26:18narimiran@alehander42 glad to hear you found it (on your end :P)
10:27:10sealmoveAraq: not use if it should be implemented around NimScript, could be normal Nim. the idea is to make something as convenient as bash that uses Nim procs (putEnv etc).
10:29:04sealmoveI am inspired by nimconf.nim where you can do `@putenv "key" "value"
10:31:09sealmovebtw PMunch: what do I have to do to setup nimrc? it doesn't seem to work out of the box
10:32:38PMunchHmm, it is a bit tricky to use
10:32:43PMunchWhat doesn't seem to work?
10:33:39sealmoveI don't have a nimrc executable :P
10:34:21narimiranAraq: "const poDemon {.deprecated: "blah".} = poDaemon" still raises the same error :/
10:35:32narimiranif anybody else wants to chime in: https://github.com/nim-lang/Nim/pull/10708 --> how to deprecate one enum value
10:36:55FromGitter<alehander42> thanks miran
10:37:16narimiranit seems that just {.deprecated.} works, but {.deprecated: "foo".} doesn't :/
10:38:34Araqare you sure? I remember seeing a patch for this
10:38:45FromGitter<GULPF> @Araq it was only for var/let, not const
10:39:26narimirani am sure :D and plain {.deprecated.} works inside of enum, no need for const
10:39:30*vlad1777d quit (Ping timeout: 246 seconds)
10:41:06sealmovePMunch: sorry, didn't realize it's nimble package, nvm
10:41:17*vlad1777d joined #nim
10:42:23Araq.deprecated fields in enum screw up the ordering and the exhaustiveness checks
10:42:32sealmovePMunch: works great
10:42:34Araqso it's a bad idea and my const still is preferable
10:42:44narimiranok, will do it as a const
10:43:14PMunchsealmove, nice :)
10:43:20Araqbtw this is awesome https://github.com/nim-lang/Nim/pull/10707
10:44:02Araqwe are not shooting into the dark anymore
10:45:11narimiranand because of it, i reported outdated code to several packages, and some already have fixed those things
10:46:27*vlad1777d quit (Ping timeout: 240 seconds)
10:47:09narimiranif anybody wants some of their packages to be included: let me know
10:53:18PMunchHmm, maybe nimlsp could be put on there
10:53:28PMunchBut it's build system is a bit hairy at the moment
10:53:37PMunchs/it's/its
10:53:50*PMunch quit (Remote host closed the connection)
11:32:19ZevvUsing capitals and correcting your plurals on IRC, you are one in a thousand!
11:42:57sealmovewhat's the difference between os.execShellCmd and osproc.execCmd?
11:43:13narimiranShell
11:43:23narimirani love these easy questions :D
11:44:41sealmovehaha
11:45:05*stefanos82 joined #nim
11:48:58sealmovearen't all commands shell commands?
11:58:08*Snircle joined #nim
11:58:18*fanta7531 quit (Quit: fanta7531)
12:00:42*sealmove quit (Quit: WeeChat 2.3)
12:01:14*Vladar joined #nim
12:02:58*fanta7531 joined #nim
12:11:29*sz0 joined #nim
12:12:46ZevvGood question, actually, but I can explain this for you: the first boils down to a call to 'system()', but the latter does a call to 'system()'
12:14:21*nsf quit (Quit: WeeChat 2.3)
12:32:39*fanta7531 is now known as fanta7531|away
12:34:42krux02sealmove, not really. A shell command involves the command line interpreter, so it can do environment variable substitution, splitting the line into args etc
12:35:11krux02where a command is just tha command with a list of arguments no interpreter or command splitter involved.
12:35:30Zevvyeah, buth both calls actually run a shell command - they do exactly the same thing
12:36:05krux02yea I see
12:36:49krux02I think it isn't the best design here
12:52:35narimirangoogle hashcode: the deadline for the registration is in 6 days. anybody wants to participate and use Nim? https://codingcompetitions.withgoogle.com/hashcode/rulesandterms
12:52:56*ng0 joined #nim
13:09:44FromGitter<mratsim> what is this competition?
13:09:56FromGitter<mratsim> do we need to do our own compiler and standard library?
13:10:10FromGitter<mratsim> 1) 5 Source Code. Participants must develop original code to generate their solution. To be valid, every code submission must include a file (typically, a ZIP archive) containing the source code of the program you developed to generate the solution.
13:10:26narimiranhere are the previous tasks: https://codingcompetitions.withgoogle.com/hashcode/archive
13:15:19FromGitter<mratsim> it seems quite graph heavy
13:15:38FromGitter<mratsim> also quite optimisable via genetic algorithms
13:19:24FromGitter<zetashift> @narimiran "Participants must compete in a group of two, three, or four members " aww shieee
13:19:52narimiranbut do they have to be at the same place or can a team be formed over internet?
13:25:55FromGitter<Vindaar> @sealmove: not exactly what you want, but maybe interesting: https://github.com/Vindaar/shell ⏎ @narimiran: that sounds like a fun competition :)
13:26:07FromGitter<zetashift> I don't know the site site you form it in the Judge System but I can't access it yet
14:04:24*nsf joined #nim
14:08:15*neceve quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
14:08:38*neceve joined #nim
14:21:52FromGitter<gogolxdong> Anyone experienced with HTML canvas? How to draw horizontal text in rotated context?
14:22:15*Marumto joined #nim
14:24:56*Marumoto quit (Ping timeout: 255 seconds)
14:30:48*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:33:09*dom96_w joined #nim
14:43:54*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:04:00*sealmove joined #nim
15:16:53*neceve quit (Read error: Connection reset by peer)
15:18:02*Cthalupa quit (Ping timeout: 255 seconds)
15:19:41*Cthalupa joined #nim
15:23:43*qxxxb joined #nim
15:26:39*fanta7531|away quit (Quit: fanta7531|away)
15:40:27*dom96_w joined #nim
15:43:41qxxxbis it possible to use the parsecfg module at compile time?
15:45:03FromGitter<mratsim> I don't see why not
15:45:18FromGitter<mratsim> just make sure to gorge/staticRead your config file
15:45:30federico3albeit it is a bit odd...
15:46:31qxxxbNot sure how to make parsecfg accept a string instead of a stream tho
15:47:53FromGitter<mratsim> ah, I didn't check if it worked with streams
15:47:58FromGitter<mratsim> strings*
15:53:52federico3loadConfig supports both streams or filenames
15:57:49qxxxbHere's what i've tried so far: https://hastebin.com/miwiyemowe.cs
15:59:02sealmoveguys, I have this template `template `>>`(cmd: untyped): untyped {.discardable.} = execCmd(astToStr(cmd))` but it doesn't let me use the pragma. It says: "Error: cannot attach a custom pragma to '>>'. I tried with other operators too, same thing. Is there a way to get around that, and why is that limitation there?
15:59:10federico3qxxxb: you might want to use const
15:59:55FromGitter<Vindaar> @federico3 but `loadConfig` with only filename arg also just creates a `FileStream` from it
16:00:19FromGitter<Vindaar> so I'm pretty sure it's not possible atm
16:01:19qxxxbI get a different error with const: nim-0.19.4/lib/pure/streams.nim(387, 8) Error: invalid field at index 3
16:01:21FromGitter<Vindaar> same problem as with JSON at CT. We need streams at compile time :)
16:01:26federico3works for me
16:01:52federico3https://pastebin.com/bzw9sYiE
16:02:34FromGitter<Vindaar> but that only reads the cfg file at CT, but does the parsing at runtime, no?
16:06:22qxxxbthx for the help, though it looks like isn't possible for now. gtg!
16:06:24*qxxxb quit (Quit: WeeChat 1.9.1)
16:07:01federico3good question
16:09:44Araqsealmove, you cannot use .discardable on a template
16:10:05sealmoveah ok.. only procs then
16:10:47FromGitter<mratsim> templates just do substitution
16:10:56Araqand ignoring the result of execCmd seems to be a bad idea
16:12:18AraqError: unhandled exception: index -1 not in 0 .. -1 [IndexError]
16:12:19sealmoveif the user wants to run a bunch commands, it seems tedious to prepend them with "discard"
16:13:22Araq-1 not in 0 .. -1 ? hmmm I suppose it isn't
16:13:42narimiran0 .. -1 usually means an empty container
16:13:44*kapil____ quit (Quit: Connection closed for inactivity)
16:14:38narimiranthis is probably some `len - 1` somewhere ;)
16:14:43FromGitter<mratsim> :p
16:15:28FromGitter<mratsim> go users loves their if err = foo()
16:16:03FromGitter<mratsim> but you can do a macro that discard all expressions in a scope.
16:19:30*noeontheend joined #nim
16:19:32narimiranAraq: see here: https://github.com/nim-lang/Nim/pull/10610/files
16:20:11*Trustable joined #nim
16:23:53narimiran(and it seems there are some off-by-one errors there too :))
16:27:13AraqI don't think so
16:28:39narimiranhttps://github.com/nim-lang/Nim/pull/10610/files#diff-f3396a3284b9ca3e52aff3aeef171a09R199 ?
16:29:08narimiranshouldn't there also be -1?
16:31:56AraqI guess, lol
16:31:58Araqbbl
16:42:33*rnrwashere joined #nim
16:43:21*rnrwashere quit (Client Quit)
16:50:53leorizecouldn't `high()` be used instead of `len() - 1`?
16:56:34*rnrwashere joined #nim
16:57:13narimiranleorize: or couldn't `formatErrorIndexBound` template use `n-1`, and then you use `len` everywhere, and that `x.rawType.size div bs` is not OB1 error
17:18:02*rnrwashere quit (Remote host closed the connection)
17:24:07*avsej quit (Ping timeout: 240 seconds)
17:24:55*oprypin quit (Remote host closed the connection)
17:27:02*FromGitter quit (Remote host closed the connection)
17:27:11*avsej joined #nim
17:27:11*avsej quit (Changing host)
17:27:11*avsej joined #nim
17:27:22*FromGitter joined #nim
17:28:10*floppydh quit (Quit: WeeChat 2.3)
17:58:06sealmovemy idea is a failure T_T
18:00:08sealmoveit looks terrible: https://bpaste.net/show/50c05fbbd79b
18:16:26*zachk joined #nim
18:17:41*zachk quit (Read error: Connection reset by peer)
18:17:59*zachk joined #nim
18:18:23*zachk quit (Changing host)
18:18:23*zachk joined #nim
18:29:16FromGitter<dandevelo> What is the difference between: when defined(amd64): and when defined(cpu64): ? Which one should be used to identify a 64-bit target?
18:31:55sealmoveone seems to be for OS and the other for CPU architecture support
18:34:31FromGitter<dandevelo> @sealmove do you have any refs that you can share?
18:34:43sealmovenop
18:35:35*chimez quit (Quit: chimez)
18:39:51*sealmove quit (Quit: WeeChat 2.3)
18:41:42*druonysus joined #nim
18:41:42*druonysus quit (Changing host)
18:41:42*druonysus joined #nim
19:05:41krux02dandevelo: I prefer ``when sizeof(int) == 8:``
19:06:34krux02there are more 64 bit systems than just ``amd64``
19:07:18FromGitter<dandevelo> @krux02 that's true. sizeof(int) == 8 sounds good
19:07:22FromGitter<dandevelo> thanks!
19:08:12FromGitter<dandevelo> Also took a look at the isDefined proc in compiler/options.nim
19:08:44FromGitter<dandevelo> This line: case symbol. normalize of "cpu64": result = CPU[conf.target.targetCPU].bit == 64
19:09:03FromGitter<dandevelo> So I am wondering if cpu64 would also work
19:09:14krux02probably
19:09:25krux02but I think sizeof(int) == 8 is simpler
19:09:40FromGitter<dandevelo> Yes, looks simpler. Thanks again!
19:10:15*nsf quit (Quit: WeeChat 2.3)
19:11:44*sealmove joined #nim
19:11:54*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:18:17*sealmove quit (Quit: WeeChat 2.3)
19:18:24*lritter quit (Quit: Leaving)
19:18:34*sealmove joined #nim
19:19:38*sealmove quit (Client Quit)
19:40:55*Tyresc joined #nim
19:46:17*sealmove joined #nim
20:10:32*Vladar quit (Remote host closed the connection)
20:27:54*sealmove quit (Quit: WeeChat 2.3)
20:35:52*smitop joined #nim
20:36:03smitopHow do I change my password on the forum?
20:44:16*narimiran_ joined #nim
20:45:00*narimiran quit (Ping timeout: 246 seconds)
21:04:24*rnrwashere joined #nim
21:10:24Araqsmitop: I don't think that's possible :-)
21:12:31*Trustable quit (Remote host closed the connection)
21:12:50*krux02 quit (Remote host closed the connection)
21:18:36*narimiran_ is now known as narimiran
21:29:36FromGitter<Varriount> I think you can get a password reset
21:33:20*narimiran quit (Ping timeout: 255 seconds)
21:40:29dom96lol
21:40:32dom96it totally is possible
21:53:41*rnrwashere quit (Remote host closed the connection)
22:01:56*cornfeedhobo quit (Quit: ZNC - https://znc.in)
22:14:47*cornfeedhobo joined #nim
22:38:40*rnrwashere joined #nim
22:51:22FromDiscord<exelotl> dom96: last time I tried to post on the forums I couldn't because my activation link expired and there was no way to request another one :(
22:51:44dom96Okay, so tell me your nick and I'll activate for you
22:52:18FromDiscord<exelotl> exelotl
22:58:28dom96done
23:00:20FromDiscord<exelotl> sweet, thank you!
23:16:19*a_b_m joined #nim
23:18:12*abm quit (Ping timeout: 255 seconds)
23:20:44*vlad1777d joined #nim
23:44:27*leorize quit (Quit: WeeChat 2.3)
23:59:25*sz0 quit (Quit: Connection closed for inactivity)