<< 04-09-2019 >>

00:01:04juturnasIs there a nop statement akin to python's `pass`? For e.g. case branches that don't need any action
00:01:33disruptek`discard`
00:01:59juturnasThanks
00:02:16*cyraxjoe quit (Quit: I'm out!)
00:13:46*absolutejam1 quit (Ping timeout: 258 seconds)
00:24:09*matlock quit (Read error: Connection reset by peer)
00:38:29FromGitter<deech> Is there a simple stack exposed by the standard lib?
00:38:40disruptekdeques?
00:41:37*abm joined #nim
00:43:55*abm quit (Client Quit)
00:55:19*wildtrees quit (Quit: Leaving)
00:57:48FromGitter<awr1> i mean `seq[T]` is essentially a stack
00:57:56FromGitter<awr1> unless you want a deque or something
00:58:26FromGitter<mratsim> just use a seq
00:59:04FromGitter<awr1> use `&=` or `add()` for push, and `pop()` for...popping
01:10:13*cyraxjoe joined #nim
01:20:01*cyraxjoe quit (Quit: I'm out!)
01:20:52*cyraxjoe joined #nim
01:24:30*cyraxjoe quit (Client Quit)
01:25:26*cyraxjoe joined #nim
01:25:26*cyraxjoe quit (Client Quit)
01:37:51*cyraxjoe joined #nim
01:39:23*cyraxjoe quit (Client Quit)
01:40:22*cyraxjoe joined #nim
01:46:36*cyraxjoe quit (Quit: I'm out!)
01:57:00*cyraxjoe joined #nim
02:09:32*endragor joined #nim
02:45:07*laaron- quit (Remote host closed the connection)
02:46:57*laaron joined #nim
03:19:33*laaron- joined #nim
03:19:52*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
03:19:58FromDiscord_<Zuup> Hey, i'm trying to make a lisp language and i'm making type objects, but my ``new_numberobj*`` function is acting weird regaurding the reference it should be returning. in like 11 i get a error saying "Type mismatch: got <ObjectNumber> but expected 'ref ObjectNumber' https://gist.github.com/Pancakeddd/b6bc4dd21755676c6fd9b0898ed39278
03:21:26*a_chou joined #nim
03:22:52*laaron- quit (Remote host closed the connection)
03:23:07*laaron joined #nim
03:24:00*laaron quit (Remote host closed the connection)
03:24:15*laaron joined #nim
03:27:00shashlicktry http://ix.io/1Udv
03:27:16*alexander92 quit (Ping timeout: 246 seconds)
03:34:10*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
03:34:29*laaron joined #nim
03:38:28*chemist69 quit (Ping timeout: 264 seconds)
03:39:55*chemist69 joined #nim
03:46:33FromDiscord_<Zuup> Yep, that worked. Thanks
03:46:45FromDiscord_<Zuup> actually
03:47:11FromDiscord_<Zuup> I need it to return a reference
03:54:36shashlickit is a ref
04:14:27*a_chou quit (Quit: a_chou)
04:26:24*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
04:26:54*laaron joined #nim
04:48:05*nsf joined #nim
04:48:48leorize_Zevv, disruptek: anyone would like an auto conversion to camel-case/snake-case feature for auto completion identifiers?
04:49:03*leorize_ is now known as leorize
04:56:00*narimiran joined #nim
04:59:21*fjellfras joined #nim
05:00:22*juturnas quit (Remote host closed the connection)
05:16:30*solitudesf joined #nim
05:49:50*alexander92 joined #nim
06:01:01shashlickWhy is brew so slow to update
06:15:26leorizeit clones a git repo I think
06:15:42leorizeusually it will only be slow for the first update if it really works like that
06:18:43Araqfor me it's always slow but probably because I run it so rarely
06:20:38*absolutejam1 joined #nim
06:25:12Zevvleorize: no thanks, I'm style agnostic
06:27:21*solitudesf quit (Remote host closed the connection)
06:34:12*solitudesf joined #nim
06:40:53*alexander92 quit (Ping timeout: 245 seconds)
06:41:12*laaron quit (Remote host closed the connection)
06:44:09*laaron joined #nim
06:52:52*PMunch joined #nim
06:56:52*krux02 joined #nim
07:00:00*gmpreussner quit (Quit: kthxbye)
07:04:56*gmpreussner joined #nim
07:08:49PMunchZevv, I see you tried to install packages in the playground. Unfortunately it doesn't have network :P
07:11:24*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
07:11:54*laaron joined #nim
07:14:32PMunchHmm, but no-one replied to my questions about parseUri..
07:17:09*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
07:18:26*laaron joined #nim
07:27:21*owl_000 joined #nim
07:27:40AraqPMunch, I think it's a bug
07:27:43Araqreport it please
07:28:31PMunchOkay, will do
07:30:04*absolutejam1 quit (Ping timeout: 264 seconds)
07:31:51PMunchHmm, this is strange: http://ix.io/1Ue1
07:32:34PMunchchoosenim reports 0.20.2, nim --version reports 0.20.2, the .nimble file specifies 0.20.2, and my vim file specifies that it should use 0.20.2
07:32:44PMunchBut somehow it pulls in 0.20.0 along the way..
07:35:59PMunchApparently there was no compiler-0.20.2 in the .nimble/pkgs directory
07:41:48PMunchAaah, it has requires "nim >= 0.20.2" but only requires "compiler" in the nimble file
07:41:51PMunchThat explains it
07:53:58*couven92 quit (Read error: Connection reset by peer)
07:55:19*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
07:55:58*laaron joined #nim
08:10:52*huuskes quit (Quit: ZNC 1.7.2+deb3 - https://znc.in)
08:12:39*actuallybatman quit (Ping timeout: 264 seconds)
08:15:01PMunchHmm, nimsuggest doesn't work unless compiled with -d:danger
08:16:08*laaron quit (Remote host closed the connection)
08:16:46*laaron joined #nim
08:16:56PMunchhttp://ix.io/1Ue6/
08:17:04PMunchThe output of the last sug command is cut short for brevity
08:17:24PMunchOops, ix messed up the lines: ix.io/1Ue6
08:18:09livcdPMunch: what is wrong with parseUri i cant find your comment
08:18:25*laaron quit (Remote host closed the connection)
08:18:53PMunchWell it started with this: https://github.com/PMunch/nimlsp/issues/23
08:19:08PMunchEssentially URI path elements are a bit weird
08:19:55*laaron joined #nim
08:20:35PMunchThe file:///home/user/file.txt is a shorthand for file://localhost/home/user/file.txt. And the path there is relative to localhosts root folder, which is /. But most people (myself included) just assumed that the leading slash was part of a fully qualified path on the file system.
08:21:02*absolutejam1 joined #nim
08:21:16PMunchBut this assumptions breaks when we enter the Wonky World of Windows where the path now comes out as /C:/whatever
08:22:07PMunchBecause now the path doesn't make sense any longer. What is supposed to be C:/whatever on the host localhost is now given as an invalid path
08:22:16livcdah I get it
08:23:19PMunchBut reading the RFC for URIs (https://tools.ietf.org/html/rfc3986#section-3.3) we see that paths can also not have this separator
08:25:04*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
08:25:13PMunchIf it doesn't have a scheme, or if it is "rootless" whatever that means
08:25:22*laaron joined #nim
08:25:50PMunchFor now I've just accepted the hacky workaround in nimlsp, but it would be really nice if the URI module handled this properly
08:27:15PMunchBut it's still not entirely clear to me if the leading / should be removed or if Windows paths should just have to be put through some special URI-path-to-Windows-path converter
08:27:34PMunchBecause a normal Windows path isn't valid in URIs anyways because of the colon
08:28:13PMunchhttps://en.wikipedia.org/wiki/File_URI_scheme
08:28:26PMunchThis seems to note two different ways of passing these
08:28:29ZevvPMunch: I have a RFC3986 uri parser in NPeg, which also thinks the path is "/C:/Users/moigagoo/Projects/norm/src/norm.nim"
08:30:12PMunchBased on the official ABNF?
08:30:21Zevvack
08:30:30PMunchHmm, yeah that's what I was thinking
08:31:03PMunchSo it seems like the / is to be considered as part of the path, and a special URI-path-to-windows-path converter is needed..
08:39:23*absolutejam1 quit (Ping timeout: 258 seconds)
08:46:21*absolutejam1 joined #nim
08:47:18*fjellfras_ joined #nim
08:47:29*fjellfras quit (Read error: Connection reset by peer)
09:19:58*absolutejam1 quit (Ping timeout: 276 seconds)
09:23:00*laaron quit (Remote host closed the connection)
09:23:43*absolutejam1 joined #nim
09:25:10*laaron joined #nim
09:34:03*fjellfras_ quit (Read error: Connection reset by peer)
09:34:35*fjellfras joined #nim
09:44:10*lritter joined #nim
10:10:14*gangstacat quit (Quit: Ĝis!)
10:13:37leorizePMunch: yea, the nimsuggest thing is only fixed in devel
10:18:54*gangstacat joined #nim
10:19:11PMunchleorize, that was the devel branch. Pulling earlier today
10:20:41leorizeoh, then you should file a bug report
10:21:02AraqPMunch, I think /c:/foo/bar is a valid Windows path
10:21:09PMunchleorize, already done that :)
10:21:44PMunchAraq, I don't have a Windows machine running at the moment, but you can try to run openFile with it and see, pretty sure it fails
10:22:20PMunchThe issue in nimlsp was that it saw that it didn't start with a drive letter and appendend one for you, so the path ended up being C:\C:\foo\boor
10:22:46Araqthat could be a Nim os.nim bug
10:23:03Araqbut nah
10:23:11Araqyou're right, it doesn't work
10:29:15leorizedisruptek, narimiran, Zevv: please pull the latest changes from the 'refactoring' branch :)
10:29:37leorizeI've mostly finished the refactoring at this point :D
10:29:59leorizeplease test every nimsuggest-based features provided by the plugin
10:34:05leorizewhat you should see is less errors (if not none) poping out :P
10:34:35*lritter quit (Quit: Leaving)
10:34:46*ng0 joined #nim
10:34:46leorizeif you have any feature requests, please let me know so I can implement them :)
10:35:46Zevvcan you make it bring me coffee?
10:36:35leorizeno, but I can make it install the latest version of openjdk on your machine :)
10:38:33narimiranZevv: you need emacs for that
10:40:37leorizejust wondering: anyone thought of using nimsuggest-enabled editors as an attack vector?
10:41:27Zevvnarimiran: true
10:44:37*absolutejam1 quit (Ping timeout: 245 seconds)
10:45:38*absolutejam1 joined #nim
10:49:24*laaron quit (Remote host closed the connection)
10:51:16*solitudesf quit (Ping timeout: 258 seconds)
10:51:32*fjellfras quit (Quit: Leaving)
10:52:08*laaron joined #nim
10:57:40*solitudesf joined #nim
10:57:41*solitudesf quit (Read error: Connection reset by peer)
10:58:25*solitudesf joined #nim
11:18:36PMunchleorize, yeah I though about it
11:18:51PMunchWhen I wrote my macro that took AST and wrote a .dot file from it
11:19:15PMunchTurns out every time I saved the document nimlsp would compile it, which would of course overwrite the file on my disk
11:19:58PMunchSo it wouldn't be hard to write a macro that steals some stuff on compile-time, and then if you just open the file in your editor it will execute.
11:24:00*Vladar joined #nim
11:26:34AraqPMunch, if you have a good solution for this I'm all ears
11:26:44AraqI think it's nimsuggest's biggest problem :-)
11:27:09Araqon the other hand, you can't simply *not* evaluate macros
11:29:46PMunchYeah I haven't really thought of anything
11:29:57PMunchApart from somehow disallowing the VM IO access
11:46:12*seni joined #nim
11:50:59Zevvwell, probably not trivial, but what if vm I/O could be differentiated between good and potentially evil? reading a file is ok, but writing not?
11:53:12Zevvbut its a larger problem of course. Compiling a nim program is a dangerous job
11:55:54*Hideki_ joined #nim
11:57:49Araqyeah, writeFile and staticExec are dangerous and must be skipped for nimsuggest
12:09:12*absolutejam1 quit (Read error: Connection reset by peer)
12:14:52PMunchThat would definitely be a good start
12:15:05PMunchOf course that might break some very strange macros..
12:16:08*sacredfrog quit (Quit: ZNC 1.7.4 - https://znc.in)
12:17:31*absolutejam1 joined #nim
12:18:53*cgfuh joined #nim
12:19:54Araqchances are high nimsuggest didn't work with them anyway
12:23:40FromGitter<arnetheduck> hahaha, that's funny, when you're typing something like `staticExec("rm -rf /tmp/mydirectory")` and it runs it at the right moment
12:24:37FromGitter<arnetheduck> the joy of working with a new language, you get to solve all the well known security issues in the world *again*
12:25:31Araqlast time I checked I can add 'rm -rf' to a makefile
12:25:54Araqnot to mention 40K line of generated configure scripts
12:26:12Araqno idea where this "again" comes from, previously it wasn't solved at all
12:27:31FromGitter<arnetheduck> ever heard of excel vb commands running on spreadsheet open?
12:28:22FromGitter<arnetheduck> makefiles don't run while you're typing them out, nimsuggest does
12:28:53shashlickCurse Travis and it's partial logs
12:29:08shashlickAnyone have osx and some time to try a test
12:29:15Araqrunning a build in the background is not unheard of in makefile-using-land
12:29:56Araqand btw I usually compile programs to *run* them afterwards
12:30:22Araqso the attack surface is "every line of code, really"
12:30:29Zevvwhat is 'gorge'?
12:31:19ZevvAraq: I share your point on view on this, but not fixing this is waiting for someone to go haywire over it and exclaiming nim is a crappy language because of this kind of things
12:31:43PMunchWell the thing with this is that code can run as soon as you open your editor, which isn't great..
12:31:48ZevvAnd opening my editor on a file is different then running make.
12:31:50Zevvright
12:31:59Zevvits not the kind of side effect I like to run into
12:32:47PMunchI'm not it actually happens on file open though
12:32:52PMunchBut it might happen on hover..
12:32:58AraqI agree it's bad and I'll fix it, but "security" simply doesn't exist
12:33:16Araqthe OSes are simply not designed for security
12:33:36Zevvno, its a sliding scale. And execing things when you open a file in your editor is below *not* execing something when you open your editor.
12:34:22Zevvand also, if not for security, for the sake of protecting users like me against their own stupidity
12:34:38Zevvoh wait, then I will no longer be able to write these nifty graphs from npeg! :)
12:34:45leorizePMunch: unless you use my nvim plugin
12:35:12leorizethat thing spawns a nimsuggest instance for every project
12:35:36FromGitter<arnetheduck> this isn't even security.. in my example you're doing it to yourself as you type..
12:35:38leorizeI've just tested writing `static: writeFile("/tmp/test", "pwned!")`
12:35:51leorizeand it wrote that file after I close the paren
12:36:08Araqexactly, it isn't "security", it's a bad user experience.
12:36:16ZevvOh, good for you. I just tested with static: execStatic("rm -rf ~") :(
12:36:23FromGitter<arnetheduck> so imagine that editors usually automatically close parens and quotes
12:36:45FromGitter<arnetheduck> meaning you start typing inside a ready function call already which parses and all
12:36:52leorizethe ultimate exploit would be this: https://thejh.net/misc/website-terminal-copy-paste
12:36:55leorizebut for nim code :P
12:43:06*endragor quit (Remote host closed the connection)
12:46:07*endragor joined #nim
12:46:33PMuncharnetheduck, if it auto closes parens and quotes it could get real ugly real fast as you're typing "rm -rf" and then a path, you will wipe every file and directory as you start typing..
12:46:43PMunchleorize, nimlsp also has an instance per project
12:47:13PMunchZevv, it should still be allowed to do these things, but with a switch
12:47:22PMunchSo nimsuggest could disable IO
12:47:48ZevvPMunch: Yeah of course, I was just trolling
12:50:27*endragor quit (Ping timeout: 245 seconds)
13:06:57*clyybber joined #nim
13:09:25FromGitter<mratsim> I'm pretty sure I already raised such a bug
13:09:30clyybberWhat parts of sqlite are actually used by the compiler?
13:09:35*abm joined #nim
13:13:21*clyybber quit (Remote host closed the connection)
13:14:11*clyybber joined #nim
13:17:43FromGitter<mratsim> Same discussion: https://irclogs.nim-lang.org/13-05-2019.html#15:36:04
13:19:25*clyybber quit (Remote host closed the connection)
13:19:56*clyybber joined #nim
13:20:02*clyybber quit (Client Quit)
13:22:05Araqmratsim: it's related but not the same discussion
13:27:07*simple_idiot joined #nim
13:31:10simple_idiothey everyone. i stumbled upon nim today, and I'd like to ask how hard it is to learn, because I've been interested in learning a system programming language for a while but I can currently only code in Java (not even that good at it tbh). so, how hard is it for newcomers that aren't used to it? my end goal was to be able to make simple 2d platforme
13:31:11simple_idiotrs
13:32:14Zevvdepends on your experience with other languages and platforms I guess
13:33:22Araqfollow our tutorials and see for yourself
13:33:41narimiransimple_idiot: check https://nim-lang.org/learn.html
13:33:43Araqhardest will probably to setup and use the 2d library
13:34:46narimiranhardest will probably be letting go of OOP :P
13:36:18FromGitter<mratsim> forget about getters and setters and 90% of the work is done :p
13:36:52simple_idiotthanks a lot
13:37:55FromGitter<mratsim> Anyway I think Nim is good and maybe Rust as well. C/C++, Rust would be a big jump due to the low-level memory management that you need to learn from the start while Nim allows you to learn it only if you actually need it.
13:38:02FromGitter<mratsim> maybe D as well*
13:38:11narimiransimple_idiot: feel free to ask the questions here if/when you stumble upon some problem
13:43:04*simple_idiot quit (Remote host closed the connection)
13:53:48*endragor joined #nim
13:55:20PMunchNo one pointed simple_idiot to: https://hookrace.net/blog/writing-a-2d-platform-game-in-nim-with-sdl2/ =
13:55:41PMunchThat was one of my starting points when I looked at Nim, and it fits his bill of making 2D platformers perfectly
13:55:49PMunchThere are some things there though that are out of date.
13:56:10PMunchIIRC
14:00:23*PMunch quit (Remote host closed the connection)
14:04:00*leorize_ joined #nim
14:04:12*leorize quit (Ping timeout: 260 seconds)
14:05:19FromGitter<awr1> nimscript needs like specific mechanisms for sandboxing, e.g. like getting rid of all the I/O stuff
14:07:30shashlickseems like the playground restrictions apply in general as well
14:11:37*nsf quit (Quit: WeeChat 2.5)
14:12:04Calinoushashlick: you could make Travis upload the logs somewhere, using the shell alias in https://transfer.sh/ or curl directly with https://0x0.st/ ;)
14:12:28*absolutejam1 quit (Ping timeout: 276 seconds)
14:14:23shashlick@Calinou - does that mean i have to save the console logs myself and upload or is the default log available somewhere
14:14:56Calinoudoes Travis stop your build if the log gets too large, or does it just trim it?
14:15:27Calinouin any case, you can redirect all the output to a file to upload, and print something every few minutes to prevent Travis from stopping your build because of inactivity
14:15:33Calinou(you need to print at least 1 character every 10 minutes)
14:15:45Calinouor try Azure Pipelines… :)
14:21:35shashlickan example will be great if you have one
14:21:45shashlickbut it just trims on failure and no way to know why it failed
14:23:47*absolutejam1 joined #nim
14:26:12*dddddd joined #nim
14:26:29*clyybber joined #nim
14:30:45disruptekleorize_: i just switched to `refactoring`, but the only issues i've noticed lately are a loss of syntax highlighting here and there.
14:30:52*leorize_ is now known as leorize
14:31:08leorizeoh, can I have a test example?
14:31:24leorizeCalinou: well I did set up Azure for Nim
14:31:26disrupteksure, if'n i get hit again.
14:31:28leorizeit's unmerged
14:31:39leorizenot merged*
14:31:50Araqleorize, we are still working on it
14:31:56Araqtests are/were red
14:32:07narimiranleorize: i had some problem setting it up, but it is on our todo list, it is not forgotten
14:32:24Calinoushashlick: do you have a single command that writes lots of output, or is it multiple commands?
14:32:49leorizeI still don't know why windows and osx is unstable there :P
14:32:55Araqawr1: actually nimscript has sandboxing options but nimsuggest doesn't use them...
14:33:02Calinouif it's a single command, use `some_command 2>&1 > output.txt` then upload `output.txt` using one of the tools I mentioned
14:33:05Calinou(during the Travis step, that is)
14:33:09shashlick@Calinou - i can start with one
14:33:10Araqspeaking of which ... VS code calls 'nim check' interactively
14:33:13shashlicknimble test
14:33:27Araqso 'nim check' should also diverge from 'nim c' then?
14:33:58leorizeI don't think so
14:33:58shashlicki could debug my linux build with a local docker instance of travis
14:34:02shashlickbut no luck with osx
14:34:09Calinouwait, that doesn't work
14:34:20CalinouI guess, just use the bashism &> for now :P
14:34:26Calinounimble test &> output.txt
14:34:30Calinouit should be fine to use in Travis
14:35:35disrupteki didn't realize `nim doc` could fail due to the content of a comment.
14:35:45shashlickwell that would mean no output to travis console
14:35:50shashlickperhaps i need to use tee
14:36:21disruptekfun part is that it fails with `ERecoverableError` 🙄
14:37:21*Hideki_ quit (Remote host closed the connection)
14:37:51leorizeAraq: disabling staticExec does have the side-effect of packages like nimterop won't work anymore :(
14:38:28*owl_000 quit (Ping timeout: 264 seconds)
14:38:34shashlick@Calinou - but if the command fails, there's no way to run a step after that
14:38:42Araqremember the context, nimsuggest shouldn't build nimterop packages
14:38:51Calinoushashlick: yeah, you can use tee for that
14:38:56Calinouhttps://stackoverflow.com/questions/637827/redirect-stderr-and-stdout-in-bash
14:39:38leorizeAraq: well, just in case you ever decide to diverge `nim check` from `nim c`
14:39:48Araqsame
14:39:57Araq'nim check' shouldn't build nimterop packages
14:40:21shashlick@Calinou - I'll use after_failed
14:40:38leorizewell a noticible side-effect would be that nimsuggest consider every call to any of nimterop-generated symbols an error
14:41:06leorizewhich would mean a lot of red coloring in some of my code...
14:41:48Araqbuild it once and rely on a persistent cache that nimsuggest understands?
14:42:29leorizeyou can do that?
14:43:13shashlickI guess an option is to check if nimsuggest mode and just return success
14:43:18Araqyou run 'nim c foo' it produces stuff.nim as a side-effect
14:43:18shashlickof course then no symbols will work
14:43:32Araqand then nimsuggest doesn't update stuff.nim but picks it up
14:43:35Araqwhat's the problem?
14:43:49leorizeI don't think nimterop works that way currently
14:44:37*sagax quit (Ping timeout: 245 seconds)
14:45:31Araqmaybe it should work this way
14:46:54disruptekthat's actually how my api generator works; seems fine.
14:47:29shashlickright now nimterop runs staticExec to convert h => nim and then uses parseStmt to pull the generated Nim in
14:47:31disruptekmy macro writes a foo.nim and merely yields ast to import it, so it gets imported "normally" as part of compilation.
14:47:49shashlickit uses gorgeEx cache as well to avoid running every time
14:49:24Zevvleorize: do you happen to know to what level nimsuggest does error checking? Not sure how to explain my question, but for example this compile-time errors but does not show errors in my editor: http://ix.io/1Ufl
14:49:59leorizefor `highlight` it's symbol-level
14:50:13leorizeerrors are only generated by unknown symbols
14:50:27Zevvis that a nimsuggest choice or a nim.vim choice?
14:50:35leorizenimsuggest choice
14:50:48Zevvok, makes sense. I guess it would become pretty heavy otherwise
14:51:03leorizeone of those many linter plugin does support automated linting if you want that :P
14:51:35ZevvNo, not really. I was just wondering if it would be possible to have my macro-induced errors show in highlighting.
14:57:22leorizeI'd say a little meddling with `chk` command and you will even have a nice annotated text next to your error line :P
14:57:42leorizebut again, maybe one of those auto linters has already done so
15:00:06disrupteki wonder if you could just do a tree diff on the ast to some positive effect.
15:00:14shashlick@dom96 - https://github.com/nim-lang/nimble/pull/697
15:02:06*Hideki_ joined #nim
15:02:18*endragor quit (Remote host closed the connection)
15:02:42*frost_red joined #nim
15:03:05*Hideki_ quit (Remote host closed the connection)
15:03:26FromGitter<awr1> @Araq can you link me to these sandboxing options?
15:03:52Araqgrep for 'nimcore'
15:04:06Araqby default it's even disabled
15:04:17Araqand only the Nim tools use it
15:04:31Araqturned out, not good enough :P
15:05:23FromGitter<awr1> k thanks
15:07:56leorizelooks like it's not possible to determistically detect the main project file of a project :/
15:08:09ZevvI've heard that before
15:08:28*absolutejam1 quit (Ping timeout: 264 seconds)
15:09:01Araqproc findProjectNimFile*(conf: ConfigRef; pkg: string): string
15:09:09Araqin compiler/options.nim
15:09:24Araqit's deterministic code because it doesn't use rand()
15:09:34Zevv:)
15:09:36disruptekneat trick.
15:10:28leorizeso... nimsuggest can use a directory for real?
15:10:37leorizethis simplify everything
15:11:05AraqI keep bringing it up, nothing changes
15:11:31leorizewell, this usage line is certainly not helping: nimsuggest [options] projectfile.nim
15:11:42FromGitter<awr1> since `staticExec()` etc. can be used for nefarious reasons i have wondered if there a command line option to display a prompt to approve every execution. obviously this is not useful for nimsuggest's problem...
15:12:23leorizea global toggle is much better
15:13:02FromGitter<awr1> nake had `--careful` which is kind of in that spirit
15:13:11FromGitter<awr1> but it wasn't foolproof
15:13:11*Hideki_ joined #nim
15:13:20*Hideki_ quit (Remote host closed the connection)
15:13:56*Hideki_ joined #nim
15:14:18disruptekhow are you liking nim, Hideki_? any problems?
15:14:50Araqideally you use an OS that doesn't allow random pieces of software to delete files or upload files
15:15:11FromGitter<mratsim> Virtualbox?
15:15:16disruptekselinux and carry on
15:15:17Araqwhere capabilities are assigned to processes, not to users
15:15:36FromGitter<mratsim> but I want Nim to work in the real world ...
15:15:46FromGitter<mratsim> without deleting it
15:16:01disruptekwhen you get there, lemme know how it is.
15:16:11FromGitter<mratsim> empty
15:16:26disruptekthe grass is always greener.
15:17:57leorizethe bsds and linux can do the capabilities thing to an extent
15:18:10FromGitter<awr1> personally i have found `staticExec()` useful primarily in the sense of "bits and pieces of things that nimvm doesn't want to be able to do." for instance I don't think `downloadFile()` was available in the VM, so i had to do this weird thing where I `curl()` (or the powershell equivalent) to get a specific file (but i'm sure for some, downloading files from the internet counts as a thing sandboxed VMs shouldn't do)
15:18:22leorizepledge() is straightforward, but seccomp is a nightmare
15:18:44FromGitter<awr1> also `staticExec()` has caching.
15:19:03Araqawr1: downloadFile is dangerous too :-)
15:19:25livcdwhat are the limitations for => from sugar ?
15:19:38*Hideki_ quit (Ping timeout: 245 seconds)
15:19:53Araqthe intersection between useful and dangerous is huge
15:19:55FromGitter<awr1> yeah i suppose it is :/
15:19:56disruptekbasically that too much sugar will give you cancer of the semicolon.
15:20:00livcd:D
15:20:28Zevvwow, thats a baaaaad pun
15:20:51disruptekoldie.
15:20:53*shashlick quit (Ping timeout: 245 seconds)
15:21:07disruptektoo much syntactic sugar, that is.
15:21:17ZevvI figured :)
15:21:21FromGitter<awr1> it seems weird that we worry about about the security of compile-time mechanisms in spite of things possible runtime nefarious. but of course, you can put the executable you get in a "real sandbox"
15:21:41FromGitter<awr1> like qemu or docker or something
15:22:08Zevvawr1: it was about funny things happening while your code is being "run" by nimsuggest
15:22:10disruptekif you don't trust the code to run it, why are you bothering to compile it?
15:22:36ZevvI have a staticWrite in my code, and every time I type a bit in my editor, it writes a file to disk
15:22:40disruptekjust require the execute bit on your source code in order to staticExec. :-P
15:22:56FromGitter<awr1> @disruptek i feel similarly
15:23:12disruptekwell, you should. it's a good idea.
15:23:18AraqZevv, yeah, it is really bad, a showstopper.
15:24:26FromGitter<awr1> but it becomes weird when you consider the possibility of certain attack vectors...specifically what comes to mind are compromised nimble packages
15:24:52FromGitter<awr1> which, thankfully, we have been as of current spared from having to deal with.
15:24:54FromGitter<awr1> i hope, anyway.
15:24:58Araqthat's where we disagree
15:25:21FromGitter<awr1> but i have heard of this type of thing in npm etc
15:25:47Araqexactly, this problem is everywhere and unrelated to "nimsuggest runs staticExec"
15:26:19Araqthe "attack vector" still is "every line of code", nothing changed.
15:26:31Araqit's already so bad that nothing can make it worse :P
15:26:42*clyybber quit (Ping timeout: 245 seconds)
15:27:02*frost_red quit (Quit: Konversation terminated!)
15:27:12*nif quit (Quit: ...)
15:27:15Araqnow let me get back to program in C+makefile where I configured the build so that 'make' runs in the background when one of my source files changed...
15:27:21*nif joined #nim
15:27:48disrupteka source code filter that twiddles staticExec but only in the compiler or vice-versa.
15:28:32*clyybber joined #nim
15:28:46disruptekmaybe it's a source code filter that can be overridden by the execute bit.
15:28:49FromGitter<awr1> there should at the least be some documentation on the current situation w/r/t this somewhere
15:29:11disruptekit's not new; comes up every couple months.
15:29:28FromGitter<awr1> that doesn't surprise me
15:29:31FromGitter<awr1> nevertheless...
15:31:24FromGitter<awr1> `staticRead()` can theoretically be put on a leash, by constraining its paths to the project dir
15:31:44FromGitter<awr1> and, i assume, taking caution with symlinks
15:33:01*zyklon joined #nim
15:35:19disruptekwell, you can write code that runs in the compiler and writes code that runs in the compiler and writes code that runs in the compiler.
15:35:43disrupteki think that leash is longer than you realize.
15:37:16*uvegbot quit (Ping timeout: 264 seconds)
15:40:04*Trustable joined #nim
15:41:16FromGitter<awr1> also w/r/t to the prompt thing: emacs does something similar with untrusted code (e.g. in `.dir-locals.el`), and also gives you an ability to "remember" certain code as trusted
15:47:05*doesntgolf joined #nim
15:47:15*Hideki_ joined #nim
15:49:48FromGitter<awr1> nim just needs a big stupid disclaimer: "don't do nefarious things" :P
15:51:08FromGitter<dawkot> can you call a macro with indented `of` nodes, the same way you can with `case`?
15:51:36*clyybber quit (Remote host closed the connection)
15:51:47FromGitter<dawkot> indended :P
15:52:25*clyybber joined #nim
15:53:00*Trustable quit (Remote host closed the connection)
15:54:37*cyraxjoe quit (Quit: I'm out!)
15:55:32*cyraxjoe joined #nim
15:56:56*clyybber quit (Client Quit)
16:01:18*snooptek quit (Remote host closed the connection)
16:05:04FromDiscord_<exelotl> At some points in my project I generate identifiers based on all the files in a given directory (by parsing staticExec("ls"))
16:05:31FromDiscord_<exelotl> Would be nice to be able to keep doing that and still have autocomplete
16:06:24FromDiscord_<exelotl> But I understand that this freedom can be dangerous
16:07:54*Hideki_ quit (Ping timeout: 258 seconds)
16:12:30*wildtrees joined #nim
16:12:30*Vladar quit (Remote host closed the connection)
16:12:53*Vladar joined #nim
16:13:21*wildtrees quit (Max SendQ exceeded)
16:26:27*theelous3 joined #nim
16:47:40*actuallybatman joined #nim
17:06:43*juturnas joined #nim
17:22:57*abm quit (Quit: Leaving)
17:33:21lqdev[m]@exelotl don't do `staticExec("ls")`
17:33:26lqdev[m]it's not cross-platform
17:33:44lqdev[m]remember that windows uses `dir/w` to list files and the format is way different
17:34:00lqdev[m]list files: in an ls-like fashion
17:53:38*rockcavera quit (Remote host closed the connection)
17:56:16*xet7 quit (Quit: Leaving)
17:59:00*xet7 joined #nim
18:00:18juturnasLooking at the base64 functions in the stdlib - seems odd to me that `decode` quietly swallows non-base64 characters instead of raising or returning an option. Is that sort of behavior common or idiomatic in nim code?
18:32:01*nsf joined #nim
18:39:57*mfiano left #nim ("WeeChat 2.5")
18:52:49*cyraxjoe quit (Quit: I'm out!)
18:53:35*cyraxjoe joined #nim
19:00:33FromDiscord_<exelotl> lqdev[m]: my project is only for use with a certain toolchain (devkitARM) so ls is guaranteed to be available
19:00:55lqdev[m]fine then
19:01:54*rockcavera joined #nim
19:05:28FromDiscord_<exelotl> would be nice if there was a cross platform way to do it though
19:06:14FromDiscord_<exelotl> like if some features of the os module were available at compile time or something
19:07:25*krux02 quit (Ping timeout: 250 seconds)
19:08:03FromGitter<mratsim> maybe: https://github.com/nim-lang/Nim/pulls?q=is%3Apr+compileTimeFFI+is%3Aclosed
19:11:34*Hideki_ joined #nim
19:14:34*doesntgolf quit (Ping timeout: 258 seconds)
19:15:47*Hideki_ quit (Ping timeout: 244 seconds)
19:20:56*arecaceae quit (Remote host closed the connection)
19:21:36*arecaceae joined #nim
19:23:18*absolutejam1 joined #nim
20:12:04*jfoutaise quit (Ping timeout: 258 seconds)
20:12:57*narimiran quit (Ping timeout: 245 seconds)
20:13:34*jfoutaise joined #nim
20:35:18*Ven`` joined #nim
20:38:09*sagax joined #nim
20:48:49*nsf quit (Quit: WeeChat 2.5)
20:52:35*Ven`` quit (Read error: Connection reset by peer)
21:09:00Araqjuturnas: no, it's simply really old code
21:15:57*setenforce left #nim ("ERC (IRC client for Emacs 27.0.50)")
21:16:05*setenforce joined #nim
21:31:44*seni quit (Quit: Leaving)
21:41:52*krux02 joined #nim
21:53:37*solitudesf quit (Ping timeout: 246 seconds)
22:28:22*juturnas quit (Ping timeout: 245 seconds)
22:45:04*absolutejam1 quit (Ping timeout: 264 seconds)
22:56:00FromDiscord_<DarkAlpha_Sete> What color theme does the Nim website use for code? It's really nice.
23:04:10*owl_000 joined #nim
23:06:27*uvegbot joined #nim
23:06:40*zyklon quit (Ping timeout: 264 seconds)
23:09:36*Vladar quit (Remote host closed the connection)
23:13:15*Hideki_ joined #nim
23:17:36*Hideki_ quit (Ping timeout: 258 seconds)
23:45:23*krux02_ joined #nim
23:48:04*krux02 quit (Ping timeout: 264 seconds)
23:55:38*ng0 quit (Quit: Alexa, when is the end of world?)