00:00:02 | * | junland quit (Quit: %ZNC Disconnected%) |
00:00:17 | ryukoposting | hexchat probably moved more bytes around to send this message than your kernel needs to copy in order to make a forked page table |
00:00:38 | ryukoposting | the cost comes in when you deal with the page faults caused by exec |
00:00:55 | ryukoposting | but either way, you're loading something from disk |
00:01:43 | * | junland joined #nim |
00:02:46 | FromGitter | <awr1> https://unix.stackexchange.com/a/155020 |
00:02:46 | FromGitter | <awr1> hm |
00:02:55 | FromGitter | <awr1> so the whole memory image is COW'd |
00:03:34 | ryukoposting | my *guess* is that linux probably immediately makes a copy of whatever page the bottom of the stack is currently in, since those are almost certainly going to change very quickly |
00:04:19 | ryukoposting | and, if it's immediately followed by an exec in one of the processes, copying anything else would be inefficient |
00:05:27 | leorize | https://github.com/rtomayko/posix-spawn#benchmarks |
00:05:53 | leorize | well so instead of guessing, we can just know the difference and use whatever suits the use case best |
00:07:58 | ryukoposting | the numbers illustrate exactly what I'm saying. If the linux implementation copies the entire page table, it copies the entire page table. That's a performance problem. The OSX one works fine |
00:08:49 | leorize | still 2x the time though :P |
00:08:55 | ryukoposting | use the faster tool when it makes sense, but that doesn't make fork() bad |
00:09:03 | ryukoposting | that's the thing I'm trying to defend here |
00:09:41 | leorize | well you could have just said the other use cases of fork() than trying to defend fork-exec :P |
00:09:56 | leorize | openbsd got a pretty compelling one regarding security |
00:10:02 | ryukoposting | no, it's the thread thing that set me off |
00:10:19 | ryukoposting | totally different thing for a totally different purpose |
00:10:56 | leorize | pthreads doesn't exist until posix finally gets that fork() is not a replacement for it |
00:11:31 | * | couven92 quit (Quit: Client Disconnecting) |
00:11:50 | ryukoposting | you wanna know what sets me off even more than people trying to compare processes and threads |
00:12:07 | ryukoposting | people that use C for things C isn't designed to do, then complain about how bad it is |
00:12:25 | ryukoposting | go write a kernel in Java, have fun |
00:13:17 | leorize | C is designed to do everything, except when it isn't :) |
00:13:38 | ryukoposting | that's what posix thinks at least |
00:13:49 | leorize | someone even have the balls to write a kernel in C# actually, I've seen it |
00:14:52 | ryukoposting | until some other language has even half the support for cross-compilation, C will always rule the worlds of systems and embedded programming |
00:15:06 | leorize | zig pulled it off |
00:15:24 | ryukoposting | is Zig LLVM? |
00:15:33 | leorize | their aim is to dethrone C anyway |
00:15:47 | leorize | yea, zig is llvm-based |
00:15:57 | ryukoposting | that's the only way anyone is gonna do it within the next 10 years |
00:16:09 | leorize | and yes, I do know places where llvm don't want to support :P |
00:16:31 | ryukoposting | Zig makes Nim look like a well-known mainstream project |
00:16:59 | leorize | gotta say, you can hate the gpl all you want, but thanks to gcc's licensing we got compilers for all sorts of weird architectures |
00:17:41 | ryukoposting | good god dude |
00:17:48 | FromDiscord | <Rika> `Zig makes Nim look like a well-known mainstream project` what do you mean |
00:17:56 | ryukoposting | the weird abominations of ancient versions of GCC I see at work |
00:18:33 | ryukoposting | Nim's not exactly a ubiquitous thing is all I'm saying. It SHOULD be |
00:20:22 | leorize | to be fair, zig has shown how slow nim grow :P |
00:20:42 | ryukoposting | I think nim's long beta stage was good |
00:21:25 | leorize | it's rather poor marketing |
00:21:35 | FromDiscord | <Rika> nim needs more media prescence |
00:21:38 | leorize | our userbase doesn't even grow half the rate of everyone else |
00:21:39 | FromDiscord | <Rika> presence |
00:22:04 | leorize | which is the main reason why nim has so little users compared to its age |
00:22:23 | leorize | 4raq solo-ed the project for several years before dom joins in iirc |
00:22:40 | FromDiscord | <Rika> he's got some dedication |
00:22:52 | ryukoposting | even worse marketing would have been going 1.0 with a compiler that doesn't work right, no package manager, and a miniscule support team that couldn't handle millions of scornful HackerNews comments |
00:22:54 | FromDiscord | <Rika> or maybe intense disliking of other languages 😛 |
00:23:17 | FromDiscord | <Rika> ryukoposting, who are you implying lmao |
00:23:21 | FromDiscord | <Rika> V? |
00:23:43 | ryukoposting | nobody, but that's what Nim would have been if it went 1.0 say, 2 years ago |
00:24:30 | FromDiscord | <Rika> did nimble exist back in 0.18 or so? |
00:25:41 | leorize | iirc nim only got a surge of contributors around 2017 |
00:25:44 | * | IWSnim joined #nim |
00:26:04 | leorize | 4raq was ahead of his time :p |
00:26:35 | * | voltist quit (Quit: Leaving) |
00:26:45 | leorize | it appears that when he first advertised it on the Lazarus forums, they shunned him away |
00:26:53 | ryukoposting | Rika: yes, but it didn't work great. I don't remember exactly when nimble.directory became it came long after I started using Nim around 0.17 |
00:27:08 | IWSnim | New to nim...how do I turn @[84, 69, 84, 82, 73, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0] back into an ASCII string? |
00:27:19 | IWSnim | I've been digging through the stdlib for quite a while now |
00:27:24 | ryukoposting | oh i had to do this like 2 days ago and now I forgot |
00:27:25 | ryukoposting | one sec |
00:28:00 | leorize | IWSnim: a for loop should do there |
00:28:21 | IWSnim | oh, then I can just use $ on the standalone to cast back to ascii? |
00:28:27 | ryukoposting | is it a char sequence or a seq of bytes? |
00:28:33 | IWSnim | sequence of bytes |
00:29:13 | ryukoposting | if it's seq[char] then yeah I'd do import sequtils, strutils; asdf.mapIt($it).join |
00:29:20 | * | dwdv quit (Ping timeout: 265 seconds) |
00:30:14 | leorize | https://play.nim-lang.org/#ix=2gGE |
00:30:17 | leorize | IWSnim: ^ |
00:30:28 | ryukoposting | I always forget that exists lol |
00:30:37 | leorize | I'd advice against using `$` unless needed |
00:30:40 | leorize | it's slow by design |
00:30:43 | IWSnim | fantastic |
00:30:53 | FromDiscord | <Rika> then its still the same `import sequtils, strutils; asdf.mapIt(chr it).join` |
00:30:58 | ryukoposting | that's a better way to do it for sure |
00:31:11 | ryukoposting | either leorize's or rika's |
00:31:21 | leorize | there's a faster way but not beginner friendly |
00:31:38 | IWSnim | Thank you all :) Yea, I started implementing opcodes and started on the template route |
00:31:42 | ryukoposting | does it involve alloc |
00:31:44 | IWSnim | nopped out of that for now :) |
00:31:54 | leorize | ryukoposting: once |
00:31:58 | ryukoposting | dude I love alloc so much |
00:32:04 | leorize | https://play.nim-lang.org/#ix=2gGF |
00:32:05 | IWSnim | but otherwise I'm loving this language. so clean :) |
00:32:13 | leorize | implicitly alloc :P |
00:32:44 | ryukoposting | that is the thing every new lang like nim is missing. All of them want to be so much better than C that they refuse to allow access to the very thing that makes C useful |
00:33:42 | leorize | IWSnim: here's the safe but faster version: https://play.nim-lang.org/#ix=2gGG |
00:33:52 | ryukoposting | IWSnim watch these 2 videos I made a while ago if you wanna learn about iterators https://ryuk.ooo/videos.html |
00:34:08 | FromDiscord | <Rika> leorize: aint it time to also show off nim's new collect macro? 😛 |
00:34:17 | leorize | it creates a string with the right length so you don't have to pay the cost associated with `.add` (resizing strings so it fits more) |
00:34:22 | leorize | @Rika: ah, yea |
00:34:44 | IWSnim | Thanks ryukoposting :) |
00:35:37 | ryukoposting | so, I have a connundrum |
00:35:55 | ryukoposting | conundrum? conunndrum. idk |
00:36:03 | leorize | @Rika: nope it doesn't work here :( |
00:37:09 | ryukoposting | I am nearly done with a beta version of a nim visual novel engine. however, I am not an artist and cannot make my proper art for a demo of the engine |
00:37:27 | ryukoposting | so, do I make stick figures in MS paint, or do I go out and find an artist |
00:37:30 | FromDiscord | <Rika> what??? how doesnt it work? |
00:38:10 | leorize | @Rika: it requires a function with signature of proc[T](...): Container[T] |
00:38:20 | leorize | obviously newString isn't one of them |
00:38:58 | FromDiscord | <Rika> eeeh |
00:39:11 | FromDiscord | <Rika> boo |
00:39:24 | ryukoposting | also going to put together a modified version of the Kate text editor and make that into a little IDE for the engine. very excited about this, I'm gonna post some sample code of how the engine is used one sec |
00:39:51 | leorize | go find an artist :) |
00:40:09 | FromDiscord | <KingDarBoja> Hey guys, it is possible to get all type definitions from a module and filter (like grouping) by inherited parent object? |
00:40:34 | leorize | wdym? |
00:41:23 | FromDiscord | <KingDarBoja> For example, moduleA has several types that inherit from MyHumbleType and other that doesn't. I want to extract all the ones that inherit from MyHumbleType in another module and save its names in a list. |
00:42:11 | leorize | well you can, though not in the way that you would expect |
00:42:39 | FromDiscord | <KingDarBoja> 😛 wdym |
00:43:03 | leorize | you gotta use parseStmt(readFile"/path/to/other/module.nim") |
00:43:10 | leorize | then you got the entire AST to play with |
00:43:37 | FromDiscord | <KingDarBoja> That sounds interesting and complex at the same time 😄 |
00:43:43 | * | IWSnim quit (Quit: leaving) |
00:44:23 | * | IWSnim joined #nim |
00:47:27 | FromGitter | <awr1> do you need `readFile`? |
00:47:33 | FromDiscord | <KingDarBoja> The funny thing is that the file I want to get the types is called AST too 😄 |
00:47:41 | FromGitter | <awr1> why not pass `include` to a `typed` macro |
00:49:32 | ryukoposting | whipping up a demo real quick |
00:51:14 | * | krux02_ quit (Remote host closed the connection) |
01:07:05 | FromGitter | <awr1> @KingDarBoja https://play.nim-lang.org/#ix=2gGL |
01:08:33 | FromDiscord | <KingDarBoja> Woaaah |
01:09:34 | FromDiscord | <KingDarBoja> Clever solution awr1 |
01:10:01 | FromDiscord | <KingDarBoja> Can I use that macro you made? |
01:10:51 | FromGitter | <awr1> sure thing |
01:11:18 | FromDiscord | <KingDarBoja> So the input can be some module by using include, right? |
01:11:40 | FromDiscord | <KingDarBoja> let x = grabTypes:include filepath ? |
01:12:02 | leorize | try it I guess? |
01:12:05 | FromGitter | <awr1> i think so |
01:12:08 | FromGitter | <awr1> because it is `typed` |
01:12:10 | FromDiscord | <KingDarBoja> On it |
01:12:26 | FromGitter | <awr1> and `include` is kind of like a template expansion |
01:14:16 | ryukoposting | an example of the VN stuff https://play.nim-lang.org/#ix=2gGN |
01:15:13 | FromGitter | <awr1> interesting DSL |
01:15:31 | ryukoposting | everything in that sample compiles into a fully-functioning game. Only major feature still in progress is audio, and I just pushed out a PR today that will get that stuff very close to completion |
01:16:04 | FromGitter | <awr1> in regards to the `if` exprs, e.g. `alice_happiness` |
01:16:18 | FromGitter | <awr1> are the layers reeavluated on certain events |
01:16:35 | ryukoposting | yep, they get reevaluated when the user touches any gamevar |
01:16:56 | ryukoposting | I make up the performance hit by caching images very aggressively |
01:17:21 | FromGitter | <awr1> that was the other thing i was going to ask |
01:17:26 | FromGitter | <awr1> whether this was all cached or not |
01:17:35 | FromDiscord | <clyybber> disruptek: I'm probably missing something, but why not blacklist $nim from the path minifying thing |
01:17:49 | FromGitter | <awr1> do you just grab everything from images/, etc. on program boot |
01:17:54 | ryukoposting | I designed the image caching thing so that I could come back and swap it out for a better one later. |
01:18:03 | FromDiscord | <clyybber> getting the path to be as short as possible is a heuristic anyways right? |
01:18:30 | ryukoposting | right now, it caches any image shown in the game, forever, without ever evicting any of them. So the game runs fast as hell but it's rather memory hungry |
01:19:16 | ryukoposting | that's an easy thing to fix, though, since all images get cached in a common structure that's part of that `internal` variable you see in there |
01:20:27 | FromGitter | <awr1> how will text be stored |
01:20:32 | FromGitter | <awr1> plan on using something like gettext? |
01:21:21 | FromGitter | <awr1> or making something yourself |
01:21:27 | ryukoposting | it uses a font texture caching system, which is set up so that certain changes (color and alpha) don't require re-drawing of the same text |
01:21:47 | ryukoposting | everything sits on top of SDL2 |
01:21:49 | FromGitter | <awr1> no i mean |
01:21:53 | FromGitter | <awr1> the source text |
01:22:19 | ryukoposting | oh, like how does the game get compiled? |
01:22:38 | FromGitter | <awr1> more or less |
01:22:46 | ryukoposting | everything you see there is a nim macro. there's a couple of imports that go at the top of the file, and you're off to the races |
01:22:59 | * | chemist69 quit (Ping timeout: 265 seconds) |
01:23:11 | FromGitter | <awr1> oh so all your strings for dialogue, etc. will be in a nim DSL? |
01:24:03 | FromDiscord | <clyybber> ryukoposting: Damn nice. So thats why you added audio stream support to sdl? |
01:24:12 | FromDiscord | <clyybber> the nim wrapper I mean |
01:24:22 | ryukoposting | *are* in a nim DSL. All of that stuff compiles, and the game loads. you can save the game, load one, go backwards and forwards in the script, everything |
01:24:28 | ryukoposting | clyybber yep |
01:24:40 | ryukoposting | AudioCVT is annoying to use so I wanted something better |
01:24:50 | FromGitter | <awr1> interesting |
01:24:52 | * | chemist69 joined #nim |
01:24:58 | FromGitter | <awr1> plan to handle i18n with it? |
01:25:01 | FromDiscord | <clyybber> Incidentally I just finished wrapping libsndfile this minute |
01:25:04 | FromDiscord | <clyybber> 😄 |
01:25:28 | ryukoposting | i18n is a long term goal |
01:25:54 | FromDiscord | <KingDarBoja> awr1: Sorry for the noob question but how I can pass another parameter to that macro? like change the ancestor string comparison so I can compare with different strings instead of fixed one |
01:26:03 | ryukoposting | with a VN, localization is really not a task the engine can help much with. No matter what you do, the game developer is gonna have to translate their entire script. |
01:27:02 | FromGitter | <awr1> @KingDarBoja you might want to add a `static[string]` as the first parameter and leave the `typed` as the second, then you could do: `grabTypes("myType"): include blah blah` |
01:27:14 | ryukoposting | that is why I have it set up so you can put every part of the game in separate files. that way, you could have a script block for each language. still thinking about ways to make that better though |
01:28:02 | ryukoposting | long story short, I took on a freelancing job helping this guy make a game in ren'py, a python-based VN engine. Ren'py was great until you try to do anything beyond a couple characters on screen, and a single line of dialogue you click through one screen at a time. |
01:28:55 | ryukoposting | beyond the most basic stuff, ren'py fights with you the whole way. So, I want to make a better ren'py, something with all of its strengths and fewer of its weaknesses |
01:29:05 | FromDiscord | <clyybber> ryukoposting: i18n support is killer |
01:29:17 | FromDiscord | <clyybber> This whole VN engine in nim thing is killer |
01:29:22 | FromDiscord | <clyybber> Is it on your gitlab? |
01:29:30 | ryukoposting | dude I didn't know how to use quote do: for a long time |
01:29:44 | ryukoposting | and quote do: doesn't even work for a lot of these macros |
01:30:07 | ryukoposting | so at least 2/3rds of the macro code is literally nnkWhatever.newTree(nnkSomeOtherThing.newTree(...)) |
01:30:35 | FromDiscord | <Rika> thats most macros in a nutshell though tbh |
01:30:47 | FromDiscord | <clyybber> I almost only use newTree |
01:30:50 | FromDiscord | <clyybber> Instead of the helpers |
01:30:54 | FromDiscord | <Rika> also still looking for a dynamic i18n pure nim library |
01:31:01 | FromDiscord | <clyybber> Check out PMunchs macroutils tho |
01:31:02 | ryukoposting | dumpAstGen is my best friend |
01:31:03 | FromDiscord | <clyybber> its a bliss |
01:31:45 | FromDiscord | <clyybber> https://github.com/PMunch/macroutils |
01:31:49 | ryukoposting | the entire script: block gets compiled into a single proc definition |
01:32:05 | FromGitter | <awr1> macros are too verbose. i wish instead of `findChild`, is that child nil, etc. there was something like the `withValue`stuff you get from `tables` |
01:32:19 | ryukoposting | it turns the script into a gigantic case statement, and each line has a different integer |
01:32:50 | ryukoposting | making sequtils stuff work with macros would be a godsend |
01:32:54 | FromDiscord | <clyybber> awr1: pssst macroutils |
01:36:22 | FromGitter | <awr1> hm? |
01:38:28 | ryukoposting | I googled macroutils and a crates.io link showed up lol |
01:38:46 | FromDiscord | <clyybber> I posted a link 5 mins ago I think |
01:38:55 | FromDiscord | <clyybber> assuming the discord bridge hasn't bugged out |
01:39:01 | FromDiscord | <clyybber> https://github.com/PMunch/macroutils |
01:39:04 | FromDiscord | <clyybber> there it is again |
01:39:18 | ryukoposting | Rust: the only language so bad that it's best feature is its package manager |
01:39:57 | ryukoposting | Rust: C++ for masochists |
01:40:01 | FromGitter | <awr1> i'll take a look at it in a second |
01:40:17 | FromDiscord | <clyybber> ryukoposting: Rust isn't bad IMO |
01:40:18 | FromGitter | <awr1> in an ideal world this would be something like how i would write that marco |
01:40:23 | FromGitter | <awr1> *more ideal |
01:40:23 | FromGitter | <awr1> https://play.nim-lang.org/#ix=2gGT |
01:40:32 | FromDiscord | <clyybber> its just that it disallows some stuff that is valid code |
01:40:37 | FromDiscord | <clyybber> So its overly pessimistic |
01:40:52 | ryukoposting | I like the concept but it is profoundly annoying to use |
01:40:57 | FromDiscord | <clyybber> yeah |
01:42:12 | FromDiscord | <KingDarBoja> I am so noob at this thing, was trying to change the code to return the type instead of the string value, without success |
01:42:19 | ryukoposting | everything about its compiler is lovely. its error messages are always easy to read, and super specific. It has probably the single best package manager of any language. It has an immensely expressive type system. It has wonderful metaprogramming tools. |
01:42:33 | FromGitter | <awr1> or even |
01:43:06 | FromGitter | <awr1> imagining that you could navigate down multiple nodes looking for a node, but even more concisely |
01:43:08 | FromGitter | <awr1> https://play.nim-lang.org/#ix=2gGU |
01:44:03 | FromDiscord | <KingDarBoja> As I really wanted to pass a list of types to some procedure to check if they are a child of another child |
01:44:05 | ryukoposting | everything about Rust should make it the best language ever, yet it is burdened with a memory management system that sounds nice until you actually try to use it |
01:44:07 | FromDiscord | <KingDarBoja> Sounds crazy I know.. |
01:44:43 | FromGitter | <awr1> allright now let me take a look at this macroutils |
01:45:36 | FromDiscord | <KingDarBoja> No language is the best as each one has its own use case and isn't always nice to use for everything |
01:46:09 | FromDiscord | <KingDarBoja> But have heard tons of compliments about Rust and GO since last year |
01:46:14 | ryukoposting | I find this one quite helpful https://play.nim-lang.org/#ix=2gGW |
01:46:42 | * | lritter quit (Ping timeout: 260 seconds) |
01:47:01 | ryukoposting | Turns a tree of statements like the one in the doc comment into something that can be processed with a bunch of procs |
01:47:25 | * | lritter joined #nim |
01:47:43 | FromGitter | <awr1> this `macroutils` module looks interesting |
01:48:17 | FromGitter | <awr1> although for me i would like to depend less on the magic number indexing |
01:48:34 | ryukoposting | these two help a lot with making easy-to-read error messages https://play.nim-lang.org/#ix=2gGZ |
01:49:18 | ryukoposting | the first makes a human-friendly description of a NimNode's contents, and the other gives a human-friendly description of a NimNodeKind |
01:49:33 | ryukoposting | the former being a bit more verbose since it has more information to work with |
01:51:27 | FromGitter | <awr1> right now i've been working on a nim DSL that will translate to HLSL (and possibly MSL) |
01:51:37 | ryukoposting | then those two come together in this glorious 3-liner: https://play.nim-lang.org/#ix=2gH1 |
01:52:05 | ryukoposting | a lot of my error-checking in my macros is just `expect node, nnkStmtList` and stuff like that |
01:55:12 | FromGitter | <awr1> @ryukoposting IMO in a more ideal macro system that should be be conveyed in the type somehow |
01:55:36 | ryukoposting | dom96, any chance we can get a git tag for version 2.0.3 of the SDL2 package? I can throw the new procs into a module inside my engine for now, but having them in the actual SDL2 package feels better |
01:55:54 | FromGitter | <awr1> e.g. `proc (x :StmtList)` vs `proc (x :NimNode) = expect blah blah ...` |
01:56:25 | FromDiscord | <KingDarBoja> awr1: how do you return the type (not as string but as type) on the macro you made? |
01:56:27 | ryukoposting | you can do stuff like `macro(foo: string)` |
01:56:46 | FromGitter | <awr1> i don't know *precisely* how that might be done, maybe through converters possibly, which would be the site of the type check |
01:57:25 | ryukoposting | if every node kind was a different subclass of some root class, it could be done |
01:57:40 | FromGitter | <awr1> @KingDarBoja you can get the type in the macro, but you can't really "return the type" as an expression |
01:57:50 | FromDiscord | <KingDarBoja> Ohhh |
01:58:34 | ryukoposting | how's that fancy new gc coming along by the way |
01:58:39 | FromGitter | <awr1> nim is still statically typed: you can't have a sequence consisting of different types without taking some things into account |
01:59:14 | ryukoposting | yeah the tree would be NimNode, then you'd have type `StmtListNode = ref object of NimNode` |
01:59:36 | ryukoposting | all the nodes would have lists of children represented as seq[NimNode], a seq of the root class |
01:59:55 | FromGitter | <awr1> My opinion would be instead of getting the macro to try and return something, have the macro itself construct the type-specific code you want |
02:00:24 | FromGitter | <awr1> @KingDarBoja |
02:00:42 | FromGitter | <gogolxdong> How to turn an array into a string variable? |
02:00:43 | FromDiscord | <KingDarBoja> I see |
02:02:10 | FromDiscord | <KingDarBoja> You mean join all array values into a string? |
02:02:19 | FromDiscord | <KingDarBoja> Do you* |
02:03:49 | FromGitter | <gogolxdong> when put `var buf: array[16384, byte] ` into a string with `$` , it includes [] which causes some issue. |
02:04:22 | FromGitter | <gogolxdong> make a string without [] from array |
02:07:54 | ryukoposting | https://play.nim-lang.org/#ix=2gH4 gogolxdong |
02:09:15 | ryukoposting | or do you mean just without the [], but still the numerical values? |
02:09:42 | FromGitter | <gogolxdong> how about ``` ⏎ var x: array[3,char] = ['A','B','C'] ⏎ var y = castcstring (addr x[0]) ⏎ echo y ⏎ ... [https://gitter.im/nim-lang/Nim?at=5e893de6d021c45cc7c5937a] |
02:11:35 | * | z0 joined #nim |
02:11:45 | ryukoposting | well, x isn't a cstring since it isn't null terminated, but if it was that'd be fine yeah |
02:11:59 | * | z0 is now known as Guest27114 |
02:13:43 | * | endragor joined #nim |
02:15:34 | * | Pix_ quit (Ping timeout: 240 seconds) |
02:20:31 | * | lritter quit (Ping timeout: 250 seconds) |
02:22:56 | FromGitter | <awr1> you need some kind of dependent typing or contractual system for the strict StmtList thing |
02:24:00 | ryukoposting | (or inheritance) |
02:24:53 | FromGitter | <awr1> that too |
02:25:17 | ryukoposting | are you familiar with the new gc thing? |
02:26:04 | FromGitter | <awr1> did you watch araq's presentation on it |
02:26:14 | ryukoposting | there's a presentation? |
02:26:16 | FromGitter | <awr1> https://www.youtube.com/watch?v=yA32Wxl59wo |
02:26:21 | ryukoposting | dope |
02:27:17 | FromGitter | <gogolxdong> there is a issue about this casting, if array is all 0, string length will be 0. |
02:27:21 | ryukoposting | "copying bad design is not good design" that is both amusing and extremely german |
02:31:29 | FromDiscord | <KingDarBoja> Just tried to use the `include` on the macro and the file being refered started to show errors lol |
02:32:05 | FromDiscord | <KingDarBoja> I mean, the macro is at one module, the file that calls the macro is in another and tries to load another different file |
02:32:19 | ryukoposting | quick side thought: opinions on being able to import modules within a proc, and having those imports only affect code inside the proc? |
02:32:39 | leorize | terrible |
02:33:21 | leorize | modules can have initialization code (any top-level statement) |
02:33:39 | FromDiscord | <Rika> yeah that |
02:33:55 | ryukoposting | an in-proc import would only import symbols, no top-level statements |
02:33:58 | FromDiscord | <Rika> im kinda missing namespaces tho |
02:34:32 | leorize | ryukoposting: how are you gonna deal with `var global = newSeq`? |
02:35:07 | * | endragor quit (Remote host closed the connection) |
02:35:29 | * | muffindrake quit (Ping timeout: 265 seconds) |
02:35:30 | ryukoposting | import the symbol global, with type information, but don't produce initialization code |
02:35:43 | leorize | as I said, how are you gonna deal with the above? |
02:35:53 | ryukoposting | And I told you exactly what I'd do |
02:36:06 | leorize | now you can pass by without init a seq, but how about something with side-effects? |
02:36:09 | leorize | like opening a db? |
02:36:20 | leorize | do you not initialize them too? |
02:36:25 | ryukoposting | put the initialization wherever it would go if the import happened at the module level |
02:37:17 | * | muffindrake joined #nim |
02:37:22 | ryukoposting | python does this and it works fine. assume that whatever nim would do is whatever python was doing |
02:37:54 | leorize | I don't think copying python is considered good practice, but ok |
02:38:30 | disruptek | this isn't possible and it would never be merged if it were impl. |
02:38:43 | ryukoposting | it was just a thought, not sure how I feel about either. there were a few places in my VN engine development where putting a module import in the output of a macro would have made it easy to clean up a lot of boilerplate crud |
02:38:56 | disruptek | you can do that, sure. |
02:39:13 | ryukoposting | and having that import inside of a proc produced by the macro would allow the symbols to only be visible in places where they should be visible |
02:39:26 | disruptek | now, that's not a thing and never will be. |
02:39:49 | ryukoposting | does it just come down to how the module import system works? |
02:39:55 | FromGitter | <gogolxdong> oh , doesn't need all set 0 , only one 0 hidden in the array will truncate the length. |
02:40:05 | disruptek | it comes down to how the backend works. |
02:40:23 | leorize | not really a problem tbh |
02:40:25 | leorize | it's doable |
02:40:36 | leorize | whether we want it or not is something that's up to debate |
02:40:44 | ryukoposting | I found ways around that problem, they just aren't pretty lol |
02:42:12 | disruptek | would i rewrite the backend if i could? yes. |
02:42:20 | leorize | python is that language that can get away with "if you don't hit this branch, it doesn't matter if it's broken" |
02:42:43 | disruptek | will it be easier with my ic stuff? yes. |
02:42:49 | leorize | I don't know whether bringing in a concept like this from them is sound |
02:42:49 | disruptek | but that doesn't mean it's a good idea. |
02:42:50 | ryukoposting | oh wow, sink is really cool. Stopped paying attention to nim's evolution when I discovered the glory of macros |
02:43:11 | disruptek | cyclic imports first, then it won't be an issue. |
02:43:24 | ryukoposting | god yes PLEASE |
02:43:38 | leorize | once disruptek is done with ic, then you can have cyclic imports |
02:43:52 | ryukoposting | give me cyclic imports and I will never update my compiler again |
02:43:54 | ryukoposting | no need |
02:43:59 | ryukoposting | lang's done |
02:44:31 | disruptek | i don't think they are very hard, but i do think i need to change my approach to compiler code. |
02:45:36 | ryukoposting | if the module system can't import symbols without importing the whole shebang, and assuming that's the reason in-proc imports wouldn't work, that could get kinda nasty |
02:46:09 | leorize | it can, just whether if we want that is something else |
02:46:39 | leorize | if you can write a good rfc describing the idea, then you'll get more feedback |
02:46:50 | ryukoposting | I'm not sure if I want it lol |
02:46:55 | disruptek | honestly, i wouldn't bother. |
02:47:38 | ryukoposting | the only non-abusive use case would be shoving imports inside of procs spat out by macros to confine special symbols to that part of the AST |
02:48:49 | disruptek | do you have a demonstration of a problem? |
02:49:33 | * | redviking joined #nim |
02:49:43 | disruptek | weakening the spec in pursuit of problems that don't exist is a unlikely to garner many upvotes. |
02:49:52 | ryukoposting | yeah kinda figured |
02:49:54 | disruptek | what we need are fewer features, not more. |
02:50:06 | * | voltist joined #nim |
02:50:18 | ryukoposting | just a hypothetical thing that kinda popped into my head while writing all these macros |
02:50:33 | disruptek | yeah, i missed that feature of python, so i get it. |
02:50:55 | ryukoposting | it seems stupid until you actually have a use for it |
02:50:55 | disruptek | but i like that imports are more weighty in nim. |
02:51:04 | ryukoposting | for sure |
02:51:13 | disruptek | include is a thing. i wish it wasn't, most of the time. |
02:51:38 | ryukoposting | with some code shuffling and a couple of carefully placed `include`s, I got around the issue |
02:51:46 | disruptek | if it didn't exist, we'd already have seen more work on imports. |
02:52:02 | shashlick | I wish more features were focused on compile time macros rather than actual compiler code |
02:52:28 | disruptek | agree. i wish transform was easier to hook. |
02:53:40 | ryukoposting | on the bright side, there are ways around every problem in the module system |
02:54:07 | ryukoposting | if anything, the no-cyclic-imports rule forces you to think about how you organize your code |
02:54:10 | disruptek | yes, but it's not ergonomic. |
02:54:39 | redviking | What digital signature libraries exist for Nim? |
02:54:47 | ryukoposting | not enough |
02:54:55 | leorize | none, we have wrappers though |
02:55:10 | redviking | Which would you recommend? |
02:55:13 | disruptek | what kind of signatures? |
02:55:27 | disruptek | status has like 8 different crypto libs. |
02:55:38 | leorize | !packages openssl |
02:55:39 | disbot | https://github.com/cowboy-coders/nim-openssl-evp -- 9openssl_evp: 11Wrapper for OpenSSL's EVP interface |
02:55:39 | disbot | https://github.com/genotrance/nimssl -- 9nimssl: 11OpenSSL wrapper for Nim |
02:55:46 | leorize | !packages gnutls |
02:55:47 | disbot | https://github.com/FedericoCeratto/nim-gnutls -- 9gnutls: 11GnuTLS wrapper |
02:55:54 | leorize | !packages gpg |
02:55:54 | disruptek | !repos jwt |
02:55:55 | disbot | no packages match 😢 |
02:55:55 | disbot | https://github.com/ekarlso/nim-jwt -- 9nim-jwt: 11JWT implementation for nim-lang 15 11⭐ 11🍴 |
02:55:55 | disbot | https://github.com/h3rald/litestore -- 9litestore: 11A lightweight, self-contained, RESTful, searchable, multi-format NoSQL document store. 15 74⭐ 2🍴 |
02:56:03 | disruptek | !repo sigv4 |
02:56:04 | disbot | https://github.com/disruptek/sigv4 -- 9sigv4: 11Amazon Web Services Signature Version 4 15 4⭐ 0🍴 |
02:56:14 | ryukoposting | redviking, are you talking about stuff like Windows exe signing? That's something I really wish Nimble let you fiddle with |
02:56:30 | ryukoposting | though I guess nimble really doesn't have full control of that |
02:56:51 | * | jegfish quit (Quit: Leaving) |
02:56:56 | redviking | I'm interested in XML digital signatures (https://www.w3.org/TR/2008/REC-xmldsig-core-20080610/). |
02:56:59 | FromGitter | <gogolxdong> Is there any AEAD implementation? |
02:57:48 | disruptek | !repo sodium |
02:57:49 | disbot | https://github.com/judofyr/sodium.nim -- 9sodium.nim: 11 15 6⭐ 0🍴 |
02:58:02 | leorize | !repo libsodium |
02:58:03 | disbot | https://github.com/FedericoCeratto/nim-libsodium -- 9nim-libsodium: 11Nim wrapper for the libsodium library 15 25⭐ 5🍴 7& 1 more... |
02:58:08 | leorize | ^ that's more up-to-date |
02:58:09 | disruptek | yeah, that one. |
02:59:35 | leorize | redviking: I don't think we have the kind of lib to deal with that |
02:59:58 | ryukoposting | is anyone here familiar with aporia? would it be a decent foundation for a little IDE for my VN engine? |
03:00:11 | leorize | it'd be a terrible foundation, sadly |
03:00:19 | ryukoposting | :( |
03:00:25 | ryukoposting | does it work? |
03:00:30 | leorize | it's written in gtk2, and unmaintained |
03:00:30 | disruptek | !repo feud |
03:00:31 | disbot | https://github.com/genotrance/feud -- 9feud: 11Fed Ep with UDitors 15 25⭐ 1🍴 |
03:01:04 | ryukoposting | maintained or not, I'd be forking it and modifying it to fit a purpose where only very basic IDE functionality is needed |
03:01:23 | disruptek | feud is what you want. |
03:01:30 | disruptek | you can simply impl your needs as a plugin. |
03:01:42 | leorize | yea if you're going that route, use that |
03:02:07 | ryukoposting | is this a terminal editor? |
03:02:55 | ryukoposting | it's hard to tell from the screenshot |
03:03:17 | disruptek | what? |
03:03:25 | leorize | it's a gui editor |
03:04:00 | ryukoposting | nice, that's what I want. the target userbase is predominantly people who aren't software engineers by trade |
03:04:38 | disruptek | the main thing is that you can get support for it. |
03:05:42 | ryukoposting | I will look into this, for sure. My current plan is to use Kate as my foundation, since I already use that editor and I know how to write syntax highlighting files for it |
03:06:43 | ryukoposting | all this thing really needs to do is decent syntax highlighting, and have 4 buttons: open project, save project, run game, create release package. |
03:08:28 | disruptek | !repo lua |
03:08:29 | disbot | https://github.com/jangko/nimLUA -- 9nimLUA: 11glue code generator to bind Nim and Lua together using Nim's powerful macro 15 43⭐ 5🍴 7& 7 more... |
03:08:30 | FromDiscord | <KingDarBoja> Just noticed the macro doesn't work with ref objects, awr1 |
03:08:53 | FromDiscord | <Rika> Is there a macro or library for simulating inheritance with composition |
03:09:43 | leorize | inheritance with composition? |
03:09:53 | leorize | can you elaborate a bit on this pattern? |
03:10:24 | leorize | @KingDarBoja: should be an easy fix? |
03:10:26 | FromDiscord | <Rika> uh, instead of using inheritance, i use composition |
03:10:36 | disruptek | i would look at nesm for inspiration. |
03:10:40 | disruptek | !repo nesm |
03:10:41 | disbot | https://github.com/xomachine/NESM -- 9NESM: 11NESM stands for Nim's Easy Serialization Macro. The macro that allowing generation of serialization functions by one line of code! (It is a mirror of https://gitlab.com/xomachine/NESM) 15 40⭐ 1🍴 |
03:10:44 | FromDiscord | <Rika> but i'll be able to "surface" the procs that are usable |
03:10:52 | FromDiscord | <Rika> on the composed object |
03:10:55 | FromDiscord | <KingDarBoja> Not sure, still a newbie with all that macro stuff |
03:10:59 | FromDiscord | <Rika> onto the new composed object |
03:11:08 | FromDiscord | <KingDarBoja> Reading the docs looking for answers |
03:12:57 | leorize | Rika: we don't have any macro like that |
03:13:01 | ryukoposting | just got this really ugly error from nimble https://pastebin.com/AjF42He4 |
03:13:20 | FromDiscord | <Rika> leorize, is it recommended to make a macro like that? is it even possible? |
03:13:27 | leorize | it's possible |
03:13:42 | leorize | I did it then I threw it away because I designed around it :P |
03:13:52 | FromDiscord | <Rika> what did you do? |
03:14:07 | leorize | converters |
03:14:14 | leorize | lot's of converters |
03:14:23 | disruptek | yuck. |
03:14:25 | FromDiscord | <Rika> sounds worse |
03:14:38 | leorize | that's why I threw the macro away |
03:14:52 | disruptek | look at nesm. i think it will help. |
03:15:20 | ryukoposting | nimterop 0.4.4 fails to build on 1.0.4, interesting |
03:16:06 | disruptek | i am beginning to think that i have a weird environment. |
03:16:25 | ryukoposting | nimterop 0.4.4 also fails to build on 1.0.6... |
03:16:35 | disruptek | it's the simplest explanation for why i have so much trouble with nimterop, nimble, etc. |
03:16:58 | ryukoposting | how do I ask the compiler which C compiler it's using? |
03:17:14 | disruptek | use `please`. |
03:17:27 | ryukoposting | I hope you get coronavirus |
03:17:42 | disruptek | me too. i hope it happens soon, though. |
03:17:47 | ryukoposting | or was that an actual answer and someone was being funny when they came up with the compiler commands |
03:17:59 | shashlick | disruptek: once you give me something I can reproduce, I will fix it |
03:18:17 | disruptek | i know, buddy, i know. |
03:18:32 | shashlick | But I know there's a real issue |
03:18:40 | disruptek | i know you realize there is a limit to patience, too. |
03:18:41 | leorize | ryukoposting: std/compilesettings |
03:18:53 | leorize | or just when defined(gcc) <- using gcc |
03:19:10 | disruptek | that's madness. |
03:19:11 | leorize | defined(clang) and defined(msvc) is valid too |
03:19:13 | shashlick | Yay compile settings - need to use that in nimterop |
03:19:14 | ryukoposting | well that's the problem, I have 3 different gccs |
03:19:21 | disruptek | --listcmd |
03:19:38 | shashlick | I extracted the plugin system from feud |
03:19:42 | leorize | ryukoposting: it'll use whatever is in your PATH |
03:20:12 | shashlick | But I'm yet to update feud to use it instead of the built in one |
03:20:24 | shashlick | As part of making it separate, made several improvements |
03:21:01 | shashlick | disruptek: one of these days, I'll get on mumble and we'll figure it out |
03:21:19 | disruptek | i know it's hard for you to do much from work. |
03:21:42 | disruptek | what are the improvements to the plugin system? |
03:23:05 | shashlick | Heh I need to go back and check |
03:24:21 | disruptek | somehow i wasn't watching it. |
03:24:48 | disruptek | maybe i can use this in my streaming app. |
03:25:48 | * | redviking left #nim (#nim) |
03:26:10 | disruptek | is lqdev using it? |
03:26:53 | * | endragor joined #nim |
03:27:00 | shashlick | I don't think so |
03:27:01 | ryukoposting | huh, as soon as I switched from x86_64-pc-msys to x86_64-pc-mingw64 It worked fine |
03:27:02 | shashlick | https://github.com/genotrance/plugins |
03:27:39 | shashlick | but i incorporated feedback from those who reviewed it |
03:27:47 | ryukoposting | well, nimterop built but that git tag makes it angry |
03:28:19 | disruptek | Rika: let us know what you come up with. i am in the market for a pattern with which to add object persistence and versioning and introspection. it will be similar. |
03:29:27 | shashlick | ryukoposting: have some failing build logs? |
03:29:32 | disruptek | shashlick: it's a big api. |
03:29:47 | ryukoposting | okay how does feud build |
03:29:54 | disruptek | slowly. |
03:30:11 | ryukoposting | oh wait, this looks like a nimble thing |
03:30:40 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
03:30:53 | ryukoposting | shashlick https://pastebin.com/FzuWHpAn |
03:31:20 | ryukoposting | this isn't a nimterop thing but it's still me trying to make feud build |
03:32:41 | ryukoposting | either that or I cloned the repo instead of downloading a tag |
03:34:44 | disruptek | you're a madman. |
03:35:01 | ryukoposting | god above what am I looking at |
03:35:19 | ryukoposting | this looks like a very barebones editor which is exactly what I want |
03:35:29 | disruptek | indeed. |
03:35:30 | ryukoposting | does it do nim syntax highlighting |
03:36:18 | disruptek | i dunno, i was never able to get it to run. |
03:36:44 | ryukoposting | the zip artifact with the latest tag works fine for me |
03:37:23 | disruptek | it's been 6 months since i last tried. |
03:38:24 | FromGitter | <awr1> lol |
03:38:25 | FromGitter | <awr1> https://play.nim-lang.org/#ix=2gHe |
03:38:33 | FromGitter | <awr1> this is profoundly janky but it "works" |
03:38:57 | ryukoposting | I have never seen someone to their types :LikeThis |
03:39:09 | ryukoposting | but I kind of like it |
03:39:20 | FromGitter | <awr1> i do it a lot because it's easier to align my types |
03:39:33 | * | endragor quit (Remote host closed the connection) |
03:39:43 | FromGitter | <awr1> i know in some various typed lisps you have to do that |
03:39:54 | ryukoposting | hey, it does syntax highlighting! It isn't great syntax highlighting, but with some tweaks it'll do the job |
03:41:10 | FromGitter | <kayabaNerve> So ARC is the main feature of Nim 1.2. Does it finally work with async and is used by default, or is still 'almost ready'? |
03:41:27 | disruptek | no, no, and no. |
03:42:13 | FromGitter | <kayabaNerve> So it's not working with async, not used by default, and not almost ready, meaning it's far from ready? |
03:42:31 | disruptek | "public beta" is probably the right term. |
03:43:23 | disruptek | i believe it's closer to alpha, but the important thing is that people can test it with a tag that is pretty serviceable otherwise. |
03:43:23 | FromGitter | <awr1> but ya that check macro - it "works" - StmtList would fail for a empty node |
03:43:32 | FromGitter | <awr1> i would not use it in practice though |
03:43:41 | FromGitter | <awr1> in an ideal world, like i said, this would be solved with dependent types |
03:44:07 | disruptek | 1.2 is a dev release, not a stable release. |
03:44:12 | FromGitter | <awr1> however the likelihood nim will ever get dependent types is low |
03:47:22 | shashlick | ryukoposting: you got feud to build? |
03:48:56 | shashlick | yes syntax highlighting was one of the first things |
03:53:20 | shashlick | it shouldn't be trying to build tls.c |
03:57:45 | ryukoposting | shashlick: no but I downloaded a prebuilt version from a tag |
03:57:56 | ryukoposting | works like a champ but how do I make/add a plugin? |
03:58:19 | shashlick | ok i've not built it in a while and like I said, the plugin system is old and not replaced by the standalone version |
03:59:07 | ryukoposting | hmmmm |
03:59:30 | shashlick | further it is windows only cause that's all i had time to experiment with |
03:59:56 | ryukoposting | I'd be using it as part of a package that's windows-focused so that's perfect actually |
04:00:00 | shashlick | but it is very good in practice - performant and very flexible |
04:00:17 | ryukoposting | I like the socket thing, remotely controlling the editor is pretty sweet |
04:00:20 | shashlick | can code in real time and plugins reload |
04:00:37 | ryukoposting | that's something you can do with Sam, the editor I use when not on windows |
04:00:40 | shashlick | ya with nim a lot of cool stuff is possible very fast |
04:01:20 | shashlick | i stopped working on it cause i realized i don't have enough time to give it my 100% but I did extract the plugin system cause i know it will be useful for others too |
04:01:28 | shashlick | what's your goal for this? |
04:01:50 | ryukoposting | I want an extremely simple editing environment for people who want to make games with my engine |
04:02:34 | shashlick | ok i think most of the functionality for that is in place - colors, highlighting and load/save/etc |
04:02:47 | shashlick | but the main part of the experiment was to have no UI elements |
04:02:54 | shashlick | everything is command driven |
04:04:38 | ryukoposting | not the most approachable thing on earth, but any user could figure out how to ctrl-S |
04:05:21 | ryukoposting | and I could have a separate program that opens the project, and just gives them buttons saying "open script.nim" "open screens.nim" etc |
04:05:59 | shashlick | i think most of that should be possible with little change |
04:06:02 | * | supakeen quit (Quit: WeeChat 1.9.1) |
04:06:04 | ryukoposting | the alternative is modifying Kate, which is a collossal rats nest of Qt |
04:06:17 | shashlick | basically there's configurable hotkeys and aliases and a config system so you can build all that easily |
04:06:27 | ryukoposting | yeah that ini is sweet |
04:06:40 | shashlick | see the test script as well |
04:06:43 | * | supakeen joined #nim |
04:12:03 | * | endragor joined #nim |
04:13:14 | * | endragor quit (Remote host closed the connection) |
04:19:07 | * | z0 joined #nim |
04:19:31 | * | z0 is now known as Guest40045 |
04:21:13 | FromGitter | <kayabaNerve> I thought odd numbers were dev releases. 1.2.0 is even. 1.2.1 isn't. |
04:21:37 | FromGitter | <kayabaNerve> That's why we have 1.0.2 and 1.0.4. |
04:22:17 | * | Guest27114 quit (Ping timeout: 250 seconds) |
04:22:48 | leorize | yes? |
04:23:43 | FromGitter | <kayabaNerve> > *<disruptek>* 1.2 is a dev release, not a stable release. |
04:23:52 | FromGitter | <kayabaNerve> just responding to disruptek. |
04:24:02 | FromGitter | <kayabaNerve> Unless he's referring to the inclusion of ARC in 1.2 |
04:25:00 | shashlick | i guess he meant that about arc |
04:28:22 | FromGitter | <kayabaNerve> It wasn't clear, but that sounds right. |
04:29:03 | * | opal quit (Ping timeout: 240 seconds) |
04:29:06 | ryukoposting | feud is pretty sweet, perfect for what I need really |
04:29:20 | ryukoposting | just need a signed version of the binary so windows doesn't yell at you when it opens lol |
04:30:38 | * | opal joined #nim |
04:30:52 | leorize | ryukoposting: you can buy a license I guess :P |
04:31:02 | leorize | certificate* |
04:31:05 | FromGitter | <kayabaNerve> Can you not sign for free? I thought you could. |
04:31:21 | FromGitter | <kayabaNerve> Either via a leaked cert or developer program. |
04:31:56 | shashlick | ryukoposting - if you can figure out how to do that, will make life fantastic |
04:32:01 | ryukoposting | pretty sure you can |
04:32:08 | shashlick | IT is a nightmare |
04:32:10 | FromGitter | <kayabaNerve> Seems to be free https://docs.microsoft.com/en-us/windows/win32/appxpkg/how-to-create-a-package-signing-certificate |
04:34:25 | shashlick | i don't know if self-signed certs are good enough |
04:35:40 | * | dddddd quit (Ping timeout: 256 seconds) |
04:42:23 | * | opal quit (Ping timeout: 240 seconds) |
05:12:15 | * | Guest40045 quit (Quit: Lost terminal) |
05:38:53 | FromDiscord | <Rika> `method has lock level <unknown>, but another method has 0 [LockLevel]` what does this mean... |
05:43:18 | axion | o/ |
05:43:28 | FromDiscord | <Rika> oh hello |
05:43:34 | axion | Looks like 1.2.0 doesn't break any of my code woohoo |
05:43:52 | axion | Oh hey Rika. I haven't seen you on the mumble chat |
05:43:59 | FromDiscord | <Rika> yeah its uh |
05:44:10 | FromDiscord | <Rika> dunno really why i didnt join |
05:44:17 | FromDiscord | <Rika> was watching a livestream |
05:44:33 | axion | I've been mostly chatting there to varriount and krux for hte last week. so much so that i forget to say i'm alive and still using Nim in this channel :) |
05:44:51 | FromDiscord | <Rika> had no doubts that you were alive lol |
05:45:48 | axion | well i'm almost always there, and i made some fixes to my stream so it shouldn't flicker for you any more! |
05:46:36 | FromDiscord | <Rika> wait wtf how did you discover the issue? |
05:47:25 | axion | i just noticed that my refresh rate was 30hz, probably after a driver update or something |
05:47:29 | axion | it's now 120 |
05:48:06 | FromDiscord | <Rika> you on mumble right now? or are you about to sleep or something? |
05:48:18 | axion | i'll be there for a few more hours at least |
06:05:00 | * | solitudesf joined #nim |
06:05:43 | * | rockcavera quit (Remote host closed the connection) |
06:08:40 | leorize | axion: wait you stream? |
06:09:38 | axion | Sorta |
06:09:44 | axion | I mostly just share my screen and ask dumb questions |
06:09:47 | * | ryukoposting quit (Ping timeout: 260 seconds) |
06:11:15 | leorize | when are you streaming? I'll try to tune in :) |
06:11:47 | * | NimBot joined #nim |
06:11:51 | axion | I'm on mumble now and sharing on Jitsi |
06:15:03 | * | sleepyqt joined #nim |
06:16:13 | leorize | ok, how can I tune in? :P I don't do either :P |
06:17:45 | axion | gotta install a mumble client and connect to uberalles.mumbl.io |
06:18:00 | axion | a few of us here use that. surprised you dont know about it :) |
06:18:28 | leorize | I do, I just like chatting more :P |
06:18:46 | leorize | (mainly because my spoken english is terrible) |
06:23:30 | * | Pixeye joined #nim |
06:46:28 | * | Perkol joined #nim |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:04:52 | * | gmpreussner joined #nim |
07:08:42 | * | chemist69 quit (Ping timeout: 260 seconds) |
07:09:42 | * | chemist69 joined #nim |
07:20:15 | * | opal joined #nim |
07:22:50 | Araq | leorize, can you please fix https://github.com/nim-lang/Nim/issues/13870 |
07:22:52 | disbot | ➥ Gcc cross compiler doesn't know '-mno-ms-bitfields' ; snippet at 12https://play.nim-lang.org/#ix=2gHR |
07:27:43 | leorize[m] | Araq: I don't think there's anything to fix. They didn't specify the flags for the cross compiler, so the compiler ended up using the host flags |
07:28:53 | leorize[m] | also without details on how they did the compilation, I have doubt it's being done correctly |
07:30:46 | livcd | who is "nugatty" here ? Oo |
07:32:04 | * | andinus joined #nim |
07:37:56 | * | andinus quit (Quit: ERC (IRC client for Emacs 26.3)) |
07:38:33 | * | andinus joined #nim |
07:52:03 | * | opal quit (Ping timeout: 240 seconds) |
08:06:10 | * | kenran joined #nim |
08:06:26 | * | voltist quit (Quit: Leaving) |
08:09:08 | * | Perkol quit (Remote host closed the connection) |
08:17:44 | * | hax-scramper quit (Read error: Connection reset by peer) |
08:18:03 | * | hax-scramper joined #nim |
08:18:13 | * | opal joined #nim |
08:22:12 | FromGitter | <eliezedeck> Hello everyone, I seem to remember that in the old days, Nim would mangle symbol names in the final binary (or I might be wrong) ... How does one typically *obfuscate binaries* so that no names from the original symbols will be seen in the binary? |
08:22:20 | * | andinus quit (Quit: ERC (IRC client for Emacs 26.3)) |
08:22:55 | * | andinus joined #nim |
08:23:57 | supakeen | You could strip your binary, or do you want to specifically mangle them? |
08:25:42 | FromGitter | <eliezedeck> yes, completely mangle it |
08:26:43 | supakeen | I'm not too sure how to mangle but perhaps you can say what you want to achieve instead of the means to achieve it? :) |
08:27:14 | * | tane_ joined #nim |
08:28:07 | FromGitter | <eliezedeck> right, so: if I open the binary file in the editor, I'll be able to see a bunch of symbol names that would indicate features that I'm using in the binary ... I want to mangle these symbols so that it is not going to be obvious, what features or technology the app might be using |
08:28:08 | * | hax-scramper quit (Ping timeout: 265 seconds) |
08:28:15 | * | hax-scramper joined #nim |
08:28:42 | * | tane_ is now known as tane |
08:28:53 | FromGitter | <eliezedeck> I already found a way to obfuscate strings, symbols obfuscation is next step |
08:29:37 | FromGitter | <eliezedeck> I'm not looking for *fullproof* protection, just trying to make things not too obvious |
08:30:34 | supakeen | Sure I understand, I thought stripping the binary would already resolve much of this but I might be wrong :) |
08:31:29 | FromGitter | <eliezedeck> I've already stripped the binary, but I'm still seeing stuffs, plenty of them |
08:32:10 | FromGitter | <eliezedeck> using existing C obfuscator tools might be a way, but if there is already this feature (which I remember Nim did), I prefer it to be at Nim level |
08:32:52 | FromGitter | <eliezedeck> this way also, I don't have to avoid mangling names that shouldn't be mangled |
08:36:45 | * | natrys joined #nim |
08:51:28 | * | kenran quit (Ping timeout: 256 seconds) |
08:56:43 | * | opal quit (Ping timeout: 240 seconds) |
08:58:28 | * | opal joined #nim |
09:05:26 | * | dwdv joined #nim |
09:18:05 | FromDiscord | <mratsim> use exportc |
09:19:37 | FromDiscord | <mratsim> @eliezedeck, example: https://github.com/numforge/laser/blob/master/laser/openmp.nim#L13-L25 |
09:19:37 | FromDiscord | <mratsim> https://github.com/numforge/laser/blob/master/laser/openmp.nim#L207-L208 |
09:19:59 | FromDiscord | <mratsim> and you can push/pop {.push exportc: myRandomName().} as well |
09:20:15 | * | Trustable joined #nim |
09:20:43 | FromDiscord | <mratsim> this way you can apply that to proc and temporary variables |
09:29:32 | * | endragor joined #nim |
09:40:21 | * | endragor quit (Remote host closed the connection) |
10:05:38 | * | silvernode joined #nim |
10:15:43 | * | opal is now known as ^^opal_ |
10:16:50 | * | endragor joined #nim |
10:18:06 | * | silvernode quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
10:24:06 | * | endragor quit (Remote host closed the connection) |
10:24:46 | * | silvernode joined #nim |
10:25:18 | supakeen | Hola, I've been working on writing testcases for asynchttpserver and this is my current layout: https://bpaste.net/3I3Q I'm not entirely confident in my Nim yet, does anyone have any remarks to improve/make it more idiomatic? :) |
10:25:46 | supakeen | Perhaps a template or macro for the request/handler definitions inside the test procs? |
10:25:47 | FromDiscord | <Rika> you got pragmas wrong |
10:26:01 | FromDiscord | <Rika> {.async} should be {.async.} |
10:26:10 | supakeen | Ah. |
10:26:18 | FromDiscord | <Rika> you dont need to append system. in system.void |
10:27:03 | FromDiscord | <Rika> aside from that i think its okay |
10:27:20 | FromDiscord | <Rika> also looks like youre using testament, interesting |
10:27:48 | supakeen | Rika, I run it with './bin/testament --print r stdlib/tasynchttpserver.nim' so I can run only this testcase at a time. |
10:28:11 | supakeen | What is the importance of the postfix dot in the pragmas, is it part of the name or does it have more meaning? |
10:28:23 | FromDiscord | <Rika> its part of the pragman syntax |
10:28:34 | FromDiscord | <Rika> its required, otherwise its invalid syntax isnt it? |
10:28:47 | supakeen | I didn't get any compiler errors before that change :) |
10:29:12 | supakeen | (not that a lack of those proves correctness) |
10:29:30 | FromDiscord | <Rika> well it seems like it works |
10:29:46 | FromDiscord | <Rika> just know that ive never seen it ever in nim >= 0.20 |
10:32:15 | supakeen | Things looking wrong are good remarks, looking at the other testcases they also use {.async.} so consistent++. |
10:42:25 | * | endragor joined #nim |
10:42:59 | * | Trustable quit (Remote host closed the connection) |
10:48:26 | lqdev[m] | @Rika the {.async} syntax is valid and supported, actually |
10:49:21 | lqdev[m] | but yeah {.async.} is generally preferred |
10:50:54 | * | dddddd joined #nim |
10:53:36 | supakeen | Is there a meaning to the postfix dot, I see some pragmas don't have one. |
10:54:08 | * | silvernode quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
10:54:12 | supakeen | Or is that a mistake of the person who wrote those and should they tend to end in the dot :) |
11:02:20 | * | hax-scramper quit (Read error: Connection reset by peer) |
11:02:37 | * | hax-scramper joined #nim |
11:03:21 | FromDiscord | <exelotl> Never seen a pragma without the ending dot until today lol |
11:03:54 | FromDiscord | <exelotl> I don't think omitting it is recommended |
11:03:57 | FromDiscord | <Rika> i have, but on older code |
11:03:58 | FromDiscord | <Rika> its not |
11:07:10 | * | nsf joined #nim |
11:07:26 | * | Zectbumo quit (Remote host closed the connection) |
11:08:11 | FromGitter | <eliezedeck> @mratsim Thanks man! that's a pretty cool feature |
11:13:59 | * | Zectbumo joined #nim |
11:16:00 | * | hax-scramper quit (Read error: Connection reset by peer) |
11:16:28 | * | hax-scramper joined #nim |
11:38:17 | FromGitter | <eliezedeck> @mratsim hmm... I'm not getting the intended effect ... it seems that it doesn't have any effect at all; I have tried exportc and extern, they look just the same, and the original proc name is still visible in the binary |
11:38:32 | FromGitter | <eliezedeck> *desired effect |
11:40:08 | * | josch557 joined #nim |
11:40:36 | FromDiscord | <mratsim> that's strange, what if you add manually {.exportc: myRandomName().} to the proc instead fo via push/pop |
11:42:06 | FromGitter | <eliezedeck> ok, let me try ... |
11:42:58 | FromGitter | <eliezedeck> in fact, this is what I have already tried: {.async, extern: "aizaaryahooh".} |
11:43:06 | FromGitter | <eliezedeck> also {.async, exportc: "aizaaryahooh".} |
11:43:37 | FromGitter | <eliezedeck> didn't have any effect, the binary still had the original proc name, and I didn't find the "aizaaryahooh" string anywhere |
11:44:06 | * | liblq-dev joined #nim |
11:45:26 | FromGitter | <eliezedeck> without any extern/exportc, the binary contained 3 occurences of the original proc name, with either of extern/exportc: same thing |
11:45:33 | FromGitter | <eliezedeck> using 1.2.0 |
11:49:42 | FromDiscord | <mratsim> can you try on a non-async proc |
11:50:25 | * | krux02 joined #nim |
11:50:27 | FromDiscord | <mratsim> the async pragma might be rewriting the proc and dropping additional pragmas in the process |
11:50:28 | FromGitter | <eliezedeck> I'm not sure what the section of the binary is, but redacting the visible name of the proc from the binary doesn't break the program ... which begs the question: why are then these symbols in the binary in the first place? (I've already stripped the binary, using default compiler/toolchain on macOS 10.15.4) |
11:50:52 | FromGitter | <eliezedeck> Ok, I'll try, but I've also tried on a type, and it didn't have any effect either |
11:53:22 | FromGitter | <eliezedeck> yep! that worked ... |
11:55:18 | * | Vladar joined #nim |
12:06:01 | * | supakeen quit (Quit: WeeChat 1.9.1) |
12:06:45 | * | supakeen joined #nim |
12:06:55 | * | PMunch joined #nim |
12:12:41 | dom96 | Using channels on Android is like a minefield |
12:12:56 | dom96 | Sending enums works, as soon as I try an object variant I get segfaults on memcpy |
12:13:17 | * | sleepyqt_ joined #nim |
12:15:54 | FromGitter | <eliezedeck> @dom96 that's scary ... I'm planning to run on Android too ... I'm interested in your quest since I might take the same road as you |
12:16:55 | * | sleepyqt quit (Ping timeout: 265 seconds) |
12:18:27 | dom96 | #13880 |
12:18:29 | disbot | https://github.com/nim-lang/Nim/issues/13880 -- 3Channels segfault on Android ; snippet at 12https://play.nim-lang.org/#ix=2gJi |
12:18:53 | FromGitter | <eliezedeck> thanks |
12:19:50 | dom96 | Android is quite painful, I don't know how easy it is when using Java/Kotlin but I've been feeling like I'm walking on egg shells for a while now |
12:19:50 | * | Guest44825 quit (Ping timeout: 256 seconds) |
12:21:26 | * | dadada joined #nim |
12:21:49 | * | dadada is now known as Guest19582 |
12:22:13 | FromGitter | <eliezedeck> does this apply to 1.2.0 also? |
12:22:39 | FromGitter | <eliezedeck> I guess, a version change will probably not make a difference ... but still |
12:22:49 | dom96 | It's even worse with 1.2.0 :) |
12:23:06 | dom96 | Well, it may be better once the regressions are fixed |
12:23:08 | FromGitter | <eliezedeck> wow |
12:23:29 | FromDiscord | <mratsim> I thought they were slated for complete rewrite? |
12:23:47 | FromDiscord | <mratsim> like they are the one thing that prevents Araq from removing the typeinfo module |
12:25:38 | FromDiscord | <mratsim> My naive guess would be that there is a sizeof issuewith variants in the channel module |
12:26:04 | FromDiscord | <mratsim> or offsetof for padding |
12:27:54 | dom96 | probably |
12:30:42 | Araq | dom96: compile with --gc:arc -d:useMalloc and run valgrind. if that works on Android at all... |
12:31:58 | dom96 | I cannot, I'm stuck on 1.0.6 |
12:32:09 | dom96 | I can try that later if I can fix the problems introduced by 1.2.0 |
12:32:28 | * | waleee-cl joined #nim |
12:32:44 | dom96 | or if my current planned workaround doesn't work out |
12:44:05 | FromDiscord | <Rika> https://play.nim-lang.org/#ix=2gJv what are the advantages and disadvantages of either? |
12:47:36 | FromDiscord | <exelotl> I guess it mainly depends if you're planning on using `test` in this circumstance more than once? |
12:47:56 | FromDiscord | <Rika> i only have `test` for the `A` object |
12:47:59 | FromDiscord | <Rika> no other one should have it |
12:49:53 | FromDiscord | <exelotl> and does the loop only appear once too? |
12:50:36 | FromDiscord | <Rika> not relevant though, but no it doesnt |
12:52:22 | FromDiscord | <exelotl> hmm idk I guess I'd lean towards the first approach unless i was going to be adding more cases or duplicating the logic a lot. |
12:54:37 | FromDiscord | <exelotl> interesting to see you catch the ObjectConversionError like that though, I'd have done something like `if i of A` |
12:55:58 | FromDiscord | <Rika> ... |
12:56:00 | FromDiscord | <Rika> i forgot about that |
12:56:04 | FromDiscord | <Rika> me dumbo |
12:56:15 | * | owl_000 joined #nim |
12:56:40 | FromDiscord | <exelotl> it's nice in languages like Kotlin where you can do that and it's smart enough to know that `i` is an instance of `A` for the duration of that block. So you don't have to perform the type conversion manually |
12:56:42 | FromDiscord | <Rika> its 9 pm, im supposed to be sleeping, no thoughts head empty |
12:57:45 | FromDiscord | <Rika> thanks though |
12:57:50 | FromDiscord | <Rika> i shall now sleep |
12:58:01 | FromDiscord | <exelotl> night! |
13:05:27 | * | endragor quit (Remote host closed the connection) |
13:05:53 | * | Perkol joined #nim |
13:06:05 | FromDiscord | <Bulbasaur> :L pretty active. |
13:09:00 | * | Zectbumo quit (Remote host closed the connection) |
13:10:19 | * | owl_000 quit (Quit: Leaving) |
13:15:43 | Perkol | So I try to download file using winim library, yet I get wrong file format https://bpaste.net/HCUQ |
13:15:54 | Perkol | File bigger than it should be |
13:16:03 | Perkol | What may be wrong? |
13:19:12 | livcd | Why would you do it that way? |
13:19:52 | FromDiscord | <Rika> Just use httpclient |
13:21:10 | FromDiscord | <exelotl> @Rika that's not sleeping 😠 |
13:21:28 | FromDiscord | <Rika> Hey, I'm lying down on my bed |
13:21:30 | FromDiscord | <Bulbasaur> lol |
13:21:36 | FromDiscord | <Rika> It'll come sooner or later |
13:22:20 | Perkol | Don't want to have ssl deps |
13:28:30 | dom96 | That's a good reason, sadly I cannot help (and I doubt there are many other here who have winim for this). Might want to create an issue in the winim repo, maybe the maintainer can help. |
13:28:36 | dom96 | *others |
13:28:54 | * | lbart quit (Ping timeout: 256 seconds) |
13:30:47 | * | josch557 quit (Ping timeout: 260 seconds) |
13:43:34 | * | endragor joined #nim |
13:43:45 | * | endragor quit (Remote host closed the connection) |
13:45:30 | FromDiscord | <clyybber> Does nimpretty use compiler/renderer.nim? |
13:46:28 | FromDiscord | <clyybber> Doesn't look like it.. |
13:48:00 | * | ^^opal_ is now known as opal |
13:53:48 | * | lritter joined #nim |
14:03:24 | * | hax-scramper quit (Read error: Connection reset by peer) |
14:03:39 | * | hax-scramper joined #nim |
14:24:51 | * | endragor joined #nim |
14:37:20 | * | andinus quit (Quit: ERC (IRC client for Emacs 26.3)) |
14:39:09 | disruptek | ~stream |
14:39:10 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
14:39:13 | disruptek | fix this nimph bug. |
14:41:00 | * | gmpreussner quit (Quit: kthxbye) |
14:41:16 | * | gmpreussner joined #nim |
14:48:05 | FromDiscord | <clyybber> @eliezedeck FYI dom96's issue has been resolved. It was not a stdlib error |
14:48:12 | FromDiscord | <clyybber> But a user error |
14:48:33 | FromDiscord | <clyybber> #13880 |
14:48:34 | disbot | https://github.com/nim-lang/Nim/issues/13880 -- 5Channels segfault on Android ; snippet at 12https://play.nim-lang.org/#ix=2gJi |
14:48:59 | dom96 | yeah, still not fun spending 3 hours chasing these kinds of bugs |
14:49:05 | FromDiscord | <clyybber> disruptek: Does #13876 help? |
14:49:08 | disbot | https://github.com/nim-lang/Nim/pull/13876 -- 6add nimPath to nim dump ; snippet at 12https://play.nim-lang.org/#ix=2gK0 |
14:49:14 | FromDiscord | <clyybber> dom96: Yeah |
14:49:44 | disruptek | nope. |
14:50:44 | leorize | @clyybber: nim dump already have prefixDir, so we don't need that anymore |
14:50:55 | FromDiscord | <clyybber> So revert it? |
14:51:11 | FromDiscord | <clyybber> Because it was created to help you with that issue afaik |
14:51:15 | leorize | now just need someone to make it work without having to specify a path name |
14:52:23 | leorize | clyybber: I'm pretty sure it wasn't |
14:52:35 | FromDiscord | <clyybber> disruptek: Not sure if you read it last night, but I asked why you can't just blacklist $nim from the path minifying thing |
14:52:44 | leorize | not that its a bad feature |
14:52:51 | disruptek | because that's dumb. |
14:52:58 | leorize | he wanted it to be portable |
14:53:07 | FromDiscord | <clyybber> leorize: https://github.com/disruptek/nimph/issues/127#issuecomment-609297698 |
14:53:10 | disbot | ➥ Path error when using choosenim ; snippet at 12https://play.nim-lang.org/#ix=2gK1 |
14:53:27 | disruptek | this is just such a boring bug and everyone wants to talk about it. |
14:53:30 | disruptek | find something else to work on. |
14:53:34 | disruptek | this will be fixed in 10mins. |
14:53:39 | FromDiscord | <clyybber> Lol |
14:53:45 | FromDiscord | <clyybber> still, I wonna know 😄 |
14:53:52 | disruptek | you wonna know what? |
14:54:02 | disruptek | c'mon mumble so i can work while i explain it. |
14:54:19 | FromDiscord | <clyybber> does it choose the path substitutions so that the paths ascii representation is as short as possible? |
14:54:40 | disruptek | yes, and so you can export the cfg to other users. |
14:54:44 | FromDiscord | <clyybber> disruptek: am on a pc without a mic :/ |
14:54:53 | disruptek | not my problem. |
14:55:24 | FromDiscord | <clyybber> disruptek: but then the cfg depends on where my nim is installed right? |
14:55:45 | * | sagax quit (Read error: Connection reset by peer) |
14:56:01 | disruptek | i don't understand. |
14:56:17 | FromDiscord | <clyybber> $nim is the compilers location, is that right? |
14:56:34 | dom96 | lol |
14:56:40 | leorize | isn't that the point? |
14:56:43 | dom96 | same questions I had |
14:56:56 | disruptek | jesus you guys are dense. |
14:57:35 | FromDiscord | <clyybber> leorize: But isn't that bad? |
14:57:44 | FromDiscord | <clyybber> Depending on the compilers location? |
14:57:45 | leorize | why? |
14:58:03 | * | andinus joined #nim |
14:58:09 | leorize | no? |
14:58:14 | FromDiscord | <clyybber> Because its better to depend on the projects location, no? Or is there no way to do that? |
14:58:20 | leorize | I don't think you understand the problem here... |
14:58:31 | FromDiscord | <clyybber> Yeah, I think so too |
15:00:29 | FromDiscord | <clyybber> leorize: AFAI understood it the problem is that $nim is not the compilers actual location with choosenim, since it uses symlinks and shims, right? |
15:00:48 | leorize | yes, because of nimph faulty detection |
15:00:52 | leorize | that'll be fixed now |
15:00:58 | leorize | it has no impact on the actual compiler |
15:01:00 | leorize | just nimph |
15:01:12 | FromDiscord | <clyybber> But isn't another "solution" to simply not depend on the compilers location at all? |
15:01:16 | disruptek | every tool will have this problem. |
15:01:29 | leorize | clyybber: you don't understand the problem :P |
15:01:37 | FromDiscord | <clyybber> I just don't see a scenario where it would be benefitable to depend on the compilers location |
15:01:48 | FromDiscord | <clyybber> leorize: probably |
15:01:53 | disruptek | i guess you don't write code that parses .cfg files. |
15:01:56 | dom96 | What is the damn problem? |
15:02:32 | disruptek | i tire of explaining it. |
15:02:33 | leorize | nimph tries to minify the --path so that it starts at a common root, so it can be portable between system |
15:02:41 | dom96 | yes, but whyyyyy |
15:02:42 | leorize | iirc it uses $config for the project location |
15:02:43 | FromDiscord | <clyybber> I get that |
15:02:52 | FromDiscord | <clyybber> yeah, thats cool |
15:03:00 | leorize | $nim is just an artifact due to the faulty detection |
15:03:06 | dom96 | why does it use $nim to shorten the path? |
15:03:18 | leorize | faulty detection of $nim |
15:05:39 | * | ryukoposting joined #nim |
15:07:32 | FromDiscord | <clyybber> so it uses $nim to shorten the path because of faulty detection of $nim? |
15:07:54 | FromDiscord | <clyybber> leorize: Or was that an appendix to your last sentence? |
15:08:00 | disruptek | i'd hate to have to watch you guys debug anything. |
15:08:14 | FromDiscord | <clyybber> I hate to watch you debug anything 😛 |
15:09:06 | disruptek | suit yourself. |
15:09:29 | FromDiscord | <clyybber> hey, at least I'm not stupid alone oka |
15:09:30 | FromDiscord | <clyybber> y |
15:10:13 | disruptek | yeah, you're in great company. |
15:10:16 | solitudesf | what the FUCK is going on |
15:10:22 | FromDiscord | <clyybber> dunno |
15:10:29 | FromDiscord | <clyybber> I don't get the bug |
15:10:35 | disruptek | so what? |
15:10:36 | disruptek | move on. |
15:10:45 | disruptek | it's a waste of time to talk about. |
15:10:51 | disruptek | already fixed. |
15:10:54 | FromDiscord | <clyybber> nice |
15:11:09 | FromDiscord | <clyybber> is the fix online? |
15:13:15 | disruptek | sure. |
15:15:04 | FromDiscord | <clyybber> ok cool, so now you parse the compilers dump, and the bug is fixed. I get that |
15:15:19 | FromDiscord | <clyybber> I just don't get why you have a need for the compilers location at all? |
15:15:42 | disruptek | i'm okay with that. |
15:16:59 | shashlick | You can import compiler as a package |
15:17:09 | shashlick | So $nim is useful |
15:17:34 | FromDiscord | <clyybber> ah I see |
15:17:57 | FromDiscord | <clyybber> And when the path using $config happens to be shorter than using $nim it won't use it? |
15:18:57 | shashlick | And nimph generates nim.cfg files so that you don't need to use Nim's code that searches nimble dir itself to figure out where packages are |
15:19:07 | shashlick | Yes it will |
15:19:12 | FromDiscord | <clyybber> but then its unreliable |
15:19:29 | shashlick | No one will put nimble packages in the compiler directory |
15:19:55 | shashlick | config will be most likely for local deps |
15:20:21 | FromDiscord | <Lea-Kitty> Hi 🙂 , |
15:20:21 | FromDiscord | <Lea-Kitty> |
15:20:21 | FromDiscord | <Lea-Kitty> I am interested in NIM (https://nim-lang.org/) and V (https://vlang.io/), I would like to know what is the main difference between them put a by the community ? 👀 |
15:20:52 | leorize | Nim exists :) |
15:20:54 | shashlick | Short answer, Nim's been around for a decade+ |
15:20:54 | FromDiscord | <clyybber> nim works |
15:21:01 | FromDiscord | <clyybber> and V is hot air |
15:21:25 | leorize | technically V does work now, with a lot of asterisks :p |
15:21:47 | FromDiscord | <Recruit_main707> "it works on my machine" lang |
15:22:02 | FromDiscord | <konsumlamm> also with a lot of memory leaks |
15:22:06 | FromDiscord | <konsumlamm> and a lot of WIPs |
15:22:19 | leorize | why does everyone keep writing Nim "NIM"? |
15:22:35 | leorize | it's not an abbrevation or anything |
15:23:05 | FromDiscord | <exelotl> lol it's the Lua curse |
15:23:21 | FromDiscord | <konsumlamm> you mean LUA? |
15:23:55 | IWSnim | hey all, I'm attempting to figure out why 1) overloading isn't working as I'd expect and 2) why I'm hitting a type mismatch for mutability |
15:24:00 | IWSnim | I have a snippet here https://pastebin.com/TQccVrwk |
15:24:20 | dom96 | shashlick, so it's just for the compiler? |
15:24:27 | dom96 | you know, you can install `compiler` as a package |
15:24:34 | FromDiscord | <Lea-Kitty> You mean that Nim instead of NIM ^^ compared to V is more serious about development, that V is just a dying language ? |
15:25:33 | FromDiscord | <Lea-Kitty> @gitterirc Out of habit, as soon as I name a language, I put everything in bold. 😋 |
15:26:03 | FromGitter | <zetashift> @Lea-Kitty something that never was alive can't die |
15:26:19 | leorize | dom96: `$nim` is the path to the compiler itself |
15:26:25 | FromDiscord | <konsumlamm> V is mostly empty promises as i see it |
15:26:27 | leorize | the compiler package have nothing to do with this |
15:26:47 | FromDiscord | <clyybber> so |
15:26:52 | dom96 | leorize: yes, I know. As far as I understand nimph is using it as a hack to get shorter paths |
15:26:53 | FromDiscord | <clyybber> why use $nim at all? |
15:26:59 | dom96 | $nim/../pkgs/blah-1.0 |
15:27:04 | FromGitter | <zetashift> there are a lot of differences between Nim and V, but the biggest one is Nim is production proven and V is still getting started, but I agree with konsumlamm, V is mostly empty promises at the moment |
15:27:07 | dom96 | because Nim sometimes happens to be in ~/.nimble/bin |
15:27:08 | leorize | dom96: no, it's not doing that |
15:27:20 | dom96 | then wtf is it for? |
15:27:29 | disruptek | just to confuse simps. |
15:27:58 | dom96 | haha, cool |
15:28:06 | leorize | if you do `--path=/path/to/nim/lib/pure/ioselectors`, then it can be safely shortened into `--path=$nim/lib/pure/ioselectors` |
15:28:13 | leorize | completely portable between systems |
15:28:19 | dom96 | why would you do that? |
15:28:28 | dom96 | It's already added to the path by Nim |
15:28:29 | leorize | `$nim` is never used as a relative path in the `..` sense |
15:28:41 | FromDiscord | <clyybber> ah |
15:29:02 | leorize | dom96: no one does that, but it doesn't hurt to have the code |
15:29:17 | dom96 | lol |
15:29:25 | leorize | he has the code to convert it one way, doesn't hurt to do it the other way as well |
15:29:27 | FromDiscord | <clyybber> So why does it end up in kungtottes cfg? |
15:29:28 | dom96 | if no one uses the code then yes it does hurt to have it |
15:29:29 | leorize | esp since it saves parsing time |
15:29:43 | dom96 | it's just untested code that will rot |
15:29:58 | leorize | @clyybber: the compiler path is detected as this: `~/.nimble` |
15:30:07 | FromDiscord | <clyybber> Ah |
15:30:08 | leorize | was* |
15:30:28 | FromDiscord | <clyybber> gotcha |
15:30:31 | * | rockcavera joined #nim |
15:31:00 | disruptek | that's just how the bug was /found/. |
15:31:25 | disruptek | the real problem is that config parsing is broken unless you know the true path to the compiler, which is obscured by choosenim's hack. |
15:31:36 | disruptek | 😜 |
15:31:47 | FromDiscord | <clyybber> What will end up in kingtottes config now that its fixed? |
15:32:15 | disruptek | on 1.0.6? $home/.nimble/pkgs/... |
15:32:23 | disruptek | on 1.2? $nimbledir/... |
15:32:27 | FromDiscord | <clyybber> Ah cool |
15:32:30 | FromDiscord | <clyybber> Thanks I get it now |
15:32:50 | FromDiscord | <clyybber> sorry for being annoying bro |
15:33:01 | disruptek | because he doesn't use choosenim anymore. 🤣 |
15:33:19 | Zevv | disruptek: how do I unsubscribe a disbot channel? |
15:33:37 | disruptek | a what? |
15:33:41 | Zevv | radio thingy |
15:33:48 | disruptek | i think it's `detune`? |
15:34:08 | disruptek | notune, untune, detune. |
15:34:12 | Zevv | okay! |
15:34:22 | Zevv | thanks for that |
15:34:22 | disruptek | lemme know if it works. |
15:34:26 | Zevv | okay! |
15:34:28 | Zevv | it says "okay!" |
15:34:41 | disruptek | yeah, i don't trust that mofo though. |
15:35:01 | Zevv | better safe then sorry, right |
15:36:07 | * | dddddd quit (Ping timeout: 250 seconds) |
15:36:58 | dom96 | so you're not actually putting `$nim` into nim.cfg files, would have saved us a lot more trouble if you just made that clear ;) |
15:37:13 | disruptek | yeah, it's all my fault. |
15:37:26 | disruptek | whenever you don't understand something, just blame someone else. |
15:37:28 | shashlick | Ok so what next |
15:37:57 | shashlick | People asking questions to understand != blame |
15:38:12 | shashlick | They actually care else they wouldn't ask |
15:38:22 | disruptek | it's just noise. |
15:38:47 | shashlick | It got us a fix :p |
15:39:01 | disruptek | now fix the rest of the tools. |
15:41:48 | dom96 | This is what I was concerned about FWIW, maybe I misunderstood it completely but it sounded like shashlick was saying that nimph uses something like: --path:$nim/../pkgs/blah-1.0 because "It's shorter" |
15:41:52 | dom96 | https://irclogs.nim-lang.org/04-04-2020.html#23:13:20 |
15:42:12 | dom96 | and disruptek wasn't disagreeing |
15:42:18 | leorize | this is the loss of data in communications :p |
15:43:03 | leorize | they were talking in the context of the bug |
15:43:16 | leorize | the detailed explaination is there if you wanna read |
15:44:00 | * | josch557 joined #nim |
15:50:06 | shashlick | Nimph is shortening yes but $nim wasn't right sure to choosenim symlinks - he has fixed this in nimph but the issue persists if anyone assumes that $nim can be found using findExe |
15:50:13 | FromDiscord | <clyybber> shashlick: I don't understand. It is fixed in nimph now, and its not using any workarounds. So theres nothing anymore to fix in choosenim right? |
15:50:31 | shashlick | My last message |
15:50:47 | leorize | this is a tooling problem |
15:50:52 | FromDiscord | <clyybber> Hmm, IMO thats no ones problem. findExe can't find $nim . |
15:51:04 | FromDiscord | <clyybber> not a problem really |
15:51:21 | FromDiscord | <clyybber> get $nim from nim dump |
15:51:29 | * | nsf quit (Quit: WeeChat 2.7) |
15:51:49 | leorize | well how else are you supposed to find it when the compiler code does exactly that? :) |
15:52:02 | disruptek | hard to parse configs without this information. |
15:52:19 | FromDiscord | <clyybber> leorize: Were you replying to shashlick or me? |
15:52:24 | leorize | the old detection code was based on how the compiler does it itself iirc |
15:52:25 | leorize | you |
15:52:42 | FromDiscord | <clyybber> the compiler does findExe? |
15:52:53 | leorize | getAppFilename() |
15:53:02 | leorize | because it knows exactly where it is :P |
15:53:13 | FromDiscord | <clyybber> Yeah. So it doesn't do findExe |
15:53:18 | FromDiscord | <clyybber> So it doesn't have the shims problem |
15:53:22 | FromDiscord | <clyybber> Problem solved? |
15:53:35 | disruptek | it's never a problem for the compiler. |
15:53:41 | FromDiscord | <clyybber> Yeah |
15:53:44 | disruptek | it's a problem for any other tool that wants to parse a config. |
15:53:49 | disruptek | for the 10th time... |
15:53:53 | FromDiscord | <clyybber> They should use nim dump |
15:53:59 | FromDiscord | <clyybber> for the 2nd time... |
15:54:05 | disruptek | "they" are. where "they" are nimph. |
15:54:26 | leorize | clyybber: do you know that nim dump don't get you the path unless you pass in some undocumented flags? :) |
15:54:38 | FromDiscord | <clyybber> So document them :p |
15:56:22 | liblq-dev | shashlick: does nimterop support ARC? |
15:56:30 | FromDiscord | <clyybber> choosenim doesn't really have an alternative afaict |
15:56:43 | disruptek | rename. |
15:56:52 | dom96 | rename? |
15:56:52 | shashlick | Not yet - the last few times I tried, it r crashed |
15:56:54 | dom96 | rename what? |
15:57:37 | FromDiscord | <clyybber> rename the binaries I guess |
15:57:43 | disruptek | or a directory. |
15:57:54 | liblq-dev | shashlick: right. I just had a bug report on euwren from a user trying to compile it under --gc:arc, I'll let them know that nimterop doesn't support it yet |
15:58:10 | dom96 | elaborate |
15:58:14 | disruptek | nope. |
15:58:34 | leorize | dom96: https://github.com/disruptek/nimph/issues/127#issuecomment-608991164 |
15:58:36 | disbot | ➥ Path error when using choosenim ; snippet at 12https://play.nim-lang.org/#ix=2gK1 |
15:58:39 | leorize | though please don't argue there :P |
15:59:23 | FromDiscord | <clyybber> IMO findExe simply shouldn't be used for that purpose, until it gets an option to follow symlinks |
16:00:10 | leorize | or you can use expandFilename(findExe) |
16:00:15 | leorize | :P |
16:00:39 | FromDiscord | <clyybber> AFAICT findExe even has an option to follow symlinks |
16:00:54 | FromDiscord | <clyybber> And its on by default |
16:00:55 | disruptek | i'm told it doesn't work on windows. |
16:01:05 | FromDiscord | <clyybber> Yeah, but kingtotte wasnt on windows |
16:01:19 | leorize | well can we just rest the issue now? |
16:01:21 | disruptek | i'm not going to guess at what code works there. |
16:01:29 | leorize | it's fixed. |
16:01:35 | shashlick | Renaming directories for choosenim is an option but then you need to add two directories to path |
16:01:37 | FromDiscord | <clyybber> leorize: Yeah, but it may have surfaced an issue with findExe |
16:02:04 | dom96 | As far as I can tell Araq's suggestions doesn't work when you want to only add ~/.nimble/bin to the PATH |
16:02:38 | dom96 | and then what, you want me to add a new PATH entry for each Nim version I install? |
16:02:53 | leorize | @clyybber: choosenim uses shim binaries everywhere fwiw |
16:02:56 | dom96 | I can't see how else that can work |
16:03:16 | shashlick | No add a second path and rename toolchains to that dir |
16:03:21 | FromDiscord | <clyybber> leorize: Oh, I was under the assumption that it used symlinks on posix |
16:03:41 | * | disbot left #nim (#nim) |
16:03:46 | shashlick | It is symlinks on posix |
16:03:55 | solitudesf | no? |
16:03:56 | dom96 | is it? |
16:04:13 | FromDiscord | <clyybber> shashlick said so :p |
16:04:19 | dom96 | shashlick, hrm, that could work |
16:04:47 | shashlick | But that's a second directory added to path |
16:05:02 | shashlick | Will be third if you consider gcc |
16:05:18 | ryukoposting | just realized that building Kate would require me to install 40GB worth of Qt crap, a special version of cmake, and another build tool that sits on top of that, then string all of that stuff together perfectly so that it all works perfectly |
16:05:40 | ryukoposting | guess I'm using feud as the development environment for my engine |
16:05:43 | shashlick | But everyone else using Nim without choosenim already add more dirs to path |
16:05:47 | leorize | ryukoposting: now you know why qt stays with C++ devs |
16:05:57 | FromDiscord | <exelotl> lol Qt is tragic |
16:06:05 | dom96 | shashlick, yeah, not sure it's worth it |
16:06:22 | dom96 | The way Nim handles paths is hacky already IMO |
16:06:25 | ryukoposting | I really like Kate, it gives a nice balance of np++'s simplicity and vscode |
16:06:31 | ryukoposting | 's featureful-ness |
16:06:39 | ryukoposting | but sweet jesus the code that makes it tick |
16:06:43 | dom96 | findExe cannot always work because of how Unix package managers install it for example |
16:06:46 | FromDiscord | <clyybber> shashlick: So is it symlinks on shims on posix now? |
16:06:51 | dom96 | so there are special cases for that |
16:06:53 | FromDiscord | <exelotl> the software made with Qt is so nice and lightweight... but I don't have that many gigabytes to spare on my hard drive |
16:07:01 | FromDiscord | <clyybber> dom96: WDYM? |
16:07:12 | leorize | it's still more lightweight than electron, fwiw |
16:07:26 | dom96 | clyybber: /usr/bin/nim and stdlib is /usr/lib/nim, so stdlib isn't in $nim/lib |
16:07:28 | ryukoposting | it's a good thing I'm doing this on windows, my windows drive has that space available but my linux disk? hell no |
16:07:57 | FromDiscord | <clyybber> dom96: Ah gotcha, I was thinking that you were talking about a problem with findExe |
16:08:03 | dom96 | clyybber: unless something changed it should be shims on all platforms. |
16:08:14 | FromGitter | <deech> Does anyone here care about high level Nim binding to FLTK? I've done it for Haskell and found it quite nice. |
16:08:33 | FromGitter | <deech> I know it's not Qt. |
16:09:04 | leorize | its never hurt to have more libraries :) |
16:09:14 | FromDiscord | <exelotl> yeah that would be neat @deech |
16:09:33 | leorize | I kinda hope that we would have something that's as lightweight as LCL |
16:09:50 | FromDiscord | <clyybber> dom96: k, thx for clearing it up |
16:10:13 | FromGitter | <deech> FLTK is and LCL is hard to use on macos |
16:10:47 | leorize | yea but LCL is native and I like that :P |
16:11:28 | * | josch557 quit (Remote host closed the connection) |
16:11:44 | * | josch557 joined #nim |
16:11:46 | FromDiscord | <exelotl> where can I find out about lcl? |
16:11:46 | shashlick | I think the current solution is good - don't assume where the compiler is |
16:12:05 | shashlick | We can change choosenim if there's other real issues with shims and symlinks |
16:12:14 | shashlick | Else there are better things to do |
16:12:38 | leorize | @exelotl: https://wiki.freepascal.org/LCL |
16:12:53 | FromDiscord | <clyybber> shashlick: choosenim isn't using symlinks |
16:13:47 | ryukoposting | what do other tools use? e.g. multirust |
16:13:49 | shashlick | Ok maybe, I thought it was symlinks there |
16:14:29 | ryukoposting | if there's no good solution, copying someone else's bad solution at least gives you a scapegoat |
16:14:53 | shashlick | @ryukoposting: looks like feud it is - I can commit to work on porting it to use the plugin system package and help getting it to compile on windows |
16:15:06 | FromDiscord | <clyybber> ryukopositng: I think they do the rename approach |
16:15:14 | ryukoposting | shashlick, how were you compiling it before? |
16:15:19 | dom96 | IIRC they use shims |
16:15:21 | leorize | shims are used by chocolatey since forever :P |
16:15:38 | dom96 | well, rustup does |
16:15:44 | shashlick | There's a nimble task |
16:15:44 | dom96 | not sure about multirust |
16:16:03 | ryukoposting | well I have multirust so I guess I can find out real quick |
16:16:05 | shashlick | I think nng might have changed causing that failure |
16:16:16 | FromDiscord | <clyybber> multirust is deprecated btw |
16:16:30 | ryukoposting | o |
16:16:32 | shashlick | @liblq-dev: I don't think that issue is a nimterop issue with arc |
16:16:37 | ryukoposting | shows how long it's been since I used rust |
16:16:40 | shashlick | Need to try and check |
16:16:53 | leorize | @clyybber: how's your ryu port? |
16:16:58 | leorize | have you managed to clean it up? |
16:17:18 | dom96 | https://github.com/rust-lang/rustup#how-rustup-works |
16:17:28 | Zevv | disruptek: well,there you have it. it says "okay!" but didnt do it |
16:17:37 | dom96 | yep, I copied rustup :) |
16:17:44 | ryukoposting | sounds good shashlick. Is feud dependent on a particular toolchain? I plan to use mingw64 |
16:17:44 | leorize | shashlick: I'm kinda out of ideas now. nim.cfg in the project dir can't be honored by my way of doing nimble -> nims |
16:17:46 | FromDiscord | <clyybber> leorize: Cleaned it up, but didn't change semantics |
16:17:49 | disruptek | Zevv: i knew it. |
16:18:20 | shashlick | @ryukoposting ya I was using mingw too |
16:18:25 | ryukoposting | sweet |
16:18:54 | shashlick | @leorize I'm secretly considering adding the compiler back into nimble ever since I discovered $nim |
16:19:09 | FromDiscord | <clyybber> don't |
16:19:15 | leorize | don't |
16:19:29 | shashlick | Using compiler as a nimble package didn't work since you could have different versions |
16:19:37 | dom96 | yeah, don't |
16:19:43 | shashlick | But $nim fixes that |
16:19:47 | shashlick | There will only be one |
16:20:01 | ryukoposting | btw where did "Fed Ep with UDitors" come from? |
16:20:08 | leorize | I consider the compiler unstable for any inclusion into any program |
16:20:22 | disruptek | Zevv: it looks like it worked. |
16:20:36 | shashlick | I was fed up with going back and forth looking for a good programming env |
16:21:01 | shashlick | Vscode is too fat, but I've compromised with it since I mostly use remote ssh now which works well |
16:21:02 | dom96 | shashlick, how does it? |
16:21:09 | ryukoposting | for the record, I like the idea of having a $NIMPATH environment variable or similar, that just points to a particular nim/bin. Nimble knows to call the compiler from that, and you leave it up to the user to configure their $PATH as they please |
16:21:56 | shashlick | When you add --path:"$nim", then import compiler/options will import the active compiler's instance of the file |
16:22:13 | leorize | ryukoposting: how are you gonna call nim without nimble? |
16:22:34 | ryukoposting | the user is instructed to put it in their PATH if they want it |
16:22:43 | leorize | shashlick: that's quite a hack tbh |
16:23:00 | shashlick | So there's no scenario where you have a new options.nim being built by an old compiler.exr |
16:23:02 | dom96 | shashlick, what does that solve? You'll get whatever Nim the user has, which may be 1.0.6 or it may be 0.8.0 |
16:23:04 | leorize | ryukoposting: or you could just put it in their PATH for them :P |
16:23:28 | shashlick | Ya and nimble will be built with that |
16:23:38 | FromDiscord | <clyybber> Why? |
16:23:44 | shashlick | What's the harm - it's not like nimble lives outside the nim directory |
16:23:46 | ryukoposting | yes but then they might fiddle with their path so there's multiple nim.exe's in it. now what does choosenim do when they ask it to switch versions? |
16:23:51 | FromDiscord | <clyybber> Why not use the abstraction "executables" given to us by the os |
16:23:59 | shashlick | When you change your compiler version, you use a new nimble with it |
16:24:00 | leorize | ryukoposting: it just swap out the shims? |
16:24:04 | leorize | it knows where they are |
16:24:15 | FromDiscord | <clyybber> shashlick: Maybe we don't want that? |
16:24:16 | * | solitudesf quit (Quit: Leaving) |
16:24:20 | ryukoposting | what I was proposing gets rid of shims entirely |
16:24:23 | dom96 | shashlick, what does it actually solve? |
16:24:28 | shashlick | That's how it works today too |
16:24:32 | dom96 | from my perspective it is just like we had it before |
16:24:39 | shashlick | You can nimble install nimble no doubt but almost no one does that |
16:24:44 | dom96 | and even worse since the compiler source code isn't pinned |
16:25:09 | shashlick | The issue in the past was that there was the nim compiler and a compiler package in nimble pkgs which conflicted |
16:25:16 | ryukoposting | nor would a "use-a-separate-env-variable" solution require symlinks. It'd be elegant, if not the most tightly integrated thing on earth |
16:25:20 | leorize | ryukoposting: oh, the proposal was much simpler: have a ~/.choosenim/nim-current directory, which will be in PATH, then rename ~/.choosenim/nim-<version> into that directory everytime a version switch is requested |
16:25:49 | ryukoposting | I'd prefer shims over that |
16:25:55 | FromDiscord | <clyybber> what? |
16:26:00 | dom96 | shashlick, the issue was that Nimble was compiled against a Nim version that mismatched the one that was installed |
16:26:11 | leorize | I'd prefer shims over the environment variable mess too :P |
16:26:21 | FromDiscord | <clyybber> I'd prefer renaming |
16:26:22 | ryukoposting | ok so we're back to chims |
16:26:30 | FromDiscord | <clyybber> No, why not rename? |
16:26:36 | FromDiscord | <clyybber> Theres no reason against it so far |
16:26:49 | leorize | to be fair, the current solution works :P |
16:26:58 | dom96 | yeah, the current solution is there already |
16:27:07 | FromDiscord | <clyybber> Yeah, but it could be cleaner |
16:27:08 | dom96 | there isn't really a good reason to change |
16:27:15 | FromDiscord | <clyybber> True |
16:27:59 | shashlick | I'll fine with leaving it as is |
16:28:02 | ryukoposting | question: what happens on unix vs. windows when a process starts with some path /x/y/z in its $PATH, then /x/y/z get renamed to something else and some new directory gets named /x/y/z |
16:28:15 | ryukoposting | that would decide whether renaming makes sense |
16:28:19 | shashlick | The issue was with compile failures though |
16:28:38 | shashlick | Cause you could have an old compilers package sitting in pkgs |
16:28:58 | dom96 | ryukoposting, that's a good point. Windows will screw you up: if a .exe is running you cannot move it IIRC so this may prevent renames |
16:29:32 | leorize | unless the exe was opened with FILE_SHARE_DELETE, which 100% of windows programs don't do |
16:29:35 | ryukoposting | if it just tells you "no" that's fine, then just tell the user "no, wait until this other thing is done" |
16:30:08 | FromDiscord | <clyybber> is someone on windows here? |
16:30:13 | dom96 | so there is your reason for not doing renames |
16:30:15 | ryukoposting | currently yes |
16:30:17 | FromDiscord | <clyybber> I wonder if it applies to renaming the parent folder |
16:30:31 | FromDiscord | <clyybber> or if it only applies to renaming the exe itself |
16:30:32 | ryukoposting | my main toolchain is x86_64-pc-msys |
16:30:50 | FromDiscord | <clyybber> ryukoposting: Can you check? |
16:30:56 | ryukoposting | aight let's find out |
16:30:59 | ryukoposting | one sec |
16:33:01 | FromGitter | <deech> leorize, if you like native doesn't WxWidgets already get you there? |
16:33:23 | dom96 | Even if it works, this isn't enough to convince me to switch to this mechanism. The current way works pretty well. |
16:33:54 | leorize | @deech: it's heavyweight, and the Nim API for it is ugly |
16:34:04 | * | hax-scramper quit (Ping timeout: 265 seconds) |
16:34:18 | leorize | though PMunch's genui pretty much solved that |
16:34:29 | * | hax-scramper joined #nim |
16:34:36 | ryukoposting | no, windows will not let you do that |
16:35:02 | FromDiscord | <clyybber> thanks for testing |
16:35:08 | FromDiscord | <clyybber> heh, someone tell Araq |
16:35:34 | leorize | I'm thinking of making a genui-like thing for karax actually |
16:36:17 | leorize | so I can build the dom and get whatever `Node` that I want |
16:36:20 | dom96 | hah. Already posted on that thread |
16:36:34 | leorize | complete control over the state :P |
16:36:51 | FromDiscord | <Recruit_main707> btw what happened with the online talks? |
16:37:20 | FromGitter | <deech> leorize, seems there's some initial work on genui+karax? https://github.com/PMunch/genui/tree/master/genui/platforms/karax |
16:37:58 | dom96 | So I now have the prospect of linking openssl on android. This does not sound like fun. |
16:38:09 | leorize | deech: that's for generating the vdom |
16:38:32 | FromGitter | <deech> leorize, ah, got it. |
16:38:41 | leorize | Araq said that my best bet of actually having Components is to use a Node |
16:38:56 | leorize | because the dom have a state and you gotta accept that fact :P |
16:39:35 | FromGitter | <deech> This is part of the Svelte approach I think. |
16:39:40 | ryukoposting | leorize if you want macros that turn ui-definition language into stuff that you can make a proc for, I've spent 3 months doing that for Chroma |
16:40:00 | leorize | ah, mine is gonna be simpler |
16:40:10 | leorize | just the karax ast, but output a Node |
16:40:23 | FromDiscord | <clyybber> I should be able to rely on fspSet/Cur/End being the same SEEK_SET/CUR/END right? |
16:40:34 | FromGitter | <deech> I think Nim can do Svelte better than Svelte. :) |
16:40:49 | ryukoposting | man, I didn't even think to look at karax first lol |
16:40:50 | leorize | then I can have the same syntax as genui: `variable % tdiv` and I'll have the Node for tdiv in my variable |
16:41:21 | leorize | this allows for easier tinkering :) |
16:42:05 | leorize | @deech: Araq actually tried, he gave up in the end though, because you gotta wrap every type in React[T] wrappers |
16:42:31 | ryukoposting | it actually looks very similar to an earlier iteration of Chroma's ui language. I moved away from command-style syntax like that the karax sample uses, and went to assignments |
16:42:51 | leorize | deech: https://github.com/pragmagic/karax/blob/master/karax/reactive.nim |
16:42:59 | ryukoposting | so instead of button: text "hello", it's button: text = "hello" |
16:43:39 | ryukoposting | I'm not enough of a web guy to know what any of this stuff is lol |
16:44:02 | ryukoposting | my entire website is hand-written HTML and CSS without a single line of JS |
16:44:08 | leorize | ryukoposting: you should still study them |
16:44:19 | leorize | they open a pretty interesting path for native ui |
16:44:44 | ryukoposting | I've used JS plenty, granteds |
16:44:47 | ryukoposting | granted* |
16:45:32 | ryukoposting | my current job (which I'm leaving soon! oh boy) uses it to make our android apps scriptable, so I maintain this entire JS interpreter tangle that's mashed together with an android app |
16:45:46 | leorize | lol |
16:45:53 | ryukoposting | this was not my idea |
16:46:17 | ryukoposting | had I been around, I would have made it clear how stupid of an idea that is |
16:47:27 | ryukoposting | I wonder if my ladder logic nimble package will ever be used |
16:48:24 | ryukoposting | I made that so I could prove to my employer that Nim could work as a replacement for IEC 61131-3 |
16:48:39 | leorize | was he convinced? |
16:49:03 | ryukoposting | the ones who understood what a Nim macro is, and what the compiler does to make them work, were seriously impressed |
16:49:59 | leorize | how about the people that actually makes decisions? :P |
16:50:07 | ryukoposting | nah they didn't care |
16:50:25 | leorize | lol |
16:50:39 | ryukoposting | I still used nim to made a makefile generator that we use for at least one codebase |
16:50:49 | ryukoposting | did that under their noses |
16:51:11 | leorize | once you left they will pluck that out for cmake, guaranteed |
16:51:15 | ryukoposting | I don't have my hopes up for getting nim into my new workplace though. Defense contractor, and a big one at that |
16:51:30 | ryukoposting | nah they'll never use cmake |
16:52:22 | ryukoposting | we have one software engineer who pretty much runs the show, dude's a soviet union expat who lived in isreal for a while as a kid, then in canada, then came to the US |
16:52:54 | ryukoposting | he wrote the kernel we use on nearly all of our products, and his name is on the patent for said kernel. management knows he knows more than they do, and they know he's worth millions to the company |
16:53:28 | leorize | damnnnnnnn |
16:53:42 | ryukoposting | and he HATES cmake |
16:53:57 | ryukoposting | he sees it as a non-solution to a non-issue |
16:54:16 | leorize | yes, but is he gonna write his kernel in nim? |
16:55:05 | leorize | did you manage to impress him enough? :P |
16:55:06 | ryukoposting | I showed it to him. His earliest professional work was with Borland so the Pascal influences helped |
16:55:13 | * | thomasross_ joined #nim |
16:55:13 | * | thomasross is now known as Guest36986 |
16:55:13 | * | Guest36986 quit (Killed (barjavel.freenode.net (Nickname regained by services))) |
16:55:13 | * | thomasross_ is now known as thomasross |
16:55:32 | * | josch557 quit (Ping timeout: 260 seconds) |
16:55:35 | ryukoposting | or, sorry, not borland, delphi |
16:55:55 | ryukoposting | he's been a DOS guy since the very beginning |
16:56:30 | disruptek | leorize: are you alive? |
16:56:35 | disruptek | can you come on the stream? |
16:56:44 | * | josch557 joined #nim |
16:57:18 | ryukoposting | me and this guy are good friends now, couldn't have found myself a better mentor in the beginnings of my career. |
16:57:52 | leorize | disruptek: I'm on the stream |
16:57:58 | leorize | what's up? |
17:09:00 | FromGitter | <awr1> @exelotl @supakeen i think the pragma ending dot omission is unlikely to be removed at this point |
17:09:34 | leorize | it's not a bug, it's an actual feature |
17:09:45 | leorize | but tbh, `{. .}` looks better :P |
17:09:45 | supakeen | awr1: Sure, but for now I'll use the ending dot like the rest of us :) |
17:09:54 | FromGitter | <awr1> i remember there was an issue about a while ago and i think dom or araq said that it wasn't going to be removed |
17:10:09 | leorize | yea, it's a part of the actual grammar |
17:10:13 | FromGitter | <awr1> yes |
17:13:34 | FromDiscord | <exelotl> what if we got rid of the leading dot too? 🤔 |
17:14:05 | FromDiscord | <exelotl> then I guess it conflicts with the Set syntax |
17:14:10 | leorize | `{ }` is the set/array construction syntax |
17:14:12 | * | hax-scramper quit (Read error: Connection reset by peer) |
17:14:26 | * | hax-scramper joined #nim |
17:14:26 | FromGitter | <awr1> there have been people before that have argued for the pragma syntax to be changed |
17:14:55 | FromGitter | <awr1> but idk |
17:15:27 | FromGitter | <awr1> pragma syntax is fine |
17:15:54 | FromDiscord | <exelotl> yeah it's fine how it is |
17:20:20 | supakeen | Interesting. |
17:21:00 | supakeen | Wonder if this is intended, setting a custom Content-Length on a response makes httpclient's body that length even if there was more data :) |
17:21:07 | supakeen | I can understand why, but a thought. |
17:23:22 | leorize | the less you send, the faster it becomes |
17:24:02 | supakeen | https://github.com/supakeen/Nim/blob/add-asynchttpserver-tests/tests/stdlib/tasynchttpserver.nim |
17:24:10 | supakeen | I really need to get rid of the repetition :( |
17:26:38 | leorize | supakeen: write a template :) |
17:28:59 | * | Perkol quit (Remote host closed the connection) |
17:29:15 | supakeen | Yea, next step! |
17:29:53 | * | hax-scramper quit (Ping timeout: 258 seconds) |
17:31:15 | * | hax-scramper joined #nim |
17:37:21 | FromDiscord | <exelotl> doing some very evil things lol |
17:37:21 | FromDiscord | <exelotl> https://cdn.discordapp.com/attachments/371759389889003532/696413181941252216/unknown.png |
17:38:52 | FromDiscord | <exelotl> result is that I can group together related definitions like so: |
17:38:52 | FromDiscord | <exelotl> https://cdn.discordapp.com/attachments/371759389889003532/696413560623988827/unknown.png |
17:39:27 | FromDiscord | <clyybber> Ha nice |
17:39:45 | FromDiscord | <clyybber> Thats actually very neat IMO |
17:39:52 | FromDiscord | <exelotl> yeah would be nice if there was a real feature like this x) |
17:40:21 | FromDiscord | <exelotl> was planning to make a feature request for it |
17:40:32 | FromDiscord | <clyybber> Make a PR ? |
17:40:41 | FromDiscord | <clyybber> Seems like you managed to do it |
17:41:42 | FromDiscord | <clyybber> I actually prefer it like this |
17:41:48 | FromDiscord | <clyybber> seperation of concerns and so on |
17:42:21 | FromDiscord | <clyybber> Maybe we could add it, and document it |
17:42:23 | supakeen | How do I tell my template to accept 'await' in it, I'm using it an an {.async.} pragmaed proc but it seems template's themselves don't take those pragma's. |
17:42:44 | leorize | supakeen: that's a well known bug |
17:42:59 | supakeen | Is there a well known workaround? |
17:43:19 | FromDiscord | <exelotl> this solution is pretty hacky, it just *undoes* the spacing. Would be nice to add a directive that tells the compiler not to create the spacing element in the first place. |
17:43:46 | leorize | #12743 |
17:43:48 | FromDiscord | <exelotl> and also it could play nicely with Nimsuggest and stuff |
17:44:03 | leorize | disbot? |
17:44:06 | leorize | wait it died? |
17:44:14 | FromDiscord | <clyybber> lol |
17:44:24 | FromDiscord | <clyybber> zevv accidently turned disbot off |
17:44:28 | leorize | https://github.com/nim-lang/Nim/issues/12743 |
17:44:29 | FromDiscord | <clyybber> in his quest to unsubscribe |
17:45:57 | supakeen | leorize: yield is indeed a bit tricky because I actually need the result :) |
17:47:00 | supakeen | But it seems I can use waitFor(..) instead in my specific case (was said in an issue linked-to from that one). Thanks! |
17:47:43 | leorize | note: don't use waitFor() in an async proc |
17:48:09 | leorize | supakeen: just yield it, then check if it's finished, then get the value from the future |
17:49:19 | supakeen | In my specific case I can use the waitFor even though it won't work in general (I only start two futures at a time, the second one ends the first one). |
17:49:43 | * | Trustable joined #nim |
17:53:41 | FromDiscord | <kaderallam> Hello everyone, I have a question which will certainly sound stupid to you but let's say i have var a:string = "test" and i want a reference to the same object, liek var b: ref string , how do i assign a reference to the object ? |
17:54:14 | leorize | you can't |
17:54:27 | leorize | it has to be a reference from the start |
17:54:40 | leorize | it'd be helpful if you can give us an example use case |
17:55:31 | FromDiscord | <kaderallam> interesting |
18:01:27 | * | holikon1 joined #nim |
18:02:26 | FromDiscord | <KingDarBoja> How to specify a proc parameter of type `proc`? like this maybe ?-> proc myCustom(a: proc) = ... ? |
18:02:58 | shashlick | Put the full proc signature including return value ND pragmas if any |
18:03:49 | supakeen | For example: proc test(handler: proc (request: Request): Future[void] {.gcsafe.}) |
18:04:28 | FromDiscord | <KingDarBoja> Ok |
18:04:59 | FromDiscord | <KingDarBoja> Hummm if the passed procedure is a generic? |
18:05:32 | * | josch557 quit (Ping timeout: 260 seconds) |
18:09:22 | * | endragor quit (Remote host closed the connection) |
18:09:36 | * | holikon1 quit (Ping timeout: 240 seconds) |
18:10:05 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
18:11:30 | * | pbb joined #nim |
18:15:16 | FromGitter | <eliezedeck> https://play.nim-lang.org/#ix=2gL4 ⏎ I feel it is a bug because not all async procs are aware that the future has been resolved; but I tried older versions down to v0.17.0, and it behaves the same ... why is it *only one await aware of the resolved future*? |
18:15:50 | FromGitter | <eliezedeck> in the example, I was expecting "Foo and Bar to be saved" |
18:15:57 | FromGitter | <eliezedeck> no just one of them |
18:15:59 | FromDiscord | <Varriount> axios: When disruptek said that he muted you, he was talking about a local mute (local to disruptek's computer). |
18:18:55 | * | andinus left #nim ("ERC (IRC client for Emacs 26.3)") |
18:20:40 | FromGitter | <eliezedeck> @Araq @dom96 @mratsim guys, this really doesn't seem right, what am I missing? https://play.nim-lang.org/#ix=2gL4 ... normally, instinct and experience from Javascript and probably other languages with promise/future/... would say that both "Foo and Bar will be saved", but no, only one await will be awakened; that's really not right |
18:21:08 | FromGitter | <eliezedeck> I hope I'm wrong |
18:22:37 | leorize | https://play.nim-lang.org/#ix=2gL8 |
18:25:24 | leorize | well to be fair I'm not sure what's wrong :P |
18:25:35 | leorize | @Varriount: he is axion |
18:26:26 | FromGitter | <eliezedeck> yes, it's not clear why asyncCheck works ... but then, what if I want the value sent from the savior proc? https://play.nim-lang.org/#ix=2gL9 |
18:27:09 | FromDiscord | <kaderallam> guys i am confused with seq it is said to be a ref in the doc but when i assign the value to another var it is copied. And when i tried to do something simple like this, it doesnt work: |
18:27:09 | FromDiscord | <kaderallam> var d:ref seq[int] = new seq[int] |
18:27:09 | FromDiscord | <kaderallam> d.add[int](1) |
18:28:35 | leorize | kaderallam: you gotta dereference the `ref`: https://play.nim-lang.org/#ix=2gLb |
18:29:36 | FromDiscord | <kaderallam> thx |
18:34:04 | * | FromDiscord <KingDarBoja> Axion has joined the battle |
18:34:18 | axion | wut |
18:34:37 | FromDiscord | <KingDarBoja> I just noticed I was trying to do some dumb check and remembered what Rika said about Nim being compile check lol |
18:34:59 | FromDiscord | <KingDarBoja> For real, I must stop thinking like it is python |
18:35:08 | FromDiscord | <KingDarBoja> Welcome axion! |
18:38:43 | FromDiscord | <kaderallam> > <leorize> kaderallam: you gotta dereference the `ref`: https://play.nim-lang.org/#ix=2gLb |
18:38:43 | FromDiscord | <kaderallam> @gitterirc is it possible to dereference a string ? |
18:39:31 | * | sagax joined #nim |
18:39:59 | leorize | no |
18:40:07 | leorize | string and seq are value types in nim |
18:40:42 | * | kenran joined #nim |
18:40:49 | FromDiscord | <kaderallam> is there a way to create a ref string or req seq from an existing string or seq |
18:41:15 | leorize | no |
18:41:25 | FromDiscord | <kaderallam> thanks |
18:41:28 | leorize | well yes, but it won't have the effect that you expect |
18:42:02 | FromDiscord | <kaderallam> actually i dont want a ref on the actual string or seq, i just want a copy of it but as a ref |
18:42:27 | leorize | ah, then just make a ref, then `ref[] = what you wanna copy` |
18:57:36 | * | josch557 joined #nim |
19:00:45 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
19:04:16 | Yardanico | I forgot, is it possible to split Jester routes between multiple files? |
19:05:37 | leorize | yes, though it's painful |
19:05:56 | leorize | use the `router` template |
19:06:20 | leorize | but beware, everything you put in there must be accessible by the module that routes into it |
19:06:28 | leorize | since the AST inside will be copied verbatim |
19:06:44 | ryukoposting | how easy is it to build a nim compiler that can be embedded inside another software package? |
19:06:48 | * | kenran quit (Ping timeout: 265 seconds) |
19:07:08 | leorize | ryukoposting: wdym by can be embedded? |
19:07:38 | ryukoposting | let me simplify the question: how easy is it to compile the compiler |
19:08:17 | FromDiscord | <Recruit_main707> this remembers me to silentrinity |
19:08:21 | FromDiscord | <Recruit_main707> reminds* |
19:08:44 | Zevv | ryukoposting: the compiler is available as a nimble lib IIRC |
19:08:49 | Zevv | never tried it though |
19:09:04 | Zevv | `nimble install compiler` |
19:09:08 | ryukoposting | hmmmmm that's got me thinking |
19:09:34 | ryukoposting | maybe my SDK's installer could basically just install Nimble, then just tell nimble what packages to install |
19:21:52 | * | Vladar quit (Quit: Leaving) |
19:22:23 | * | opal quit (Ping timeout: 240 seconds) |
19:27:42 | jken | I have a question about nim wrappers for c, looking at https://github.com/barcharcraz/nim-assimp its missing a function I want (pMaterial->GetTextureCount). it's defined in the C header here: https://github.com/assimp/assimp/blob/5a674bb464f7cba4b4c14356b04779bab656ccb9/include/assimp/material.h#L749 |
19:28:41 | jken | I was thinking that getting access to it woul be as simple as copying and modifying the getTexture proc in nim-assimps' assimp.nim, but GetTextureCount belongs to their material class |
19:28:46 | jken | s/c/cpp/ |
19:29:02 | jken | Is there an easy way to get access to the function from nim? |
19:29:39 | FromGitter | <eliezedeck> @jken c2nim? |
19:30:16 | FromGitter | <eliezedeck> AFAIK, I suppose it also works with C++ |
19:32:58 | ryukoposting | remind me, can nimble be passed a git repo url to install from? |
19:36:28 | Yardanico | yes |
19:38:09 | ryukoposting | perfect, my installer will just download and install nimble, then give it git tags to install components from |
19:52:09 | supakeen | Is it possible to fetch the compilers Nim version at runtime? |
19:53:21 | supakeen | Found it, I should search before I ask. |
19:55:22 | dom96 | eliezedeck: interesting, possibly a bug. I think this happens because when you await the `promise` the `await` **sets** a callback, so the second time it is awaited the previous callback gets overwritten. |
19:55:53 | dom96 | I could be wrong, but if not then we should change it to add a callback (i.e. `addCallback` vs. `callback=`) |
19:58:35 | * | moerm joined #nim |
19:58:38 | moerm | o everyone |
19:58:46 | moerm | +hell |
19:58:49 | supakeen | Hello. |
19:59:54 | yumaikas | heyo |
20:01:10 | Yardanico | is there any difference between using $ for cstring, or setLen(mystrvar, 0); add(mystrvar, mycstringvar) |
20:01:14 | Yardanico | ? |
20:01:18 | * | opal joined #nim |
20:02:00 | Yardanico | I just needed to reimplement PHP's mysqli_fetch_assoc in Nim (it's actually just a few lines of code added to db_mysql, but I won't modify the original module ofc so I copied stuff I need from it) |
20:02:51 | * | Vladar joined #nim |
20:11:39 | shashlick | @ryukoposting what are you trying to do with compiler |
20:12:04 | shashlick | I'd recommend not using the compiler as a package, use $nim instead |
20:13:00 | shashlick | But will help to understand what you want to do |
20:14:52 | ryukoposting | what do you mean by $nim |
20:15:15 | ryukoposting | I need to make an installer for all the tools needed to make games with my engine, it's nearing that point |
20:16:09 | shashlick | Ok then why not just download the latest stable zip that has everything in it |
20:16:39 | ryukoposting | fair, just trying to find ways to make that whole thing easier to make |
20:17:18 | shashlick | I have some ideas around it |
20:17:29 | shashlick | Do you need the entire Nim or just a subset |
20:17:39 | shashlick | Do you care about install size |
20:18:09 | ryukoposting | compared to competitors, this install should be very small |
20:19:27 | ryukoposting | users will have to switch windows into developer mode, then the installer will install mingw64-gcc, nim, the SDL2 DLLs, libz DLLs, and nimble. then nimble will be responsible for installing the libz and sdl2 packages at a minimum |
20:20:59 | shashlick | Nim already installs mingw if you want to leverage that |
20:21:03 | FromDiscord | <kaderallam> > <leorize> ah, then just make a ref, then `ref[] = what you wanna copy` |
20:21:03 | FromDiscord | <kaderallam> @gitterirc Thanks |
20:21:33 | shashlick | Of course I'm assuming that you've not already done all that |
20:21:57 | * | josch557 quit (Remote host closed the connection) |
20:22:22 | * | josch557 joined #nim |
20:22:59 | moerm | Maybe a stupid question: Why not simply use lua? FreeBSD for example uses it too instead of the shell |
20:32:45 | ryukoposting | shashlick, does choosenim do that if you use it to do your first installation? |
20:38:27 | * | sentreen_ quit (Ping timeout: 265 seconds) |
20:38:59 | moerm | HAHAHA I just discovered "VerifPal" a kind of crypto analyzer. The idio^H^H^H^H "professor" wrote it in *Go*! Hahaha |
20:41:30 | supakeen | moerm: FreeBSD uses Lua instead of the shell? What do you mean. |
20:42:22 | * | pbb joined #nim |
20:42:29 | ryukoposting | I have a rant on my blog where I kind of tear into Go but it's really not that bad |
20:44:33 | moerm | ryukoposting I don't say that Go is bad. I say that re. security it is ridiculous(ly bad). |
20:44:41 | ryukoposting | is it? |
20:44:52 | moerm | Yes, definitely |
20:45:18 | ryukoposting | huh, never heard anything about it. why's that? |
20:45:22 | * | tane quit (Read error: Connection reset by peer) |
20:45:58 | PMunch | @deech, yeah that link is for my planned library (currently confusingly also named genui). The idea was to have the user declare what they wanted to show/have the user be able to edit, and the UI should build itself based on that. So instead of saying things like I want an input box here with a callback that sets a variable on update, blah blah blah, you just go: hi I want to let the user edit this string variable and the library figures it out on |
20:45:58 | PMunch | its own. |
20:46:14 | moerm | In two words: Rob Pike (plus its weak typing and other factors) |
20:46:18 | PMunch | So that file is not really meant to be used like the other genui macros |
20:46:35 | * | tane joined #nim |
20:46:43 | ryukoposting | a type system doesn't make a language have poor security |
20:46:52 | ryukoposting | a good type system can make a language have good security, sure |
20:47:49 | moerm | Sorry, I've had that discussion often enough and won't have it again. If you trust Go by all means use it for sensitive projects |
20:48:32 | * | PMunch quit (Quit: leaving) |
20:49:04 | ryukoposting | well most of my professional work is C and ARM assembly so I guess I see security as being something that's not really the fault of the language, especially if that language is meant for a purpose where an overly sophisticated type system becomes a hindrance |
20:49:27 | krux02 | what is the meaning of benign? |
20:49:28 | ryukoposting | I suppose you're right though, Go can't really use the C excuse. |
20:50:04 | ryukoposting | benign? it means "not aggressive" or "gentle" |
20:50:07 | moerm | Hint: There are a few good static analyzers for C. For GO? Good luck ... |
20:50:59 | yumaikas | So, does 1.2.0 not support certain versions of gcc? |
20:51:00 | ryukoposting | Those static analyzers are great until you try to use them on an embedded codebase and the freak out every time they see a write to a SFR |
20:51:46 | moerm | krux benign ~ no bad intentions, not negative. Ex: a benign tumor is supposed to not spread wildly and to not kill |
20:51:56 | ryukoposting | cause in code, every single one of those looks like you're dereferencing an integer value. Which is exactly what you're doing, but that's a valid behavior on a device with no MMU |
20:52:58 | moerm | ryukoposting Maybe you are talking about better linters? |
20:54:06 | moerm | yumaikas ?? |
20:54:51 | yumaikas | Well, I'm running on an older ubuntu, and when I try to build from source, it complains about missing a set of fuctions |
20:55:11 | yumaikas | I don't have a ton of into just yet |
20:56:09 | moerm | yumaikas Hmm, interesting. Maybe Nim somehow really depends on min. C versions (possibly (almost) full C99) |
20:57:19 | yumaikas | Perhaps. 1.2.0 is not working, but 1.0.0 was working |
20:58:58 | yumaikas | I get a lot of errors to the effect of "undefined reference to `__builtin_ssubll_overflow" |
20:59:58 | yumaikas | That happens when I use choosenim, or when I build 1.2.0 by hand |
21:02:39 | FromDiscord | <kaderallam> what is the best way to conver a uint32 for instance into a binary string / big endian |
21:07:18 | shashlick | @ryukoposting yes choosenim also does that |
21:08:05 | moerm | yumaikas that sound really like too old a compiler version (more precisely too old a lib version and runtime) |
21:08:34 | yumaikas | moerm: Hrm... I suppose. Nim 1.0.0 works fine, but 1.2.0 doesn't seem to |
21:10:34 | dom96 | yumaikas, if it works on 1.0.0 and not on 1.2.0 then that's a regression, report it |
21:11:36 | moerm | Ah, dom96 is here (hello) - that's good, listen to him yumaikas. He is quite close to Nim devel. |
21:12:08 | yumaikas | dom96: Will do |
21:12:35 | moerm | dom96 In case the Nim team gave up compatibility with GCC 4.x that would be understandable and reasonable to me |
21:13:08 | FromGitter | <timotheecour> @ yumaikas a quick code search woul’dve revealed the fix: -d:nimEmulateOverflowChecks |
21:13:38 | dom96 | moerm, sure, it would also be great if the Nim team made that clear in the release notes :) |
21:14:31 | moerm | dom96 If in doubt you are right and I'm wrong, no questions. But hey, the Nim teams is human and humans can forget something ... |
21:14:46 | dom96 | heh, looks like it is mentioned in the release notes |
21:14:53 | dom96 | search for __builtin_saddll_overflow in https://nim-lang.org/blog/2020/04/03/version-120-released.html |
21:15:06 | dom96 | well done Nim team :) |
21:15:53 | moerm | *g |
21:15:57 | yumaikas | timotheecour: I suppose I could have done more looking into that, but it'd be nice if the compiler could detect some of that |
21:16:24 | yumaikas | And/or how to I feed that flag to choosenim? |
21:17:40 | yumaikas | (Since that's part of how nim is compiled) |
21:17:47 | yumaikas | Or, it is on my system |
21:18:03 | FromGitter | <timotheecour> can u try `nim c -d:nimEmulateOverflowChecks main` (ie, unrelated to choosenim) |
21:18:19 | dom96 | If choosenim needs to compile Nim for you then you cannot pass that flag to it |
21:18:48 | yumaikas | dom96: It seems to need to? |
21:19:16 | dom96 | Afraid it's not supported |
21:19:40 | dom96 | if you try `choosenim devel` you might be able to get a nightly build |
21:19:57 | dom96 | strange that we don't have this for stable releases... |
21:20:00 | yumaikas | Or, when I use "choosenim 1.2.0", it doesn't, but it seemed to when I used `choosenim stable`? |
21:20:14 | moerm | yumaikas What's the newest clang/llvm version available on your old Ubuntu? |
21:20:58 | moerm | yumaikas Plus: I'd bet that there is somewhere a repo providing more current GCC versions to old Ubuntu versions |
21:21:21 | yumaikas | moerm: Not sure, I'm on 14.04 atm, I'm kinda overdue to rebuild my server |
21:22:10 | moerm | yumaikas well, in the worst of cases you build (almost?) any GCC version by hand |
21:22:20 | yumaikas | Yeah, fair enough |
21:22:48 | dom96 | or just use nim 1.0.6, it's good enough |
21:22:52 | moerm | Btw: Maybe you have the resources to simply create & use a VM with a newer Ubuntu version? |
21:22:55 | yumaikas | I have a build 1.2.0 from choosenim working now, so the -d:emulateOverflows should work. |
21:23:24 | * | Pixeye quit (Ping timeout: 265 seconds) |
21:23:38 | yumaikas | dom96: I'm needing some improvements to the to(JSONNode, type) function that seem to be in 1.2.0 |
21:24:25 | * | tane quit (Quit: Leaving) |
21:25:50 | moerm | - afk - |
21:26:08 | * | NimBot joined #nim |
21:28:01 | yumaikas | moerm: Yeah, in a little bit, I'll be building a new server with the newest Ubuntu LTS. |
21:28:41 | FromGitter | <timotheecour> @dom96 if choosenim can build, then choosenim should be able to take cmdline otions |
21:29:02 | FromGitter | <timotheecour> that would forward to nim as is |
21:29:59 | * | sirikon joined #nim |
21:35:07 | FromGitter | <timotheecour> => https://github.com/dom96/choosenim/issues/190 |
21:35:21 | * | Vladar quit (Quit: Leaving) |
21:35:46 | yumaikas | I do have a question, tho: I've seen config files that set certain things? Is there a config I can use to always emulate overflow checks? |
21:36:48 | FromGitter | <timotheecour> same thing, add `-d:nimEmulateOverflowChecks` to your nims/cfg (see example of nims files for how to pass flags) |
21:37:06 | dom96 | yeah, actually you may be able to do that without involving choosenim at all |
21:37:15 | dom96 | AFAIK there is a global cfg file that Nim will read |
21:37:42 | dom96 | that said, when compiling Nim you usually build C sources... which won't have the code that the -d flag enables |
21:37:49 | dom96 | so you're screwed either way |
21:38:03 | dom96 | Even choosenim passing flags cannot help you |
21:38:04 | yumaikas | dom96: Well, I have a working 1.2.0 binary atm |
21:38:33 | yumaikas | I'm just trying to figure out how to tell _it_ to use that flag all the time |
21:44:02 | * | disbot joined #nim |
21:48:09 | disruptek | Zevv: you really cannot detune the radio? 'cause i don't see you in the tuner. |
21:50:33 | * | zyklon joined #nim |
21:52:49 | * | uvegbot quit (Ping timeout: 252 seconds) |
21:52:57 | * | sleepyqt_ quit (Read error: Connection reset by peer) |
21:59:39 | * | dddddd joined #nim |
22:00:32 | * | Zectbumo joined #nim |
22:00:50 | moerm | - back - and Hello disruptek |
22:01:52 | yumaikas | eyo |
22:02:17 | yumaikas | moerm: I seem to have things working now, using the emulated overflow checks |
22:04:00 | * | liblq-dev quit (Quit: WeeChat 2.7.1) |
22:06:09 | FromDiscord | <KingDarBoja> Ufff almost finishing some translation from Python to nim, reaching 1000 lines x.x |
22:06:42 | * | natrys quit (Quit: natrys) |
22:09:49 | moerm | yumaikas Nice. If I could be of help I'm glad ;) |
22:10:23 | ryukoposting | shashlick nice, that makes my life a lot easier |
22:12:33 | shashlick | Yep |
22:12:55 | shashlick | Alternatively you can download the windows binary zip and run finish |
22:13:07 | shashlick | It will setup mingw as well |
22:13:26 | shashlick | Might be simpler unless you want to support multiple Nim versions |
22:15:23 | ryukoposting | will collect work with iterators? |
22:24:49 | moerm | -afk - |
22:33:53 | * | Trustable quit (Remote host closed the connection) |
22:43:09 | FromDiscord | <Varriount> timotheecour: What's the difference between emulated overflow checks and non-emulated overflow checks? |
22:44:13 | FromGitter | <timotheecour> perf |
22:44:35 | FromDiscord | <Varriount> Yeah, but what about from an implementation standpoint? What's the difference? |
22:45:02 | FromGitter | <timotheecour> emulated use FP mult for int ops, as done in python, which is 5X slower as i explained here https://github.com/nim-lang/RFCs/issues/199 |
22:45:04 | disbot | ➥ 2X-5X faster integer multiplication ; snippet at 12https://play.nim-lang.org/#ix=2gME |
22:45:30 | FromGitter | <timotheecour> also you can browse the code to discover this, nothing is hidden :) |
22:52:56 | * | josch557 quit (Quit: ERC (IRC client for Emacs 26.3)) |
23:07:23 | moerm | bye. have a good time everyone |
23:07:28 | * | moerm quit (Quit: Leaving) |
23:09:57 | ryukoposting | dom96, I realize there may be a mistake in my sample code I added to the SDL2 module |
23:10:48 | ryukoposting | I'll have to double check but I might have used normal alloc() to make a buffer that gets passed into the audio thread |
23:11:50 | leorize | we should update our openssl requirement to 1.1 like everyone else then deprecate older protocols: https://github.com/nim-lang/Nim/issues/13884 |
23:11:51 | disbot | ➥ SslProtVersion only supports TLS 1.0 and older. Add TLS 1.2 & TLS 1.3 since TLS 1.1 and older are deprecated. |
23:12:05 | ryukoposting | yes, it appears I did do that. not sure if queueAudio copies its buffer into the other thread safely. Probably better safe than sorry. |
23:12:09 | leorize | this would break code, for good reason I guess :P or we can keep older enums and raise errors |
23:17:52 | * | lritter quit (Quit: Leaving) |
23:28:49 | ryukoposting | is it safe to assume that if I GC_ref a ref object, everything it references is implicitly GC_ref'd? |
23:29:43 | leorize | wdym? |
23:29:45 | disruptek | nope. |
23:31:38 | ryukoposting | welp, the audio thread just crashed my demo game so it seems "no" is the answer |
23:32:07 | leorize | use arc :P |
23:32:45 | ryukoposting | it wouldn't help, unless arc somehow knows how to track references through a cast to pointer, and a run through SDL2 and back up into a function called by it |
23:34:16 | FromDiscord | <kaderallam> Guys simple question, how can i add an array[0..3, char] to a string or convert it to a string ? |
23:35:10 | ryukoposting | arr.mapIt(char it).join |
23:35:28 | ryukoposting | import sequtils and strutils |
23:35:47 | FromDiscord | <kaderallam> thanks |
23:35:48 | FromGitter | <timotheecour> thats inefficient |
23:35:55 | FromDiscord | <kaderallam> seems heavy |
23:36:02 | ryukoposting | OH GOD OH NO 4 BYTES |
23:36:13 | FromGitter | <timotheecour> 3 could be N |
23:36:28 | ryukoposting | that's not what he asked for, is it |
23:36:42 | Yardanico | var mystr = newSeq(myarr.len); for i, x in myarr: mystr[i] = x |
23:36:44 | Yardanico | very efficient :P |
23:36:56 | Yardanico | or maybe you can just play with pointers to get even more efficient |
23:37:05 | Yardanico | ah sorry not newSeq but newString |
23:38:14 | IWSnim | while we're golfing, is there a more elegant way to construct a uint16 from two uint8s than this? |
23:38:17 | IWSnim | var word: uint16 |
23:38:18 | IWSnim | ? |
23:38:21 | IWSnim | word = cpu.mem.gameboy.readByte(address + 1) |
23:38:23 | IWSnim | word = word shl 8 |
23:38:26 | IWSnim | word = bitor(word, cpu.mem.gameboy.readByte(address)) |
23:38:37 | IWSnim | it works... but there's gotta be a better way? |
23:38:55 | Yardanico | read two bytes instead? |
23:39:03 | ryukoposting | word = (b0 shl 8) or b1? |
23:39:09 | Yardanico | word = cpu.mem.gameboy.readTwoBytes() :P |
23:39:14 | IWSnim | :P |
23:39:32 | IWSnim | it'd be the same inside that proc as well |
23:39:33 | IWSnim | unfortunately |
23:39:50 | Yardanico | well but how can you make it the other way? you'll still have to call readByte twice anyway |
23:40:10 | IWSnim | Just wondering if there was a way around thie shift / or. Not a huge deal :) |
23:40:16 | IWSnim | just making sure I din't miss some obvious builtin for it |
23:40:24 | FromDiscord | <Rika> i dont see any other way |
23:40:33 | IWSnim | Thanks :) |
23:41:27 | FromDiscord | <kaderallam> anyway I did this, var tst = "" |
23:41:27 | FromDiscord | <kaderallam> var val:array[0..3, char] = extract_32(2001) |
23:41:27 | FromDiscord | <kaderallam> for c in val: |
23:41:27 | FromDiscord | <kaderallam> tst.add c |
23:41:27 | FromDiscord | <kaderallam> but find it inefficient, there must be a better way |
23:41:50 | wgetch | whats a good way to convert an array of bytes (in utf8 encoding) to a string? |
23:41:52 | leorize | it's as efficient as it could be tbh |
23:42:01 | Yardanico | wgetch: nim string is just an array of bytes basically |
23:42:11 | Yardanico | so you don't have to do any conversion at all |
23:42:17 | leorize | we can go the nice way or the not nice way :P |
23:42:18 | Yardanico | and nim strings are utf8-encoded |
23:42:21 | ryukoposting | I think this is the 5th time someone has asked that in under 24 hours |
23:42:21 | FromDiscord | <kaderallam> to a binary string not utf8 i am building a protocol encoder |
23:42:33 | Yardanico | it'll work the same won't it? |
23:42:44 | ryukoposting | wgetch, how obtuse of an answer do you want |
23:42:56 | wgetch | lol |
23:43:03 | Yardanico | nim strings are just bytes, they don't HAVE to be utf8-correct |
23:43:05 | wgetch | well give me a second, need to parse the situation |
23:43:08 | leorize | @kaderallam: I'd recommend working with seq[byte] or openArray[byte] for working with binary protocols |
23:43:15 | ryukoposting | we're golfing our way from pretty one liners all the way to the nastiest super-optimized stuff you'll ever see |
23:43:23 | wgetch | I'm using binaryparse.nim, but the strings are not NUL terminated |
23:43:33 | wgetch | so I can't use the parser's string type |
23:43:37 | FromDiscord | <kaderallam> thanks @leorize will look into it |
23:43:42 | wgetch | instead, I just ask for an array of u8's |
23:43:50 | ryukoposting | clever |
23:44:06 | * | krux02_ joined #nim |
23:44:26 | wgetch | but now I am not sure how to convert to string. looked at unicode module but nothing is standing out |
23:44:41 | leorize | you got a seq[uint8]? |
23:44:46 | wgetch | yep! |
23:44:54 | ryukoposting | (testing whether my GC_refs are keeping the audio engine from exploding is awful. I'm sitting here listening to the same 2:30 WAV on repeat) |
23:45:03 | leorize | wgetch: are you new to Nim? |
23:45:12 | wgetch | very new! |
23:45:50 | ryukoposting | wgetch: yourseq.mapIt(char it).join is the way I like to do it if lightning-fast performance isn't a concern |
23:46:29 | ryukoposting | it's slow, but easy to read |
23:46:47 | * | krux02 quit (Ping timeout: 260 seconds) |
23:46:50 | leorize | wgetch: https://play.nim-lang.org/#ix=2gMV |
23:46:58 | ryukoposting | (update: the wav is on its 4th loop. I am slowly losing my mind but I think I finally put GC_refs in all the right spots) |
23:47:11 | leorize | you can also turn this into a nice proc for usage :) |
23:47:22 | Yardanico | yeah, and that's already efficient :) |
23:47:37 | wgetch | legit, thank you! |
23:48:11 | * | cjb joined #nim |
23:48:14 | leorize | this is the kind of operations that we might want in the stdlib :P |
23:48:44 | ryukoposting | those who play video games: how much RAM is an acceptable amount of RAM for a game to use |
23:50:03 | leorize | if AAA, I'd expect 8gb |
23:50:11 | ryukoposting | this is a visual novel |
23:50:13 | FromDiscord | <Rika> as much ram as i have free 😛 |
23:50:13 | leorize | if not, 500meg is my limit :P |
23:50:29 | wgetch | so far I am liking how nim handles unicode strings. kinda surprised that mapIt(char it) works so well :P |
23:50:29 | ryukoposting | well, it's idling at 800 right now |
23:50:49 | FromDiscord | <Rika> 800 sounds pretty chonky for a vn |
23:50:53 | ryukoposting | granted, that's with asinine caching systems that I was going to replace later anyway |
23:51:28 | ryukoposting | It loads every image it can ASAP then keeps them there forever lmao |
23:51:53 | leorize | wgetch: our strings don't care about encoding |
23:51:57 | leorize | we aren't python :P |
23:52:04 | FromDiscord | <Rika> nor rust |
23:52:15 | FromDiscord | <Rika> afaik rust requires valid utf8 too 😛 |
23:52:41 | ryukoposting | this week on "encoding-agnostic strings: convenient or harmful?" |
23:53:01 | FromDiscord | <Rika> convenient, dont see how its harmful |
23:53:07 | leorize | add "by default" into the thing |
23:53:13 | leorize | then you'll get a proper answer :P |
23:53:41 | ryukoposting | I refuse to acknowledge the existence of UTF-16 |
23:53:55 | FromDiscord | <Rika> well, thats fine |
23:54:10 | FromDiscord | <Rika> you must acknowledge shiftjis though : ) ) ) ) ) |
23:54:17 | wgetch | its all fun and games until your database has screwed up by 8 different encodings used at one time or another |
23:54:18 | FromDiscord | <Rika> *sobs* |
23:54:30 | ryukoposting | : ) ) ) ) ) is what UTF-16 nerds' smiley faces look like |
23:54:35 | FromDiscord | <Rika> hey if you do that then thats your fault lmao |
23:54:40 | ryukoposting | they think they're :)))), they're wrong |
23:55:23 | ryukoposting | It's all fun and games until powershell's print-to-file directive "helps" by converting everything passing through it to UTF-16 |
23:55:35 | FromDiscord | <clyybber> hahaha |
23:55:47 | * | Jesin quit (Quit: Leaving) |
23:56:11 | wgetch | or its the fault of the developer who thought "I really need emojis, lets just change this column to SQL_ASCII" |
23:56:12 | ryukoposting | that actually happened, wasted so many hours trying to figure out why stuff I was sending to a mac using a ps script was getting corrupted |
23:56:43 | wgetch | and also yeah, can confirm about powershell |
23:57:12 | wgetch | like if you do that uh, -encodedCommand thing |
23:57:20 | wgetch | it expects base64 encoded UTF16 iirc |
23:58:46 | wgetch | with powershell, encoding is kinda like USB. doesnt fit one way, you turn it upside down, still doesnt fit. |
23:58:57 | leorize[m] | is there anything on windows that is not expecting utf-16? :p |
23:59:50 | ryukoposting | UTF-16 is microsoft's "standard" |