00:01:09 | disruptek | iirc, he comes close to saying "if you want real software, use real programming languages." which is, i think, the best encapsulation of the problem: you ship a dsl because you want to constrain use to a smaller set of semantics. if you don't want that, don't choose that. |
00:03:51 | shashlick | But isn't the problem more that such embedded engines are also limited in terms of tools support |
00:04:39 | shashlick | Hard to deal with when bugs need to be root caused and fixed |
00:05:22 | shashlick | I'm having that exact problem - even though I'm using dlls, when I run into memory or crash issues, they are a pain to figure out |
00:05:34 | disruptek | of course. but when you choose a little language, everything is little. |
00:05:52 | shashlick | I've spent more time with such issues than actual dev for feud |
00:06:31 | disruptek | i'm sorry, what's in the dlls. i know you've explained this and i just wasn't paying close attention. |
00:08:21 | FromDiscord_ | <Shield> lua may be little but it's not fun to debug |
00:08:27 | shashlick | All the editor functionality is in the dlls |
00:08:39 | shashlick | The main exe is mostly just a plugin system |
00:09:10 | disruptek | it sounds pretty ambitious to me. |
00:09:47 | shashlick | So this way any user plugin gets the same capability as the core editor |
00:10:02 | shashlick | Well it works, except for the gc issue |
00:10:22 | shashlick | I think Nim makes it very easy to pull such stuff off |
00:10:34 | shashlick | That's why I'm really keen on pushing this further |
00:11:10 | shashlick | Adding new capabilities is super easy and very fast |
00:11:34 | disruptek | yeah, i get it, i mean, i have big plans for nim. i'm taking a much longer view, i guess. |
00:12:39 | FromDiscord_ | <Shield> when does it break btw? |
00:13:15 | FromDiscord_ | <Shield> I need to go through your code multiple of times to get the whole thing, it seems that you have a nice dependency handling in there |
00:13:55 | shashlick | Well in 0.19.6, everything works but I need to use boehm since I was doing sharing across threads with string and seq which isn't correct |
00:14:53 | shashlick | With 0.20.x, everything fell apart, probably because I the gc was fixed or perhaps changed for some reason |
00:15:14 | FromDiscord_ | <Shield> threads? are you making a new thread per plugin? |
00:15:30 | shashlick | So an object allocated in the main exe gets passed to a dll which modifies it and sends it back |
00:15:52 | shashlick | And somewhere in there it messes up and the object gets cleared or filled with garbage |
00:16:01 | shashlick | With boehm that is |
00:16:13 | shashlick | With native gc, it just asserts and crashes |
00:16:47 | shashlick | Well the thread is for code monitoring and recompile of the dlls |
00:16:56 | shashlick | Right now all dlls are loaded in the main thread |
00:17:27 | shashlick | Some of the dlls spawn threads of their own |
00:17:31 | disruptek | i last used boehm like 25 years ago, but it blew my mind at the time. |
00:17:51 | shashlick | The remote plugin for example runs a listener thread with nng |
00:17:53 | disruptek | i can reproduce this bug on your master branch or w/e? for feud? |
00:18:24 | shashlick | Yes, it should crash |
00:19:17 | shashlick | There's also an Araq branch with some minor cleanup |
00:19:34 | disruptek | oh, do i want that? |
00:19:37 | shashlick | I replaced hash set with seq due to the issue I opened |
00:19:48 | disruptek | ah, okay. |
00:19:49 | shashlick | Ya try that, it gives a better stack trace too |
00:20:24 | FromDiscord_ | <Shield> did you try lockfree approaches? instead of modifying in place, you copy and basically do anything to avoid memory conflict, it may double memory usage tho |
00:20:32 | shashlick | Also, you can minimize the plugins loaded by adding a plugins/allow.ini with just one line - config |
00:21:16 | shashlick | That's a good idea to try @Shield |
00:21:58 | shashlick | Build with `nimble debug` |
00:22:05 | shashlick | It will build all plugins |
00:23:15 | shashlick | @Shield - how do I copy tho - have to be careful such that I transfer data between exe and dll without involving the gc on either side |
00:24:36 | * | krux02_ quit (Remote host closed the connection) |
00:25:07 | FromGitter | <Varriount> Memory map? |
00:25:35 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
00:27:04 | * | laaron joined #nim |
00:27:51 | * | theelous3 joined #nim |
00:28:23 | FromDiscord_ | <Shield> passing by value or using something like channels? maybe try to make a copy of the object as soon as you get it |
00:28:57 | FromDiscord_ | <Shield> I'm digging through the various gcs to see which works better |
00:29:22 | shashlick | One idea I've had is to have each dll in a separate thread and use rpc to interact |
00:29:31 | shashlick | But I think that will be slow comparatively |
00:30:09 | disruptek | ah, toast was in my path but not installed via nimble, so it was puking. |
00:30:19 | shashlick | I'll probably use alloc and cast to avoid the gc |
00:30:38 | shashlick | How do you use memory maps in Nim? Any examples @varriount? |
00:31:16 | shashlick | Channels seems sad since they all are in the same thread |
00:32:06 | FromDiscord_ | <Shield> channels are used to communicate between threads |
00:32:11 | shashlick | I wonder if someone has written a lib to use objects which are alloc dealloc instead of the gc |
00:32:54 | shashlick | Right but all these dlls run in the same thread so using channels doesn't make sense |
00:33:46 | shashlick | Anyway, really appreciate any feedback |
00:34:03 | FromDiscord_ | <Shield> I meant the same concept, channels copy their data before doing any work, I believe http does the same, it reserves a copy of the string you passed so it doesn't get gc'd while being used |
00:34:23 | shashlick | Ideal goal will be to extract the plugin capability from feud and make it a package so that others can use it too |
00:34:27 | FromDiscord_ | <Shield> but using pointers to hold a copy of the object and passing those instead can work |
00:35:01 | shashlick | K I'll be look into it, at least avoid Nim objects from doing that |
00:36:40 | shashlick | Do you have an example of copying @Shield? I'll take a look |
00:36:44 | disruptek | wow, i'm getting a gcc error trying to build this; it actually looks like i may have broke my gcc. |
00:36:56 | shashlick | What version of gcc |
00:37:19 | shashlick | Cause Araq was also using 6.3.0 and it couldn't find string_view |
00:37:23 | disruptek | it's a link error. |
00:37:26 | disruptek | /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/crtbeginT.o: requires dynamic R_X86_64_32 reloc against '__TMC_END__' which may overflow at runtime; recompile with -fPIC |
00:37:36 | * | endragor joined #nim |
00:38:05 | shashlick | This is windows |
00:38:37 | shashlick | Feud is only working on windows right now |
00:38:44 | disruptek | oh, really? |
00:38:56 | shashlick | Though the plugin system should be able to work anywhere with minor changes if any |
00:39:21 | shashlick | Ya, using mfc for gui |
00:39:24 | disruptek | what's missing on linux? |
00:39:47 | shashlick | Scintilla for gui, need windows for events etc |
00:40:10 | shashlick | Just haven't ported but should be possible since both scintilla and nim support cross platform |
00:40:44 | shashlick | Sorry I should have mentioned earlier |
00:40:56 | disruptek | i'm just a little disappointed. :-/ |
00:41:26 | shashlick | ( |
00:41:36 | shashlick | Anyway, thanks for trying |
00:41:58 | * | endragor quit (Ping timeout: 246 seconds) |
00:43:02 | disruptek | i'll mess with it and see how far i get. |
00:43:28 | FromGitter | <zetashift> do I need to run nimble release to compile feud? |
00:43:57 | * | a_b_m joined #nim |
00:47:26 | FromDiscord_ | <Shield> I'd like to ask if using the normal gc for the exe and regions for the dll would cause gc conflict and vice versa |
00:48:16 | * | abm quit (Ping timeout: 268 seconds) |
00:49:25 | FromGitter | <zetashift> mhmhm weird getting a scintilla error |
01:00:16 | rayman22201 | @shashlick IIRC told you before to try channels, but you didn't like it. You told me you that you really wanted to used shared mem instead of copying. |
01:00:41 | rayman22201 | * s/told you/I suggested/ |
01:02:39 | rayman22201 | might be worth benchmarking it. It might not be as slow as you think.... FYI, Go and Erlang uses channels, and it works alright for them. |
01:14:37 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
01:17:02 | * | laaron joined #nim |
01:34:13 | * | deech quit (Ping timeout: 245 seconds) |
01:45:34 | FromDiscord_ | <Shield> does anybody has an example about using gc:none? or any explanation? |
01:48:49 | rayman22201 | explanation? lol. It means no gc at all. complete manual memory management, like C. |
01:51:14 | * | sagax_ joined #nim |
01:51:24 | * | sagax quit (Remote host closed the connection) |
01:51:50 | rayman22201 | most of the stdlib won't work in that mode. It's mostly useful for embedded development. I.E. you want to use Nim to build an Operating System, or run it on a tiny device like an arduino. |
01:52:25 | FromDiscord_ | <Shield> do you still use normal variable and ref declaration or you're stuck with pointers only? it's unclear to me, an example would've helped |
01:52:50 | FromDiscord_ | <Shield> I didn't see any destructors or pointers being called in the kernel example |
01:53:47 | rayman22201 | normal vars and refs work just fine with gc:none |
01:54:21 | rayman22201 | I should be more specific, you can create a ref, but it degrades to a normal pointer. |
01:54:37 | rayman22201 | since all the gc tracing operations become noops |
01:55:04 | rayman22201 | which means destructors also don't work iirc |
02:03:35 | * | a_b_m quit (Quit: Leaving) |
02:10:57 | FromDiscord_ | <Shield> I'll stick to testing regions then, it forces good habits, as in not allocate things randomly |
02:11:23 | FromDiscord_ | <Shield> the price you pay to let other people use nim for shared libraries |
02:11:58 | FromDiscord_ | <Shield> does anybody knows why boehm works at all for that issue? |
02:15:56 | rayman22201 | I highly recommend regions. I think regions are very underrated. |
02:18:16 | rayman22201 | all the gc's have known issues with shared libraries iirc. Only gc:none, gc:regions, and newruntime work well for shared libraries. |
02:28:02 | rayman22201 | bah. Everyone is probably asleep now. I possibly have a choosenim and/or a nim bug. |
02:28:02 | rayman22201 | I did a fresh install of choosenim on my windows 10 machine, and I noticed that it downloaded an old version of mingw (version 4.9.1). The recommended version on the nim website is mingw 6.3.0 |
02:29:19 | rayman22201 | I noticed this because nim cpp appears to be broken for me on windows. not even `echo "hello world"` seems to work. It compiles but produces no output. |
02:37:11 | * | mal`` quit (Quit: Leaving) |
02:41:46 | * | theelous3 quit (Read error: Connection reset by peer) |
02:46:41 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
02:47:25 | * | laaron joined #nim |
02:47:44 | * | mal`` joined #nim |
02:57:07 | * | mal`` quit (Ping timeout: 245 seconds) |
02:59:13 | * | mal`` joined #nim |
03:03:26 | FromDiscord_ | <Shield> I'm going through the forums and Araq suggested to not use nimrtl for a certain issue, so you can have multiple instances of the gc |
03:03:50 | FromDiscord_ | <Shield> I see a good amount of people trying to make this approach for plugins to work but without a result |
03:05:55 | rayman22201 | The most successful plugin system that I know of is shashlick with Feud |
03:06:07 | rayman22201 | and he had much trouble, as you know |
03:06:22 | rayman22201 | newruntime should make this much better though |
03:06:31 | * | lritter quit (Ping timeout: 246 seconds) |
03:07:25 | * | lritter joined #nim |
03:14:02 | * | fjellfras_ joined #nim |
03:14:40 | * | fjellfras_ quit (Max SendQ exceeded) |
03:15:12 | * | fjellfras_ joined #nim |
03:15:50 | * | fjellfras_ quit (Max SendQ exceeded) |
03:16:21 | * | fjellfras_ joined #nim |
03:35:15 | * | fjellfras_ quit (Ping timeout: 244 seconds) |
03:52:54 | * | seni_ quit (Quit: Leaving) |
03:53:53 | FromGitter | <gogolxdong> There is a question, what's the underlying reason of gcc 4.7+ requirement? There is some specific systems don't support gcc package install, they have to build from source , as I tried before, it's frastrating. |
03:56:12 | leorize | probably due to the amount of gcc-specific functionality used |
03:56:19 | leorize | try clang if you don't have new gcc |
03:56:24 | * | dddddd quit (Remote host closed the connection) |
03:56:43 | * | endragor joined #nim |
03:57:06 | * | fjellfras_ joined #nim |
04:20:56 | FromDiscord_ | <Shield> not using nmrtl seems to work for strings, stdlib is usable unless that was fixed, but that may be due the fact that strings are copied by value |
04:26:41 | FromGitter | <mratsim> @Araq, I agree with @deech. {.compileTime.} should only be matched by static or macro. Otherwise use a const |
04:27:11 | FromGitter | <mratsim> or available in macro* |
04:27:37 | FromGitter | <mratsim> This way it's also easy to know what code ends up in the binary or not. |
04:37:38 | * | lritter quit (Quit: Leaving) |
04:38:23 | * | fjellfras_ quit (Remote host closed the connection) |
04:38:49 | * | fjellfras_ joined #nim |
04:40:09 | * | nsf joined #nim |
04:54:45 | FromGitter | <mratsim> BTW, should I open a RFC on Nim multithreading runtime? I do have some ideas but I probably miss some use-cases or nice patterns seen in other libraries/languages and probably also homemade parallel libraries. |
05:00:56 | * | fjellfras_ quit (Ping timeout: 258 seconds) |
05:24:15 | rayman22201 | @mratsim. Yes, definitely open an RFC. |
05:28:01 | * | fjellfras_ joined #nim |
05:34:41 | * | solitudesf joined #nim |
05:41:37 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
05:42:27 | * | laaron joined #nim |
05:49:14 | * | laaron quit (Remote host closed the connection) |
05:51:27 | * | laaron joined #nim |
05:55:03 | FromGitter | <mratsim> Also maybe this should be started as a library (or at least as "experimental") this will allow competing designs. |
05:56:00 | FromGitter | <mratsim> We should just agree on the end user API / concept / interface so that people can switch/plug-and-play schedulers and libraries |
05:57:27 | FromGitter | <mratsim> This may also allow re-using industry-proven C or C++ schedulers if we can add a thin wrapper on top of them to conform to Nim interface |
06:01:50 | * | laaron quit (Remote host closed the connection) |
06:02:20 | rayman22201 | It's a good idea. Being more formal about the api but not the implementation should also help prevent another political fiasco like async / Chronos. |
06:04:05 | FromDiscord_ | <Shield> story time? |
06:04:53 | * | laaron joined #nim |
06:07:30 | FromGitter | <zacharycarter> How many runtimes will we end up with haha? |
06:07:40 | FromGitter | <zacharycarter> And will any of them be compatible |
06:24:38 | Araq | IMO you can extract an interface after you have two or more different implementations |
06:24:49 | Araq | otherwise you end up with an interface that simply doesn't work |
06:25:22 | Araq | esp if you are after speed and every allocation counts |
06:26:06 | Araq | for instance, there is only so much you can do when 'read' is required to return a fresh Future[string] (two allocs at least) |
06:30:53 | rayman22201 | Good point |
06:32:57 | Araq | and of course, as always, basic math bites back. So you have 3 schedulers and 2 async frameworks and 3 Nim versions you claim to support. Tada: Text matrix's size is 18. |
06:33:09 | Araq | *Test matrix |
06:34:45 | Araq | of course, you also support Linux, OSX and Windows (factor 3) and 2 different CPU archs... |
06:35:43 | Araq | and 2-3 different C compilers that are invoked by Nim... |
06:36:55 | Araq | which is also why semver cannot ever work, the only factor that works is 1. 1*1*1*1 is still 1, how cool is that? |
06:40:36 | * | fjellfras_ quit (Ping timeout: 258 seconds) |
06:54:36 | * | fjellfras_ joined #nim |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:00:41 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
07:01:54 | * | laaron joined #nim |
07:04:04 | * | krux02 joined #nim |
07:04:37 | * | gmpreussner joined #nim |
07:05:55 | * | laaron quit (Remote host closed the connection) |
07:08:29 | * | laaron joined #nim |
07:14:05 | * | gokr_ joined #nim |
07:18:48 | FromGitter | <alehander42> ok hello |
07:19:34 | FromGitter | <alehander42> back from vacation |
07:19:54 | FromGitter | <alehander42> time to open nim issues |
07:22:08 | * | solitudesf quit (Ping timeout: 245 seconds) |
07:24:43 | FromGitter | <zacharycarter> welcome back! |
07:24:59 | * | laaron quit (Remote host closed the connection) |
07:26:58 | FromGitter | <alehander42> https://github.com/nim-lang/Nim/issues/11911 |
07:28:17 | FromGitter | <alehander42> i want to open PR-s for those, but firstly opening an issue to make sure |
07:29:20 | FromGitter | <alehander42> 1) https://github.com/nim-lang/Nim/issues/11912 |
07:29:41 | FromGitter | <alehander42> (tagging @dom96 as well, as its about asyncdispatch ^) |
07:29:51 | FromGitter | <alehander42> hey @zacharycarter |
07:30:38 | * | laaron joined #nim |
07:36:10 | * | fjellfras_ quit (Ping timeout: 272 seconds) |
07:37:13 | FromGitter | <bevo009> Hi all, noob query- I made a proc to iterate over a tuple, ⏎ but when I call it I need to prefix it with echo, or it won't compile ⏎ I must be missing something obvious :( ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d4bd1295178a724764d0e83] |
07:37:57 | FromGitter | <alehander42> so, discard |
07:38:11 | FromGitter | <alehander42> you can't just call a function that returns value |
07:38:18 | FromGitter | <alehander42> you have to either use the return value |
07:38:24 | FromGitter | <alehander42> or to `discard` it (in most cases) |
07:38:38 | FromGitter | <alehander42> probably you want just a void function here |
07:38:47 | FromGitter | <alehander42> printT(a: tuple) = .. |
07:39:45 | FromGitter | <bevo009> Sorry..swear I tried that |
07:39:47 | FromGitter | <alehander42> otherwise you have to either doSomethingWith(printT(tup)) (like echo) or discard printT(tup) |
07:39:50 | FromGitter | <bevo009> ta |
07:40:02 | FromGitter | <alehander42> no problem |
08:04:11 | FromGitter | <bevo009> One more noob query :) ⏎ So this template iterates over an array, string or sequence ⏎ Is it modifiable so it will take a tuple as an argument? Or perhaps using a macro? ⏎ untyped won't match a tuple parameter, is there a more generic way? ⏎ ... [https://gitter.im/nim-lang/Nim?at=5d4bd77bc87a0963e7324907] |
08:04:26 | * | NimBot joined #nim |
08:05:43 | * | tjmac joined #nim |
08:05:44 | * | shomodj joined #nim |
08:05:59 | FromGitter | <alehander42> it should take a tuple parameter |
08:06:45 | FromGitter | <alehander42> it does match as you see |
08:07:00 | FromGitter | <alehander42> oh the error is that it doesnt have `items` sorry |
08:08:03 | FromGitter | <alehander42> so you probably |
08:08:05 | FromGitter | <alehander42> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d4bd865aa5ef4596c571f4e] |
08:10:32 | FromGitter | <bevo009> ahh, haven't used 'when' yet...that's perfect |
08:10:45 | FromGitter | <alehander42> yes, when is a compile time if |
08:10:47 | FromGitter | <bevo009> Thanks for all the help Alexander! |
08:10:50 | * | floppydh joined #nim |
08:10:50 | FromGitter | <alehander42> no problem |
08:11:34 | FromGitter | <bevo009> I do try to solve them myself first...googling Nim questions doesn't always yield much |
08:12:13 | FromGitter | <bevo009> learned something else, really appreciate it :)] |
08:12:24 | Araq | you're in the right channel |
08:12:40 | Araq | we can also give you links where to find docs |
08:12:42 | FromGitter | <alehander42> its hard, no much material indeed, but the manual + channel is good |
08:13:31 | FromGitter | <bevo009> is searching the manual the best method? |
08:14:51 | Zevv | The manual is big and dense, I tend to miss things. I just ask here and have other people solve my problems :) |
08:15:45 | FromGitter | <bevo009> I did search the manual for how to iterate over a tuple, I don't think there's an example? ⏎ But I did find the answer here: https://stackoverflow.com/questions/48762646/how-to-iterate-over-a-tuple-in-nim |
08:16:16 | FromGitter | <alehander42> help is nice |
08:24:49 | * | solitudesf joined #nim |
08:27:22 | * | solitudesf quit (Read error: Connection reset by peer) |
08:29:42 | * | fjellfras_ joined #nim |
08:33:33 | krux02 | bevo009: you should try to avoid iterating over a tuple |
08:35:33 | * | fredrik92 is now known as couven92 |
08:37:48 | * | solitudesf joined #nim |
08:45:03 | FromGitter | <bevo009> @krux02 Sure thing, that function was just for examining containers while I learn ( and to see if it could be done :) ) |
08:45:44 | FromGitter | <mratsim> Fields is not a real iterator |
08:45:53 | FromGitter | <mratsim> It's just masquerading as one |
08:46:40 | FromGitter | <mratsim> You should use for f in fields(mytup): result.add $f |
08:47:24 | FromGitter | <mratsim> Then it makes sense to have a string return value |
08:47:49 | FromGitter | <mratsim> Otherwise you return an empty string |
08:48:04 | Araq | containers all come with '$' in Nim. |
08:48:14 | Araq | you can simply echo them |
08:48:49 | FromGitter | <alehander42> the guy is just trying to exercise on templates/iterators |
08:49:11 | FromGitter | <bevo009> I use that too, echo <container> |
08:49:26 | FromGitter | <bevo009> Just working out the rules here :) |
08:49:31 | FromGitter | <alehander42> i still dont understand why one cant echo ref objects |
08:49:48 | FromGitter | <alehander42> but yeah `.repr` kinda works |
08:49:54 | FromGitter | <RayoGundead> dir |
08:49:55 | FromGitter | <bevo009> Is this all the info on fields? https://nim-lang.org/docs/iterators.html#fields.i%2CT |
08:52:29 | shashlick | @Shield - that's option 2 - regular gc for exe, regions for dll, but still need to be careful with passing data back and forth |
08:53:35 | leorize | couldn't you make the second dll also depend on libnimrtl? |
08:54:06 | shashlick | @rayman22201 - the channels discussion was between threads. I dealt with that by using boehm and more recently creating the shared package |
08:54:20 | krux02 | alehander42: if you add ``proc `$`*[T](arg: ref T): string = $arg[]`` you might end up in infinite recursion. |
08:54:32 | krux02 | you would need cycle detection |
08:54:46 | shashlick | This is more about passing data between the main exe and dll both of which are in the same thread. The multiple gc issue |
08:55:05 | FromGitter | <alehander42> krux02 but the fact is `repr` seems to work for ref |
08:55:18 | FromGitter | <alehander42> so why can't the same mechanism be reused |
08:55:43 | krux02 | yea, repr is not overloadable. It is just there, builtin. |
08:55:47 | FromGitter | <alehander42> one can always use just a "ref <whatever>" for e.g. os:standalone |
08:56:06 | FromGitter | <alehander42> my point is, $ for ref can just call repr then |
08:56:14 | krux02 | no |
08:56:27 | leorize | shashlick: if you use libnimrtl then wouldn't there only be one GC? |
08:56:29 | FromGitter | <alehander42> i cant imagine why $ should work only on a subset of all types |
08:56:40 | krux02 | true |
08:57:09 | krux02 | but no, repr is something on our todo list out of the language, because it is redundant. |
08:57:30 | krux02 | I would like to have a better stringification algorithm. |
08:58:13 | FromGitter | <alehander42> so do you plan to only leave `$` or what would happen |
08:58:23 | krux02 | something that has cycle detection, works on everything, and can be overloaded if the default doesn't work |
08:58:49 | krux02 | well I personally dislike `$`, because it allways creates these intermediate objects. |
08:58:51 | FromGitter | <alehander42> souns good |
08:59:41 | FromGitter | <alehander42> well, it might be possible to somehow preallocate a buffer for the top-level $ when you have a deep $ object traversal? |
08:59:55 | krux02 | I thought about building ``$`` on top of formatValue, because formatValue can be overloaded, and it doesn't create all these intermediate string objects. |
09:00:24 | * | leorize quit (Quit: WeeChat 2.4) |
09:00:35 | krux02 | be we also need a better overload resolution for it. Because often when there is an overload for `$`, it is often not seen by the compiler because of some imports and module visibility etc. |
09:01:06 | krux02 | so until that part got solved, there is just `$` and `repr`. |
09:01:30 | krux02 | it's not too bad, because it generally is only used for debug printing, or at least that is what it should be used. |
09:01:38 | krux02 | maybe some visualizaiton in a gui |
09:02:05 | krux02 | I would like to make it usable as well in situations where performance matters. |
09:02:26 | krux02 | (e.g. stream processing in the unix world) |
09:02:55 | krux02 | but that is all scheduled for not now, because we still have way too many bugs for my preference. |
09:03:00 | FromGitter | <alehander42> how does formatValue fix it? |
09:03:06 | FromGitter | <alehander42> passing an argument with a buffer? |
09:04:01 | krux02 | formatValue is not the procedure that you eventually call to crate a string. |
09:04:36 | shashlick | @leorize yes I did try but got some other issues |
09:04:37 | krux02 | there is this string interpolation context that creates a string where formatValue is allowed to append. |
09:05:00 | FromGitter | <alehander42> yes, thats what i imagined with the buffer arg |
09:05:03 | shashlick | Overall, I need to open pointed issues so that they can be debugged and fixed |
09:05:54 | FromGitter | <genotrance> Here's the first https://github.com/nim-lang/Nim/issues/11906 |
09:07:46 | * | leorize joined #nim |
09:08:04 | * | nif quit (Quit: ...) |
09:08:13 | * | nif joined #nim |
09:11:31 | * | fjellfras_ quit (Ping timeout: 248 seconds) |
09:13:16 | * | endragor quit (Quit: Leaving...) |
09:19:57 | * | fjellfras_ joined #nim |
09:22:14 | leorize | shashlick: I think I found the main problem |
09:22:37 | leorize | just initializing a HashSet[string] with nimrtl already produced a crash |
09:22:47 | leorize | no dll needed |
09:22:57 | leorize | (note: this is with gcassert) |
09:30:03 | shashlick | wow cool |
09:30:08 | * | Vladar joined #nim |
09:30:17 | shashlick | i replaced the hashset with a seq in a branch, that crashes too, but in a different way |
09:31:15 | leorize | also, {.exportc.} != {.cdecl.} |
09:31:38 | leorize | an `{.exportc.}` function is still `{.nimcall.}` by default |
09:31:49 | leorize | so you might want to fix that |
09:32:24 | shashlick | so even if i import a nim dll from nim exe, it still needs cdecl explicitly? |
09:33:19 | leorize | not sure what you mean by that |
09:33:30 | leorize | I'm talking about this: https://github.com/nim-lang/Nim/issues/11906 |
09:33:40 | leorize | casting it to a `{.cdecl.}` is not entirely correct |
09:34:00 | shashlick | yes, same thing, that's a minimal sample of feud |
09:34:19 | leorize | it should be either `{.nimcall.}` or you annotate the `onload` with cdecl |
09:34:49 | leorize | for one param on linux that doesn't change anything, but might be of importance on windows |
09:36:16 | shashlick | do I just say {.exportc, dynlib, cdecl.} |
09:37:40 | leorize | yea |
09:39:25 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:47:05 | * | sagax_ is now known as sagax |
09:50:11 | leorize | alright, here's all needed to trigger a GC assert spree (with nimrtl): import sets; discard initHashSet[string]() |
09:54:19 | * | ng0 joined #nim |
09:56:12 | FromGitter | <alehander42> many parts of the stdlib needs fixing to work well with nimrtl iirc |
09:58:31 | leorize | shashlick: https://github.com/nim-lang/Nim/issues/11914 |
10:00:12 | * | endragor joined #nim |
10:00:24 | shashlick | just tried with nimrtl and program doesn't even run |
10:01:38 | leorize | I guess you haven't built libnimrtl? |
10:02:08 | shashlick | i have, trying to post a stack trace |
10:02:30 | shashlick | https://pastebin.com/Hig4HiT7 |
10:05:32 | * | shomodj joined #nim |
10:05:33 | leorize | how can I try that? |
10:05:35 | * | shomodj quit (Client Quit) |
10:05:42 | Cadey | how do i extract query parameters from a URL/URI? |
10:06:22 | FromDiscord_ | <Shield> mixing gc types doesn't help either |
10:06:35 | Zevv | woohoo, who made the compiler accept its command line options in random order! \o/ |
10:07:42 | leorize | Cadey: via JS backend or the C backend? |
10:07:46 | Cadey | C |
10:07:59 | leorize | I assume you're not using jester? |
10:08:28 | Cadey | i'm scraping HTML |
10:09:30 | leorize | you need this https://github.com/nim-lang/Nim/pull/7761 |
10:09:52 | FromGitter | <alehander42> leorize i cant understand how does incRef goes into recursion |
10:11:27 | * | shomodj joined #nim |
10:11:57 | leorize | hidden goodies: https://github.com/nim-lang/Nim/blob/ca4b971bc81b2e751e0388d80896fde7079b1679/lib/pure/collections/sharedstrings.nim |
10:14:50 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
10:15:19 | Araq | leorize, that's dead code |
10:16:34 | leorize | then it should probably be removed? |
10:16:35 | shashlick | @leorize - probably by using --threads:on |
10:16:47 | Araq | leorize, agreed. |
10:17:04 | shashlick | check out https://github.com/genotrance/shared - has shared string and shared seq |
10:17:25 | leorize | the last commit to touch that was the HCR commit, so not sure if it's used there |
10:17:37 | shashlick | @leorize - i tried with cdecl but didn't make a difference |
10:19:02 | * | laaron joined #nim |
10:19:30 | * | laaron quit (Remote host closed the connection) |
10:21:49 | * | laaron joined #nim |
10:24:16 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:27:53 | * | clyybber joined #nim |
10:27:54 | * | laaron quit (Remote host closed the connection) |
10:27:56 | * | laaron- joined #nim |
10:31:17 | * | stefanos82 joined #nim |
10:34:08 | * | solitudesf quit (Ping timeout: 272 seconds) |
10:56:11 | leorize | Araq: we got some chinese spam on the forum |
10:58:17 | FromDiscord_ | <Shield> gc:regions has compilerRtl pragma but if you try to use it with nimrtl it will say "could not import: nimrtl_nimGCvisit" which is only defined in the normal gc |
10:58:31 | Araq | leorize, I'm waiting for a translation |
10:59:45 | leorize | running it through gtranslate shows something that looks like an ad |
11:00:08 | leorize | for some diploma faking service? |
11:01:08 | Araq | ok, deleting it |
11:02:34 | leorize | on the bright side, looks like Nim is taking off in China :P |
11:05:28 | * | user0 joined #nim |
11:05:41 | * | user0 is now known as user0457 |
11:05:44 | * | dddddd joined #nim |
11:06:00 | user0457 | Hi. Is there any online Nim -> ASM compiler like godbolt? |
11:06:16 | leorize | rayman22201 is working on Nim support for godbolt iirc |
11:09:09 | Cadey | i think i found a bug in the parseuri proc |
11:10:05 | Cadey | parsing http://download.linuxjournal.com/pdf/get-doc.php?code=2c230d54e20e7cb595c660da48be7622&tcode=epub-301- eats the & before tcode |
11:12:13 | * | user0457 quit (Quit: user0457) |
11:13:30 | krux02 | dom96: I have a problem in nimble can you help me? |
11:14:22 | krux02 | I made nim semantic checking a bit stricter and now nimble has problems. |
11:14:24 | * | user0 joined #nim |
11:14:52 | krux02 | basically I need to know what nimble does to run a task. |
11:22:33 | Araq | krux02, you can also ask shashlick |
11:22:49 | Araq | since he wrote the new Nimble task integration code |
11:23:01 | krux02 | ok |
11:23:08 | krux02 | shashlick, are you around? |
11:23:56 | krux02 | Araq: I copied everything that I thought would be necessary to run a task in a local scratch.nims file. Magically here is no problem at all. |
11:24:27 | Araq | nimble --verbose --debug does give some info |
11:24:32 | krux02 | it doesn't help that the error message just prints a single line. I have the feeling that there are more lines of error messages and they are automatically stripped away. |
11:24:39 | krux02 | ah, ok |
11:24:42 | Araq | but for me it deleted the .nims file in my TEMP so I couldn't look at it |
11:25:04 | krux02 | yea, nimble is productivity killer. |
11:25:27 | krux02 | I think it is great to define the build process and the tests in a nimscript file, but there sould be less magic. |
11:26:18 | Araq | well the setup is actually really good, way better than before |
11:26:26 | Araq | if only it would keep the temporary files... |
11:26:32 | Araq | can't be hard to fix this |
11:26:37 | krux02 | especially when something went wrong |
11:26:41 | Araq | yup |
11:27:08 | krux02 | dumping /tmp with crap isn't at all that bad. |
11:27:56 | Araq | it's /tmp, nuke it when you do a restart, don't care otherwise |
11:43:46 | * | nullnullnull joined #nim |
11:43:59 | nullnullnull | what's the easiest way to parse string to int? |
11:45:32 | user0 | https://nim-lang.org/docs/parseutils.html#parseInt%2Cstring%2Cint%2Cint |
11:45:49 | shashlick | the nims file should be in /tmp/nimblecache |
11:46:19 | shashlick | what's the error you are seeing? |
11:47:33 | * | deech joined #nim |
11:49:30 | shashlick | @krux02 ^^ |
11:49:37 | nullnullnull | @user0, but mate, why I should put a new variable to parse int? isn't it a bit heavy? |
11:50:45 | user0 | https://nim-lang.org/docs/strutils.html#parseInt%2Cstring |
11:51:52 | * | fjellfras_ quit (Quit: Leaving) |
11:52:17 | nullnullnull | ok thanks mate ;) |
11:52:47 | krux02 | shashlick: the error is this: http://ix.io/1R11 |
11:53:30 | krux02 | the problem is, the nims file is not in /tmp/nimblecache, it is deleted |
11:53:36 | krux02 | I can't see it |
11:54:07 | krux02 | and the error message is a bit sparse, I need context. |
11:54:22 | krux02 | because in all local tests that I did, I had no problem with that variable. |
11:55:27 | shashlick | the nims file is created once and stored in tmp, it gets copied into the project directory on every run since folks tend to refer to files and imports relative to project path |
11:55:53 | krux02 | wherever it is, it is deleted. |
11:55:56 | krux02 | I can't inspect it. |
11:56:10 | krux02 | after the error message, the file is gone |
11:56:46 | shashlick | https://github.com/nim-lang/nim/blob/devel/lib/system/nimscript.nim#L194 |
11:57:54 | shashlick | there will be a /tmp/nimblecache/nimquery_hashvalue/ directory |
11:58:00 | shashlick | in that there should be an ini file and nims file |
11:58:29 | shashlick | also, seems like you are calling the log() template in a place where it cannot be handled at compile time |
11:59:54 | krux02 | I did not change the log template, I change the compiler to detect such illegal usages. |
12:00:19 | krux02 | either my detection is wrong, or nimble was wrong all the time. |
12:00:32 | shashlick | okay then the problem is line 194 in nimscript.nim - what should it change into |
12:02:20 | krux02 | all this file generation and file copying are weird complications. They should be removed from nimble. |
12:02:54 | krux02 | in my opinion, nimble should be a package to import |
12:03:11 | shashlick | I agree - if Nim can allow changing relative, we can avoid this |
12:03:16 | krux02 | then you build, `nim e mymain.nimble` |
12:03:38 | krux02 | how about, ``cd`` |
12:04:03 | shashlick | import uses currentSourcePath |
12:04:07 | shashlick | So that won't work |
12:04:22 | krux02 | the entire file generation in /tmp ..., that is just a horrible idea to begin with. It makes everything harder to understand. |
12:04:38 | krux02 | nimble files should just start with ``import nimble`` |
12:04:45 | shashlick | Anything Nim specific won't work care for cwd |
12:05:22 | shashlick | The way this is done is to avoid having to change every l nimble file out there |
12:05:25 | krux02 | yea, I am not 100% sure how path handling works in Nim, especially the nim specific rules. But I have a feeling there is room for improvement. |
12:05:44 | shashlick | I'd prefer not doing it this way |
12:06:11 | krux02 | I have done a few transitions until now. |
12:06:16 | Araq | the rules are great and I spent months on them. I doubt you can suggest anything that won't be shouted down from me. |
12:06:36 | shashlick | I'm also overriding system procs so it brings its own workarounds |
12:06:43 | krux02 | Araq: what rules do you mean? |
12:06:52 | shashlick | Look at nimscriptapi.nim |
12:08:34 | krux02 | I would like to have a build process that, when I am looking at it I instantly see: "Ah that is what it is doing", for people who don't write build scripts. |
12:08:42 | krux02 | Just some clean instructions and definitions. |
12:09:23 | Araq | well I can't disagree with that, you used the word 'clean'. |
12:09:41 | shashlick | Considering nimble now uses Nim externally, we could add some code into Nim to handle nimble files differently |
12:10:03 | Araq | I'm not sure it means anything though. Yeah, don't remove the generated nimscript file in /tmp, problem solved. |
12:10:10 | shashlick | Then just Nim e file.nimble will work |
12:10:21 | krux02 | Not the horrible nightmare that I experienced in sbt for scala, wher they advertised with "it's just scala code", but they defined 100 operators all with their special meaning of dependency management and everything fully and purely functional, with it's own standard library to operate on those collections. As a scala developers I did understand nothing. It wis it's own super compicated lengauge, just to define the dependencies and tasks. |
12:10:23 | shashlick | The file is in tmp, it is removed from the project directory after execution |
12:10:59 | shashlick | It is only generated once and saved in tmp, copied over for each execution |
12:11:13 | shashlick | Figuring out the folder isn't easy if course |
12:11:24 | shashlick | Cause I have to generate a unique name |
12:11:32 | shashlick | Hence the hash |
12:11:48 | krux02 | I would like to have a non copy files around solution. |
12:12:27 | krux02 | I once suggested to have a module level macro. This would be a use case for it. You would just write a macro that does these imports and the last line. |
12:12:38 | shashlick | Then two ideas - one is to allow changing currentSourcePath - doesn't seem like Araq likes that |
12:12:57 | Araq | this discussion is too early. |
12:13:02 | Araq | fix the problem. |
12:13:04 | krux02 | I mean, nim is about metaprogramming, and then for build scrpits, the metaprogramming doesn't work? Why? |
12:13:09 | shashlick | Another is Nim e nimble support which adds more nimble code into Nim - which isn't the general direction either |
12:13:20 | Araq | afterwards we can see what to change and where the real problem was. |
12:13:35 | krux02 | ok |
12:13:37 | Araq | right now we're in lalala "all I want is simple, nice, clean" land |
12:15:34 | krux02 | funny thing |
12:15:47 | krux02 | nimble runs nim e --hints:off --verbosity:0 -p:/tmp/nimblecache /home/arne/proj/nim/nimquery/nimquery_10988.nims and it fails |
12:15:57 | krux02 | I run that on the command line: no error |
12:16:23 | krux02 | Araq: yes, I always want to be there. |
12:16:30 | krux02 | I am working to get there though. |
12:16:37 | FromGitter | <mratsim> A language to define dependencies and tasks, that sounds like an interesting start for a task parallel scheduler :p |
12:18:25 | Araq | and let me say it again because shashlick is too modest: What he did was considered impossible by me. I thought using 'nim e' instead of importing the compiler won't work out. |
12:20:44 | Araq | offtopic, but important enough: https://thenextweb.com/security/2019/08/06/researchers-discover-troubling-new-security-flaw-in-all-modern-intel-processors/ |
12:20:53 | krux02 | an example, sbt introduces (and uses heavily) the operators <<= <+= <++= |
12:21:19 | krux02 | those don't exist in the scala standard library. To be certain that it will confuse everybody. |
12:21:45 | krux02 | they might seem familiar if you know tha haskell pattern of things, but scala is not haskell. |
12:22:02 | krux02 | nimble also has it's own operators and special synax. |
12:22:04 | krux02 | for example task |
12:22:25 | Araq | task is a template like any other. |
12:22:41 | Araq | is 'withLock' also "its own special syntax"? |
12:22:58 | Araq | makes no sense to me. |
12:23:06 | krux02 | task introduces a new syntax to define a function. |
12:23:11 | nullnullnull | dam why so many var-types there, "type mismatch: got (string) but expected 'TaintedString = distinct string'" |
12:23:15 | krux02 | Would it be so hard to use just the proc syntax |
12:23:29 | krux02 | proc myTask(arg: string): void {.task.} = ... |
12:23:51 | Araq | why? because you never read any manuals? |
12:25:13 | krux02 | depends |
12:25:43 | * | deech quit (Ping timeout: 268 seconds) |
12:25:44 | Araq | and how does {.task.} make it better anyway, how do you then describe its --help entry |
12:25:56 | krux02 | doc comment |
12:26:13 | Araq | but you have to learn this too then. |
12:26:24 | krux02 | not really. |
12:26:28 | Araq | in this case the doc comment is then transfered to the command line |
12:26:32 | Araq | in other cases it's not. |
12:26:45 | Araq | there is hardly any difference. |
12:26:48 | Zevv | nullnullnull: how do you mean "put a new variable" |
12:27:08 | Zevv | oh wait - old scrollback, nevermind me |
12:27:41 | nullnullnull | Zevv, I need to get rid of that "taintedstring" it's from args :P |
12:27:54 | nullnullnull | paramStr(1) |
12:28:24 | krux02 | when I have an interactive help window (the command line), what else should it print if not tho doc comment? |
12:28:49 | Araq | https://gist.github.com/Araq/8f79e6a5448817281e367eb4c44846c8 this is the orginal implementation of 'task' |
12:28:52 | Zevv | nullnullnull: just string() or .string it |
12:28:58 | Araq | if you can't see the beauty in that, then so be it. |
12:29:19 | nullnullnull | Zevv, btw how can I convert from string to taintedString? (the opposite way) |
12:29:53 | Zevv | nullnullnull: TaintedString(x) |
12:29:54 | Araq | but it's objectively a tiny design. Much less code than your .task macro would be. |
12:30:02 | nullnullnull | Zevv, thanks mate ;) |
12:30:10 | Zevv | http://ix.io/1R1c |
12:31:03 | krux02 | Araq: I don't see the beauty in it. |
12:32:19 | shashlick | Thanks Araq |
12:32:24 | krux02 | anyway, I can't reproduce the problem when I just copy paste the command that nimble prints. |
12:32:29 | shashlick | Got to go now, later |
12:33:31 | nullnullnull | Zevv, after I converted it, still shows the error: "Error: type mismatch: got (string) but expected 'TaintedString = distinct string'" |
12:33:55 | nullnullnull | TaintedString(paramStr(1)) |
12:33:58 | krux02 | never mind, my bad, got it |
12:34:33 | * | laaron- quit (Remote host closed the connection) |
12:38:23 | * | laaron joined #nim |
12:43:30 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
12:44:12 | * | laaron joined #nim |
12:51:13 | * | xet7 quit (Remote host closed the connection) |
12:51:48 | * | laaron quit (Remote host closed the connection) |
12:52:48 | * | xet7 joined #nim |
12:53:48 | * | laaron joined #nim |
12:59:03 | * | user0 quit (Quit: user0) |
13:00:58 | lqdev[m] | shashlick: I tried compiling taudio on a VM again, using 3 different compilers and each time it throws the same error http://termbin.com/p9t3 |
13:01:24 | lqdev[m] | I'm already so frustrated with windows I might resort to using these damned dlls. |
13:05:47 | * | solitudesf joined #nim |
13:07:33 | Zevv | nullnullnull: can you dump your complete code somewhere in a pastebin so I can take a look? |
13:13:36 | * | tjmac left #nim ("-bye") |
13:19:43 | lqdev[m] | I give up. time to wrap sokol_audio |
13:19:44 | lqdev[m] | … |
13:21:30 | lqdev[m] | at least it should go really smoothly since the library is only 1 header, also it provides all the features I'll ever need |
13:21:53 | Zevv | hmm does anyone know what the error message "Error: the field 'data' is not accessible" might be caused by, I'm not doing anything with objects with a field called 'data', but I might be doing invalid things with macros and quote do and consts... |
13:22:13 | * | shomodj joined #nim |
13:27:21 | nullnullnull | Zevv, https://pastebin.com/LcgvXdUz |
13:27:43 | nullnullnull | it's about the taintedstring thing |
13:27:57 | nullnullnull | "type mismatch: got (string) but expected 'TaintedString = distinct string'" |
13:28:45 | Zevv | paramStr() is of type TaintedString, and your code converts this to a TaintedString |
13:29:08 | Zevv | try http://ix.io/1R1E |
13:29:08 | nullnullnull | hmm but strange why I get this error, it's from the same type |
13:29:27 | Zevv | connect takes a string, not a taintedstring |
13:29:36 | nullnullnull | hmm |
13:30:09 | Zevv | the taintedstring stuff feels a bit cumbersome, but it is for a good reason. It makes your sit on your hands and think before your type when handling string data from a potentially unsafe source. |
13:30:58 | nullnullnull | btw got the same error with string(paramStr(1) |
13:31:03 | nullnullnull | ) |
13:31:11 | Araq | the taintedstring is usually disable and taintedstring is just an alias for string |
13:31:17 | Araq | *disabled |
13:31:29 | nullnullnull | yes I used this --taintMode:on |
13:31:30 | leorize | taintedstring is enabled by default actually |
13:31:47 | leorize | or maybe not :P I haven't got bumped by this for a while so... |
13:32:41 | * | endragor quit (Remote host closed the connection) |
13:33:00 | nullnullnull | this is the full error line: "lib/nim/pure/net.nim(1252, 10) Error: type mismatch: got (string) but expected 'TaintedString = distinct string'" |
13:33:29 | leorize | that's weird |
13:33:54 | leorize | anyhow, here's the fix https://play.nim-lang.org/#ix=1R1I |
13:33:56 | nullnullnull | maybe I need to put it into variable? |
13:34:46 | nullnullnull | oh same error with .string |
13:36:09 | nullnullnull | wait I think I know what could be |
13:36:10 | nullnullnull | sec |
13:36:16 | nullnullnull | I have this line: from strutils import parseInt; |
13:36:56 | nullnullnull | ah no, the same error :| |
13:37:26 | leorize | can you dump the entire code to the playground? |
13:37:29 | FromGitter | <Vindaar> what nim version are you using? and can you paste the full code you're trying to run + how you compile it? |
13:37:34 | nullnullnull | sec |
13:38:29 | Zevv | nullnullnull: complete and working: http://ix.io/1R1J |
13:38:56 | Zevv | your are bitten by the horrendous choice of having 2 'parseInt()' implementations in the stdlib |
13:39:44 | nullnullnull | https://pastebin.com/k0YuBvF4 |
13:40:13 | nullnullnull | Zevv, but I think the error is on the string, not the int |
13:43:10 | nullnullnull | if i disable the taintedmode it will "compile" but will not work properly |
13:44:30 | FromGitter | <Vindaar> if I fix line 3 and 8 it also compiles fine with taint mode on devel |
13:45:13 | leorize | nullnullnull: can you try your code on the playground? |
13:45:18 | leorize | there's a share button there |
13:45:37 | nullnullnull | sec |
13:47:18 | nullnullnull | https://play.nim-lang.org/#ix=1R1S |
13:52:53 | * | laaron quit (Remote host closed the connection) |
13:56:04 | * | laaron joined #nim |
14:03:26 | * | user0 joined #nim |
14:04:48 | * | gokr joined #nim |
14:04:51 | * | gokr_ quit (Ping timeout: 248 seconds) |
14:06:01 | nullnullnull | strange, I removed everything related to args and parsing , but still getting that error |
14:06:05 | nullnullnull | what happened here sec |
14:06:35 | leorize | nullnullnull: that code is running on the playground |
14:06:44 | leorize | so... what's your nim version? |
14:07:02 | leorize | also, you can import multiple modules in one statement, no need for the `;` nesting |
14:07:20 | nullnullnull | maybe it's something related to this lib/nim/pure/net.nim(1252, 10) |
14:07:27 | nullnullnull | but why |
14:07:48 | leorize | what's your Nim version? |
14:07:49 | leorize | run nim -v |
14:08:00 | nullnullnull | Nim Compiler Version 0.17.2 (2018-02-05) [Linux: amd64] |
14:08:06 | Araq | maybe it's just a stdlib bug since we don't use --taintMode:on |
14:08:13 | Araq | 0.17.2?! |
14:08:20 | nullnullnull | yes mate |
14:08:25 | Araq | you're my hero |
14:08:33 | nullnullnull | me? :P |
14:08:38 | Araq | yep. :D |
14:08:43 | leorize | you're running a 2 yrs old Nim |
14:08:46 | nullnullnull | it's a heroic version? |
14:08:50 | nullnullnull | oh |
14:09:16 | nullnullnull | but wait i installed this from ubuntu |
14:09:22 | nullnullnull | apt-get install nim |
14:09:25 | nullnullnull | something like that |
14:09:40 | federico3 | sure, but from an older Ubuntu release |
14:09:56 | user0 | This is why installing from choosenim should be encouraged |
14:09:57 | federico3 | https://launchpad.net/ubuntu/+source/nim |
14:09:58 | nullnullnull | oh |
14:10:01 | leorize | federico3: do you have a ppa for old ubuntu releases? |
14:10:19 | federico3 | why a ppa? |
14:10:28 | nullnullnull | but wait , I wanna stay a hero |
14:10:36 | nullnullnull | let me fix this bug first :P |
14:10:40 | federico3 | user0: no thanks |
14:12:04 | leorize | federico3: some people want/have to use old Ubuntu versions |
14:12:11 | leorize | a ppa would help (i think) |
14:12:34 | nullnullnull | but I dont think it's about old version of nim (that error) |
14:13:03 | federico3 | leorize: no, that's what snapshots is for https://snapshot.debian.org/package/nim/ |
14:13:41 | nullnullnull | ok u know what , i will install it and see |
14:13:45 | nullnullnull | maybe im missing some files |
14:13:55 | Araq | we also have nightly builds with Linux binaries |
14:14:02 | leorize | nullnullnull: you should use a newer version anyway |
14:14:15 | leorize | there's a fair share of breaking changes over the years |
14:14:59 | nullnullnull | damn |
14:15:01 | nullnullnull | it worked! |
14:15:04 | nullnullnull | wtf :| |
14:15:11 | nullnullnull | i was missing some files there |
14:15:36 | nullnullnull | thanks guys ;) |
14:17:50 | * | nullnullnull quit (Remote host closed the connection) |
14:18:14 | * | nullnullnull joined #nim |
14:27:52 | * | clyybber quit (Quit: WeeChat 2.5) |
14:28:13 | * | endragor joined #nim |
14:32:51 | * | endragor quit (Ping timeout: 258 seconds) |
14:44:27 | FromGitter | <Vindaar> ha, funny. While searching a specific commit, I just stumbled on this: https://github.com/nim-lang/Nim/commit/40c5509a02c74740e020336708c3f26c838e36f7 ⏎ Been fixed only recently |
14:49:49 | Araq | is --taintMode:on popular? |
14:50:13 | Araq | we could enable it per default but I only found it annoying |
14:51:54 | FromGitter | <Vindaar> I like the idea of it, but for the stuff I write it falls into the "annoying" category too |
14:52:55 | Araq | in practice output validation works much better, have a typesafe SQL/HTML tree that always quotes your strings |
14:54:13 | * | gokr quit (Ping timeout: 246 seconds) |
14:54:15 | * | gokr_ joined #nim |
15:05:19 | * | nsf quit (Quit: WeeChat 2.4) |
15:05:56 | FromDiscord_ | <Kiloneie> How did you guys find out about Nim btw ? |
15:06:26 | leorize | free pascal forum :p |
15:07:10 | leorize | there were a lot of noises about Nim being the better pascal there |
15:07:41 | Araq | oh? I've only seen the usual FUD |
15:07:48 | FromDiscord_ | <Kiloneie> I found it by googling Python alternative and found this page: https://www.slant.co/options/110/alternatives/~python-alternatives |
15:08:20 | FromDiscord_ | <Kiloneie> and seeing the like to dislike ratio and pros vs cons, and the language syntax, instant, welp that's mine O,O |
15:08:43 | FromDiscord_ | <Kiloneie> it's also top in this category: https://www.slant.co/topics/5984/~productivity-enhancing-well-designed-and-concise-rather-than-just-popular-or-time-tested-programming-lang |
15:09:04 | * | user0 quit (Quit: user0) |
15:11:24 | leorize | Araq: well I've found some of the mentions while scraping the mailing list to deal with all the problems I was having with fpc's generics |
15:22:20 | Araq | well generics are hard ;-) |
15:23:05 | Araq | and Nim was written with them in mind and yet we got them pretty much wrong. but at least they are usable for containers which is what matters most |
15:31:00 | Araq | and they have no runtime indirections ;-) |
15:31:48 | * | endragor joined #nim |
15:35:53 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
15:36:54 | * | laaron joined #nim |
15:38:42 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:39:21 | * | floppydh quit (Quit: WeeChat 2.5) |
15:54:29 | shashlick | @lqdev - do you think you need c++ mode |
15:54:55 | lqdev[m] | likely not |
15:56:55 | rayman22201 | @shashlick: just catching up. Regarding channels. I misunderstood the context. I understand now. Thanks for the clarification 👍😁 |
16:00:54 | shashlick | Np |
16:01:25 | shashlick | Am going to try @Shield suggestion and use alloc + pointers |
16:01:28 | shashlick | Won't be able to use any Nim objects which is sad |
16:01:42 | shashlick | I might make a poor man's alloc based object |
16:02:19 | shashlick | Like SharedSeq |
16:02:29 | leorize[m] | make your own shared_ptr and unique_ptr then |
16:05:23 | rayman22201 | I wonder if you can solve it with some set of procs to change gc ownership. Gc_unref from gc A. Pass the now non-gc-ref to a proc owned by gc B, and gc_ref there. |
16:07:09 | rayman22201 | The idea of two gcs on a single thread just seems like asking for trouble either way. 😕 |
16:07:27 | shashlick | Cool ideas |
16:07:27 | Araq | you can't change "ownership" between different heaps |
16:07:45 | shashlick | Well the object really belongs to the main exe |
16:07:49 | Araq | it's fundamentally impossible, which is why --newruntime abandons the idea |
16:07:53 | shashlick | The dlls should be able to modify |
16:08:03 | shashlick | But ya the dll gc will have no clue |
16:08:53 | Araq | what you can do: var x: array[100, MyObject] and use fixed size arrays for everything :P |
16:09:18 | Araq | you would be surprised how far you can get with it, old Pascal worked this way |
16:09:30 | Araq | and I maybe Cobol still does. |
16:09:33 | shashlick | But won't changing the fields still involve the gc |
16:09:38 | shashlick | Strings |
16:09:54 | Araq | String --> array[30, char] :P |
16:16:18 | shashlick | No what if an object has a string field, it will still be managed by the gc right? |
16:16:29 | shashlick | So I'll have to make an object with array fields |
16:19:51 | Araq | exactly |
16:20:45 | FromDiscord_ | <Kiloneie> if a procedure creates a sequence, then adds new elements to it in a loop, can you access those from outside the loop ? |
16:22:55 | Araq | you can't add elements unless it's 'var' |
16:23:44 | shashlick | Ok I have an option now |
16:27:45 | nullnullnull | btw guys, is there any performance improvement if i import part of "os" instead of "import os;"? |
16:29:26 | Araq | no |
16:30:00 | FromDiscord_ | <Kiloneie> it should be in compilation a bit no ? |
16:30:28 | FromDiscord_ | <Kiloneie> or do you actually need to use a procedure from imported module ? |
16:30:31 | Araq | you won't be able to measure it |
16:30:54 | FromDiscord_ | <Kiloneie> insignificant then |
16:31:17 | FromDiscord_ | <Kiloneie> would it be measurable if you imported all of Nim's modules though ? or stll no ? |
16:31:47 | nullnullnull | hmm |
16:32:09 | Araq | that's a different question. |
16:32:09 | nullnullnull | so why they made that thing if it's not doing anything |
16:32:42 | Araq | import os vs from os import copyFile # hard to measure |
16:32:45 | nullnullnull | like what's the difference between importing os; and "from os import paramStr;" |
16:32:56 | Araq | import os, strutils, tables, .... # adds up |
16:34:03 | Araq | nullnullnull: the difference is what you have in scope afterwards. |
16:34:14 | nullnullnull | maybe bigger file? or more memory |
16:34:27 | nullnullnull | compilation or something |
16:34:46 | shashlick | The code still needs to be read |
16:35:31 | nullnullnull | im imagining it like reading the whole library vs reading a function from library |
16:35:43 | nullnullnull | loading* |
16:35:57 | FromGitter | <alehander42> It has nothing to do with filed because of dead code elimination |
16:36:03 | FromDiscord_ | <Kiloneie> so in a really big program where you use a few procedures from idk, every module, you would want to include only those procedures right ? |
16:36:50 | FromGitter | <alehander42> It's mostly because when you analyze code it's easier when only the functions you use are explicitly imported |
16:37:42 | FromGitter | <alehander42> And sometimes also because functions from different modules might both match :same name and types |
16:37:47 | Araq | just use what you like more |
16:38:06 | Araq | until you understand the differences and grow an opinion on this issue |
16:38:24 | disruptek | this. |
16:38:58 | Araq | I often start with 'from os import stuff' and then if the list grows I don't want to maintain it further and do 'import os' |
16:40:02 | Araq | and has no difference on the binary size or runtime speed and the compile-time difference will get even smaller with IC. |
16:41:17 | FromDiscord_ | <Kiloneie> best left for after the program is finished |
16:45:27 | * | endragor quit (Remote host closed the connection) |
16:45:40 | leorize | I usually do `import` then if too many symbols collide I switch to `from import` or `import except` |
16:45:53 | * | endragor joined #nim |
16:47:09 | shashlick | I like the new hint when an import isn't used |
16:47:12 | shashlick | Very nice |
16:50:04 | * | endragor quit (Ping timeout: 246 seconds) |
17:04:29 | FromGitter | <mratsim> I agree, super useful for large projects |
17:30:26 | Zevv | hmm, how can I pass a generic pointer/length combo as openArray? |
17:33:25 | Zevv | is toOpenArray() with UncheckedArray[] the way to go? |
17:34:03 | leorize | yea |
17:34:11 | leorize | it's added precisely for that reason iirc :P |
17:37:13 | Zevv | sweet, like a charm |
17:37:34 | Zevv | npeg can now parse zero-copy through memfile |
17:37:50 | leorize | nice |
17:37:50 | * | kungtotte quit (Read error: Connection reset by peer) |
17:38:37 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
17:38:42 | Zevv | I got most of my wishlist, but I'm still stuck with unwilling macros to make stuff composable. |
17:39:05 | rayman22201 | That's very awesome! congrats @zevv |
17:39:53 | shashlick | Zevv: why does npeg use prefix mode |
17:40:08 | Zevv | because nim syntax does not allow suffixes |
17:41:06 | Zevv | I could just parse pegs from strings, but I wanted to define grammar as valid Nim so that grammar and nim code can be freely mixed. |
17:42:14 | * | laaron joined #nim |
17:42:22 | FromGitter | <mratsim> there is the postfix * |
17:42:43 | Zevv | is there? |
17:42:57 | rayman22201 | @shashlick, did you see my choosenim bug report from yesterday? |
17:43:10 | rayman22201 | or maybe I should ping @Dom96? |
17:43:27 | rayman22201 | idk who is more active on it atm. |
17:44:11 | shashlick | I didn't see it |
17:45:23 | FromGitter | <mratsim> it’s the one for proc foo*(x: int): int |
17:45:27 | shashlick | You posted two |
17:45:37 | rayman22201 | I did. one is more of a feature request |
17:46:39 | rayman22201 | the real bug is https://github.com/dom96/choosenim/issues/129 |
17:46:49 | rayman22201 | might also be a nim bug? I'm not sure. |
17:47:01 | rayman22201 | Should the latest nim devel work with Mingw 4.9.1? |
17:49:36 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
17:49:51 | Zevv | mratsim: true, but that's the odd one out |
17:49:52 | shashlick | I thought it installs 630 |
17:50:43 | * | laaron joined #nim |
17:51:56 | rayman22201 | could be my environment? I did a fresh install and still got 4.9.1 |
17:53:52 | rayman22201 | I was looked through the code (very briefly), and it looked like it might not re-download if it finds the zip file already exists. Maybe It saw the the old version mingw from the old choosenim I had, and re-used that? |
17:54:52 | rayman22201 | if that is the case, it is still a bug, but a caching bug. |
17:55:04 | shashlick | Could be ya |
17:55:12 | leorize | @mratsim that one is a special token, only in specific places would the compiler parse that |
17:55:15 | shashlick | But 630 is what is been for a long time |
17:55:29 | leorize | iirc someone tried to write a macro that make use of that but got refused by the compiler |
17:55:44 | rayman22201 | I had a very old version of nim on my windows box. I hadn't used nim on windows for a long time. |
17:58:47 | rayman22201 | possibly related, possibly not, but I had to re-install libcrypto after I changed mingw versions (which nimble requires, but windows doesn't necessarily come with). |
18:00:55 | rayman22201 | I think choosenim should probably install libcrypto on windows if it is also going to install mingw. |
18:01:35 | FromGitter | <mratsim> @leorize: someone —> you? :P |
18:02:31 | * | gokr_ quit (Ping timeout: 246 seconds) |
18:06:55 | FromGitter | <mratsim> @Araq, I’m writing your old concurrency blog posts, are they still relevant, btw i guess the “shared” annotation never made it to the language right? (https://nim-lang.org/araq/concurrency.html and https://nim-lang.org/araq/concurrency2.html) |
18:17:21 | rayman22201 | @shashlick check this out. I just tried a fresh install again. I still get Mingw 4.9.1 https://www.irccloud.com/pastebin/6wzppGsQ/ |
18:18:21 | rayman22201 | and it shows it downloading a fresh copy of mingw |
18:18:31 | rayman22201 | so it's definitely getting the wrong version somehow |
18:19:00 | rayman22201 | Does anybody else have a windows machine that they can verify it's not just me? |
18:23:37 | rayman22201 | I figured it out. The hard coded link here is wrong: https://github.com/dom96/choosenim/blob/master/src/choosenim/download.nim#L17 |
18:23:49 | rayman22201 | it should be https://nim-lang.org/download/mingw32-6.3.0.7z |
18:24:12 | rayman22201 | so that is real bad for people who want to use choosenim on windows lol |
18:33:11 | rayman22201 | First time I created a PR completely from the web lol. Using only the github UI. :-P https://github.com/dom96/choosenim/pull/132 |
18:42:30 | * | rockcavera quit (Ping timeout: 268 seconds) |
18:43:21 | * | rockcavera joined #nim |
18:43:21 | * | rockcavera quit (Changing host) |
18:43:21 | * | rockcavera joined #nim |
18:52:37 | Araq | mratsim: yes. 'shared' is the wrong idea. |
18:58:55 | Araq | the lock levels and .guard are still quite good and once the heap is not shared anymore we can use them way more often :P |
19:04:03 | * | gangstacat quit (Quit: Ĝis!) |
19:08:02 | * | nsf joined #nim |
19:09:27 | * | huuskes joined #nim |
19:24:00 | FromGitter | <zacharycarter> shashlick: I'm working on that macro for NimScript - nimLUA is giving me a good starting point |
19:35:52 | shashlick | Excellent |
19:36:07 | * | nsf quit (Quit: WeeChat 2.4) |
19:36:27 | shashlick | @rayman22201 I need to update 630 to 810 on the web and CI as well |
19:36:52 | shashlick | Will be good to have a way for choosenim to detect rather than have to hard code |
19:40:22 | FromGitter | <Varriount> mratsim: I don't suppose you've done any work on perfect hash algorithms, have you? |
19:40:50 | FromGitter | <Varriount> Araq: I thought the heaps were already seperate, due to GC complications? |
19:44:05 | rayman22201 | @shashlick: understood. My PR is a quick fix, because right now choosenim is completely broken on Windows. |
19:48:08 | rayman22201 | Is the plan to keep hosting our own copy of mingw? Is there a reason choosenim can't grab it from the mingw servers directly? |
19:48:31 | rayman22201 | I never understood why Nim mirrored it's own copy. |
19:50:54 | FromDiscord_ | <treeform> So that it does not go away for some reason? |
19:51:04 | FromDiscord_ | <treeform> I mirror everything... |
19:56:04 | rayman22201 | Sure, but are you also maintaining a code distribution tool used by a (relatively) large community? It's a cost benefit analyses. |
19:58:14 | rayman22201 | Mingw is unlikely to go away, it's a big project. Much bigger than Nim. |
20:07:54 | rayman22201 | Let me put my comment in a different way. Choosenim is broken because of a hardcoded link that was not updated and not properly version labeled. Choosenim must get smarter with regards to checking the mingw version. But, If we choose to mirror, the mirror must also get smarter, or at least more organized about version labels. |
20:07:57 | rayman22201 | Or, we can take advantage of that fact that Mingw has done this organization already, and just link there. |
20:09:01 | * | gangstacat joined #nim |
20:09:22 | leorize[m] | rayman22201: I think it's more of being a tested mingw version than mirrored |
20:10:12 | rayman22201 | We can make choosenim download the tested version from mingw. It doesn't have to come from a nim server. |
20:11:22 | rayman22201 | I understand the "tested version" concept. That's fine. I don't have a problem with that. But who cares where it gets downloaded from? |
20:13:01 | rayman22201 | Mingw 6.3.0 is the minimum required version. If I download MinGW 6.3.0 from the Nim servers or from github, or from joeschmoe.net, who cares? as long as the checksum matches and it works. |
20:13:48 | leorize[m] | true |
20:13:51 | rayman22201 | I understand the point about servers going away. There is a reason for corporate code mirrors. But I just think it's too paranoid in this particular case. |
20:14:33 | rayman22201 | and it will save an already small team of developers a lot of work to not mirror. |
20:15:04 | leorize[m] | not that choosenim ever checked the checksum :p |
20:15:13 | rayman22201 | that's another story lol |
20:15:58 | leorize[m] | to be fair it's not that complicated to mirror |
20:17:40 | leorize[m] | I'm more concerned about how are the dlls produced |
20:17:46 | Araq | we mirrored because the original mingw it uses freaking sourceforge with always changing links and a super confusing structure |
20:17:53 | disruptek | there was probably a point in time when specific versions mattered. |
20:18:41 | rayman22201 | Meh. Fair enough. I'm just mad about choosenim being broken in such a stupid way. We need to do better. |
20:19:30 | Araq | how was it broken? *our* download links never change |
20:20:06 | Araq | looks to me choosenim doesn't use our mirror and that's how it got broken...? |
20:20:34 | rayman22201 | Nim devel no longer works with mingw 4.9.1 but the hardcoded link still points to that version |
20:21:04 | * | deech joined #nim |
20:21:43 | rayman22201 | Is the mirror not https://nim-lang.org/download/mingw32-6.3.0.7z? |
20:21:58 | dom96 | rayman22201, choosenim cannot extract 7z files |
20:23:18 | leorize[m] | it's weird, fwiw 4.9 were what devel was being tested against |
20:23:37 | rayman22201 | @dom96 Shit. I forgot about that. Well that's even worse. |
20:24:01 | leorize[m] | I only adjusted it to 6.3 recently as that's what everyone will get from the homepage |
20:24:05 | rayman22201 | Is Nim cpp being tested? It's coo mode that is broken specifically |
20:24:35 | rayman22201 | Nobody who uses choosenim will get the correct version. I just tested this. Twice. |
20:25:01 | leorize[m] | no, cpp is being tested on osx exclusively |
20:25:06 | leorize[m] | which uses clamg |
20:25:26 | leorize[m] | clang* |
20:25:27 | rayman22201 | There you go. That is probably why the bug wasn't found. |
20:25:36 | Araq | shrug. Not my bug. I didn't write choosenim and said "fuck you koch.nim & finish.nim, I can't be bothered to read Araq's code" |
20:25:46 | dom96 | wow |
20:27:49 | leorize[m] | the test matrix should probably be expanded a bit |
20:28:21 | leorize[m] | but then there aren't many parallel jobs to begin with |
20:36:56 | * | Vladar quit (Remote host closed the connection) |
20:38:44 | krux02 | dom96, I just realized you are around |
20:39:03 | krux02 | I could really need your help with nimble, because I am dealing with your code right now |
20:41:08 | dom96 | sure, feel free to ask questions |
20:42:16 | krux02 | it not really just a question I need to resolve a problem and you know the architecture. |
20:44:12 | krux02 | I just wrote on github that I have a problm with my pr, where nimble causes problems. |
20:48:12 | * | nullnullnull quit (Quit: Leaving) |
20:48:50 | * | laaron quit (Remote host closed the connection) |
20:50:41 | * | laaron joined #nim |
20:54:05 | * | shomodj joined #nim |
21:05:12 | * | Kaivo quit (Quit: WeeChat 2.5) |
21:10:09 | rayman22201 | Can someone with access to the nim-lang.org website please update http://nim-lang.org/download/mingw32.tar.gz to point to the newer version of mingw? |
21:20:56 | shashlick | I really need to get nimarchive working so that choosenim can extract 7z |
21:24:02 | Araq | all you need to do is to copy code from finish.nim and ship 7z.exe |
21:24:54 | Araq | there is also code in there to set the PATH variable |
21:25:46 | Araq | and code that creates a start menu entry |
21:36:42 | * | Jesin quit (Quit: Leaving) |
21:46:52 | dom96 | Araq, but then you'd be d-uuuu-ppplicatinggggg codeeee :P |
21:47:24 | Araq | duplicated code is still better than broken code |
21:47:30 | Araq | or missing code |
21:48:03 | Araq | and you could patch finish.nim, make it importable as a module and import it from choosenim |
21:48:12 | Araq | but I'm not even asking for that... |
21:49:21 | * | Jesin joined #nim |
21:49:50 | dom96 | Araq, very true |
21:53:02 | dom96 | on the other hand, you could also just update the .tar.gz |
21:53:07 | rayman22201 | this is all great, but it will take 5 minutes to change the .gz file on the server, and it will make choosenim work right now :/ |
21:54:05 | rayman22201 | @shashlick can you refresh my memory. what is broken with nimarchive right now? |
21:55:37 | dom96 | rayman22201, is this something you want for your own use? |
21:56:02 | rayman22201 | mostly just curious. |
21:56:24 | dom96 | rayman22201, I mean the change in mingw |
21:57:09 | rayman22201 | I just built nim manually already. Now it's just the principle of it :-) |
21:58:08 | dom96 | nothing stops you from installing your own mingw btw |
21:58:15 | dom96 | choosenim only downloads it if it's missing |
21:58:15 | rayman22201 | I did that too |
21:58:32 | rayman22201 | That is how I figured out that was the problem. |
21:59:02 | Araq | rayman22201: I'm willing to login *now* if you can give me instructions that treat me as amoeba |
21:59:14 | Araq | as it's late here :P |
21:59:33 | rayman22201 | hahaha. Amoebaraq, a new species :-P |
22:00:46 | Araq | https://youtu.be/dGareAFJ1qc?t=50 |
22:00:58 | Araq | ^ like that |
22:01:15 | dom96 | This seems like a good thing to invest into: https://github.blog/2019-08-08-github-actions-now-supports-ci-cd/ |
22:01:21 | rayman22201 | lol |
22:02:23 | Araq | well? |
22:03:36 | rayman22201 | the steps are. 1. Unzip the 6.3 version. 2. Re-zip the 6.3 version as a .gz 3. upload the .gz to the server |
22:03:51 | rayman22201 | I'm trying to see if I can do step 1 and 2 for you and just send you the file |
22:03:54 | rayman22201 | give me 5 minutes |
22:10:46 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:11:47 | FromGitter | <zacharycarter> if I have a compile time proc that takes in an argument, and inside that proc I generate and call a macro - how can I pass that argument as a parameter to the macro? |
22:12:03 | FromGitter | <zacharycarter> in the macro invocation that I generate |
22:12:55 | deech | What editor are Nim compiler devs using? Emacs doesn't seem to work well ... |
22:14:07 | FromGitter | <zacharycarter> VSCode if you can stand electron |
22:14:20 | FromGitter | <zacharycarter> if you want a modal editor I think people use neovim with nvim or something |
22:14:24 | FromGitter | <zacharycarter> krux02 uses emacs |
22:15:16 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
22:17:10 | rayman22201 | and extracting is taking forever.... |
22:18:12 | FromGitter | <zacharycarter> I figured I just needed to do `bindSym` |
22:18:41 | FromGitter | <zacharycarter> but if I use `bindSym` with the NimNode itself - I get the error: `cannot evaluate at compile time: tn` |
22:18:55 | FromGitter | <zacharycarter> and if I do it with `bindSym("tn")` nothing seems to happen |
22:20:40 | FromGitter | <zetashift> @deech I also switched to vscode, nim support is really nice here. Emacs was great but Nim support is okay-ish and my elisp-fu is too weak to contribute :(. |
22:20:52 | FromGitter | <zacharycarter> hmm I think I may have figured out a way to make it work |
22:23:07 | * | nif quit (Quit: ...) |
22:23:16 | * | nif joined #nim |
22:25:12 | * | aq60 joined #nim |
22:25:46 | rayman22201 | @Araq: http://www.filedropper.com/mingw32tar |
22:25:52 | aq60 | Hi, one question: can you use ref with the new runtime? |
22:25:54 | deech | @zetashift, Emacs seems to work ok for non-compiler Nim dev, completion etc. is more or less ok. It falls apart on the compiler code itself. I'll try VSCode. |
22:27:28 | rayman22201 | @aq60 yes (might need to add owned ref annotation to places, but yes) |
22:27:33 | aq60 | This is the error: type mismatch: got <ref MyType>but expected one of:proc new[T](a: var ref T; finalizer: proc (x: ref T) {.nimcall.}) |
22:27:58 | rayman22201 | what is the code that caused the error? |
22:28:03 | FromGitter | <zacharycarter> still can't get this to work bleh |
22:28:10 | * | solitudesf quit (Ping timeout: 246 seconds) |
22:28:41 | aq60 | well, I have var r: ref MyType |
22:28:49 | aq60 | new r |
22:29:14 | * | shomodj joined #nim |
22:29:30 | rayman22201 | @aq60 that's not how new works |
22:30:01 | rayman22201 | you do `var myR = new r` |
22:30:49 | aq60 | it works with the old runtime, with linked list, iterators, no errors, the data is ok |
22:31:13 | aq60 | ill check it out now |
22:31:35 | rayman22201 | you haven't shown any real code snippets, so I don't know enough to help you |
22:32:22 | rayman22201 | actually, I made a mistake. it should be "var myR = new MyType" |
22:33:03 | rayman22201 | that' is your problem. the `new` function takes a type, you are passing a pointer. |
22:34:11 | rayman22201 | `var myR` in my example will be inferred to be of type `ref MyType` |
22:35:10 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:37:01 | aq60 | let me check it quickly, i'd give you the example |
22:37:52 | * | shomodj joined #nim |
22:40:53 | * | laaron quit (Remote host closed the connection) |
22:41:44 | aq60 | now i have: `if condition: new myR` |
22:41:52 | aq60 | it works like that |
22:42:25 | aq60 | i have to instance it in the 'if' block |
22:43:08 | * | laaron joined #nim |
22:43:09 | rayman22201 | new myR is wrong. it should be new MyType |
22:44:02 | rayman22201 | If the condition works, it's probably because it's not being evaluated. But that should not work either. |
22:45:39 | rayman22201 | new is sugar for a function that takes a type. it can be written as `new[Type]()`. you are essentially writing `new[myR]()` which makes no sense. |
22:54:57 | aq60 | there is the simplified example: https://play.nim-lang.org/#ix=1R5k |
22:58:21 | FromGitter | <zacharycarter> how would I do: `for item in seq[1..^]: ...` |
23:01:02 | aq60 | for item in 0 ..< seq.len(): ... ? |
23:02:32 | FromGitter | <zacharycarter> I want a slice of 1 to len - 1 |
23:02:42 | FromGitter | <zacharycarter> that would give me an integer |
23:02:57 | FromGitter | <zacharycarter> I want an item from the sequnce |
23:03:01 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
23:03:16 | FromGitter | <zacharycarter> I mean yes I can index the seq - but if there's a shorter way like what I described, I'd rather do that |
23:03:47 | rayman22201 | @aq60: it should be like this: https://play.nim-lang.org/#ix=1R5o |
23:04:10 | rayman22201 | also, just fyi, the convention is that types should start with a capital letter. |
23:06:28 | rayman22201 | @zacharycarter, the items iterator doesn't let you specify the range. I think you have to index it by hand. |
23:06:44 | FromGitter | <zacharycarter> gotcha - thanks rayman, that's what I figured |
23:06:56 | FromGitter | <zacharycarter> alternatively I could create a slice but that's more verbose |
23:07:24 | rayman22201 | You could also create your own iterator that takes a range :-P |
23:15:00 | aq60 | tnx rayman22201 |
23:15:18 | rayman22201 | np :) |
23:15:33 | aq60 | i had to comment one line to compile, but it works with the newruntime too |
23:15:49 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
23:16:03 | rayman22201 | 🎉 awesome! |
23:19:06 | * | krux02_ joined #nim |
23:19:49 | FromGitter | <mratsim> For those still awake, here is a draft of the RFC I will submit for Nim’s multithreading runtime. https://gist.github.com/mratsim/f1cb710b640e7a4cf8ba5f22ee34ab7b ⏎ ⏎ I’m going to sleep, too tired. |
23:20:50 | * | laaron joined #nim |
23:21:00 | FromGitter | <mratsim> need to generate the table of contents and do some formatting |
23:21:26 | FromGitter | <zacharycarter> https://play.nim-lang.org/#ix=1R5r |
23:21:31 | FromGitter | <zacharycarter> can someone help me with this template? |
23:23:05 | * | krux02 quit (Ping timeout: 268 seconds) |
23:24:42 | * | PrimHelios joined #nim |
23:25:20 | FromGitter | <mratsim> easy, don’t use strings :p |
23:25:32 | * | PrimHelios_ quit (Ping timeout: 272 seconds) |
23:25:37 | FromGitter | <zacharycarter> well - I start with a string |
23:25:47 | FromGitter | <mratsim> or use a macro that accepts static string and creates an ident from it |
23:26:00 | FromGitter | <zacharycarter> the string will not be static |
23:26:06 | FromGitter | <zacharycarter> as it's coming from a PNode from the VM |
23:26:37 | * | Jjp137 quit (Ping timeout: 246 seconds) |
23:27:00 | FromGitter | <mratsim> but it’s known at compile-time right? |
23:27:13 | FromGitter | <mratsim> you can reuse the examples I put in this thread: https://forum.nim-lang.org/t/5000#31345 |
23:27:15 | FromGitter | <zacharycarter> I guess so |
23:27:33 | FromGitter | <zacharycarter> thanks I will check that out |
23:27:52 | FromGitter | <mratsim> for “runtime” dynamism |
23:28:07 | FromGitter | <mratsim> of if compile-time, just use untyped parameter |
23:28:36 | FromGitter | <mratsim> and pass setField(myObject, bar, footer) |
23:28:48 | FromGitter | <mratsim> setField(myObject, bar, foobar) |
23:28:57 | FromGitter | <mratsim> without the “” for strings |
23:29:02 | * | Jjp137 joined #nim |
23:29:08 | FromGitter | <mratsim> this way it’s an ident, and the template will inject it |
23:30:44 | * | couven92 quit (Quit: Client disconnecting) |
23:30:47 | FromGitter | <zacharycarter> well - that's not going to work in my scenario but I'll see if I can use a macro to create an ident |
23:30:56 | krux02_ | deech: I use emacs regularly on the compiler. But I disabled nimsuggest, too much frustration with it. |
23:32:45 | krux02_ | rayman22201, About types to start with capital letter: I even went so far and said in emacs everything that starts with a capital letter is a type. It's incorrect, but for anything except constants it works |
23:33:12 | rayman22201 | lol. good enough |
23:33:23 | FromGitter | <bevo009> I was just reading the earlier discussion about imports ⏎ So is this macro that makes you use qualified names a bad or useless idea? :) ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d4cb1432612bb718c3417d0] |
23:33:42 | * | stefanos82 quit (Quit: Quitting for now...) |
23:34:12 | * | nif quit (Quit: ...) |
23:34:20 | * | hogeland quit (Remote host closed the connection) |
23:34:21 | * | nif joined #nim |
23:34:32 | aq60 | Why its so important for types to start with capital lettter? |
23:34:59 | disruptek | it helps their self-esteem. |
23:35:29 | * | shomodj joined #nim |
23:36:41 | FromGitter | <zacharycarter> meh - I think I'm going to give up on this macro |
23:36:52 | rayman22201 | @a60 it's just the convention: https://nim-lang.org/docs/nep1.html |
23:38:54 | rayman22201 | @aq60 even |
23:42:45 | * | arecaceae quit (Remote host closed the connection) |
23:43:09 | * | arecaceae joined #nim |
23:43:41 | krux02_ | aq60, it is not important to start types with capital letter. Many types in system don't start with capital letter, e.g. int float string seq set |
23:43:57 | FromDiscord_ | <Kiloneie> Can someone help me with this code: https://play.nim-lang.org/#ix=1R5s |
23:43:57 | FromDiscord_ | <Kiloneie> |
23:43:57 | FromDiscord_ | <Kiloneie> I don't know how to do this with objects |
23:43:58 | krux02_ | but it helps to see that an identifier is a type |
23:45:18 | krux02_ | Kiloneie: well, you search for an object with age: 0 |
23:45:24 | krux02_ | default initialization |
23:45:32 | krux02_ | even if you don't write it is is there |
23:50:44 | aq60 | @krux02 one thing I'm not fond of in Nim is the 576 different ways to do things |
23:51:04 | krux02_ | yea me neither |
23:51:05 | aq60 | for ex. instantiation |
23:51:15 | krux02_ | what instantiation? |
23:51:27 | krux02_ | with instantiation I don't have a problem. |
23:51:28 | aq60 | instancing, sry |
23:51:48 | krux02_ | can you give an example? |
23:53:30 | aq60 | for ex. this: https://play.nim-lang.org/#ix=1R5o and this https://play.nim-lang.org/#ix=1R5k |
23:54:28 | aq60 | both fill the data, the second example doesnt work with newruntime |
23:54:57 | rayman22201 | @kiloneie: try this https://play.nim-lang.org/#ix=1R5u |
23:55:02 | * | lritter joined #nim |
23:55:36 | krux02_ | aq60: we had a discussion recently about exactly this, thanks for giving the same feeding, that pushes it up on my priorities list. |
23:56:10 | krux02_ | basically the consesuls was the deprecate the ``new value; value.x = 123`` approach |
23:56:46 | krux02_ | it is very confusing for people who come from languages where ``new`` works differently ``all langages I can think of`` |
23:56:59 | aq60 | yes it is :) |
23:57:05 | rayman22201 | @aq60 Krux02_, I personally think it should always be `new Type`, `new value` is a bug. |
23:58:18 | FromDiscord_ | <Kiloneie> rayman thank you ! |
23:58:54 | krux02_ | I wouldn't call `new value` a bug, as it clearly works. But yes it is redundant, and confusing. |
23:59:21 | rayman22201 | I consider confusing and redundant to be a bug :-P |
23:59:26 | rayman22201 | a human bug |