00:01:04 | juturnas | Is there a nop statement akin to python's `pass`? For e.g. case branches that don't need any action |
00:01:33 | disruptek | `discard` |
00:01:59 | juturnas | Thanks |
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:29 | FromGitter | <deech> Is there a simple stack exposed by the standard lib? |
00:38:40 | disruptek | deques? |
00:41:37 | * | abm joined #nim |
00:43:55 | * | abm quit (Client Quit) |
00:55:19 | * | wildtrees quit (Quit: Leaving) |
00:57:48 | FromGitter | <awr1> i mean `seq[T]` is essentially a stack |
00:57:56 | FromGitter | <awr1> unless you want a deque or something |
00:58:26 | FromGitter | <mratsim> just use a seq |
00:59:04 | FromGitter | <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:58 | FromDiscord_ | <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:00 | shashlick | try 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:33 | FromDiscord_ | <Zuup> Yep, that worked. Thanks |
03:46:45 | FromDiscord_ | <Zuup> actually |
03:47:11 | FromDiscord_ | <Zuup> I need it to return a reference |
03:54:36 | shashlick | it 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:48 | leorize_ | 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:01 | shashlick | Why is brew so slow to update |
06:15:26 | leorize | it clones a git repo I think |
06:15:42 | leorize | usually it will only be slow for the first update if it really works like that |
06:18:43 | Araq | for me it's always slow but probably because I run it so rarely |
06:20:38 | * | absolutejam1 joined #nim |
06:25:12 | Zevv | leorize: 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:49 | PMunch | Zevv, 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:32 | PMunch | Hmm, 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:40 | Araq | PMunch, I think it's a bug |
07:27:43 | Araq | report it please |
07:28:31 | PMunch | Okay, will do |
07:30:04 | * | absolutejam1 quit (Ping timeout: 264 seconds) |
07:31:51 | PMunch | Hmm, this is strange: http://ix.io/1Ue1 |
07:32:34 | PMunch | choosenim 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:44 | PMunch | But somehow it pulls in 0.20.0 along the way.. |
07:35:59 | PMunch | Apparently there was no compiler-0.20.2 in the .nimble/pkgs directory |
07:41:48 | PMunch | Aaah, it has requires "nim >= 0.20.2" but only requires "compiler" in the nimble file |
07:41:51 | PMunch | That 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:01 | PMunch | Hmm, 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:56 | PMunch | http://ix.io/1Ue6/ |
08:17:04 | PMunch | The output of the last sug command is cut short for brevity |
08:17:24 | PMunch | Oops, ix messed up the lines: ix.io/1Ue6 |
08:18:09 | livcd | PMunch: what is wrong with parseUri i cant find your comment |
08:18:25 | * | laaron quit (Remote host closed the connection) |
08:18:53 | PMunch | Well it started with this: https://github.com/PMunch/nimlsp/issues/23 |
08:19:08 | PMunch | Essentially URI path elements are a bit weird |
08:19:55 | * | laaron joined #nim |
08:20:35 | PMunch | The 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:16 | PMunch | But this assumptions breaks when we enter the Wonky World of Windows where the path now comes out as /C:/whatever |
08:22:07 | PMunch | Because 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:16 | livcd | ah I get it |
08:23:19 | PMunch | But 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:13 | PMunch | If it doesn't have a scheme, or if it is "rootless" whatever that means |
08:25:22 | * | laaron joined #nim |
08:25:50 | PMunch | For 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:15 | PMunch | But 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:34 | PMunch | Because a normal Windows path isn't valid in URIs anyways because of the colon |
08:28:13 | PMunch | https://en.wikipedia.org/wiki/File_URI_scheme |
08:28:26 | PMunch | This seems to note two different ways of passing these |
08:28:29 | Zevv | PMunch: I have a RFC3986 uri parser in NPeg, which also thinks the path is "/C:/Users/moigagoo/Projects/norm/src/norm.nim" |
08:30:12 | PMunch | Based on the official ABNF? |
08:30:21 | Zevv | ack |
08:30:30 | PMunch | Hmm, yeah that's what I was thinking |
08:31:03 | PMunch | So 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:37 | leorize | PMunch: yea, the nimsuggest thing is only fixed in devel |
10:18:54 | * | gangstacat joined #nim |
10:19:11 | PMunch | leorize, that was the devel branch. Pulling earlier today |
10:20:41 | leorize | oh, then you should file a bug report |
10:21:02 | Araq | PMunch, I think /c:/foo/bar is a valid Windows path |
10:21:09 | PMunch | leorize, already done that :) |
10:21:44 | PMunch | Araq, 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:20 | PMunch | The 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:46 | Araq | that could be a Nim os.nim bug |
10:23:03 | Araq | but nah |
10:23:11 | Araq | you're right, it doesn't work |
10:29:15 | leorize | disruptek, narimiran, Zevv: please pull the latest changes from the 'refactoring' branch :) |
10:29:37 | leorize | I've mostly finished the refactoring at this point :D |
10:29:59 | leorize | please test every nimsuggest-based features provided by the plugin |
10:34:05 | leorize | what 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:46 | leorize | if you have any feature requests, please let me know so I can implement them :) |
10:35:46 | Zevv | can you make it bring me coffee? |
10:36:35 | leorize | no, but I can make it install the latest version of openjdk on your machine :) |
10:38:33 | narimiran | Zevv: you need emacs for that |
10:40:37 | leorize | just wondering: anyone thought of using nimsuggest-enabled editors as an attack vector? |
10:41:27 | Zevv | narimiran: 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:36 | PMunch | leorize, yeah I though about it |
11:18:51 | PMunch | When I wrote my macro that took AST and wrote a .dot file from it |
11:19:15 | PMunch | Turns out every time I saved the document nimlsp would compile it, which would of course overwrite the file on my disk |
11:19:58 | PMunch | So 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:34 | Araq | PMunch, if you have a good solution for this I'm all ears |
11:26:44 | Araq | I think it's nimsuggest's biggest problem :-) |
11:27:09 | Araq | on the other hand, you can't simply *not* evaluate macros |
11:29:46 | PMunch | Yeah I haven't really thought of anything |
11:29:57 | PMunch | Apart from somehow disallowing the VM IO access |
11:46:12 | * | seni joined #nim |
11:50:59 | Zevv | well, 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:12 | Zevv | but its a larger problem of course. Compiling a nim program is a dangerous job |
11:55:54 | * | Hideki_ joined #nim |
11:57:49 | Araq | yeah, writeFile and staticExec are dangerous and must be skipped for nimsuggest |
12:09:12 | * | absolutejam1 quit (Read error: Connection reset by peer) |
12:14:52 | PMunch | That would definitely be a good start |
12:15:05 | PMunch | Of 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:54 | Araq | chances are high nimsuggest didn't work with them anyway |
12:23:40 | FromGitter | <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:37 | FromGitter | <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:31 | Araq | last time I checked I can add 'rm -rf' to a makefile |
12:25:54 | Araq | not to mention 40K line of generated configure scripts |
12:26:12 | Araq | no idea where this "again" comes from, previously it wasn't solved at all |
12:27:31 | FromGitter | <arnetheduck> ever heard of excel vb commands running on spreadsheet open? |
12:28:22 | FromGitter | <arnetheduck> makefiles don't run while you're typing them out, nimsuggest does |
12:28:53 | shashlick | Curse Travis and it's partial logs |
12:29:08 | shashlick | Anyone have osx and some time to try a test |
12:29:15 | Araq | running a build in the background is not unheard of in makefile-using-land |
12:29:56 | Araq | and btw I usually compile programs to *run* them afterwards |
12:30:22 | Araq | so the attack surface is "every line of code, really" |
12:30:29 | Zevv | what is 'gorge'? |
12:31:19 | Zevv | Araq: 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:43 | PMunch | Well the thing with this is that code can run as soon as you open your editor, which isn't great.. |
12:31:48 | Zevv | And opening my editor on a file is different then running make. |
12:31:50 | Zevv | right |
12:31:59 | Zevv | its not the kind of side effect I like to run into |
12:32:47 | PMunch | I'm not it actually happens on file open though |
12:32:52 | PMunch | But it might happen on hover.. |
12:32:58 | Araq | I agree it's bad and I'll fix it, but "security" simply doesn't exist |
12:33:16 | Araq | the OSes are simply not designed for security |
12:33:36 | Zevv | no, 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:22 | Zevv | and also, if not for security, for the sake of protecting users like me against their own stupidity |
12:34:38 | Zevv | oh wait, then I will no longer be able to write these nifty graphs from npeg! :) |
12:34:45 | leorize | PMunch: unless you use my nvim plugin |
12:35:12 | leorize | that thing spawns a nimsuggest instance for every project |
12:35:36 | FromGitter | <arnetheduck> this isn't even security.. in my example you're doing it to yourself as you type.. |
12:35:38 | leorize | I've just tested writing `static: writeFile("/tmp/test", "pwned!")` |
12:35:51 | leorize | and it wrote that file after I close the paren |
12:36:08 | Araq | exactly, it isn't "security", it's a bad user experience. |
12:36:16 | Zevv | Oh, good for you. I just tested with static: execStatic("rm -rf ~") :( |
12:36:23 | FromGitter | <arnetheduck> so imagine that editors usually automatically close parens and quotes |
12:36:45 | FromGitter | <arnetheduck> meaning you start typing inside a ready function call already which parses and all |
12:36:52 | leorize | the ultimate exploit would be this: https://thejh.net/misc/website-terminal-copy-paste |
12:36:55 | leorize | but for nim code :P |
12:43:06 | * | endragor quit (Remote host closed the connection) |
12:46:07 | * | endragor joined #nim |
12:46:33 | PMunch | arnetheduck, 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:43 | PMunch | leorize, nimlsp also has an instance per project |
12:47:13 | PMunch | Zevv, it should still be allowed to do these things, but with a switch |
12:47:22 | PMunch | So nimsuggest could disable IO |
12:47:48 | Zevv | PMunch: Yeah of course, I was just trolling |
12:50:27 | * | endragor quit (Ping timeout: 245 seconds) |
13:06:57 | * | clyybber joined #nim |
13:09:25 | FromGitter | <mratsim> I'm pretty sure I already raised such a bug |
13:09:30 | clyybber | What 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:43 | FromGitter | <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:05 | Araq | mratsim: it's related but not the same discussion |
13:27:07 | * | simple_idiot joined #nim |
13:31:10 | simple_idiot | hey 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:11 | simple_idiot | rs |
13:32:14 | Zevv | depends on your experience with other languages and platforms I guess |
13:33:22 | Araq | follow our tutorials and see for yourself |
13:33:41 | narimiran | simple_idiot: check https://nim-lang.org/learn.html |
13:33:43 | Araq | hardest will probably to setup and use the 2d library |
13:34:46 | narimiran | hardest will probably be letting go of OOP :P |
13:36:18 | FromGitter | <mratsim> forget about getters and setters and 90% of the work is done :p |
13:36:52 | simple_idiot | thanks a lot |
13:37:55 | FromGitter | <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:02 | FromGitter | <mratsim> maybe D as well* |
13:38:11 | narimiran | simple_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:20 | PMunch | No one pointed simple_idiot to: https://hookrace.net/blog/writing-a-2d-platform-game-in-nim-with-sdl2/ = |
13:55:41 | PMunch | That was one of my starting points when I looked at Nim, and it fits his bill of making 2D platformers perfectly |
13:55:49 | PMunch | There are some things there though that are out of date. |
13:56:10 | PMunch | IIRC |
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:19 | FromGitter | <awr1> nimscript needs like specific mechanisms for sandboxing, e.g. like getting rid of all the I/O stuff |
14:07:30 | shashlick | seems like the playground restrictions apply in general as well |
14:11:37 | * | nsf quit (Quit: WeeChat 2.5) |
14:12:04 | Calinou | shashlick: 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:23 | shashlick | @Calinou - does that mean i have to save the console logs myself and upload or is the default log available somewhere |
14:14:56 | Calinou | does Travis stop your build if the log gets too large, or does it just trim it? |
14:15:27 | Calinou | in 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:33 | Calinou | (you need to print at least 1 character every 10 minutes) |
14:15:45 | Calinou | or try Azure Pipelines… :) |
14:21:35 | shashlick | an example will be great if you have one |
14:21:45 | shashlick | but 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:45 | disruptek | leorize_: 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:08 | leorize | oh, can I have a test example? |
14:31:24 | leorize | Calinou: well I did set up Azure for Nim |
14:31:26 | disruptek | sure, if'n i get hit again. |
14:31:28 | leorize | it's unmerged |
14:31:39 | leorize | not merged* |
14:31:50 | Araq | leorize, we are still working on it |
14:31:56 | Araq | tests are/were red |
14:32:07 | narimiran | leorize: i had some problem setting it up, but it is on our todo list, it is not forgotten |
14:32:24 | Calinou | shashlick: do you have a single command that writes lots of output, or is it multiple commands? |
14:32:49 | leorize | I still don't know why windows and osx is unstable there :P |
14:32:55 | Araq | awr1: actually nimscript has sandboxing options but nimsuggest doesn't use them... |
14:33:02 | Calinou | if 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:05 | Calinou | (during the Travis step, that is) |
14:33:09 | shashlick | @Calinou - i can start with one |
14:33:10 | Araq | speaking of which ... VS code calls 'nim check' interactively |
14:33:13 | shashlick | nimble test |
14:33:27 | Araq | so 'nim check' should also diverge from 'nim c' then? |
14:33:58 | leorize | I don't think so |
14:33:58 | shashlick | i could debug my linux build with a local docker instance of travis |
14:34:02 | shashlick | but no luck with osx |
14:34:09 | Calinou | wait, that doesn't work |
14:34:20 | Calinou | I guess, just use the bashism &> for now :P |
14:34:26 | Calinou | nimble test &> output.txt |
14:34:30 | Calinou | it should be fine to use in Travis |
14:35:35 | disruptek | i didn't realize `nim doc` could fail due to the content of a comment. |
14:35:45 | shashlick | well that would mean no output to travis console |
14:35:50 | shashlick | perhaps i need to use tee |
14:36:21 | disruptek | fun part is that it fails with `ERecoverableError` 🙄 |
14:37:21 | * | Hideki_ quit (Remote host closed the connection) |
14:37:51 | leorize | Araq: 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:34 | shashlick | @Calinou - but if the command fails, there's no way to run a step after that |
14:38:42 | Araq | remember the context, nimsuggest shouldn't build nimterop packages |
14:38:51 | Calinou | shashlick: yeah, you can use tee for that |
14:38:56 | Calinou | https://stackoverflow.com/questions/637827/redirect-stderr-and-stdout-in-bash |
14:39:38 | leorize | Araq: well, just in case you ever decide to diverge `nim check` from `nim c` |
14:39:48 | Araq | same |
14:39:57 | Araq | 'nim check' shouldn't build nimterop packages |
14:40:21 | shashlick | @Calinou - I'll use after_failed |
14:40:38 | leorize | well a noticible side-effect would be that nimsuggest consider every call to any of nimterop-generated symbols an error |
14:41:06 | leorize | which would mean a lot of red coloring in some of my code... |
14:41:48 | Araq | build it once and rely on a persistent cache that nimsuggest understands? |
14:42:29 | leorize | you can do that? |
14:43:13 | shashlick | I guess an option is to check if nimsuggest mode and just return success |
14:43:18 | Araq | you run 'nim c foo' it produces stuff.nim as a side-effect |
14:43:18 | shashlick | of course then no symbols will work |
14:43:32 | Araq | and then nimsuggest doesn't update stuff.nim but picks it up |
14:43:35 | Araq | what's the problem? |
14:43:49 | leorize | I don't think nimterop works that way currently |
14:44:37 | * | sagax quit (Ping timeout: 245 seconds) |
14:45:31 | Araq | maybe it should work this way |
14:46:54 | disruptek | that's actually how my api generator works; seems fine. |
14:47:29 | shashlick | right now nimterop runs staticExec to convert h => nim and then uses parseStmt to pull the generated Nim in |
14:47:31 | disruptek | my macro writes a foo.nim and merely yields ast to import it, so it gets imported "normally" as part of compilation. |
14:47:49 | shashlick | it uses gorgeEx cache as well to avoid running every time |
14:49:24 | Zevv | leorize: 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:59 | leorize | for `highlight` it's symbol-level |
14:50:13 | leorize | errors are only generated by unknown symbols |
14:50:27 | Zevv | is that a nimsuggest choice or a nim.vim choice? |
14:50:35 | leorize | nimsuggest choice |
14:50:48 | Zevv | ok, makes sense. I guess it would become pretty heavy otherwise |
14:51:03 | leorize | one of those many linter plugin does support automated linting if you want that :P |
14:51:35 | Zevv | No, not really. I was just wondering if it would be possible to have my macro-induced errors show in highlighting. |
14:57:22 | leorize | I'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:42 | leorize | but again, maybe one of those auto linters has already done so |
15:00:06 | disruptek | i wonder if you could just do a tree diff on the ast to some positive effect. |
15:00:14 | shashlick | @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:26 | FromGitter | <awr1> @Araq can you link me to these sandboxing options? |
15:03:52 | Araq | grep for 'nimcore' |
15:04:06 | Araq | by default it's even disabled |
15:04:17 | Araq | and only the Nim tools use it |
15:04:31 | Araq | turned out, not good enough :P |
15:05:23 | FromGitter | <awr1> k thanks |
15:07:56 | leorize | looks like it's not possible to determistically detect the main project file of a project :/ |
15:08:09 | Zevv | I've heard that before |
15:08:28 | * | absolutejam1 quit (Ping timeout: 264 seconds) |
15:09:01 | Araq | proc findProjectNimFile*(conf: ConfigRef; pkg: string): string |
15:09:09 | Araq | in compiler/options.nim |
15:09:24 | Araq | it's deterministic code because it doesn't use rand() |
15:09:34 | Zevv | :) |
15:09:36 | disruptek | neat trick. |
15:10:28 | leorize | so... nimsuggest can use a directory for real? |
15:10:37 | leorize | this simplify everything |
15:11:05 | Araq | I keep bringing it up, nothing changes |
15:11:31 | leorize | well, this usage line is certainly not helping: nimsuggest [options] projectfile.nim |
15:11:42 | FromGitter | <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:23 | leorize | a global toggle is much better |
15:13:02 | FromGitter | <awr1> nake had `--careful` which is kind of in that spirit |
15:13:11 | FromGitter | <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:18 | disruptek | how are you liking nim, Hideki_? any problems? |
15:14:50 | Araq | ideally you use an OS that doesn't allow random pieces of software to delete files or upload files |
15:15:11 | FromGitter | <mratsim> Virtualbox? |
15:15:16 | disruptek | selinux and carry on |
15:15:17 | Araq | where capabilities are assigned to processes, not to users |
15:15:36 | FromGitter | <mratsim> but I want Nim to work in the real world ... |
15:15:46 | FromGitter | <mratsim> without deleting it |
15:16:01 | disruptek | when you get there, lemme know how it is. |
15:16:11 | FromGitter | <mratsim> empty |
15:16:26 | disruptek | the grass is always greener. |
15:17:57 | leorize | the bsds and linux can do the capabilities thing to an extent |
15:18:10 | FromGitter | <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:22 | leorize | pledge() is straightforward, but seccomp is a nightmare |
15:18:44 | FromGitter | <awr1> also `staticExec()` has caching. |
15:19:03 | Araq | awr1: downloadFile is dangerous too :-) |
15:19:25 | livcd | what are the limitations for => from sugar ? |
15:19:38 | * | Hideki_ quit (Ping timeout: 245 seconds) |
15:19:53 | Araq | the intersection between useful and dangerous is huge |
15:19:55 | FromGitter | <awr1> yeah i suppose it is :/ |
15:19:56 | disruptek | basically that too much sugar will give you cancer of the semicolon. |
15:20:00 | livcd | :D |
15:20:28 | Zevv | wow, thats a baaaaad pun |
15:20:51 | disruptek | oldie. |
15:20:53 | * | shashlick quit (Ping timeout: 245 seconds) |
15:21:07 | disruptek | too much syntactic sugar, that is. |
15:21:17 | Zevv | I figured :) |
15:21:21 | FromGitter | <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:41 | FromGitter | <awr1> like qemu or docker or something |
15:22:08 | Zevv | awr1: it was about funny things happening while your code is being "run" by nimsuggest |
15:22:10 | disruptek | if you don't trust the code to run it, why are you bothering to compile it? |
15:22:36 | Zevv | I have a staticWrite in my code, and every time I type a bit in my editor, it writes a file to disk |
15:22:40 | disruptek | just require the execute bit on your source code in order to staticExec. :-P |
15:22:56 | FromGitter | <awr1> @disruptek i feel similarly |
15:23:12 | disruptek | well, you should. it's a good idea. |
15:23:18 | Araq | Zevv, yeah, it is really bad, a showstopper. |
15:24:26 | FromGitter | <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:52 | FromGitter | <awr1> which, thankfully, we have been as of current spared from having to deal with. |
15:24:54 | FromGitter | <awr1> i hope, anyway. |
15:24:58 | Araq | that's where we disagree |
15:25:21 | FromGitter | <awr1> but i have heard of this type of thing in npm etc |
15:25:47 | Araq | exactly, this problem is everywhere and unrelated to "nimsuggest runs staticExec" |
15:26:19 | Araq | the "attack vector" still is "every line of code", nothing changed. |
15:26:31 | Araq | it'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:15 | Araq | now 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:48 | disruptek | a source code filter that twiddles staticExec but only in the compiler or vice-versa. |
15:28:32 | * | clyybber joined #nim |
15:28:46 | disruptek | maybe it's a source code filter that can be overridden by the execute bit. |
15:28:49 | FromGitter | <awr1> there should at the least be some documentation on the current situation w/r/t this somewhere |
15:29:11 | disruptek | it's not new; comes up every couple months. |
15:29:28 | FromGitter | <awr1> that doesn't surprise me |
15:29:31 | FromGitter | <awr1> nevertheless... |
15:31:24 | FromGitter | <awr1> `staticRead()` can theoretically be put on a leash, by constraining its paths to the project dir |
15:31:44 | FromGitter | <awr1> and, i assume, taking caution with symlinks |
15:33:01 | * | zyklon joined #nim |
15:35:19 | disruptek | well, 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:43 | disruptek | i 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:16 | FromGitter | <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:48 | FromGitter | <awr1> nim just needs a big stupid disclaimer: "don't do nefarious things" :P |
15:51:08 | FromGitter | <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:47 | FromGitter | <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:04 | FromDiscord_ | <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:31 | FromDiscord_ | <exelotl> Would be nice to be able to keep doing that and still have autocomplete |
16:06:24 | FromDiscord_ | <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:21 | lqdev[m] | @exelotl don't do `staticExec("ls")` |
17:33:26 | lqdev[m] | it's not cross-platform |
17:33:44 | lqdev[m] | remember that windows uses `dir/w` to list files and the format is way different |
17:34:00 | lqdev[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:18 | juturnas | Looking 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:33 | FromDiscord_ | <exelotl> lqdev[m]: my project is only for use with a certain toolchain (devkitARM) so ls is guaranteed to be available |
19:00:55 | lqdev[m] | fine then |
19:01:54 | * | rockcavera joined #nim |
19:05:28 | FromDiscord_ | <exelotl> would be nice if there was a cross platform way to do it though |
19:06:14 | FromDiscord_ | <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:03 | FromGitter | <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:00 | Araq | juturnas: 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:00 | FromDiscord_ | <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?) |