00:01:20 | PMunch | And you can pass it a module name, or the folder where a nimble file lives. So you could just get the information for package ".." and you'd get your own nimble file :) |
00:10:42 | FromDiscord | <sOkam!> is there any good tar file library for nim? |
00:13:01 | * | ilikescaviar quit (Ping timeout: 246 seconds) |
00:14:10 | FromDiscord | <Elegantbeef> zippy supports tar |
00:15:42 | FromDiscord | <Hourglass [She/Her]> Hey Beef, what's your decision processing for making distinct types? |
00:16:37 | FromDiscord | <Elegantbeef> "Do I want a type that is the same as another but with different semantics" |
00:17:00 | FromDiscord | <sOkam!> oh it does? thats epic |
00:26:33 | FromDiscord | <Hourglass [She/Her]> In reply to @Elegantbeef ""Do I want a": Makes sense |
00:26:59 | FromDiscord | <Hourglass [She/Her]> I can do `type VarInt = int32`, right? |
00:27:10 | FromDiscord | <Elegantbeef> That's an alias |
00:27:53 | FromDiscord | <Elegantbeef> I generally only use aliases for shortening generic |
00:27:56 | FromDiscord | <Elegantbeef> generics\ |
00:37:00 | PMunch | They're also handy for conditional types |
00:37:06 | PMunch | And macro-magic |
00:44:37 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
00:45:44 | * | ehmry joined #nim |
00:50:16 | * | PMunch quit (Quit: leaving) |
00:52:05 | FromDiscord | <Hourglass [She/Her]> In reply to @Elegantbeef "That's an alias": Yep |
00:53:29 | FromDiscord | <Hourglass [She/Her]> Idk if i should make VarInt a distinct or an alias, since Minecraft has VarInts, but they're just `int32`s that may not have all the bytes defined |
00:55:26 | FromDiscord | <Elegantbeef> It only matters what semantics you want |
00:55:46 | FromDiscord | <Hourglass [She/Her]> In that case, better to have it as an alias or not to define it at all |
00:55:51 | FromDiscord | <Elegantbeef> Do you want static safeties when converting from a int32 to an alias |
00:56:09 | FromDiscord | <Hourglass [She/Her]> Static safeties? |
00:56:13 | FromDiscord | <Elegantbeef> Yes |
00:56:30 | FromDiscord | <Elegantbeef> `myInt32 = someProcThatReturnsVarInt()` |
00:56:34 | FromDiscord | <Elegantbeef> This is a static error |
00:56:42 | FromDiscord | <Yepoleb> Pmunch\: why do you call the nimble binary instead of running the nimble file directly? |
00:56:42 | FromDiscord | <Hourglass [She/Her]> Hm, then no |
00:57:35 | FromDiscord | <Hourglass [She/Her]> I'd say it's useless to have different semantics in this case |
00:57:57 | FromDiscord | <Elegantbeef> Well then there you go |
00:58:13 | FromDiscord | <Elegantbeef> If you do not want the types to be different you do not use distinct |
01:00:54 | FromDiscord | <Hourglass [She/Her]> I'm gonna hate myself tomorrow/later today |
01:15:04 | FromDiscord | <Gumbercules> In reply to @tfp "rn im adding a": this is the way - unless you want to use Nim's C++ backend |
01:15:53 | FromDiscord | <Gumbercules> I think you could write the C API in Nim theoretically, I've never tried before though |
01:18:11 | FromDiscord | <Gumbercules> tmk, the only support SWIG has for C is - https://github.com/swig/swig/wiki/GSoC-2008-C-Backend |
01:19:21 | FromDiscord | <Gumbercules> I guess there is also - https://github.com/swig/swig/tree/gsoc2012-c - doesn't look like any of these are complete though |
01:19:39 | FromDiscord | <Gumbercules> if you manage to get it to work, you should definite share your results! |
01:56:02 | FromDiscord | <Gumbercules> In reply to @tfp "are there any examples": I've written some bindings to C++ libraries with Nim and written C APIs to wrap them, if you want me to share some example code, let me know... |
01:57:39 | FromDiscord | <Gumbercules> In reply to @tfp "is there a faster": IMHO I think nanovg with a layout engine would serve you better. |
01:58:33 | FromDiscord | <Gumbercules> https://github.com/jdryg/vg-renderer |
01:58:58 | FromDiscord | <Gumbercules> I was thinking about porting this to Nim and making it work with Sokol |
02:21:57 | NimEventer | New Nimble package! kroutes - Karax router supporting both client-side and server-side rendering, see https://github.com/ryukoposting/kroutes |
02:29:10 | FromDiscord | <sOkam!> In reply to @Gumbercules "https://github.com/jdryg/vg-renderer": why that, and not just pixie/boxy? |
02:35:58 | * | dropkick joined #nim |
02:46:05 | FromDiscord | <spook> sent a code paste, see https://play.nim-lang.org/#ix=4ovq |
02:46:44 | FromDiscord | <Elegantbeef> How do you declare `generate`? |
02:46:58 | FromDiscord | <Require Support> anyone have experience in implementing a decryption function in python 3 for this encryption function in nim? https://github.com/cheatfate/nimcrypto/blob/master/examples/ctr.nim |
02:48:17 | FromDiscord | <spook> In reply to @Elegantbeef "How do you declare": not sure what you mean |
02:48:31 | FromDiscord | <Elegantbeef> You declare a generate procedure it seems |
02:48:59 | FromDiscord | <spook> should i declare another way? |
02:49:18 | FromDiscord | <Elegantbeef> Well how do you write it |
02:49:25 | FromDiscord | <spook> wdym |
02:49:42 | FromDiscord | <Elegantbeef> You have a `generate` proc |
02:49:46 | FromDiscord | <Elegantbeef> how do you declare it |
02:49:50 | FromDiscord | <Elegantbeef> What is the code causing the isssue |
02:49:51 | FromDiscord | <Elegantbeef> issue\ |
02:50:17 | FromDiscord | <spook> sent a code paste, see https://play.nim-lang.org/#ix=4ovr |
02:50:30 | FromDiscord | <Elegantbeef> Is that your code? |
02:50:35 | FromDiscord | <Elegantbeef> If so yes that's very wrong |
02:50:49 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/tut1.html i suggest following this |
02:51:03 | FromDiscord | <spook> sent a code paste, see https://play.nim-lang.org/#ix=4ovs |
02:56:58 | FromDiscord | <spook> In reply to @Elegantbeef "If so yes that's": can you please explain how it's wrong |
02:57:09 | FromDiscord | <spook> I'm just utilizing the example from the package |
02:57:16 | FromDiscord | <Elegantbeef> You're putting code inside of the parameter list |
02:58:15 | FromDiscord | <spook> I genuinely do not know what that means |
02:58:27 | FromDiscord | <Elegantbeef> `proc name(parameterList): returnType = body` |
02:58:39 | FromDiscord | <Elegantbeef> You're putting code inside the parameterList |
02:58:43 | FromDiscord | <Elegantbeef> Read the tutorial i linked |
02:59:40 | FromDiscord | <Require Support> I think you need to try to code something simpler first to get the hang of nim |
02:59:51 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4ovu |
03:00:11 | FromDiscord | <spook> In reply to @Require Support "I think you need": the point is not to learn nim |
03:00:26 | FromDiscord | <Elegantbeef> You're writing nim but do not want to know nim |
03:00:28 | FromDiscord | <Elegantbeef> ... |
03:00:32 | FromDiscord | <spook> its just that a nim package exists for EXACTLY my use case |
03:00:53 | FromDiscord | <Require Support> 🤔 |
03:00:57 | FromDiscord | <sOkam!> In reply to @spook "its just that a": well if you want to use that package, you gonna need to learn the basics of the lang at least |
03:00:59 | FromDiscord | <Require Support> so you have to learn nim then |
03:01:08 | FromDiscord | <sOkam!> read tut1, it should be more than enough |
03:01:24 | FromDiscord | <sOkam!> it will take you 1h, and will save you at least 10h of frustration |
03:03:44 | FromDiscord | <spook> sent a code paste, see https://play.nim-lang.org/#ix=4ovw |
03:04:18 | FromDiscord | <Elegantbeef> We're not going to write Nim for you |
03:04:29 | FromDiscord | <Gumbercules> In reply to @sOkam! "why that, and not": I don't use either of those |
03:05:02 | FromDiscord | <Gumbercules> I'm using sokol_gfx and I'm guessing these are tightly coupled with OpenGL knowing treeform |
03:05:22 | FromDiscord | <Elegantbeef> Boxy is, but pixie is just a skia like library |
03:06:18 | FromDiscord | <Gumbercules> gotcha |
03:06:27 | FromDiscord | <Gumbercules> https://github.com/edubart/sokol_gp exists, so maybe I will start there |
03:08:53 | FromDiscord | <spook> In reply to @Elegantbeef "We're not going to": if it could be explained to me in human terms that would be helpful |
03:10:29 | FromDiscord | <Elegantbeef> The tutorial explains in human terms |
03:24:13 | * | brobot joined #nim |
03:25:42 | FromDiscord | <ringabout> So this was on the front page of hacker news => https://news.ycombinator.com/item?id=34847941 |
03:30:59 | FromDiscord | <ringabout> So many talks regarding Nim on the front page of the hacker news recently. |
03:32:07 | FromDiscord | <Elegantbeef> And they all say the same thing of "Tooling, ecosystem, god damn style insensitivity" 😛 |
03:32:51 | FromDiscord | <amadan> Think for once no one has mentioned insensitivity lol |
03:33:15 | FromDiscord | <Elegantbeef> Yea i was mildly surprised |
03:38:11 | FromDiscord | <Diogenes of Toronto> hey i want to create a generic function that takes a list of types that can be converted to strings and runs the $ operator and then concatenates them together. basically an arbitrary join function but i can't find the documeentation on the nim website for this |
03:38:23 | FromDiscord | <Diogenes of Toronto> (generics) |
03:38:42 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#types-varargs |
03:39:12 | FromDiscord | <ringabout> concepts? |
03:39:24 | FromDiscord | <spook> sent a code paste, see https://play.nim-lang.org/#ix=4ovA |
03:39:27 | FromDiscord | <Elegantbeef> Nah i think they just want a join like echo |
03:39:42 | FromDiscord | <Elegantbeef> Nim does not use `:` for procedure bodies |
03:39:44 | FromDiscord | <Elegantbeef> It uses `=` |
03:40:59 | * | azimut quit (Ping timeout: 255 seconds) |
03:41:42 | FromDiscord | <spook> changing that, where exactly is it giving me this new mismatch error? <File, string> |
03:42:15 | FromDiscord | <spook> messages.txt should be a file, shouldnt it? |
03:43:02 | FromDiscord | <Elegantbeef> Sure but what is `file.open` |
03:43:11 | FromDiscord | <Elegantbeef> Nim doesnt have a `file` type |
03:43:53 | FromDiscord | <spook> supposed to open a text file |
03:44:35 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4ovC |
03:45:04 | FromDiscord | <Elegantbeef> What ringabout said |
03:57:57 | FromDiscord | <Diogenes of Toronto> In reply to @Elegantbeef "https://nim-lang.org/docs/manual.html#types-varargs": thanks |
03:58:06 | FromDiscord | <Diogenes of Toronto> it works |
03:58:44 | FromDiscord | <Elegantbeef> As an aside are you driving down the housing prices in toronto? 😄 |
04:14:32 | FromDiscord | <Diogenes of Toronto> lol |
04:15:07 | FromDiscord | <Diogenes of Toronto> i got expelled from the city of r defacing the currencyu |
04:41:45 | FromDiscord | <Diogenes of Toronto> sent a code paste, see https://paste.rs/YoB |
04:42:29 | FromDiscord | <Elegantbeef> You do not use any strutils procedure |
04:45:43 | FromDiscord | <Diogenes of Toronto> $ and & are not strutils procs? |
04:46:01 | FromDiscord | <Elegantbeef> Nope |
04:46:12 | FromDiscord | <Elegantbeef> Those are apart of system since they're primitive string ops |
04:46:16 | FromDiscord | <Diogenes of Toronto> this is confusing then https://media.discordapp.net/attachments/371759389889003532/1076726389585227878/image.png |
04:46:40 | FromDiscord | <Elegantbeef> that varargs converts them to strings |
04:46:48 | FromDiscord | <Elegantbeef> So the module that uses this procedure needs `$` not this one |
04:47:16 | FromDiscord | <Elegantbeef> You do not need `$item` since `item` is already a string |
04:47:46 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4ovK |
04:48:16 | FromDiscord | <amadan> In reply to @Diogenes of Toronto "this is confusing then": Wordings a bit bit weird but the important piece to note is that "this module builds upon that" i.e. doesn't actually define them.↵The first sentence talks about those procs (`$`, `&`) being defined in system (which is automatically imported) |
04:48:34 | FromDiscord | <Diogenes of Toronto> okay |
04:48:52 | FromDiscord | <amadan> (edit) "imported)" => "imported (docs are here https://nim-lang.org/docs/system.html for it))" |
04:49:19 | FromDiscord | <Diogenes of Toronto> sent a code paste, see https://play.nim-lang.org/#ix=4ovL |
04:49:49 | FromDiscord | <Diogenes of Toronto> but i think this should probably raise an error or exception when str conv is not possible |
04:49:49 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=4ovM |
04:49:58 | FromDiscord | <ElegantBeef> It doesnt compile when it's not possible |
04:50:05 | FromDiscord | <Diogenes of Toronto> okay then no need |
04:50:24 | FromDiscord | <ElegantBeef> Nim is statically typed if something is not possible you'll hear about it in a mismatch procedure |
04:50:28 | FromDiscord | <ringabout> In reply to @ElegantBeef "I think this is": Yeah, found it was used in tests. |
04:50:55 | FromDiscord | <ElegantBeef> I know araq likes(d) using `nil` for case objects |
04:50:58 | FromDiscord | <ringabout> https://media.discordapp.net/attachments/371759389889003532/1076727572139884544/image.png |
04:51:03 | FromDiscord | <ElegantBeef> It's a pointless feature imo |
04:51:12 | FromDiscord | <ElegantBeef> It's just the same as `discard` but makes `nil` more meaningful |
04:51:43 | FromDiscord | <ElegantBeef> untyped nil has like 1 use in my view, but is used a fair bit |
04:52:28 | FromDiscord | <ringabout> I see |
04:53:07 | FromDiscord | <amadan> sent a code paste, see https://play.nim-lang.org/#ix=4ovN |
04:54:50 | FromDiscord | <Diogenes of Toronto> i see |
04:54:54 | FromDiscord | <ElegantBeef> Using `&=` instead of `add` amadan is my enemy! 😛 |
04:55:08 | FromDiscord | <Diogenes of Toronto> so add also works |
04:55:32 | FromDiscord | <ElegantBeef> yes `&` is Nim's concatenation operator, `&=` is a natural extension |
04:55:52 | FromDiscord | <amadan> I like &= 😝 (Except when it breaks with some stuff and I have to resort to .add lol) |
04:56:17 | FromDiscord | <ElegantBeef> Meh `&=` doesnt work with block syntax without making an abomination |
04:56:34 | FromDiscord | <ElegantBeef> It's just not nice |
04:56:35 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=4ovO |
04:57:02 | FromDiscord | <amadan> oh god I never do that 🤢 ↵Yeah block syntax is when I swap to .add |
04:57:33 | FromDiscord | <ElegantBeef> Yea i'd rather it all be consistent so only use add, there isnt much benefit in `&=` to me |
04:58:25 | FromDiscord | <eyes> there are no nim bindings for box2d as far as i can tell |
04:58:38 | FromDiscord | <eyes> is there a good physics engine with nim bindings? |
04:58:55 | FromDiscord | <eyes> looking to make a game from scratch with nim + raylibnim + a physics engine |
04:59:00 | FromDiscord | <amadan> There is https://github.com/avahe-kellenberger/nim-chipmunk/ |
04:59:05 | FromDiscord | <eyes> oho |
04:59:12 | FromDiscord | <amadan> raylib also has its own physics engine doesn't it? |
04:59:14 | FromDiscord | <eyes> i used to use pymunk |
04:59:22 | FromDiscord | <eyes> no raylib doesnt have physics i dont think? |
04:59:46 | FromDiscord | <ElegantBeef> it does |
04:59:48 | FromDiscord | <ElegantBeef> It has physac |
04:59:57 | FromDiscord | <eyes> wahoo |
05:00:45 | FromDiscord | <eyes> wacky yeah idk how i missed that |
05:00:57 | FromDiscord | <eyes> i dont think im going to use it though since its 3D probs |
05:01:15 | FromDiscord | <eyes> im familiar with chipmunk so im gonna try that |
05:01:25 | FromDiscord | <ElegantBeef> physac is 2D iirc |
05:01:31 | FromDiscord | <ElegantBeef> > Physac is a small 2D physics engine written in pure C. |
05:01:41 | FromDiscord | <eyes> oh |
05:01:43 | FromDiscord | <eyes> so it is |
05:02:00 | FromDiscord | <eyes> i saw "to be used in any 3D rendering api" and stopped there |
05:02:31 | FromDiscord | <eyes> maybe the reason i wasnt using this before was because I was doing a 3D game at that time? but idk i dont think i ever saw this |
05:02:50 | FromDiscord | <eyes> hm okay maybe Physac |
05:03:02 | FromDiscord | <eyes> although not sure if the nim bindings im using have physac included |
05:03:12 | FromDiscord | <ElegantBeef> Which bindings? |
05:03:19 | FromDiscord | <eyes> nvm it does |
05:03:21 | FromDiscord | <eyes> this is swag |
05:03:24 | FromDiscord | <eyes> physac it is |
05:03:33 | FromDiscord | <eyes> im using nimraylibnow |
05:23:59 | * | hernan joined #nim |
05:26:01 | * | arkurious quit (Quit: Leaving) |
05:41:11 | FromDiscord | <sOkam!> how can i find the default options available for operating systems with `when defined(windows)` etc? |
05:55:15 | * | dropkick quit (Ping timeout: 260 seconds) |
06:45:57 | * | derpydoo quit (Ping timeout: 255 seconds) |
06:50:29 | * | rockcavera quit (Remote host closed the connection) |
07:05:33 | FromDiscord | <emmikat> hi, is there any way of passing an asyncsocket to a thread? |
07:05:40 | FromDiscord | <emmikat> like, one resulting from connect? |
07:08:47 | FromDiscord | <Rika> Not safe because threads have individual async event loops iirc |
07:09:04 | FromDiscord | <Rika> Not really too sure though |
07:09:17 | FromDiscord | <emmikat> one the right way be doing crap with nativesockets? |
07:09:46 | FromDiscord | <emmikat> In reply to @Rika "Not safe because threads": this part makes sense but is there no way to just transplant into a diff event loop? |
07:10:26 | FromDiscord | <Diogenes of Toronto> In reply to @Rika "Not safe because threads": could you use a channel to send the socket connect? |
07:10:37 | FromDiscord | <emmikat> In reply to @Diogenes of Toronto "could you use a": wdym? |
07:11:01 | FromDiscord | <Elegantbeef> Not only the event loop, but since async procedures are closures the the data could be in a convoluted closure environment that holds onto a `ref T` |
07:11:27 | FromDiscord | <emmikat> righttt, that makes sense |
07:11:34 | FromDiscord | <emmikat> hm but wait |
07:11:42 | FromDiscord | <emmikat> does that have much to do with the AsyncSocket object itself? |
07:12:07 | FromDiscord | <Elegantbeef> That and also the closure procedures created |
07:12:42 | FromDiscord | <Elegantbeef> You generally do not attempt to complete a future on another thread |
07:12:56 | FromDiscord | <emmikat> asyncsocket has attached closures? |
07:12:58 | FromDiscord | <Elegantbeef> If you want to thread and use async you use channels or similar to send data across threads to instigate |
07:13:23 | FromDiscord | <Diogenes of Toronto> In reply to @emmikat "wdym?": my thinking as a go program is that you would have a channel send data to your thread and lock writing to the channel with a mutex when it is being written to and unlocking etc then using the object to do what you want in the thread |
07:13:38 | FromDiscord | <Elegantbeef> No `Future`s wrap closure procedures |
07:13:39 | FromDiscord | <Elegantbeef> Those closure procedures can hold onto heap allocated data |
07:13:41 | FromDiscord | <emmikat> what i'm trying to do is send the asyncsocket resutling from an accept() over to a new worker thread |
07:14:10 | FromDiscord | <emmikat> am i thinking about this the wrong way? |
07:14:12 | FromDiscord | <Elegantbeef> Yea diogenes here is saying what i'd do |
07:14:48 | FromDiscord | <Elegantbeef> Thread A gets data sends it to Thread B, this thread then does the networking stuffs and sends whatever it wants back to A across channel(s) |
07:15:05 | FromDiscord | <emmikat> actually that's exactly what i'm trying to implment |
07:15:06 | FromDiscord | <emmikat> but |
07:15:49 | FromDiscord | <emmikat> thread A is listen()ing, thread B is networking after an accept, and thread C is other processing stuff |
07:16:35 | FromDiscord | <emmikat> is there any easy way of doing this? |
07:16:44 | FromDiscord | <Elegantbeef> Using channels |
07:16:59 | FromDiscord | <Rika> You can’t send the accepted socket I believe |
07:17:02 | FromDiscord | <emmikat> but then thread A keeps doing the networking stuff after the accept |
07:17:09 | FromDiscord | <emmikat> okay |
07:17:18 | FromDiscord | <emmikat> performance is probably fine with thread A doing all that stuff |
07:17:21 | FromDiscord | <emmikat> i'll just stick to that |
07:17:30 | FromDiscord | <Diogenes of Toronto> i have a more mundane problem i cannot for the life of me figure out why my imports are not working. the lsp keeps telling me it cannot read a file and i am confused |
07:17:45 | FromDiscord | <Elegantbeef> What does the compiler say? |
07:17:52 | FromDiscord | <Rika> Has restarting it not worked |
07:18:13 | FromDiscord | <Diogenes of Toronto> cannot open file: pages/articles |
07:18:34 | FromDiscord | <Elegantbeef> Do you have a folder named `pages` and a module named `articles.nim`? |
07:18:49 | FromDiscord | <Diogenes of Toronto> yes |
07:19:00 | FromDiscord | <Rika> Is it in the same directory as the file that has the import |
07:19:10 | FromDiscord | <Diogenes of Toronto> oh god it was a spelling error |
07:19:17 | FromDiscord | <Rika> Lol |
07:19:30 | FromDiscord | <emmikat> In reply to @Rika "You can’t send the": actually couldnt you just manually use the asyncfd? |
07:19:54 | FromDiscord | <Rika> You can try it, it might work, I personally don’t know |
07:20:22 | FromDiscord | <emmikat> a bit low level but since threads are within the same process?? |
07:20:24 | FromDiscord | <emmikat> (edit) "process??" => "process?" |
07:20:28 | FromDiscord | <Phil> Sidenote for imports, if you want to make sure you can tell apart import from std, package and your own modules:↵You can do `import ./pages/articles` , `import std/strutils` and `import pkg/jsony` (for example). |
07:20:29 | FromDiscord | <emmikat> they should have access to the same fds? |
07:20:38 | FromDiscord | <Phil> (edit) "modules:↵You" => "modules at a glance:↵You" |
07:21:30 | FromDiscord | <Diogenes of Toronto> sent a code paste, see https://play.nim-lang.org/#ix=4ows |
07:22:08 | FromDiscord | <Phil> Also perfectly valid, just wanted to give you an option if you wanted to make it more explicit for example that pages is your own thing, while karax is a downloaded package |
07:25:49 | FromDiscord | <Diogenes of Toronto> another file isn't working. Is it possible to import from a parent directory? |
07:26:14 | FromDiscord | <Diogenes of Toronto> https://media.discordapp.net/attachments/371759389889003532/1076766645122498670/image.png |
07:26:33 | FromDiscord | <Phil> You want to import what from where? |
07:26:44 | FromDiscord | <Phil> Generally getting to the parent dir is just a matter of `../` |
07:26:48 | FromDiscord | <Phil> Nim is all relative imports |
07:27:04 | FromDiscord | <Diogenes of Toronto> i want to import helpers into stats |
07:27:19 | FromDiscord | <Phil> `../helpers` |
07:27:43 | FromDiscord | <Diogenes of Toronto> its still broken |
07:27:43 | FromDiscord | <Phil> Note that `../[helpers, otherModule, nextOtherModule]` won't work, that'll need a separate `../` statement |
07:28:04 | FromDiscord | <Phil> Helpers is in the frontend folder? |
07:28:12 | FromDiscord | <Diogenes of Toronto> yes |
07:28:35 | FromDiscord | <Phil> Show your import string please |
07:28:38 | FromDiscord | <Diogenes of Toronto> import ../helpers/[strConv] |
07:28:54 | FromDiscord | <Phil> When did helpers turn into a directory? |
07:29:33 | FromDiscord | <Diogenes of Toronto> its not it has a function |
07:29:37 | FromDiscord | <Phil> Your current import is saying "Import the strConv module from the helpers directory" |
07:29:45 | FromDiscord | <Diogenes of Toronto> ah |
07:29:57 | FromDiscord | <emmikat> In reply to @Isofruit "Your current import is": wait how |
07:29:59 | FromDiscord | <emmikat> even with the / ? |
07:31:13 | FromDiscord | <Phil> If you want to import only a specific symbol from a module you can use the `from std/strutils import toHex` syntax |
07:33:00 | FromDiscord | <Phil> In reply to @emmikat "even with the /": pure `import`syntax without a `from` in there is about importing entire modules. ↵Therefore any path you provide in those cases is just a relative filepath to your current file. |
07:34:15 | FromDiscord | <emmikat> In reply to @Isofruit "pure `import`syntax without a": that part makes sense, but i dont understand how that makes it a dictionary |
07:34:20 | FromDiscord | <Phil> For more on various ways of importing here some docs: https://nim-lang.org/docs/tut1.html#modules |
07:34:27 | FromDiscord | <emmikat> assuming we have a file, ../helpers/strConv |
07:34:28 | FromDiscord | <Phil> Wait, did I write dictionary somewhere? |
07:34:31 | FromDiscord | <emmikat> that should be a valid import |
07:34:35 | FromDiscord | <emmikat> NVM |
07:34:36 | FromDiscord | <emmikat> IM BLIND |
07:34:38 | FromDiscord | <emmikat> I CANT READ |
07:34:43 | FromDiscord | <emmikat> i was like waht |
07:34:48 | FromDiscord | <emmikat> okay ignore me |
07:34:52 | FromDiscord | <emmikat> everything youre saying makes sense nowww |
07:34:56 | FromDiscord | <Phil> That gave me a good morning laugh 😄 |
07:35:10 | FromDiscord | <Diogenes of Toronto> it worked btw i am just solving my other compilation errors |
07:35:22 | FromDiscord | <Phil> An important thing to remember: Never use include |
07:35:22 | FromDiscord | <Phil> Just don't |
07:35:27 | FromDiscord | <Phil> You will run into issues |
07:35:29 | FromDiscord | <Phil> Just use import |
07:35:53 | FromDiscord | <Diogenes of Toronto> include just dumps the text right |
07:36:17 | FromDiscord | <Phil> Yep. And if you e.g. define type A in that file and you just included it, now type A exists twice and both types are not compatible with one another |
07:36:41 | FromDiscord | <Diogenes of Toronto> got it |
07:36:56 | FromDiscord | <emmikat> In reply to @Isofruit "That gave me a": im glad! |
07:37:02 | FromDiscord | <emmikat> i was so confused i was like |
07:37:13 | FromDiscord | <emmikat> failing at reading and i read directory as dictionary in both of your messages and im like |
07:37:30 | FromDiscord | <emmikat> python brain and nim brain are the same so dictionary == table and so |
07:37:43 | FromDiscord | <emmikat> nim uses `[]` for table and i was like |
07:37:49 | FromDiscord | <emmikat> that's plausible ig but thers a slash |
07:39:36 | FromDiscord | <Phil> Alrighty, now on to figure out how I want to write that next section of docs |
07:40:05 | FromDiscord | <emmikat> any easy way of awaiting a channel? |
07:40:39 | FromDiscord | <Phil> I don't do multithreaded coding in that sense in nim. My httpserver bundled with the webdev frameworks I use typically takes that over for me |
07:40:59 | FromDiscord | <emmikat> it makes sense |
07:41:10 | FromDiscord | <emmikat> im kind of using the language in a nontypical way i think |
07:41:24 | FromDiscord | <Phil> And even if I did multithreading it would likely either be having a seq of stuff and parallelising a transformation or I'd just be outsourcing some kind of computation like reading a file or sth |
07:41:54 | FromDiscord | <Phil> I wonder if there is some kind of list of the standard ways people use multiple threads |
07:42:15 | FromDiscord | <Rika> Channels are not awaited, you use loops and try receive |
07:42:31 | FromDiscord | <emmikat> In reply to @Rika "Channels are not awaited,": yeah that's what i was going to do |
07:42:35 | FromDiscord | <emmikat> just feels messy |
07:42:52 | FromDiscord | <Rika> If you want to have async as well then you call poll in the loop then your futures will be tended to |
07:43:04 | FromDiscord | <emmikat> oh |
07:43:05 | FromDiscord | <emmikat> oh smart |
07:43:30 | FromDiscord | <emmikat> im trying to figure out if that's realtime enough tho |
07:43:42 | FromDiscord | <Rika> Async isn’t real-time safe |
07:43:50 | FromDiscord | <emmikat> yep |
07:43:54 | FromDiscord | <emmikat> that makes sense |
07:43:56 | FromDiscord | <Rika> As in deterministic kind of real time |
07:43:57 | FromDiscord | <emmikat> i was thinking about not using it |
07:44:04 | FromDiscord | <emmikat> right yeah |
07:44:09 | FromDiscord | <emmikat> i dont need it to be really real time |
07:44:20 | FromDiscord | <emmikat> but i dont want to wait for inconsistent timing |
07:44:31 | FromDiscord | <Rika> How inconsistent is intolerable |
07:44:34 | FromDiscord | <emmikat> i need messages to be passed relativiely on time with a consistentish delay |
07:44:40 | FromDiscord | <emmikat> In reply to @Rika "How inconsistent is intolerable": honestly, however much someone can feel |
07:45:21 | FromDiscord | <emmikat> its for a game so |
07:45:22 | FromDiscord | <emmikat> yeah |
07:46:48 | FromDiscord | <emmikat> honestly i think it should be fine |
07:47:20 | FromDiscord | <emmikat> can a Socket be shared across threads? |
08:10:14 | FromDiscord | <Diogenes of Toronto> does nim come with a linter? |
08:10:19 | FromDiscord | <Diogenes of Toronto> i miss gofmt |
08:11:18 | FromDiscord | <tfp> In reply to @Gumbercules "I think you could": can you import member functions from cpp in nim? |
08:12:08 | FromDiscord | <planetis> In reply to @Diogenes of Toronto "does nim come with": nimpretty but your success may vary |
08:13:58 | FromDiscord | <planetis> In reply to @tfp "can you import member": yes you can but read the docs please |
08:21:12 | FromDiscord | <tfp> well it doesn't really look like you can |
08:21:28 | FromDiscord | <tfp> it looks like a hack that just generates text to me |
08:23:25 | FromDiscord | <Elegantbeef> That's Nim interop for you |
08:24:08 | FromDiscord | <demotomohiro> @tfp https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importcpp-pragma |
08:24:30 | FromDiscord | <tfp> yeah i mean but that's not what i meant by import |
08:24:35 | FromDiscord | <tfp> that's not really importing |
08:25:21 | FromDiscord | <tfp> i mean maybe i can actually |
08:25:30 | FromDiscord | <tfp> cos the lib is c++ anyway.. why should i care if it uses the c++ backend |
08:25:34 | FromDiscord | <tfp> does the c++ backend suck? |
08:25:44 | FromDiscord | <tfp> why are people saying not to use it |
08:27:40 | FromDiscord | <Elegantbeef> well what do you mean import? |
08:28:06 | FromDiscord | <tfp> like at the linker level |
08:28:14 | FromDiscord | <tfp> so i can use it with the c backend |
08:28:21 | FromDiscord | <tfp> i don't rly know if that's possible tohugh |
08:28:22 | FromDiscord | <tfp> (edit) "tohugh" => "though" |
08:28:29 | FromDiscord | <Elegantbeef> Methods are dispatched through a Vtable |
08:28:31 | FromDiscord | <Elegantbeef> In C++ atleast |
08:28:40 | FromDiscord | <tfp> u can still export them though |
08:28:48 | FromDiscord | <tfp> i just don't think the vtable layout is standardized |
08:28:54 | FromDiscord | <demotomohiro> I think people usually use C backend because C compilers are faster than c++ compiler to compile code. |
08:29:10 | FromDiscord | <tfp> hmm yeah and more portable too |
08:29:18 | FromDiscord | <tfp> maybe the c++ backend isn't so bad |
08:29:22 | FromDiscord | <tfp> i'll try it first and see how it goes |
08:29:25 | FromDiscord | <Elegantbeef> Of course you can export them, but you cannot export the dynamic dispatch part, a c++ method can just be a proc that takes a pointer to the type |
08:29:39 | FromDiscord | <tfp> ye like the abi isn't standard |
08:29:42 | FromDiscord | <Elegantbeef> The C++ backend works, there are some edge cases and features you'd want arent implemented |
08:29:48 | FromDiscord | <Elegantbeef> Nim's methods for instance do not work with C++ methods |
08:30:00 | NimEventer | New thread by arnetheduck: JIT landed in nlvm, see https://forum.nim-lang.org/t/9907 |
08:30:00 | FromDiscord | <Elegantbeef> You need to use a 'hack' with codegendecl and procs |
08:30:18 | FromDiscord | <tfp> wdym don't work with |
08:30:22 | FromDiscord | <demotomohiro> @tfp It would possible if you wrap C++ lib in C language and built it as static or dynamic lib. |
08:30:30 | FromDiscord | <tfp> yeah that's what i'm doing now |
08:30:35 | FromDiscord | <tfp> but it's so annoying to write everything 3 times over |
08:30:36 | FromDiscord | <Elegantbeef> Nim methods do not emit C++ methods |
08:30:44 | FromDiscord | <Elegantbeef> So you cannot override methods in Nim without a hack |
08:30:50 | FromDiscord | <tfp> oh i see what you mean |
08:31:01 | FromDiscord | <tfp> that's fine, as long as it's less work than what i'm doing now |
08:31:07 | FromDiscord | <tfp> maybe ill try that |
08:47:25 | FromDiscord | <tfp> https://media.discordapp.net/attachments/371759389889003532/1076787077124984832/image.png |
08:47:36 | FromDiscord | <tfp> https://media.discordapp.net/attachments/371759389889003532/1076787124759695432/image.png |
08:47:44 | FromDiscord | <tfp> https://media.discordapp.net/attachments/371759389889003532/1076787155772391504/image.png |
08:47:46 | FromDiscord | <tfp> lol |
08:47:54 | FromDiscord | <tfp> this is actually based |
09:13:05 | FromDiscord | <Diogenes of Toronto> I have done it! it all compiles!! I will continue working on it later. I am really liking nim (besides running into the indentation errors like i did with python) |
09:13:33 | FromDiscord | <Diogenes of Toronto> much more enjoyable than working with vugu |
09:50:11 | FromDiscord | <fabricio> where can I find docs about the `line` pragma? |
09:50:54 | FromDiscord | <demotomohiro> Do you mean `inline` pragma? |
09:51:11 | FromDiscord | <fabricio> no, `line` |
09:51:53 | FromDiscord | <fabricio> nvm found it https://nim-lang.org/docs/manual.html#pragmas-line-pragma |
09:52:13 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/manual.html#pragmas-line-pragma |
09:56:59 | FromDiscord | <fabricio> is there some way that I can get the line number where a macro or template is called from within that macro/template? |
09:57:25 | FromDiscord | <fabricio> smth like the `LINE` in C |
10:01:59 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/system.html#instantiationInfo%2Cint |
10:07:59 | om3ga | Is it ok when --- if list[ident].hasKey(packets[i].identification) --- raises exception Key not Found? |
10:08:51 | om3ga | As I understand manual, it should be true/false, right? |
10:09:47 | FromDiscord | <Rika> It’s likely not the procedure has key raising but something else |
10:09:56 | FromDiscord | <Rika> Like [] |
10:10:09 | om3ga | Rika, that's what I thought too |
10:10:15 | om3ga | but how :) |
10:10:31 | FromDiscord | <Rika> How what? |
10:11:06 | om3ga | debugger points on that, and here is nothing other that could be executed |
10:11:21 | FromDiscord | <Rika> Well test the [] procedures! |
10:11:24 | FromDiscord | <Rika> (edit) "procedures!" => "procedures?" |
10:11:51 | FromDiscord | <Rika> I don’t understand |
10:11:51 | om3ga | hmm... ah! I got the idea |
10:12:13 | FromDiscord | <Rika> That’s good, because I don’t lmao |
10:12:26 | om3ga | list is of type Table[tuple, Table[uint, object]] |
10:12:54 | FromDiscord | <Rika> Then the first [] of list has the issue |
10:13:11 | om3ga | seems I need to find key of the tuple first, then find key in another table |
10:13:22 | FromDiscord | <Rika> If you want to avoid that you can always get or default |
10:13:48 | FromDiscord | <Rika> But that’s maybe wasteful, making an empty table to then call has key on lol |
10:14:03 | om3ga | no, it's ok for me |
10:14:14 | om3ga | at least if it will work |
10:16:58 | om3ga | Rika, hah, thnhx for pointing me on the problem |
10:17:02 | om3ga | it works |
10:20:14 | FromDiscord | <Rika> 👌 |
10:38:51 | om3ga | <Rika> But that’s maybe wasteful, making an empty table to then call has key on lol <---- Table is not empty, it contains the data |
10:39:31 | om3ga | but acessing list[ident].hasKey(packets[i].identification) seems is wrong |
10:42:11 | om3ga | its like : if list[tuple[param1: arr1, param2: arr2][key].hasKey(..), where list is Table[tuple, Table[uint, object]] |
10:43:29 | om3ga | we need to be sure that first key presents in the table, before accessing it's value |
10:43:46 | om3ga | that's how I explain, why it not work before |
10:47:12 | FromDiscord | <Rika> In reply to @om3ga "<Rika> But that’s maybe": I mean using get or default will make an empty (inner) table if key doesn’t exist in table (outer) |
10:47:28 | FromDiscord | <Rika> And that would be wasteful |
10:47:45 | om3ga | aah, yeah.. now I understand what you mena |
10:47:47 | om3ga | *mean |
10:47:55 | om3ga | lang barrier for me haha |
10:48:52 | om3ga | well code is fixed, but I have still strange output. sometimes program just don't want to work as it should |
10:49:22 | om3ga | today is sunday, better to take a rest :) |
11:04:35 | * | azimut joined #nim |
11:29:36 | * | ilikescaviar joined #nim |
11:36:32 | * | jmdaemon quit (Ping timeout: 248 seconds) |
11:39:50 | * | PMunch joined #nim |
11:39:59 | * | ilikescaviar quit (Quit: Leaving) |
11:47:03 | NimEventer | New thread by grd: Is it possible to only compile the linked modules but not the executable?, see https://forum.nim-lang.org/t/9909 |
12:34:41 | * | azimut quit (Ping timeout: 255 seconds) |
12:35:33 | * | azimut joined #nim |
12:43:32 | FromDiscord | <伊弉冉の恵み> apparently windows defender still thinks nim is a trojan, when will they stop with this bs |
12:46:28 | FromDiscord | <demotomohiro> Until someone who loves Nim get hired by microsoft, join windows defender devteam and become team leader. |
12:54:56 | PMunch | Anyone wants to spend there summer picketing outside Microsoft HQ? |
13:00:05 | PMunch | their* |
13:03:43 | * | sagax quit (Quit: Konversation terminated!) |
13:09:28 | * | anddam joined #nim |
13:09:32 | anddam | howdy |
13:09:39 | anddam | PMunch: hey, mind a query? |
13:10:16 | PMunch | SELECT * FROM Knowledge; |
13:11:27 | anddam | odd answer, but I guess Bool("whatyousaid") is True |
13:11:41 | PMunch | Just messing with you, query away |
13:12:27 | PMunch | (The joke, bad as it was, is that it is an SQL query) |
13:13:50 | anddam | mm /SQLquery command does not work |
13:32:39 | * | xet7 quit (Ping timeout: 268 seconds) |
13:53:30 | FromDiscord | <Ecorous> How do people avoid recursive module dependency? |
13:53:42 | FromDiscord | <Ecorous> I'm having severe trauma from it |
13:53:51 | FromDiscord | <Ecorous> I'll upload the code in a minute |
13:54:02 | PMunch | There are a couple of strategies |
13:54:19 | PMunch | The simplest being to have a separate types files |
13:54:30 | PMunch | You can also play around with generics |
13:55:10 | FromDiscord | <Ecorous> You'll see my issue in a minute |
13:56:03 | FromDiscord | <Ecorous> <https://github.com/Ecorous/packnim_gui> - here's the repo |
13:57:07 | FromDiscord | <Ecorous> sent a code paste, see https://play.nim-lang.org/#ix=4oxp |
13:58:13 | FromDiscord | <Ecorous> I need `window` to import `packwiz` because it contains a lot of logic, I need to `packwiz` to import utils to get the main window, I need `utils` to import `window` to create a `getMainWindow` |
13:58:45 | FromDiscord | <Ecorous> (edit) "window," => "window error function," |
13:58:59 | FromDiscord | <Ecorous> `utils` can be removed from it, but it doesn't really change the fact that I have this issue |
14:08:34 | PMunch | Sorry, I got caught up in some playground maintainance |
14:09:08 | FromDiscord | <Ecorous> Ah, np |
14:29:00 | * | derpydoo joined #nim |
14:32:56 | FromDiscord | <fabricio> In reply to @demotomohiro "https://nim-lang.org/docs/system.html#instantiation": thanks |
14:52:23 | FromDiscord | <simulatddev> anyone have a good resource/article for understanding tables in nim?↵for basic homogeneous types and dictionaries, I think I got it. But I'm having trouble creating heterogeneous tables. I'm coming from lua where you can just throw anything in a table as a value. |
14:53:05 | PMunch | @simulatddev, well you can't |
14:53:09 | PMunch | That's the simple answer |
14:53:34 | PMunch | What you need to do is create a variant object type |
14:53:53 | PMunch | Also known as a tagged union in other languages |
14:54:28 | PMunch | This essentially makes your table homogeneous, but still allows different types to be held in every node |
14:55:47 | FromDiscord | <simulatddev> sent a long message, see http://ix.io/4oy3 |
14:56:03 | Amun-Ra | nope |
14:56:21 | Amun-Ra | like this: https://nim-lang.org/docs/manual.html#types-object-variants |
14:56:27 | PMunch | Ah damn it |
14:56:35 | PMunch | Beat me to it by seconds :P |
14:56:40 | Amun-Ra | :P |
14:56:51 | Amun-Ra | that's pretty uncommon for me :> |
14:57:39 | FromDiscord | <simulatddev> In reply to @Amun-Ra "like this: https://nim-lang.org/docs/manual.html#ty": ah okay. I will do it this way, thanks. |
14:57:48 | Amun-Ra | Nim has {.union.} pragma too but it's mean to be used with C types |
15:01:09 | FromDiscord | <simulatddev> need to get used to the differences. otherwise nim is really cool and useful |
15:02:00 | PMunch | Yeah Nim can seem a bit strict at first |
15:03:11 | Amun-Ra | like you can't change variant kind type after an object it's created (been there done that) ;> |
15:04:31 | FromDiscord | <simulatddev> I think I will learn to like the strictness...maybe↵but also writing x: int = 3 is nicer visually. easier to look at though I don't think it's necessary |
15:04:57 | PMunch | It really does help prevent bugs, which is nice |
15:05:18 | PMunch | You don't have to specify the type like that, Nim has type inference so `let x = 3` works as well |
15:05:30 | Amun-Ra | yes, type strictness helps a lot |
15:05:55 | Amun-Ra | and one of those things I love the most - UFC |
15:06:11 | FromDiscord | <simulatddev> right, it can infer. not sure how much more efficient that is, but I think it'll prevent a lot of dumb mistakes on my part |
15:06:12 | PMunch | Yeah |
15:06:28 | PMunch | The strictness of types, combined with the relaxed syntax really is a killer combination |
15:07:06 | anddam | Amun-Ra: oh that has a name |
15:07:28 | anddam | that's how Lua implement classes, IIRC |
15:07:38 | anddam | implements* |
15:09:05 | PMunch | So.. |
15:09:07 | FromDiscord | <simulatddev> I was very surprised at the syntax. definitely nice |
15:09:12 | PMunch | I might've written a logging library |
15:09:27 | PMunch | Basically completed my superlog experiment |
15:09:48 | PMunch | But now it needs a name |
15:10:20 | FromDiscord | <enthus1ast> hyperlog |
15:10:31 | FromDiscord | <enthus1ast> \:) |
15:10:43 | Amun-Ra | PMunch: that's the hardest part |
15:10:55 | FromDiscord | <simulatddev> Lognog |
15:13:29 | PMunch | I was thinking of a play on words of superlog |
15:13:40 | PMunch | And I thought to myself, what's the greatest log |
15:13:59 | PMunch | So I'm considering Yggdrasil |
15:14:25 | FromDiscord | <enthus1ast> a module that one must always look up the name to import it? \:) |
15:14:27 | FromDiscord | <simulatddev> or maybe Yule |
15:14:53 | FromDiscord | <fabricio> timber? |
15:15:13 | PMunch | @enthus1ast, yeah that's the problem isn't it.. |
15:15:22 | PMunch | Doesn't exactly roll of the tongue |
15:15:27 | PMunch | Yule could be fun |
15:15:48 | FromDiscord | <simulatddev> I mean, the yule log is traditionally the largest one they could find |
15:15:53 | PMunch | Timber just sounds like you need to watch out |
15:17:22 | PMunch | Well this is fun.. In trying to figure out what's wrong with the playground I tried building it locally, now my hard-drive is full as well.. |
15:18:29 | FromDiscord | <ringabout> There are cyclic imports in the compiler, which I didn't notice before, for instance, transf and lambdalifting rely on each other. How could I break this cyclic dep quickly? |
15:18:53 | * | xet7 joined #nim |
15:21:42 | Amun-Ra | hmm, general question, what are tags really for? |
15:22:09 | PMunch | Amun-Ra, tags in what sense? |
15:22:47 | PMunch | @ringabout, they have cyclic imports and it works? |
15:22:47 | Amun-Ra | PMunch: as in tagging effects |
15:22:54 | FromDiscord | <auxym> In reply to @ringabout "There are cyclic imports": the usual strategy is moving the dependencies in a third module |
15:23:06 | FromDiscord | <auxym> or combining both into 1 |
15:23:41 | FromDiscord | <ringabout> In reply to @PMunch "<@658563905425244160>, they have cyclic": cyclic imports (but not cyclic deps) + forward decls. |
15:24:11 | Amun-Ra | PMunch: I always add {.push raises: [].} at the beginning of every file, I'm considering changing it to {.push raises:[], tags: [].} |
15:24:17 | PMunch | I'm not sure I follow @ringabout |
15:24:29 | PMunch | Amun-Ra, well tags are just used to track things |
15:24:29 | FromDiscord | <ringabout> In reply to @auxym "the usual strategy is": Yeah, firstly I need `from lambdalifting import nil` and `from transf import nil` to find all the usages. |
15:27:58 | FromDiscord | <ringabout> It seems when using cyclic imports, I cannot implicitly import procs. https://media.discordapp.net/attachments/371759389889003532/1076887878942085120/image.png |
15:30:02 | PMunch | Huh, so apparently Docker had accumulated almost 40Gb of various stopped containers and unused images on my machine |
15:30:04 | PMunch | Fun times |
15:31:00 | Amun-Ra | you already said it by "docker"… ;) |
15:33:43 | PMunch | Yeah.. It really isn't made to save space :P |
15:38:34 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4oyD |
15:40:22 | Amun-Ra | 4zv4l: ## → # |
15:40:46 | Amun-Ra | ## is not an ordinary comment, it leaves its trace in ast |
15:42:08 | FromDiscord | <4zv4l> that's for the doc right ? |
15:42:14 | FromDiscord | <4zv4l> cannot document import ? |
15:45:00 | FromDiscord | <Rika> Nope I don’t think so |
15:46:07 | Amun-Ra | you can document whole import, not the part of it |
15:46:56 | Amun-Ra | document as in "it works"; I haven't tested what it looks like |
15:48:53 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4oyJ |
15:49:06 | FromDiscord | <4zv4l> that's for a dll with global variable |
15:50:48 | Amun-Ra | before |
15:51:01 | * | rockcavera joined #nim |
15:51:52 | FromDiscord | <4zv4l> thanks ! |
15:56:11 | PMunch | Hmm, still not sure about the name.. |
15:56:14 | FromDiscord | <4zv4l> how can I comment that I declare the proc prototype before so that I can use it before writing the body ? |
15:56:30 | PMunch | Huh? |
15:56:43 | FromDiscord | <4zv4l> I have a config variable↵that I have to load and use |
15:57:03 | FromDiscord | <4zv4l> if I put it down of the file after the `loadConfig`↵I get errors because function that use it on top |
15:57:17 | FromDiscord | <4zv4l> if I put it on top↵I get errors because `loadConfig` isn't declared yet |
15:57:29 | PMunch | Are you asking how to forward declare something? |
15:57:31 | Amun-Ra | 4zv4l: func foo() |
15:57:40 | FromDiscord | <4zv4l> I am asking how I can comment that |
15:57:46 | FromDiscord | <4zv4l> so that the dude who read my code to maintain it |
15:57:47 | Amun-Ra | 4zv4l: I mean, everything before = |
15:57:49 | FromDiscord | <4zv4l> understand why I did this |
15:58:12 | * | arkurious joined #nim |
15:58:28 | FromDiscord | <4zv4l> yeah yah I did that↵just for now the comment is like↵> # proc declaration to use before writing the body |
15:58:57 | PMunch | Well typically you wouldn't comment it. Should be obvious to any Nim user why you forward declare stuff.. |
15:59:09 | Amun-Ra | 4zv4l: something like this? https://play.nim-lang.org/#ix=4oyQ |
15:59:21 | Amun-Ra | ah, I see |
15:59:23 | FromDiscord | <4zv4l> In reply to @Amun-Ra "<@329196212282458112>: something like this?": yeah |
15:59:38 | FromDiscord | <4zv4l> and since that's the only function I declare without writing the body on top of the file |
15:59:45 | FromDiscord | <4zv4l> maybe that will be weird idk |
16:00:02 | Amun-Ra | forward declaration is staightforward by itself, I see no reason to make it verbose; it's like commenting i += 2 # add two to i |
16:00:58 | Amun-Ra | I mean there's only one reason to declare function forward… ;> |
16:01:05 | FromDiscord | <4zv4l> can sound stupid but why Nim doesn't arrange it so it's ok to use a function even if it is not declared yet but is later in the file ? |
16:01:31 | Amun-Ra | there's pragma for that, but I wouldn't recommend it |
16:01:31 | PMunch | Because Nim just does a single pass of your file |
16:01:40 | PMunch | It's faster that way (to compile) |
16:01:59 | FromDiscord | <4zv4l> In reply to @Amun-Ra "there's pragma for that,": just to know, what is the pragma ? |
16:02:07 | PMunch | But yeah, you can turn on code reordering: https://nim-lang.github.io/Nim/manual_experimental.html#code-reordering |
16:02:45 | FromDiscord | <4zv4l> oh yeah alright, I'll let my proc declaration there xD |
16:04:20 | * | xet7 quit (Quit: Leaving) |
16:22:32 | * | dropkick joined #nim |
16:50:37 | FromDiscord | <Patitotective> KDL parsing library with compile-time parsing, streams, decoder, encoder, simple preferences sytem https://github.com/Patitotective/kdl-nim/releases/tag/1.0.0 :] |
17:59:31 | * | azimut quit (Remote host closed the connection) |
18:00:41 | * | azimut joined #nim |
18:07:27 | * | sagax joined #nim |
18:22:04 | FromDiscord | <Hourglass [She/Her]> <https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/1.19.3/protocol.json> I don't get how to turn this incomprehensible blob of data into something that can actually be used for auto-generating types |
18:27:33 | Zevv | who is ZoomRmc? |
18:28:02 | Zevv | are they on matrix or irc or discord or whereever? |
18:42:18 | FromDiscord | <Hourglass [She/Her]> How would I get the folder my package is in? |
18:42:32 | FromDiscord | <Hourglass [She/Her]> Not the app directory, the source file directory is what I need |
18:44:51 | FromDiscord | <Hourglass [She/Her]> Found it! https://nim-lang.org/docs/system.html#currentSourcePath.t |
18:50:46 | * | rockcavera quit (Remote host closed the connection) |
18:57:30 | * | kenran joined #nim |
18:58:33 | * | kenran quit (Remote host closed the connection) |
19:06:17 | FromDiscord | <Hourglass [She/Her]> Anyone know what a `topBitSetTerminatedArray` is? |
19:06:29 | FromDiscord | <Hourglass [She/Her]> Not a Nim thing, but I need to represent it in Nim |
19:11:29 | NimEventer | New thread by teras: SIGSEGV when creating a dunamic library in Nim and use it in nim (and posiibbly in other places too), see https://forum.nim-lang.org/t/9910 |
19:21:34 | NimEventer | New post on r/nim by Mmiguel6288: nimpy: executing a python library inside of nim = same python performance?, see https://reddit.com/r/nim/comments/116lfah/nimpy_executing_a_python_library_inside_of_nim/ |
19:46:47 | FromDiscord | <Lanky Lemur> I'm messing around with macros right now. Does anyone know why it might be inserting semicolons in the parameters list of a new procedure I'm defining? |
19:47:49 | termer | I'm not experienced with macros, but I don't think anyone's going to be able to help with your problem easily without seeing at least some of your macro code |
19:49:01 | FromDiscord | <Hourglass [She/Her]> In reply to @Lanky Lemur "I'm messing around with": if you do `.repr` on the proc, does it do `arg: type; anotherArg: type` for the arguments? |
19:49:19 | FromDiscord | <Hourglass [She/Her]> `;` and `,` are both valid for separating params |
19:50:25 | FromDiscord | <Lanky Lemur> In reply to @Hourglass, When the Hour Strikes "if you do `.repr`": That's exactly the issue. So it's not a problem, then? |
19:51:13 | FromDiscord | <Hourglass [She/Her]> Nope! |
19:51:32 | FromDiscord | <Hourglass [She/Her]> well, I don't think it should be a problem seeing as both are valid syntax |
19:51:56 | FromDiscord | <Hourglass [She/Her]> Do `enum`s in Nim start from `0` automatically if you don't define the values? |
19:54:55 | FromDiscord | <Lanky Lemur> It appears so |
19:55:55 | FromDiscord | <Lanky Lemur> In reply to @Hourglass, When the Hour Strikes "Do `enum`s in Nim": > Do enums in Nim start from 0 automatically if you don't define the values?↵↵It appears so |
19:56:20 | FromDiscord | <Hourglass [She/Her]> Good to know! |
19:59:30 | FromDiscord | <BobBBob> sent a code paste, see https://play.nim-lang.org/#ix=4oAe |
20:00:52 | FromDiscord | <Hourglass [She/Her]> I think you can do `ThreebitRange 0, 1, 2, ...` in the declaration |
20:01:09 | FromDiscord | <Hourglass [She/Her]> I think |
20:01:52 | FromDiscord | <BobBBob> oh yep that works thanks |
20:02:01 | FromDiscord | <Hourglass [She/Her]> Ofc |
20:03:40 | FromDiscord | <emmikat> can nim sockets be sent over channels? |
20:08:34 | FromDiscord | <Hourglass [She/Her]> In reply to @emmikat "can nim sockets be": Try it and see? :P |
20:08:55 | FromDiscord | <emmikat> oh true |
20:09:01 | FromDiscord | <emmikat> im assuming if i just |
20:09:09 | FromDiscord | <emmikat> socket[] i can get send that over and it should be fine? |
20:10:41 | PMunch | Zevv, why do you ask? |
20:12:11 | PMunch | @Lanky_Lemur, it's technically even the recommended way to split a list of arguments |
20:18:55 | FromDiscord | <Hourglass [She/Her]> In reply to @emmikat "socket[] i can get": Probably if the reference is kept alive |
20:27:01 | Zevv | PMunch: i'm looking to discuss recent commits on nim-lang/threading; this is the recommended implementation for channels, but i believe it might not be right and safe |
20:27:39 | PMunch | Aha |
20:28:01 | FromDiscord | <Hourglass [She/Her]> Question: Doesn't arc make using variables and stuff between threads safe? I think it was @Phil who talked about it? |
20:28:19 | FromDiscord | <Hourglass [She/Her]> Just by default it's not threadsafe, but it could be, something along those lines |
20:28:22 | Zevv | yeah that's a great joke |
20:28:40 | FromDiscord | <Hourglass [She/Her]> I have no idea so ¯\\_(ツ)\_/¯ |
20:28:52 | Zevv | in theory, it could be/should be |
20:29:01 | PMunch | Not sure if it's the same person, but there is a Zoom on Element Zevv |
20:29:03 | FromDiscord | <Elegantbeef> It only allows sharing across threads |
20:29:22 | Zevv | it allows sharing across threads, but Nims arc reference counters are kind of in the way |
20:29:27 | FromDiscord | <Elegantbeef> It doesnt make it safe, that still requires sync objects |
20:29:31 | Zevv | it's not easy to perform a clean and safe move |
20:29:47 | Zevv | and what he says, of course ^^ |
20:29:47 | FromDiscord | <Phil> In reply to @Hourglass, When the Hour Strikes "Question: Doesn't arc make": Can't have been me, I don't do multi-threaded stuff, or at least haven't done so far.↵I've talked about how ORC collects cycles, but even that is not based on expertise, literally just based on blogposts and other statements made in here |
20:29:52 | FromDiscord | <Elegantbeef> Even with mutex or similar on the ref count you cannot share graphs afaik |
20:30:07 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "Can't have been me,": Ah |
20:30:30 | FromDiscord | <Hourglass [She/Her]> In reply to @Elegantbeef "It doesnt make it": Ah |
20:30:58 | Zevv | anyhow, after spending six weeks or so I think i kind of know the things to do and not to do to make this work, but it seems that the channels impl from that repo might not be doing the right thing |
20:31:12 | Zevv | for one, it's not running clean either on thread sanitizer, nor on valgrind/helgrind/drd |
20:33:55 | FromDiscord | <Ecorous> Is there a nim equivalent to the `directories` rust crate? |
20:37:05 | PMunch | What does the directories rust crate do? |
20:37:36 | FromDiscord | <Elegantbeef> The stdlib has some things like `getConfigDir` and friends |
20:37:59 | PMunch | Oh, it seems like it's just getting various folders. For that either the stuff in system or possibly in os should suffice |
20:41:18 | FromDiscord | <Ecorous> Does it do platform abstraction? |
20:41:43 | FromDiscord | <Ecorous> I'm mainly wanting the ProjectDirs part of it |
20:41:56 | PMunch | Yup |
20:42:08 | PMunch | That's why it's called `os`, it's OS specific stuff |
20:43:30 | PMunch | You even have a `/` operator in there which will combine paths in the platform-appropriate way |
20:43:49 | FromDiscord | <Ecorous> Hmm, it doesn't seem to have one that gets %APPDATA% and ~/.local/hare |
20:44:08 | FromDiscord | <huantian> i don't want a rabbit in my .local folder |
20:44:09 | FromDiscord | <Ecorous> (edit) "~/.local/hare" => "~/.local/share" |
20:44:46 | ixmpp | hare? in my nim chat˚ |
20:44:56 | ixmpp | smh |
20:46:05 | FromDiscord | <Elegantbeef> The general convention is like `getConfigDir() / "myProgramName" / "myConfig.format"` |
20:46:51 | FromDiscord | <Ecorous> I'm not looking for a config dir |
20:47:14 | FromDiscord | <Elegantbeef> I was elaborating |
20:47:45 | FromDiscord | <Ecorous> It should return AppData\Roaming or .local/share |
20:48:35 | FromDiscord | <Ecorous> I guess I can implement it myself, but there should be a library for it |
20:48:50 | FromDiscord | <Elegantbeef> PRs welcome 😛 |
20:49:50 | FromDiscord | <huantian> yeah there should be a `getDataDir()` or something |
20:51:26 | FromDiscord | <huantian> man I don't understand this rust code where we got getConfigDir from |
20:55:06 | FromDiscord | <huantian> it should be easy enough to make your own though, just copy the getConfigDir code |
20:56:08 | Zevv | PMunch: what's element? |
20:56:41 | FromDiscord | <enthus1ast> what do you think about the tables\:↵`assert(len(t) == L, "the length of the table changed while iterating over it")`↵Check? i do it and it works fine for me (at least in my usecase) |
20:56:48 | FromDiscord | <enthus1ast> i do it in release |
20:57:20 | FromDiscord | <Hourglass [She/Her]> Anyone know how I'd store a position? https://wiki.vg/Data_types#Position |
20:57:24 | FromDiscord | <Hourglass [She/Her]> Not really sure |
20:57:27 | PMunch | Zevv, Matrix, sorry |
20:57:35 | Zevv | PMunch: right, thanks |
20:57:36 | PMunch | My Matrix client is called Element :P |
20:57:54 | Zevv | enthus1ast: don't do it. if the spec says no, and it works, there is no guarantee it will still work next week |
20:57:54 | FromDiscord | <Hourglass [She/Her]> ` |
20:58:05 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4oAy |
20:58:15 | FromDiscord | <Hourglass [She/Her]> Not super sure how to do it |
20:58:20 | * | rockcavera joined #nim |
20:58:57 | * | rockcavera quit (Remote host closed the connection) |
20:59:21 | * | rockcavera joined #nim |
21:00:22 | Amun-Ra | Hourglass: there's no portable way in C and C++ backends |
21:00:30 | * | rockcavera quit (Remote host closed the connection) |
21:01:33 | * | Amun-Ra recommends shifts and masks |
21:01:34 | * | rockcavera joined #nim |
21:18:39 | FromDiscord | <Hourglass [She/Her]> In reply to @Amun-Ra "Hourglass: there's no portable": So it'd be different between both backends? |
21:18:46 | FromDiscord | <Hourglass [She/Her]> That's a bit of a pain |
21:19:05 | Amun-Ra | Hourglass: not backends, *compilers* even :> |
21:19:21 | Amun-Ra | I mean according to the C standard |
21:19:46 | Amun-Ra | bitfields are implementation defined, you need to rely on implementation |
21:19:57 | FromDiscord | <Hourglass [She/Her]> Anyway, the beginnings of my Minecraft packet wrapping library: https://github.com/Yu-Vitaqua-fer-Chronos/Napkins |
21:20:12 | FromDiscord | <Hourglass [She/Her]> Not even done because I need to implement all the data types for entity metadata sigh |
21:20:18 | FromDiscord | <Hourglass [She/Her]> In reply to @Amun-Ra "bitfields are implementation defined,": That's annoying |
21:20:41 | Amun-Ra | Hourglass: if you need to port data layout from some abi, you can use that implementation |
21:20:46 | FromDiscord | <Hourglass [She/Her]> ~~Solution: Virtual bits using sequences of booleans for each bit /j~~ |
21:20:55 | Amun-Ra | Hourglass: yes, that's why I've never used bitfields in C |
21:20:58 | FromDiscord | <Hourglass [She/Her]> In reply to @Amun-Ra "Hourglass: if you need": Wdym? |
21:21:31 | Amun-Ra | Hourglass: if you get the data from some C lib or sth like that |
21:21:45 | FromDiscord | <Hourglass [She/Her]> Ah, nope it's sent over the network |
21:22:29 | Amun-Ra | I see |
21:23:44 | FromDiscord | <Hourglass [She/Her]> Yeah, trying to map out the Minecraft protocol in Nim but this is a massive pain |
21:24:10 | FromDiscord | <jtv> The only thing that is not "portable" in terms of C bitfields is order in the face of endianess. Technically implementation defined, but not an issue as a C developer |
21:24:25 | Amun-Ra | not really |
21:25:48 | FromDiscord | <jtv> Really. I've only been programming in C for 30 years, and know the standard and compiler environment pretty well. |
21:26:31 | Amun-Ra | N1570, 6.7.2.1.11 |
21:26:53 | Amun-Ra | https://pastebin.com/HgHUEuYb |
21:26:56 | FromDiscord | <jtv> I know the standard, I'm telling you in practice the only thing that is a portability issue is endianess |
21:27:33 | Amun-Ra | I mentioned that, too |
21:28:07 | FromDiscord | <jtv> And pretty much everywhere 95% of code is going to run these days will be little endian, it's almost not even worth bothering these days |
21:28:42 | FromDiscord | <enthus1ast> and also network protocols should use just one |
21:29:17 | Amun-Ra | gcc and clang use the same bitfield layout, I'm not so sure about msvc |
21:29:21 | FromDiscord | <T0lk1en> Hey anyone have any experience with the nim tor library |
21:29:58 | FromDiscord | <jtv> Yeah, MSVC is vanilla on bitfields. |
21:30:06 | * | jmdaemon joined #nim |
21:46:39 | rockcavera | I didn't read the talk about bitfields early on, but I stopped using them due to a bug with mm refc and async |
21:47:39 | rockcavera | now for arc/orc it works perfectly. |
21:53:06 | FromDiscord | <jtv> Frankly I don't use them very much; primarily they save space that is not at a premium these days. I'm fine having a bunch of bools. Tho if I'm doing anything lock-free then it's sometimes critical to ensure atomicity. |
21:55:38 | NimEventer | New thread by takekikuchi: Does "--compileOnly" with "Dead Code Elimination" work?, see https://forum.nim-lang.org/t/9911 |
21:59:38 | Amun-Ra | flto helps either way |
22:02:43 | FromDiscord | <jtv> Yes link time optimization is underappreciated |
22:17:06 | PMunch | In case there are more people out there doing dynamic libraries today: https://peterme.net/dynamic-libraries-in-nim.html |
22:17:08 | * | PMunch quit (Quit: leaving) |
22:19:36 | FromDiscord | <Elegantbeef> Still need to work on seeya more |
22:19:49 | FromDiscord | <Hourglass [She/Her]> I'm actually using dynamic libraries for my Nimberite plugin system, I'm using `arc` for the plugins and actual server though |
22:20:23 | FromDiscord | <Hourglass [She/Her]> I haven't had any issues yet when it comes to passing Nim objects between the two |
22:20:45 | FromDiscord | <Elegantbeef> Well aslong as you know about the Nim optimisations it's not too bad |
22:21:11 | FromDiscord | <Hourglass [She/Her]> Like having a free-hanging reference will get it cleared? |
22:21:20 | FromDiscord | <Hourglass [She/Her]> So just make sure it's kept alive until the function returns? |
22:21:27 | FromDiscord | <Elegantbeef> I mean knowing when a object is passed by ref or copy |
22:21:29 | FromDiscord | <jtv> Yeah, overall it's one of the more intuitive FFIs you could imagine, at least from C, if you understand the memory model |
22:21:53 | FromDiscord | <Hourglass [She/Her]> In reply to @Elegantbeef "I mean knowing when": Ah, we're using ref objects so had no issues there yet |
22:24:41 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://paste.rs/i7d |
22:24:47 | FromDiscord | <Elegantbeef> RTFM |
22:24:50 | FromDiscord | <Hourglass [She/Her]> case typ of |
22:25:41 | FromDiscord | <Hourglass [She/Her]> Nice I'm right |
22:40:29 | FromDiscord | <Haze System> sent a code paste, see https://play.nim-lang.org/#ix=4oAR |
22:41:27 | FromDiscord | <Phil> No good thing starts with brainfuck |
22:42:51 | FromDiscord | <amadan> Looking at the code, you should be using `compileString` and not compile↵Also don't put it inside static |
22:42:57 | FromDiscord | <amadan> (edit) "compile↵Also" => "`compile`↵Also" |
22:46:11 | FromDiscord | <Hourglass [She/Her]> Oh another system in the wild lol |
23:00:01 | FromDiscord | <cletus> Hi everyone, I think the nim compiler is playing peek-a-boo with me: |
23:00:17 | * | xet7 joined #nim |
23:08:47 | FromDiscord | <Diogenes of Toronto> In reply to @Isofruit "No good thing starts": but many goo things end with it |
23:20:31 | FromDiscord | <Haze System> In reply to @amadan "Looking at the code,": i don't have compileString yet, just calling compile directly. the article says to put it in static to make sure its done at compile time and I thought i tried without and got a different error but I'll check 🤔 |
23:21:00 | FromDiscord | <Haze System> In reply to @Hourglass, When the Hour Strikes "Oh another system in": 👀 heh didn't notice the ampersand in y'all's bio. nice 😎 |
23:21:32 | FromDiscord | <amadan> Ah I might have gone too far ahead then sorry↵I just copied from the full code linked |
23:21:56 | FromDiscord | <Haze System> In reply to @Isofruit "No good thing starts": haven't actually used any myself lol, just learning Nim and using our for practice ^^ |
23:22:24 | FromDiscord | <Hourglass [She/Her]> God I'm gonna have to write an NBT parser soon, that sounds like hell |
23:22:36 | FromDiscord | <Haze System> wassat? |
23:23:59 | FromDiscord | <Haze System> In reply to @amadan "Ah I might have": I'll put my whole code up somewhere in a bit after i get home |
23:24:14 | FromDiscord | <Hourglass [She/Her]> Ah unrelated to your project but I'm trying to work on a Minecraft server implementation in Nim ^^ |
23:24:57 | FromDiscord | <Haze System> oo awesome! |
23:25:21 | FromDiscord | <Hourglass [She/Her]> I don't actually have any working code yet though since I'm trying to work on making all the basic structures needed for packet type generation via macros |
23:28:54 | FromDiscord | <Haze System (they/them)> never done anything with servers but it seems fun. have always dreamed of reverse engineering and making a private server for a game though :x |
23:28:56 | FromDiscord | <Faisal Alghamdi> Hello all |
23:29:33 | FromDiscord | <Faisal Alghamdi> Its easy to reverse engineer you know |
23:29:47 | FromDiscord | <Faisal Alghamdi> Or at least for websites |
23:30:15 | FromDiscord | <Faisal Alghamdi> I do it all the time with some sites i use frequently |
23:30:37 | FromDiscord | <Haze System (they/them)> I'd want to do an MMO. not easy from what I've heard. it's just a distant fantasy though lol, i haven't done much reverse engineering at all |
23:31:08 | FromDiscord | <Hourglass [She/Her]> In reply to @Haze System "never done anything with": Ngl same, but actually trying to decipher packets and work on the logic behind it sounds painful |
23:31:59 | FromDiscord | <jtv> "Reverse engineering" web pages (where some version of the source is available if you know where to go) is vastly easier than reverse engineering minecraft, which they're talking about. You basically need to be deep enough to understand low-level machines (like the JVM if you're on the java version). |
23:32:35 | FromDiscord | <Hourglass [She/Her]> Tbf, Minecraft has it's protocol documented and reverse engineered already |
23:32:44 | FromDiscord | <Hourglass [She/Her]> Mappings and decompilers exist for Java too |
23:32:54 | FromDiscord | <jtv> Yes, have you ever used them? 🙂 |
23:33:14 | FromDiscord | <jtv> They require low-level knowledge still. |
23:33:25 | FromDiscord | <Hourglass [She/Her]> Decompilers for MC? I've used it yeah but I'm more focused on reading the docs for protocols |
23:33:34 | FromDiscord | <Haze System (they/them)> In reply to @Hourglass, When the Hour Strikes "Tbf, Minecraft has it's": ye that helps a lot. bit doing it yourself is half the fun! at least for me 😜 |
23:33:45 | FromDiscord | <Hourglass [She/Her]> I have messed with JVM bytecode though, and it's a hell |
23:33:45 | FromDiscord | <Haze System (they/them)> (edit) "bit" => "but" |
23:33:48 | FromDiscord | <jtv> For any real language. |
23:34:14 | FromDiscord | <Hourglass [She/Her]> In reply to @Haze System "ye that helps a": Fair, still sounds like hell aha |
23:34:16 | FromDiscord | <Faisal Alghamdi> With minecraft you dont reverse engineer jack shit |
23:34:20 | FromDiscord | <Haze System (they/them)> i myself have done a bit of RE with assembly. v fun |
23:34:37 | FromDiscord | <Haze System (they/them)> love low level choice ❤️ |
23:34:39 | FromDiscord | <Hourglass [She/Her]> In reply to @Faisal Alghamdi "With minecraft you dont": Yeah, i don't have to do RE because it's already done |
23:34:46 | FromDiscord | <Haze System (they/them)> (edit) "choice" => "code" |
23:34:48 | FromDiscord | <Hourglass [She/Her]> Assembly sounds horrid |
23:35:14 | FromDiscord | <jtv> For some people it is, for some people it's fun 🙂 |
23:36:25 | FromDiscord | <Haze System (they/them)> In reply to @Hourglass, When the Hour Strikes "Assembly sounds horrid": it's hard to follow if just reading it, but stepping through it with a debugger helps a lot. the simplicity and being able to see every single thing that happens is kinda, idk, relaxing somehow haha. hard to explain |
23:36:39 | FromDiscord | <Hourglass [She/Her]> Fair, I can get that |
23:36:53 | FromDiscord | <Hourglass [She/Her]> God I remember my attempt with a brainfuck interpreter |
23:37:08 | FromDiscord | <Hourglass [She/Her]> I couldn't figure out loops and broke them xD |
23:37:16 | FromDiscord | <Haze System (they/them)> oh no xD |
23:39:43 | FromDiscord | <PunchCake> Or it is partially |
23:39:43 | FromDiscord | <PunchCake> Because its not meant for human consumption lol↵(@Hourglass [She/Her]) |
23:39:44 | FromDiscord | <PunchCake> The jvm programmers had to understand it to parse it and execute it |
23:39:48 | FromDiscord | <jtv> Well, brainfuck is a lot harder to understand than asm. TBF, x86 in particular is hard to learn, while close to universal, because it's just got SOOO many instructions with so many features, combined with so much legacy cruft |
23:40:35 | FromDiscord | <Hourglass [She/Her]> In reply to @PunchCake "Because its not meant": That's true |
23:40:37 | FromDiscord | <PunchCake> Assembly isnt that bad anyways |
23:40:52 | FromDiscord | <jtv> "not meant for human consumption" isn't strictly true. There have always been JVM assemblers. Even back when writing Java, it was important to have an assembler to be able to more easily test and debug |
23:41:05 | FromDiscord | <Haze System (they/them)> yeah x86 is a mess. i prefer asm of retro computers (commodore 64, consoles like Gameboy) |
23:41:09 | FromDiscord | <jtv> So the bytecode format directly sure, but it's easy to decode into an asm |
23:41:14 | FromDiscord | <PunchCake> Its just a mess when its like 5k lines lol |
23:41:26 | FromDiscord | <Hourglass [She/Her]> Oh yeah, i think Nim can do Gameboy development if you're interested in that xD |
23:41:43 | FromDiscord | <jtv> I loved SPARC asm the most. Those were the days. |
23:41:44 | FromDiscord | <Hourglass [She/Her]> Just gotta avoid a lot of stdlib |
23:42:03 | FromDiscord | <Hourglass [She/Her]> And use arc if you use memory management at all |
23:42:43 | FromDiscord | <PunchCake> Yes i was talking about directly reading bytecode not the generated asm by the vm |
23:42:46 | FromDiscord | <PunchCake> I think thats what you mean? |
23:43:05 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
23:43:07 | FromDiscord | <PunchCake> Nim compiles to C and C can compile to nearly anything |
23:43:16 | FromDiscord | <PunchCake> So nim running on a microwave when lol |
23:43:27 | FromDiscord | <PunchCake> Just a disclaimer please dont try to reprogram your microwave |
23:44:11 | FromDiscord | <Hourglass [She/Her]> I'm gonna reprogram my microwave |
23:44:41 | FromDiscord | <Hourglass [She/Her]> Ngl I really want to mess with robotics but I'm pure xD |
23:44:45 | FromDiscord | <Haze System (they/them)> In reply to @Hourglass, When the Hour Strikes "Oh yeah, i think": that could be fun c: though with the original GB assembly is more fun hehe. would def try it with GBA though |
23:44:52 | FromDiscord | <Hourglass [She/Her]> Fair! |
23:45:05 | FromDiscord | <Hourglass [She/Her]> In reply to @Hourglass, When the Hour Strikes "Ngl I really want": Poor |
23:45:28 | FromDiscord | <PunchCake> I remember reading that someone tried to do that and nearly burned down their house↵(@Hourglass [She/Her]) |
23:46:00 | FromDiscord | <Hourglass [She/Her]> Well then- |
23:46:00 | FromDiscord | <cletus> Hi everyone I think the Nim compiler is playing Peek-a-boo with me!↵↵Can someone help me understand while this is happening 🙏 ....................code details --->https://gist.github.com/Uzo2005/82ab2875a75a7d8fe34f60ac26cfc1ee |
23:46:11 | FromDiscord | <Hourglass [She/Her]> Virtual microwave simulator? Lol |
23:46:17 | FromDiscord | <cletus> (edit) "while" => "why" |
23:46:38 | FromDiscord | <PunchCake> lmao↵(@Hourglass [She/Her]) |
23:47:20 | * | Lord_Nightmare joined #nim |
23:48:36 | FromDiscord | <jtv> @Hourglass [She/Her] Lego Mindstorms is a simple way to get started in robotics |
23:49:05 | FromDiscord | <PunchCake> Oh yeah and does nim have the bohem GC? |
23:49:07 | FromDiscord | <jtv> The EV3 stuff is versatile and fun. You can buy the educator sets too, with lots of content. And it's all Python |
23:49:18 | FromDiscord | <huantian> In reply to @cletus "Hi everyone I think": Line 39 change the ig to when |
23:49:24 | FromDiscord | <Hourglass [She/Her]> In reply to @jtv "<@909883978717204561> Lego Mindstorms is": Ooh? |
23:49:31 | FromDiscord | <jtv> @PunchCake that's one option, but neither the default one or best one |
23:49:34 | FromDiscord | <Haze System (they/them)> In reply to @Haze System "I'll put my whole": okay here's my full code: <https://gist.github.com/HazeSystem/830eff3080ccbaab0669fd9ee2ad17f2>↵↵still getting the error `Error: expression 'compile [string]' is of type 'NimNode' and has to be used (or discarded)` |
23:49:37 | FromDiscord | <PunchCake> Believe it or not bjarne wanted a GC in C++ lol |
23:49:52 | FromDiscord | <huantian> (edit) "ig" => "if" |
23:49:59 | FromDiscord | <PunchCake> It works well in C++ though so im gonna use it↵(@jtv) |
23:50:06 | FromDiscord | <PunchCake> Plus arc leaks right? |
23:50:20 | FromDiscord | <Hourglass [She/Her]> In reply to @jtv "The EV3 stuff is": That sounds cool tbh... Maybe I should finally get off my ass and get a job for it :p |
23:50:26 | FromDiscord | <Hourglass [She/Her]> I think arc is stable now |
23:50:33 | FromDiscord | <Hourglass [She/Her]> Nim 2.0 is switching to it |
23:50:39 | FromDiscord | <Hourglass [She/Her]> As the default |
23:50:42 | FromDiscord | <jtv> Not as far as I can tell. Even the default 1.6 GC is going to be better / more purpose-built then them Bohem one. |
23:50:43 | FromDiscord | <huantian> (edit) "39" => "39,42" |
23:51:02 | FromDiscord | <huantian> (edit) "when" => "when↵I don’t know why you’re using fieldPairs in the first place" |
23:51:21 | FromDiscord | <PunchCake> But arc only does ref counting |
23:51:32 | FromDiscord | <PunchCake> If i ref 2 objects to each other im gonna need a cycle collector |
23:51:43 | FromDiscord | <PunchCake> Aka bohem |
23:52:07 | FromDiscord | <Hourglass [She/Her]> orc |
23:52:09 | FromDiscord | <jtv> Without looking too hard at your code, that error message in particular is clear |
23:52:26 | FromDiscord | <jtv> The last line, helloWorld(), returns a value of type NimNode, that you must do something with |
23:52:26 | FromDiscord | <Hourglass [She/Her]> Orc is like arc and handles cyclic references i believe |
23:52:27 | FromDiscord | <PunchCake> It cycle collects?↵(@Hourglass [She/Her]) |
23:52:40 | FromDiscord | <jtv> If you just want to make sure it compiles, add `discard` in front of it |
23:52:42 | FromDiscord | <PunchCake> Then why dont i use boehm? |
23:52:47 | FromDiscord | <Haze System (they/them)> In reply to @jtv "The last line, helloWorld(),": ohh right |
23:52:51 | FromDiscord | <huantian> Orc = arc + cycle collector |
23:53:08 | FromDiscord | <Hourglass [She/Her]> I've never used boehm tbh so i can't say- |
23:53:11 | FromDiscord | <Haze System (they/them)> In reply to @Haze System "ohh right": nope, same error :/ |
23:54:03 | FromDiscord | <cletus> try to `discard helloworld()` |
23:54:26 | FromDiscord | <jtv> Seriously, that's what the error you posted is. Don't understand why you've written a proc instead of a macro |
23:55:01 | FromDiscord | <jtv> If you discard it, it's certainly not going to do anything, but if you're just trying to get it to compile... |
23:55:17 | FromDiscord | <PunchCake> And i dont think garbage collected C++ is that bad right? |
23:55:21 | FromDiscord | <jtv> You're returning a parse tree from your proc, and not doing a thing w/ it. If you want to REWRITE the tree, it needs to be a macro |
23:55:36 | FromDiscord | <Haze System (they/them)> 🤔 |
23:55:58 | FromDiscord | <Haze System (they/them)> i see. i think |
23:56:48 | FromDiscord | <jtv> PunchCake, you're free to use it, but it's not going to give you better performance, or anything. The whole point about that particular collector is that it's CONSERVATIVE in the face of pointer arithmetic. When you disallow pointer arithmetic in your managed pools, you can do a lot better. |
23:57:10 | FromDiscord | <cletus> In reply to @cletus "Hi everyone I think": Please who can help with this |
23:59:22 | FromDiscord | <PunchCake> Hm alright, thanks!↵(@jtv) |