00:18:17 | * | lritter quit (Ping timeout: 258 seconds) |
00:18:57 | * | lritter joined #nim |
00:26:32 | * | abm quit (Quit: Leaving) |
00:32:55 | * | jjido quit (Quit: Connection closed for inactivity) |
00:49:30 | * | lritter quit (Quit: Leaving) |
00:58:24 | * | vlad1777d quit (Ping timeout: 268 seconds) |
01:32:07 | * | dwdv quit (Ping timeout: 245 seconds) |
01:57:16 | * | vlad1777d joined #nim |
02:12:13 | * | deech joined #nim |
02:30:08 | * | rockcavera joined #nim |
02:37:35 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
02:38:06 | * | laaron joined #nim |
02:40:03 | * | laaron quit (Client Quit) |
02:40:43 | * | laaron joined #nim |
02:50:44 | * | kungtotte quit (Remote host closed the connection) |
02:52:07 | * | deech quit (Ping timeout: 245 seconds) |
02:52:43 | * | envoyt quit (Ping timeout: 248 seconds) |
02:53:04 | * | envoyt joined #nim |
03:10:05 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
03:10:25 | * | laaron joined #nim |
03:20:22 | leorize | skrylar[m]: you make your own gtk/gdk bindings instead of using ngtk or gintro? |
03:22:00 | * | rayman22201 quit (*.net *.split) |
03:22:00 | * | uvegbot quit (*.net *.split) |
03:22:01 | * | planetis[m] quit (*.net *.split) |
03:22:01 | * | k0mpjut0r quit (*.net *.split) |
03:22:01 | * | snowolf_ quit (*.net *.split) |
03:22:01 | * | oprypin quit (*.net *.split) |
03:22:01 | * | enthus1ast quit (*.net *.split) |
03:22:01 | * | oz quit (*.net *.split) |
03:22:01 | * | Miguelngel[m] quit (*.net *.split) |
03:22:01 | * | gh0st[m] quit (*.net *.split) |
03:22:02 | * | beatmox quit (*.net *.split) |
03:22:03 | * | drewr quit (*.net *.split) |
03:22:04 | * | CcxWrk quit (*.net *.split) |
03:22:04 | * | sealmove quit (*.net *.split) |
03:22:04 | * | vegax87 quit (*.net *.split) |
03:22:05 | * | oculux quit (*.net *.split) |
03:22:05 | * | pydsigner quit (*.net *.split) |
03:22:05 | * | Kaivo quit (*.net *.split) |
03:22:50 | * | oculux joined #nim |
03:23:29 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
03:26:24 | * | CcxWrk joined #nim |
03:26:33 | * | laaron joined #nim |
03:31:06 | * | envoyt quit (Ping timeout: 258 seconds) |
03:33:40 | * | envoyt joined #nim |
03:38:02 | * | rayman22201 joined #nim |
03:38:02 | * | uvegbot joined #nim |
03:38:02 | * | planetis[m] joined #nim |
03:38:02 | * | k0mpjut0r joined #nim |
03:38:02 | * | snowolf_ joined #nim |
03:38:02 | * | oprypin joined #nim |
03:38:02 | * | enthus1ast joined #nim |
03:38:02 | * | oz joined #nim |
03:38:02 | * | Miguelngel[m] joined #nim |
03:38:02 | * | gh0st[m] joined #nim |
03:38:02 | * | beatmox joined #nim |
03:38:47 | * | drewr joined #nim |
03:38:47 | * | sealmove joined #nim |
03:38:47 | * | vegax87 joined #nim |
03:38:47 | * | pydsigner joined #nim |
03:38:47 | * | Kaivo joined #nim |
03:40:16 | * | envoyt quit (Ping timeout: 248 seconds) |
03:40:34 | * | envoyt joined #nim |
03:43:38 | * | dddddd quit (Remote host closed the connection) |
03:45:04 | * | sealmove quit (Quit: WeeChat 2.4) |
04:03:41 | skrylar[m] | leorize: when i was typing searches in to nimble gintro was the only gtk3 one i saw |
04:03:53 | skrylar[m] | and iirc that one is made by scraping gobject-introspection |
04:06:26 | leorize | yea, so it works directly with whatever version of gtk3 you got installed |
04:06:55 | skrylar[m] | i just fished out the gdk/gtk headers and threw a python-lark parser at it |
04:07:11 | leorize | but there's also this: https://github.com/StefanSalewski/oldgtk3 |
04:09:17 | leorize | personally I like gintro more because it integrates directly with Nim's gc :p |
04:09:25 | * | theelous3 quit (Ping timeout: 246 seconds) |
04:09:25 | * | nsf joined #nim |
04:11:08 | skrylar[m] | i forget if windows event loops work without a window present |
04:12:46 | skrylar[m] | i have the append-only version of bmessages working in nim, next step is burying the app-level stuff in the clean api |
04:13:11 | leorize | nice :) |
04:13:24 | leorize | does your module support haiku also? :) |
04:13:49 | skrylar[m] | not exactly |
04:14:41 | skrylar[m] | currently message handlers have an extra parameter to handle those weird messages that want immediate synchronous replies in to a specific return bmessage; i dunno how haiku handles those, i suspect some form of behind the scenes copying. |
04:15:03 | skrylar[m] | otherwise you could replace most of the procs with importcpp's and it would probably work |
04:15:49 | skrylar[m] | well. haiku also uses a lot of subclassing to implement virtual methods, those were replaced with closures |
04:16:19 | skrylar[m] | so instead of subclassing a bhandler, you just set the `fmessage_received` closure on the `handler` ref object |
04:17:13 | leorize | sounds easy enough to reimplement for haiku |
04:17:54 | leorize | well, I'll try once your package is ready for writing gui program :) |
04:18:13 | * | fjellfras joined #nim |
04:18:16 | skrylar[m] | the key/value store they use for messages still rustles my jimmies compared to sdl/allegro/gdk's unions, but i guess it has advantages |
04:18:38 | skrylar[m] | urho does it the be way too.. passes hash tables to event handlers. |
04:21:30 | * | envoyt quit (Ping timeout: 272 seconds) |
04:21:49 | * | envoyt joined #nim |
04:21:58 | leorize | key/value store is ABI-independant afaict |
04:22:03 | skrylar[m] | some of the app kit has been pushed away at least for now. they have clipboards in there and its a bit hazy to implement those on other platforms (starts getting in to a combination of messing with X11/Wayland, shm files.. windows has DDE I guess) |
04:22:47 | leorize | just that you can extend the APIs in the future without worrying about breaking older apps, I think |
04:23:10 | skrylar[m] | bmessages? yea. removes abi trouble among other things |
04:24:07 | skrylar[m] | well a bmessage also holds the specifier stack, which is used for scripting. so it carries the idea of "button 1 of window 3 of application" which exists in applescript and nowhere else [modern] |
05:10:04 | * | narimiran joined #nim |
05:15:18 | * | sealmove joined #nim |
05:25:42 | * | sealmove quit (Quit: WeeChat 2.5) |
05:59:05 | * | AndChat|624225 joined #nim |
05:59:05 | * | envoyt quit (Read error: Connection reset by peer) |
06:07:03 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
06:08:22 | * | AndChat|624225 quit (Ping timeout: 245 seconds) |
06:08:31 | * | laaron joined #nim |
06:08:45 | * | envoyt joined #nim |
06:19:43 | * | solitudesf joined #nim |
06:28:14 | * | PMunch joined #nim |
06:28:41 | * | Vladar joined #nim |
06:28:50 | * | mjanssen joined #nim |
06:34:18 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
06:34:47 | * | laaron joined #nim |
06:48:03 | * | envoyt quit (Ping timeout: 268 seconds) |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:04:55 | * | gmpreussner joined #nim |
07:07:18 | * | krux02 joined #nim |
07:19:06 | * | jjido joined #nim |
07:31:27 | FromGitter | <alehander42> btw Araq |
07:31:56 | FromGitter | <alehander42> newruntime: does the allocator own the memory-related functions |
07:32:08 | FromGitter | <alehander42> e.g. if my seq has a as allocator internally |
07:32:18 | FromGitter | <alehander42> does this a point to its own alloc free etc |
07:32:31 | FromGitter | <alehander42> what i mean is, can i write my own Allocator object |
07:32:47 | FromGitter | <alehander42> which replacecs them without fixing the compiler itself |
07:33:03 | FromGitter | <alehander42> and make my seq-s use it instead |
07:33:09 | FromGitter | <alehander42> e.g. FixedSizeBuffer |
07:33:48 | FromGitter | <alehander42> i know i can write my own alloc0 etc but this requires patching the compiler itself and |
07:34:01 | FromGitter | <alehander42> making them default for all kinds of types |
07:34:33 | FromGitter | <alehander42> (the last part is probably ok, but i wonder if i can replace the "global" allocator easily from userland) |
07:35:15 | FromGitter | <alehander42> @dom96 i thought about using and i think it is good |
07:36:10 | FromGitter | <alehander42> e.g. in web frameworks, you might write many functions which accept Requst or path: string etc and typing the type doesnt really offer anything to people that write those dsl-s for all their aps |
07:36:12 | FromGitter | <alehander42> apps |
07:36:20 | FromGitter | <alehander42> `using` |
07:45:40 | Araq | well yes, a seq can have a different allocator, one that you provided |
07:47:52 | FromGitter | <mratsim> oh, is it supported now? |
08:25:21 | Araq | I think so... |
08:31:22 | FromGitter | <mratsim> how do you create a seq with custom allocator? |
08:31:36 | FromGitter | <mratsim> I don't see a `newSeq` overload |
08:43:41 | * | dwdv joined #nim |
08:53:33 | * | gangstacat quit (Ping timeout: 258 seconds) |
09:13:44 | * | abm joined #nim |
09:16:24 | * | couven92 joined #nim |
09:24:07 | * | laaron quit (Remote host closed the connection) |
09:24:34 | * | laaron joined #nim |
09:38:55 | PMunch | Currently working with some PascalScript code and I can see a lot of the inspiration for Nim |
09:38:59 | * | gangstacat joined #nim |
09:39:07 | PMunch | And I have to say you managed to pick the good parts Araq |
09:42:30 | Araq | I know it's all the same to you but last time I checked Modula 3's and Ada's influence on Nim were bigger than Pascal's, it's all the same soup though :P |
09:45:44 | PMunch | Oh yeah, I went to a couple Ada talks last FOSDEM. Definitely found it similar as well |
09:46:13 | PMunch | I've never used Modula 3, but looking at it it's syntactically fairly similar to Pascal |
09:48:16 | PMunch | Ugh, I'm pretty sure it'd be faster to just write my own installer wizard thing that trying to use InnoSetup.. |
09:49:22 | Araq | that's why we have finish.exe now and no InnoSetup anymore |
09:49:26 | Araq | ;-) |
09:50:01 | Araq | it's always the same, productivity is the result of *not* using tools. |
09:55:39 | FromGitter | <mratsim> I would try not to use command-line but I'm pretty sure my productivity would go down ;) |
09:58:10 | * | jjido quit (Quit: Connection closed for inactivity) |
10:02:32 | * | stefanos82 joined #nim |
10:08:23 | * | natrys joined #nim |
10:14:28 | federico3 | "productivity is the result of *not* using tools" should be put in a frame in this times of proliferation of useless hipster devops tools |
10:14:56 | PMunch | Mhm |
10:15:18 | PMunch | Unfortunately this is a product that has to be shipped to people of dubious technical abilities |
10:15:32 | PMunch | So a graphical installer is nice to have |
10:25:12 | lqdev[m] | damn it, why does nimterop generate shittons of `_nimterop_*` files |
10:25:42 | PMunch | But I'd prefer to just have a Nim library built on wNim that had some common functions for setting registry keys, installing services, embedding compressed files (and unpacking them), and a light system that wraps some of the UI logic to make next/prev/etc play nice in the installer |
10:39:23 | Araq | PMunch, nullsoft installer is a bit better |
10:39:51 | Araq | https://nsis.sourceforge.io/Main_Page |
10:41:50 | PMunch | Yeah, the reason I'm using InnoSetup is because that's what they've been using for their other installers |
10:42:00 | PMunch | Turns out they aren't all that complicated.. |
10:42:22 | PMunch | I just assumed someone here would know how to actually do stuff in InnoSetup since they used it |
10:44:06 | * | laaron- joined #nim |
10:47:10 | * | laaron quit (Remote host closed the connection) |
10:47:46 | PMunch | These error messages are great "Error on line 302 in <file> column 5: Type mismatch" |
10:47:52 | PMunch | Between which types?! |
10:48:27 | PMunch | By the way, only thing on line 302 is the word "begin" -_- |
11:07:34 | * | fjellfras quit (Quit: Leaving) |
11:07:58 | * | lqdev[m] sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/TYwYXXhPacUpbxkxQgUIOHbc > |
11:09:55 | lqdev[m] | should I just bake in `-lasound -lpulse -ljack`? |
11:12:20 | lqdev[m] | yeah, seems to have worked |
11:19:36 | FromDiscord_ | <rupansh> hey |
11:19:44 | FromDiscord_ | <rupansh> can i make my program perform a task onexit |
11:22:23 | Araq | addQuitProc |
11:23:13 | FromDiscord_ | <rupansh> can you give an example |
11:29:32 | livcd | like this? https://glot.io/snippets/fd5l78efm0 |
11:31:12 | FromDiscord_ | <rupansh> thanks! |
11:37:42 | FromGitter | <kaushalmodi> livcd: |
11:43:24 | FromGitter | <kaushalmodi> turns out I never typed the rest :P |
11:43:37 | FromGitter | <kaushalmodi> livcd: why do you import system? |
11:43:54 | FromGitter | <kaushalmodi> Also Nim Playground is there now :) |
11:44:11 | FromGitter | <kaushalmodi> http://ix.io/1LKX/nim |
11:44:52 | FromGitter | <kaushalmodi> Wrong link, I meant: https://play.nim-lang.org/index.html?ix=1LKX |
11:47:20 | * | envoyt joined #nim |
11:48:43 | lqdev[m] | shashlick: I'm getting two missing DLL errors from nimterop with a normal Nim installation on Windows (just ran .\finish.exe from the downloaded zip): libgcc_s_seh-1.dll, libstdc++-6.dll |
11:48:45 | Zevv | What's this?! https://play.nim-lang.org/index.html?ix=1LKB |
11:49:28 | lqdev[m] | some Linux journald |
11:49:37 | Zevv | oh it's glued to the ix pastebin |
11:49:38 | Zevv | ha |
11:51:02 | * | theelous3 joined #nim |
11:55:28 | * | theelous3 quit (Ping timeout: 245 seconds) |
11:55:42 | * | lritter joined #nim |
11:58:24 | federico3 | a kernel happily booting on an ARM |
11:59:48 | Zevv | I though playground was leaking stuff |
12:02:05 | FromGitter | <alehander42> Araq so do we just assign to the internal allocator |
12:02:06 | FromGitter | <alehander42> field |
12:03:25 | FromGitter | <alehander42> making an object with the core/allocators interface |
12:04:03 | FromGitter | <alehander42> ahh we use setLocalAllocator |
12:04:08 | FromGitter | <alehander42> @mratsim ^ |
12:04:19 | FromGitter | <alehander42> / setSharedAllocator also |
12:04:46 | FromGitter | <mratsim> it's not in system.nim? |
12:04:51 | FromGitter | <alehander42> core / allocators |
12:05:09 | FromGitter | <mratsim> also if a library is using that does that contaminate everything?? |
12:06:00 | FromGitter | <alehander42> i think so |
12:06:18 | FromGitter | <alehander42> i only care for osdev toys in this instance, so doesnt matter |
12:06:25 | FromGitter | <alehander42> but indeed, the other option is |
12:06:39 | FromGitter | <alehander42> to have your own constructor for e.g. seq-s or other type |
12:06:45 | FromGitter | <alehander42> which assigns a custom allocator |
12:06:48 | FromGitter | <alehander42> to its payload |
12:06:52 | FromGitter | <mratsim> that would be better |
12:07:43 | FromGitter | <alehander42> i see it used only for seq and str |
12:08:41 | FromGitter | <mratsim> for Arraymancer I'm currently using seq in the backend and I wanted to try a custom alloc for seqs, but it seems like I will write my own type from scratch |
12:08:58 | FromGitter | <alehander42> however it doesnt seem to use this for other allocation |
12:09:38 | FromGitter | <alehander42> so even if i write a custom allocator like that i wouldnt be able to make all objects use it ? |
12:09:47 | FromGitter | <alehander42> so still need to just patch alloc0 |
12:10:11 | FromGitter | <alehander42> btw Araq |
12:10:24 | FromGitter | <alehander42> how does the compiler generate -Og for debugging |
12:10:29 | FromGitter | <alehander42> i looked in extccomp |
12:10:34 | FromGitter | <alehander42> and i cant see that anywhere |
12:10:46 | * | nsf quit (Quit: WeeChat 2.4) |
12:11:00 | FromGitter | <alehander42> debug for gcc is `debug: "",` |
12:19:49 | * | vlad1777d quit (Ping timeout: 268 seconds) |
12:19:53 | Araq | default nim.cfg |
12:35:56 | * | dddddd joined #nim |
12:38:15 | PMunch | Zevv, haha yeah it has ix support |
12:39:28 | PMunch | I was really confused for a while while developing it as I tried to get an ix paste which was a Nim error message I had earlier and echo it out. I wondered how a Http get call would fail with a procedure in the time module, took me waaaay to long to figure out what was going on |
12:40:02 | PMunch | So long I had started going through the sources for HttpClient in order to see where it was calling this time function! |
12:41:34 | PMunch | The new frontend has support for tours as well: https://play.nim-lang.org/newfrontend#tour=https://uploads.peterme.net/article.html |
12:41:49 | PMunch | Now that 0.20.0 is out I can probably update so the new frontend is the default one |
12:42:50 | FromGitter | <mratsim> very nice |
12:47:15 | * | envoyt quit (Read error: Connection reset by peer) |
12:48:04 | * | envoyt joined #nim |
12:57:50 | * | Snircle joined #nim |
12:59:12 | * | mjanssen quit (Ping timeout: 245 seconds) |
12:59:57 | * | laaron- quit (Quit: ZNC 1.7.1 - https://znc.in) |
12:59:58 | * | mjanssen joined #nim |
13:01:13 | * | laaron joined #nim |
13:09:06 | * | Trustable joined #nim |
13:14:13 | * | narimiran quit (Remote host closed the connection) |
13:20:28 | * | envoyt quit (Read error: Connection reset by peer) |
13:23:59 | * | theelous3 joined #nim |
13:31:14 | Trustable | Hi, the search function in the docs does not work. Is this already fixed? Details: https://nim-lang.org/docs/dochack.js gives 404 Not Found |
13:33:55 | FromGitter | <kaushalmodi> hmm, https://nim-lang.org/docs/dochack.js is loading fine for me (I disabled cache to verify that).. but I see that it's generated using Nim 0.19.6 |
13:34:27 | FromGitter | <kaushalmodi> ```/* Generated by the Nim Compiler v0.19.6 */ ⏎ /* (c) 2018 Andreas Rumpf */``` [https://gitter.im/nim-lang/Nim?at=5d03a2624e8f972d371a3feb] |
13:35:04 | FromGitter | <kaushalmodi> Trustable: In the meanwhile can you check if search works on https://nim-lang.github.io/Nim/tut1.html ? (it's working for me) |
13:35:34 | FromGitter | <kaushalmodi> well, it's working for me on https://nim-lang.org/docs/lib.html too |
13:36:21 | Trustable | On devel docs it works for me. |
13:38:50 | FromGitter | <kaushalmodi> I switched to Edge (which I never use) to test this and the search on stable docs worked for me there too |
13:39:03 | FromGitter | <kaushalmodi> do you want to Ctrl+F5 and try searching on stable docs again? |
13:39:15 | FromGitter | <kaushalmodi> (assuming that you are using Firefox/Chrome) |
13:50:06 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
13:50:06 | lqdev[m] | reminder for self: Nim `float` is a C `double`, not a C `float` |
13:51:46 | * | laaron joined #nim |
13:52:16 | * | PMunch quit (Remote host closed the connection) |
13:52:34 | Zevv | so, how did that bite you? |
13:53:41 | lqdev[m] | first time around, it was when I was using OpenGL. I set a VBO's type to GL_FLOAT and passed a seq[float] to glBufferSubData |
13:54:07 | lqdev[m] | this time what I did was I set the audio format in soundio to f32le, and wrote Nim `float`s into the audio buffer |
13:54:53 | lqdev[m] | the result sounded kind of like a zapper, and a particularly loud one. fortunately I had my speakers pretty quiet |
13:55:38 | * | sealmove joined #nim |
13:56:11 | Zevv | when interfacing with C, use the C types. cint, cfloat, cdouble, etc |
13:56:17 | Zevv | simple as that :) |
13:58:43 | lqdev[m] | yeah, I always screw up on simple cases like this one, just because `cint`, `cfloat` etc. are not syntax highlighted lmao |
13:58:50 | lqdev[m] | that makes me forget about them |
14:01:39 | Zevv | wow that's a pretty bad reason not to use them :/ |
14:01:54 | Zevv | and one of the reasons I never got into highlighting myself I guess :) |
14:06:56 | sealmove | you use pure white? |
14:07:54 | Zevv | pure green |
14:08:02 | sealmove | :D |
14:08:45 | Zevv | started green-on-black on the apple II, never left :) |
14:09:10 | * | couven92 quit (Quit: Client disconnecting) |
14:09:39 | lqdev[m] | wow |
14:10:06 | lqdev[m] | for me, code that is not highlighted is hard to read |
14:10:35 | lqdev[m] | I always associate shades of gray with temporary variables and whatnot |
14:10:58 | lqdev[m] | that's why I forget about cint, cfloat, cdouble, and all the others |
14:13:12 | lqdev[m] | well anyways, now that my soundio wrapper is finished, I guess I should work on the high-level audio interface itself |
14:14:32 | Zevv | I guess I'm afraid to get too dependend on highlighting. Layout is key for readability for me, but I guess these things are so very subjective it doesn't even make sense to talk about it. |
14:15:39 | lqdev[m] | sure, everyone has their own coding workflow and preferences :) |
14:17:23 | shashlick | @lqdev what's up |
14:17:31 | shashlick | Where you seeing these files for nimterop |
14:18:34 | lqdev[m] | I see these files in the directory of any file I cCompile, and they are created everytime nimsuggest kicks in to suggest a thing |
14:19:25 | lqdev[m] | the content of one those files is the same as the content of the file I cCompile |
14:19:32 | disruptek | if you work from the command-line, this pager with syntax highlighting could be interesting to you: https://github.com/sharkdp/bat |
14:24:20 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
14:24:44 | * | laaron joined #nim |
14:26:29 | * | nsf joined #nim |
14:29:24 | shashlick | @lqdev it is generated if the C file name conflicts with another c file or Nim file in the project |
14:29:31 | shashlick | Cause the o file gets overwritten |
14:29:54 | * | bobby quit (Read error: Connection reset by peer) |
14:29:55 | shashlick | Nim vs c conflict was fixed in 0.20.0 but c vs c will still conflict |
14:31:11 | shashlick | Maybe I need a when not defined nimsuggest |
15:02:31 | * | mjanssen quit (Ping timeout: 246 seconds) |
15:05:00 | * | PMunch joined #nim |
15:06:23 | * | mjanssen joined #nim |
15:06:57 | * | Trustable quit (Remote host closed the connection) |
15:14:39 | * | PMunch quit (Remote host closed the connection) |
15:15:59 | * | BaldEagleX02 joined #nim |
15:16:49 | * | PMunch joined #nim |
15:17:15 | * | mjanssen quit (Ping timeout: 248 seconds) |
15:20:19 | * | mjanssen joined #nim |
15:21:26 | * | Senketsu quit (Remote host closed the connection) |
15:22:05 | * | Senketsu joined #nim |
15:23:17 | * | Senketsu quit (Client Quit) |
15:23:36 | * | solitudesf quit (Remote host closed the connection) |
15:23:45 | * | solitudesf joined #nim |
15:27:27 | * | avsej quit (Ping timeout: 252 seconds) |
15:29:21 | * | Senketsu joined #nim |
15:46:58 | * | PMunch quit (Remote host closed the connection) |
15:47:39 | * | Kaivo quit (Quit: WeeChat 2.4) |
15:50:49 | lqdev[m] | shashlick: when are you going to implement nested structs in nimterop? I'm trying to wrap dr_wav and seems like I'm stuck in yet another loophole, because of those stupid nested structs |
15:51:12 | FromGitter | <kaushalmodi> I am trying to refactor the nim-emacs-module package and am stumbling at this: https://play.nim-lang.org/index.html?ix=1LM7 |
15:51:32 | shashlick | @lqdev, want to do some work today on nimterop but seems unlikely given my schedule |
15:51:35 | FromGitter | <kaushalmodi> > Error: identifier expected, but found '10' |
15:51:42 | shashlick | i think adding inline cOverride will solve many of your problems |
15:51:53 | shashlick | i have some ideas for it |
15:54:37 | FromGitter | <Vindaar> @kaushalmodi what do you expect the `maxArgs` argument to do in the template? |
15:55:06 | Araq | kaushalmodi: rename the 'maxArgs' in the proc header |
15:55:49 | FromGitter | <kaushalmodi> Araq: ok, let me try that |
15:56:04 | FromGitter | <kaushalmodi> @Vindaar I was actually stuck at a different problem: actual snippet: http://ix.io/1LM9 |
15:56:17 | FromGitter | <kaushalmodi> that complained that `replace` couldn't be found |
15:56:26 | FromGitter | <kaushalmodi> even though I did `import strutils` at top |
15:59:09 | FromGitter | <kaushalmodi> hmm, `replace` works in here: https://play.nim-lang.org/index.html?ix=1LMc |
16:00:44 | FromGitter | <kaushalmodi> but with http://ix.io/1LMf, it gives: ⏎ ⏎ > emacs_module/helpers.nim(41, 17) Error: undeclared identifier: 'replace' |
16:02:37 | FromGitter | <Vindaar> hm, unfortunately I gotta go now. :/ you'll figure it out :) |
16:02:48 | FromGitter | <kaushalmodi> no problem |
16:14:15 | * | ftsf joined #nim |
16:15:32 | ftsf | hi, is there a way I can operate on a bunch of fields by name (known at compile time) eg.. for k in ["a","b","c","d"]: foo.k = 0 ? |
16:16:38 | ftsf | i can't figure out how to turn the string into an identifier to use as a fieldname |
16:17:01 | Calinou | <Zevv> wow that's a pretty bad reason not to use them :/ |
16:17:10 | Calinou | that reminds me of editors highlighting "int" but not "int32_t" or "int64_t" |
16:20:03 | lqdev[m] | ftsf: you can use dot operators (https://nim-lang.org/docs/manual_experimental.html#special-operators-dot-operators) and astToStr() to do just that |
16:20:44 | lqdev[m] | oh, you want it the other way aroud |
16:20:46 | lqdev[m] | give me a sec |
16:21:27 | lqdev[m] | @mratsim did this once, he might know the answer |
16:28:24 | Araq | simple to do with a macro |
16:30:04 | dom96 | ftsf: you can either create the AST nodes via newDotExpr, newIdentNode and some other proc that I don't remember the name of for assignments. Or you can use `quote` with a combination of these procs (you'll need to at least change the `k` into an ident node |
16:31:35 | ftsf | guess I better learn to macro =) I've so far only touched templates |
16:46:11 | * | nsf quit (Quit: WeeChat 2.4) |
17:06:13 | Zevv | Calinou: I'm not a nimsuggest user, but I guess that should allow hignlighting of user defidn types? |
17:06:25 | Calinou | that's in C++ :) |
17:06:32 | Calinou | and it's up to the editor/IDE to highlight it correctly |
17:07:00 | Zevv | yeah, but isnt nimsuggest the intelligence between nim highlighting? |
17:07:22 | Zevv | s/between/behind/ |
17:10:29 | Calinou | I believe nimsuggest only handles autocompletion |
17:13:53 | * | Tyresc joined #nim |
17:16:25 | mjanssen | /part |
17:16:34 | * | mjanssen left #nim (#nim) |
17:18:03 | * | Vladar quit (Remote host closed the connection) |
17:18:55 | leorize | nimsuggest can do a lot |
17:19:06 | leorize | incl. highlighting :) |
17:19:13 | leorize | if you use my nim.nvim plugin ofc ;) |
17:24:29 | FromGitter | <kaushalmodi> ftsf: here's my failed attempt: http://ix.io/1LME |
17:24:49 | FromGitter | <kaushalmodi> hopefully a macro expert can help out further with that |
17:25:07 | ftsf | yeah, i've got something similar so far, no luck yet |
17:28:30 | ftsf | \o/ got it! |
17:28:41 | FromGitter | <kaushalmodi> yay! please share :) |
17:30:40 | ftsf | https://gist.github.com/ftsf/ffb596c02672a24b9ea126858d0afa13 |
17:31:34 | FromGitter | <kaushalmodi> cool! we were quite close in the solutions :) |
17:32:44 | ftsf | i don't really understand why the other one doesn't work, but oh well |
17:35:16 | * | shadowbane quit (Quit: Konversation terminated!) |
17:38:48 | FromGitter | <kaushalmodi> ftsf: thanks for sharing |
17:38:51 | * | shadowbane joined #nim |
17:38:54 | FromGitter | <kaushalmodi> I have this based off your work: https://play.nim-lang.org/index.html?ix=1LMJ |
17:39:07 | FromGitter | <kaushalmodi> I cannot make that for loop work in there: ^ |
17:39:54 | ftsf | yeah i just tried to do similar with a loop and i can't get it to work |
17:39:56 | FromGitter | <kaushalmodi> uncommenting that for loop gives: ⏎ ⏎ > /usercode/in.nim(20, 14) template/generic instantiation of `assignField` from here ⏎ > /usercode/in.nim(5, 12) Error: attempting to call undeclared routine: 'field=' [https://gitter.im/nim-lang/Nim?at=5d03dbec6f0ec85ade09a166] |
17:40:13 | ftsf | running into exactly the same here =) |
17:42:10 | ftsf | a loop over fieldPairs works though |
17:47:01 | ftsf | https://play.nim-lang.org/index.html?ix=1LML |
17:50:17 | FromGitter | <kaushalmodi> ftsf: I have asked this on forum: https://forum.nim-lang.org/t/4935#30912 |
17:50:38 | ftsf | thanks =) |
18:01:41 | * | natrys quit (Remote host closed the connection) |
18:02:08 | FromGitter | <JasperJenkins> You'll probably need to unroll the loop yourself like: https://play.nim-lang.org/index.html?ix=1LMQ |
18:08:14 | FromGitter | <kaushalmodi> @JasperJenkins do you have time to convert that to `quote do`? |
18:08:35 | FromGitter | <kaushalmodi> that way I can relate between the "raw macro" and quote do |
18:17:16 | FromGitter | <JasperJenkins> The only thing that I can see being converted to quote do is the newBlockStmt. The code is more introspective than constructive. I can update with a more commented version though. |
18:21:07 | FromGitter | <kaushalmodi> Thanks |
18:33:14 | * | jjido joined #nim |
18:34:24 | FromGitter | <JasperJenkins> https://play.nim-lang.org/index.html?ix=1LMY |
18:58:31 | * | vegax87 quit (Changing host) |
18:58:31 | * | vegax87 joined #nim |
18:58:31 | * | vegax87 quit (Changing host) |
18:58:31 | * | vegax87 joined #nim |
19:03:21 | * | nsf joined #nim |
19:08:01 | * | sealmove quit (Quit: WeeChat 2.5) |
19:16:48 | * | uvegbot quit (Ping timeout: 252 seconds) |
19:28:12 | FromGitter | <kaushalmodi> @JasperJenkins thanks! |
19:28:17 | FromGitter | <kaushalmodi> I am reading through it .. |
19:28:57 | FromGitter | <kaushalmodi> btw running that code with `--expandMacro:replaceField` works nice.. no need for the "Code after" echo :) |
19:37:16 | * | SquareHimself joined #nim |
19:38:54 | SquareHimself | So, I'm using the irc library to make an IRC bot and I'm having trouble. The bot is synchronous, but I want it to be able to launch an asynchronous loop that continues running forever beside the bot. Basically, the loop is grabbing data as it comes in and then calling the command to have the bot msg the data to the channel |
19:39:02 | SquareHimself | But I'm having no luck |
19:39:10 | SquareHimself | One second and I'll post the code... maybe you guys can help me |
19:39:44 | SquareHimself | https://0x0.st/zjzV.nim |
19:40:16 | SquareHimself | What am I doing wrong? The asynchronous procedure always blocks |
19:41:28 | shashlick | you probably need to use threads |
19:42:01 | SquareHimself | I tried that briefly. I'll do some reading. If you have any suggestions, they're welcome, also |
19:42:58 | shashlick | here |
19:43:03 | shashlick | here's an example - https://github.com/genotrance/feud/blob/master/plugins/remote.nim#L128 |
19:53:02 | * | kapilp quit (Quit: Connection closed for inactivity) |
19:57:06 | rayman22201 | dochack is 404ing on the 0.20 docs for me btw :-( |
19:57:11 | rayman22201 | dochack.js |
19:57:20 | SquareHimself | shashlick: Now it's just giving me trouble that my function is of no type |
19:57:22 | SquareHimself | :/ |
19:57:30 | SquareHimself | I'm confused with the whole threads thing. |
19:57:45 | shashlick | snippet |
19:57:48 | rayman22201 | @SquareHimself, asyncCheck just throws away the future, it doesn't do what I think you want |
19:58:10 | SquareHimself | https://0x0.st/zji5.nim |
19:58:22 | rayman22201 | I don't think you need threads, you just need to fix your async code |
19:58:41 | shashlick | irc poll isn't async is it? |
19:59:04 | SquareHimself | Well this is the first time I'm ever doing something like this, and examples that are helpful to me are scarce at the moment, so I'm working pretty much from the documentation |
19:59:23 | SquareHimself | And I'm confused at the moment :D |
20:00:11 | rayman22201 | Dom's book is the best tutorial for async, but being a book, it doesn't seem widely read lol |
20:00:51 | SquareHimself | It seems like it should be simpler to start an asynchronous loop parallel to the main loop |
20:01:34 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:02:36 | * | kapilp joined #nim |
20:04:23 | rayman22201 | waitFor lol |
20:04:25 | rayman22201 | It's that simple |
20:04:32 | SquareHimself | I tried waitFor... |
20:04:35 | SquareHimself | It waits. |
20:04:39 | SquareHimself | >.< |
20:07:20 | rayman22201 | lol |
20:07:32 | rayman22201 | You want to control the event loop is what you are saying |
20:08:20 | rayman22201 | So, you either make your irc bot async, or you control the event loop yourself using the functions in asyncdispatch |
20:08:21 | rayman22201 | https://nim-lang.org/docs/asyncdispatch.html |
20:08:47 | SquareHimself | I don't think you're understanding... |
20:13:31 | rayman22201 | is it Dom's irc client? |
20:13:45 | rayman22201 | He has an example for you: https://github.com/nim-lang/irc/blob/master/tests/asyncclient.nim |
20:14:01 | SquareHimself | I've tried it this way, also |
20:14:07 | SquareHimself | It still blocks |
20:14:14 | rayman22201 | what is blocking? |
20:14:31 | SquareHimself | Either one loop runs, or the other, but not both. |
20:14:52 | SquareHimself | I'll try again |
20:15:27 | rayman22201 | You usually only have one loop in async code, some I'm confused about what you are saying. |
20:15:30 | leorize | async is not threads, so two loops can't run at the same time :p |
20:15:47 | SquareHimself | Okay, so that's the issue I'm having |
20:17:20 | SquareHimself | So here's what I have going on now... what am I doing wrong here? (error at the bottom) https://0x0.st/zjo8.nim |
20:17:56 | SquareHimself | (besides importing asyncdispatch still, lol |
20:22:27 | shashlick | he is calling irc.poll() which blocks |
20:25:45 | * | JuanCarlos joined #nim |
20:26:08 | * | JuanCarlos is now known as Guest79604 |
20:26:23 | rayman22201 | http://ix.io/1LNC |
20:27:33 | rayman22201 | no polling |
20:29:17 | rayman22201 | he is not calling poll in the async version |
20:30:31 | rayman22201 | https://github.com/nim-lang/irc/blob/master/src/irc.nim#L563 |
20:31:23 | FromGitter | <jrfondren> got <type Thread[irc.Irc] |
20:31:32 | FromGitter | <jrfondren> ^that "type" means type. literally, you're passing a type. |
20:31:33 | FromGitter | <jrfondren> not a value. |
20:31:41 | * | Guest79604 is now known as juanim |
20:31:46 | FromGitter | <jrfondren> 42 is an int. you are not passing 42. you are passing 'int'. |
20:33:50 | rayman22201 | no that's not what that means jrfonden. Irc is a type |
20:33:53 | SquareHimself | Okay, rayman's async version works. Thanks for that. |
20:33:59 | SquareHimself | I'll study this and see why. |
20:34:21 | rayman22201 | https://github.com/nim-lang/irc/blob/master/src/irc.nim#L62 |
20:34:36 | FromGitter | <jrfondren> yes, that's what it means. "Irc is a type" <-- what is this intended to refute? |
20:35:06 | FromGitter | <jrfondren> ` createThread(Thread[Irc], testasyncsleep, bot)` is the line it's complaining about. |
20:35:34 | rayman22201 | first, this is an x, y problem. Because he didn't need threads at all. You are too focused on the error |
20:35:45 | FromGitter | <jrfondren> OK, so I'm right. |
20:36:02 | SquareHimself | Well, rayman took it back to where I originally started before I even got here |
20:36:05 | rayman22201 | second, you said "42 is an int. you are not passing 42. you are passing 'int'." which is not what he is doing |
20:36:08 | SquareHimself | I was trying to do async, but I was doing it wrong |
20:36:16 | FromGitter | <jrfondren> That is an example, not literally what he's doing. |
20:36:32 | rayman22201 | He was passing a type, you said he wasn't |
20:36:38 | rayman22201 | you said he was passing an instance |
20:36:41 | rayman22201 | which isn't true |
20:36:41 | FromGitter | <jrfondren> No, I said that he was passing a type. |
20:36:46 | FromGitter | <jrfondren> Christ, you're dumb. Stop talking to me. |
20:37:04 | rayman22201 | He was just passing the wrong type |
20:37:12 | rayman22201 | required type: var Thread[system.void] |
20:37:20 | rayman22201 | it wanted system.void |
20:37:35 | rayman22201 | why are you ad homium attacking me? That is uncessary |
20:37:55 | FromGitter | <jrfondren> It is necessary, because you are continuing to blather on while being completely wrong about what I said. |
20:38:34 | rayman22201 | I'm dumb, yet I actually helped the guy solve is problem. And what you said was unclear and unhelpful. |
20:38:35 | * | vivus joined #nim |
20:38:40 | FromGitter | <jrfondren> when I say "^that "type" means type. literally, you're passing a type." and you say "He was passing a type, you said he wasn't", this is not a conversation I want to continue. |
20:39:26 | rayman22201 | What is the point of what you are saying? What you said did not clarify the meaning of that error |
20:39:58 | FromGitter | <jrfondren> The point is that you are a moron. You are an idiot. You are drooling right now, rather than speaking. I have nothing but contempt for you. |
20:41:22 | rayman22201 | Again. I was pointing out that I thought what you said was incorrect, and at the very least unhelpful to clarifying the issue, but you continue to just ad hominem attack me? |
20:41:27 | SquareHimself | Guys, relax... |
20:41:35 | SquareHimself | It doesn't really matter. |
20:42:24 | vivus | ooof I've never known jrfondren to use mean words like that. |
20:42:27 | rayman22201 | Rudeness is a good way to help you get banned is all I'm saying... We are trying to be a helpful community here. |
20:43:02 | rayman22201 | I fully admit that I may have misunderstood what jrfondren is saying. I'm asking him to clarify. |
20:43:22 | FromGitter | <jrfondren> I said "Christ you're dumb. Stop talking to me" and here you are "asking me to clarify". |
20:43:41 | FromGitter | <jrfondren> since gitter doesn't have an ignore feature, I'm going to ban myself from it. |
20:45:11 | rayman22201 | pretty trivial thing to get so offended by, but you do what you have to do lol |
20:48:25 | shashlick | gosh |
20:51:36 | Araq | er... |
20:52:23 | rayman22201 | sorry :/ |
20:52:40 | Araq | I don't blame you |
20:59:31 | * | stefanos82 quit (Quit: Quitting for now...) |
21:03:51 | SquareHimself | Thanks again rayman22201. I was able to rewrite the rest of my bot and put the pieces together and get it working now |
21:04:00 | SquareHimself | Sorry about the trouble. |
21:04:47 | rayman22201 | awesome. glad it worked. no worries. It wasn't your fault. |
21:05:55 | rayman22201 | we need a better quick start guide for async in general I think. Maybe a good candidate for Tutorial 4 lol |
21:09:56 | * | abm quit (Ping timeout: 244 seconds) |
21:10:29 | * | c2V0a3U joined #nim |
21:11:30 | * | dGtlc3 joined #nim |
21:11:37 | * | c2V0a3U quit (Client Quit) |
21:12:26 | juanim | Hi. |
21:14:12 | rayman22201 | Hi 👋 |
21:14:13 | * | nsf quit (Quit: WeeChat 2.4) |
21:14:33 | * | SquareHimself left #nim ("WeeChat 2.5") |
21:23:11 | skrylar[m] | @freenode_PMunch:matrix.org: inno is a good installer though |
21:25:22 | skrylar[m] | if i remember doing out of box stuff gets a little weird in inno (i think its still possible with pascalscripts? its been years) but it has the most straightforward "tell me your files, ok here's installer/uninstaller" and it handles "oh no stuff didn't install right." NSIS is .. well uh, it's *very* flexible but it does jack shit unless it's told to. (ex. Inno checksums extracted files iirc, nsis just blasts them and hopes |
21:25:22 | skrylar[m] | it worked) |
21:29:13 | * | leorize quit (Remote host closed the connection) |
21:29:46 | * | leorize joined #nim |
21:39:43 | * | vlad1777d joined #nim |
21:44:58 | FromGitter | <kaushalmodi> Araq: |
21:46:46 | Araq | what? |
22:01:21 | FromGitter | <JasperJenkins> If i have an `x: var T` param, `addr(x)` is a no-op and gives just `ptr T`. Yes? |
22:03:12 | FromGitter | <JasperJenkins> More specifically: can I rely on this for c callbacks. |
22:03:22 | * | I_Right_I joined #nim |
22:04:37 | * | lritter quit (Ping timeout: 245 seconds) |
22:06:43 | * | solitudesf quit (Ping timeout: 245 seconds) |
22:07:00 | * | Acid147 joined #nim |
22:10:51 | * | Acid147 quit (Client Quit) |
22:11:02 | * | Acid147 joined #nim |
22:22:18 | * | dwdv quit (Ping timeout: 268 seconds) |
22:23:06 | * | juanim quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
22:27:26 | * | pyotr joined #nim |
22:28:12 | pyotr | Hello there, I have a doubt about nim-javascript events. |
22:32:32 | * | pyotr quit (Remote host closed the connection) |
23:00:30 | * | abm joined #nim |
23:03:51 | FromDiscord_ | <Finch> So I have a custom object, how can I get the size of a single instance of the object? |
23:09:48 | * | laaron quit (Remote host closed the connection) |
23:10:18 | * | laaron joined #nim |
23:12:28 | FromDiscord_ | <Finch> I've created this pastebin with the definition of the object (Transposition) https://pastebin.com/D4VCNnzF |
23:19:35 | rayman22201 | @Finch: something like this: http://ix.io/1LOz/nim |
23:19:47 | rayman22201 | Nim has sizeof |
23:20:01 | rayman22201 | but the ref in the type means you are getting the size of the pointer |
23:20:35 | rayman22201 | if you split it out to the full Type and the alias to the Ref Type, you can get the correct size. |
23:23:03 | FromDiscord_ | <Finch> Ah perfect exactly what I was looking for thank you! |
23:23:41 | rayman22201 | np |
23:25:25 | * | krux02 quit (Remote host closed the connection) |
23:28:43 | rayman22201 | @JasperJenkins, late reply, I'm not 100% sure, but I think for practical purposes you can just use var. (At least c2nim and nimterop seem to do it that way) |
23:29:41 | * | lf-araujo joined #nim |
23:33:48 | rayman22201 | I found this old video and I just realized that I did not know what Araq looks like until now :-P https://www.youtube.com/watch?v=hwArqelfBBY |
23:37:13 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
23:38:36 | * | Acid147 quit (Remote host closed the connection) |
23:41:28 | * | laaron joined #nim |
23:43:16 | * | lf-araujo quit (Ping timeout: 258 seconds) |