00:15:20 | * | shota joined #nim |
00:20:58 | * | matlock joined #nim |
00:21:49 | matlock | I wanted to mention that Snap packages of Nim are now available in stable, LTS 1.0.x, and nightly flavors. Testing is greatly appreciated. https://github.com/sirredbeard/nim_lang_snap |
00:46:50 | * | adeohluwa left #nim (#nim) |
00:46:58 | * | adeohluwa joined #nim |
00:47:00 | * | adeohluwa quit (Remote host closed the connection) |
00:51:15 | FromDiscord | <has1> How do you deal with concurrency in nim? I am used to go and channels |
00:51:19 | FromDiscord | <has1> I found this |
00:51:28 | FromDiscord | <has1> https://nim-lang.org/docs/channels.html |
00:52:12 | FromDiscord | <has1> But it tells me "Note: This is part of the system module. Do not import it directly. To activate thread support compile with the --threads:on command line switch." |
00:52:12 | FromDiscord | <has1> |
00:52:12 | FromDiscord | <has1> So are we not supposed to use this? |
00:52:39 | FromDiscord | <has1> Also having to explicitly enable threads via the argument seems pretty strange |
00:55:35 | disruptek | this is the current recommendation for threading: https://github.com/yglukhov/threadpools |
00:56:25 | disruptek | what you'll find with nim is that it's not really about what's impossible to do by default; it's more about what's possible to do, full stop. |
00:57:15 | disruptek | by opting into features like this, you get a better result across all scenarios. |
01:02:16 | * | jmiven joined #nim |
01:04:08 | FromDiscord | <romulo27> Hello, I am very new to nim but I got the grasp (kinda) on how to use it, but I have been having a bit of issue when attempting to use the --path command |
01:04:22 | FromDiscord | <romulo27> It gives me a "command missing" error and I have no idea what that means |
01:10:39 | * | ng0_ joined #nim |
01:10:55 | owl_000 | `proc walkTo(pointA:Coordination, pointB= (0,0))` how to know if pointB is not given by user. |
01:13:16 | * | ng0 quit (Ping timeout: 260 seconds) |
01:13:18 | owl_000 | inside the proc there is a mechanism to auto generate pointB using other value inside `coordination` type |
01:14:02 | owl_000 | but if pointB is given then it will use directly that value. so how to know pointB is given. |
01:22:45 | leorize | @has1: in Nim we use async for concurrency instead |
01:23:33 | leorize | @romulo27: what exactly are you trying to do? |
01:23:51 | leorize | owl_000: you can't |
01:24:04 | leorize | the only way is to have an overload without `pointB` |
01:24:53 | FromDiscord | <romulo27> >leorize I am tying to install NiGui, and I am literally not doing anything wrong |
01:25:02 | FromDiscord | <romulo27> all I am doing is literally use the path command |
01:25:12 | FromDiscord | <romulo27> which is imagine is nim --path:<pathhere> |
01:25:35 | owl_000 | https://play.nim-lang.org/#ix=1WNP i made like this |
01:25:49 | FromDiscord | <romulo27> at least I think I am doing it right? |
01:25:57 | leorize | @romulo27 if you've installed it via nimble, you wouldn't have to pass `--path` |
01:26:53 | leorize | can I have the full output of Nim when you run it like so? |
01:27:13 | FromDiscord | <romulo27> sure |
01:27:26 | FromDiscord | <romulo27> but if that changes anything I am currently on windows, might wanna specify this beforehand |
01:29:10 | FromDiscord | <romulo27> Hint: used config file 'C:\Users\Romulo\.nimble\config\nim.cfg' [Conf] |
01:29:10 | FromDiscord | <romulo27> Error: command missing |
01:29:18 | FromDiscord | <romulo27> that is all that is outputted |
01:30:32 | Jjp137 | --path is an option, and you need to specify something like the "compile" (or c) command before any options, such as: nim c --path:blah hello.nim |
01:30:49 | Jjp137 | you can see this if you do: nim --help |
01:31:03 | FromDiscord | <SodaScripter> Is the nim basics tutorial good |
01:31:14 | FromDiscord | <SodaScripter> I've been using it but I wanna know if there's something better out there |
01:31:15 | FromDiscord | <romulo27> but I did specify something |
01:31:37 | FromDiscord | <romulo27> I specified the src folder path like I was told to in the github page for nigui |
01:31:53 | FromDiscord | <SodaScripter> 🤔 |
01:32:09 | * | shota quit (Remote host closed the connection) |
01:32:15 | FromDiscord | <SodaScripter> I'm new to nim too, so I cant really help here ._. |
01:32:18 | FromDiscord | <SodaScripter> I'm new to nim too, so I cant really help here. ._. |
01:32:19 | Jjp137 | you're missing the "c" between nim and --path |
01:32:37 | FromDiscord | <SodaScripter> try @romulo27 nim c --path <ur stuff here> |
01:32:46 | leorize | owl_000: try this instead https://play.nim-lang.org/#ix=1WNS |
01:32:57 | FromDiscord | <romulo27> I am not trying to compile something |
01:33:10 | FromDiscord | <SodaScripter> wut r u trying to do then |
01:33:12 | leorize | --path can only be used while compiling... |
01:33:15 | * | dwdv quit (Ping timeout: 240 seconds) |
01:33:15 | FromDiscord | <romulo27> install nigui |
01:33:22 | FromDiscord | <SodaScripter> nigui is a library iirc |
01:33:25 | leorize | use `nimble install nigui` |
01:33:26 | FromDiscord | <romulo27> I am confused then |
01:33:30 | Jjp137 | oh you should probably install it--yeah with nimble |
01:33:31 | FromDiscord | <SodaScripter> u gotta use nimble |
01:33:37 | Jjp137 | nimble is Nim's package manager |
01:33:41 | FromDiscord | <SodaScripter> nimble install nigui |
01:33:42 | FromGitter | <zetashift> SodaScripter, Nim Basics is a great start! The main tutorials are better if you already know a programming language |
01:33:48 | Jjp137 | I'm guessing you're trying to follow the manual install instructions instead? |
01:33:53 | Jjp137 | for NiGui? |
01:33:53 | FromDiscord | <romulo27> ok I thought nimble was a linux thing only |
01:34:03 | Jjp137 | oh no it isn't |
01:34:04 | FromDiscord | <romulo27> yes |
01:34:16 | FromDiscord | <SodaScripter> @zetashift I've barely programed with umm other languages but I come from a python, javascript and basic background |
01:34:29 | FromDiscord | <SodaScripter> a bit of C in the mix aswell |
01:34:45 | FromDiscord | <romulo27> ok I will try the nimble way of installing nigui |
01:34:50 | FromDiscord | <SodaScripter> never made anything really cool yet |
01:34:59 | FromDiscord | <SodaScripter> nim seems like the first language I might be able to make stuff with |
01:35:11 | owl_000 | leorize thanks |
01:35:40 | FromDiscord | <SodaScripter> is nvim slow for anyone else or is it just me |
01:35:46 | FromDiscord | <SodaScripter> like compared to just vim |
01:35:50 | leorize | it's just you :) |
01:35:52 | FromDiscord | <SodaScripter> ah |
01:35:56 | FromDiscord | <romulo27> oh right I need git |
01:36:01 | FromDiscord | <romulo27> greeaaaat |
01:36:03 | FromDiscord | <SodaScripter> b r u h |
01:36:07 | FromDiscord | <SodaScripter> how do you not have git |
01:36:29 | FromDiscord | <romulo27> I am from the scripting language universe |
01:36:32 | Jjp137 | well...there's always hg :p or svn, or cvs... |
01:36:35 | FromDiscord | <SodaScripter> Git is the best invention ever made |
01:36:44 | FromDiscord | <romulo27> also known as we already did everything to you so just throw text on screen and see stuff happen |
01:36:48 | * | shota joined #nim |
01:36:56 | FromDiscord | <SodaScripter> what the actual hell |
01:37:06 | FromDiscord | <SodaScripter> my battery indicator just started dying all of the sudden |
01:37:55 | FromDiscord | <SodaScripter> it aint workin lole |
01:37:56 | FromDiscord | <SodaScripter> oh I see |
01:37:56 | FromDiscord | <SodaScripter> this is why you don't combine 2004 GTK themes with 2019 ones |
01:38:21 | FromDiscord | <romulo27> ok I did a filename to test |
01:38:33 | FromDiscord | <romulo27> and even with the path for a actual .nim file the path command asks for a file |
01:38:52 | leorize | @romulo27 uhmm, what exactly are you doing? |
01:38:55 | FromDiscord | <SodaScripter> can you show me your command |
01:38:58 | FromDiscord | <SodaScripter> like what you just typed |
01:38:59 | leorize | can we have the command + output? |
01:39:09 | FromDiscord | <romulo27> going back to the manual way of installing nigui |
01:39:13 | FromDiscord | <romulo27> I am not getting git |
01:39:18 | FromDiscord | <SodaScripter> why not |
01:39:36 | FromDiscord | <romulo27> I don't need another thing to break in the path variable chaos that windows 8 likes to do like nim did 2 hours ago |
01:39:46 | FromDiscord | <SodaScripter> it's literally just you click the exe and go through the wizard |
01:39:56 | FromDiscord | <SodaScripter> https://git-scm.com/download/win |
01:39:59 | * | endragor joined #nim |
01:40:07 | FromDiscord | <romulo27> and so is a lot of the stuff that creates a entry in the path variable list |
01:40:17 | FromDiscord | <romulo27> yet windows 8 finds a way to break every single time |
01:40:27 | FromDiscord | <SodaScripter> it's not just gonna b r e a k for no reason |
01:40:38 | FromDiscord | <SodaScripter> it's better to have tried than not tried at all |
01:41:02 | FromDiscord | <romulo27> I am using one of the very first windows 8 builds because microsoft decided I should not have windows 8.1 |
01:41:11 | FromDiscord | <romulo27> like every human being that has 8 |
01:41:19 | leorize | it shouldn't break |
01:41:48 | leorize | well, here's the "alternative" way to install |
01:41:56 | leorize | download NiGui as a zip file from github |
01:42:01 | leorize | unzip it |
01:42:06 | leorize | open a command prompt in the folder |
01:42:10 | leorize | type `nimble install` |
01:42:54 | FromDiscord | <romulo27> ok thank you |
01:42:59 | leorize | if you're on windows you might want to use wNim instead |
01:43:02 | leorize | it supports more widgets |
01:43:22 | FromDiscord | <SodaScripter> I thought everyone used NiGui? |
01:43:28 | FromDiscord | <romulo27> greeeeeaaaaaaaaat |
01:43:30 | sealmove | guys, can testament be used outside of Nim project? |
01:43:31 | FromDiscord | <SodaScripter> man nim really has changed since I last used it haha |
01:44:06 | leorize | nigui has never reached popularity in Nim :P |
01:44:07 | FromDiscord | <romulo27> I see why people started going for electron |
01:44:21 | FromDiscord | <romulo27> no offense, native software is great, but all that library jazz is painful |
01:44:59 | leorize | if you don't want anyone to touch your PATH, then it will always be painful |
01:45:13 | leorize | also you need to read the docs |
01:45:35 | leorize | sealmove: yea, IIRC @mratsim is using it for his arraymancer |
01:46:00 | sealmove | great |
01:46:45 | FromDiscord | <has1> @disruptek this thing doesn't even have a readme though?? |
01:47:00 | * | BonusSoda joined #nim |
01:47:02 | leorize | @has1 threadpool is for parallelism |
01:47:03 | BonusSoda | Hello me |
01:47:06 | FromDiscord | <SodaScripter> hi me |
01:47:16 | leorize | for concurrency we use asyncdispatch |
01:48:04 | BonusSoda | bye me |
01:48:05 | FromDiscord | <SodaScripter> bye |
01:48:06 | * | BonusSoda quit (Client Quit) |
01:49:01 | FromDiscord | <has1> This is one of those concepts that's hard to grasp |
01:50:03 | disruptek | there are a number of different storylines surrounding concurrency in nim, and none of them are without compromise. |
01:50:12 | disruptek | it all depends on what you're trying to accomplish. |
01:50:19 | FromDiscord | <has1> The way I understand it, you want to use concurrency to split your workload into multiple takes |
01:50:35 | leorize | ah, that's parallelism |
01:50:51 | FromDiscord | <has1> So for example you might have 3 tasks that you want to execute |
01:50:59 | disruptek | i almost never use threads, but that's because almost everything i do is serverless (single-core). |
01:51:18 | leorize | serverless just got a new definition thanks to a startup :P |
01:51:46 | FromDiscord | <has1> go do1() |
01:51:47 | FromDiscord | <has1> go do2() |
01:51:47 | FromDiscord | <has1> go do3() |
01:51:47 | FromDiscord | <has1> |
01:51:47 | FromDiscord | <has1> Now in Golang you might only have 1 CPU core so those 3 tasks run sequentially after each other |
01:52:07 | FromDiscord | <has1> But if you have 3 cores then those tasks can run in parallel |
01:52:10 | disruptek | all depends on what `task` means. if it's i/o, you probably want async. if it's an os process, you probably want threads. concurrency in nim doesn't have the oomph of go's channels. |
01:52:30 | leorize | @has1 download that threadpool library |
01:52:39 | leorize | then run nim doc threadpool_simple.nim |
01:52:58 | FromDiscord | <has1> But I don't care about parallelism, I just want to do things like in go |
01:53:15 | disruptek | well, you can use go for that. |
01:53:15 | FromDiscord | <has1> So that it's handled for me automatically |
01:53:40 | leorize | threadpool is kinda similar |
01:53:45 | FromDiscord | <has1> That's such a weak argument |
01:53:51 | disruptek | if you don't care about parallelism, then there's nothing to talk about. |
01:53:52 | leorize | I've actually done several example in go tutorial in threadpool |
01:54:11 | FromDiscord | <has1> I don't like X about language y, so let's throw out the entire language? |
01:54:47 | FromDiscord | <has1> @disruptek I care about concurrency |
01:54:58 | leorize | well go have this kind of automated 'concurrency/parallelism' |
01:55:19 | disruptek | i'm just quoting you. |
01:55:22 | leorize | which is really good when you write application code since you won't care what kind is being used |
01:55:26 | FromDiscord | <has1> How can I care about parallelism? How do you even know if your app runs on a server with more than 1 core? |
01:55:42 | disruptek | how do i know what hardware my code runs on? |
01:55:42 | leorize | but in Nim these are separated concepts |
01:56:08 | leorize | "systems language" quirks :P |
01:56:29 | leorize | anyhow, for your use case, which is computational, parallelism is what you're looking for |
01:56:36 | leorize | try threadpools |
01:57:20 | FromDiscord | <has1> All the articles I read tell me that the way go handles things is much more efficient than Java style thread pools |
01:57:39 | leorize | it depends |
01:58:01 | FromDiscord | <has1> And how do I know the size of the thread pool? |
01:58:02 | leorize | you can do benchmarks if you'd like :) |
01:58:03 | disruptek | i'm sorry that nim doesn't have an analogue to go's channels, but i'm not going to pretend that it does, just like i'm not going to pretend that there aren't lots of different ways to handle concurrency in nim, each with their own strengths. |
01:58:30 | leorize | @has1 by default it's the number of cpu cores |
01:58:54 | FromDiscord | <has1> I read somewhere it's 256 |
01:59:06 | FromDiscord | <has1> Maybe that was something different though |
01:59:58 | FromDiscord | <has1> But why can't it implement the concurrency thing that go did does? Is it because the go solution has disadvantages? |
02:00:03 | disruptek | are you not able to run the go toolchain? |
02:00:16 | FromDiscord | <has1> Or because it is too hard to implement in nim? |
02:00:21 | disruptek | golib is ported to nim, if you'd like to try that. |
02:00:21 | leorize | disruptek: these are legitimate questions, really... |
02:00:41 | leorize | @has1: it's just no one has looked into it |
02:00:43 | disruptek | go's solution is indemic to the entire language. |
02:01:17 | disruptek | it's baked into everything and everywhere, the stdlib, all the i/o, everything. |
02:01:17 | leorize | from what I know, go-style concurrency muddles the line between async and threads |
02:01:29 | disruptek | yes. |
02:01:30 | leorize | it's great when you don't care about what to use |
02:01:44 | leorize | but it's terrible and full of surprises when you actually care |
02:02:34 | FromDiscord | <has1> Can you elaborate? |
02:03:00 | FromDiscord | <has1> Can you give me an example where you would "care"? |
02:06:52 | disruptek | care about what? |
02:07:06 | disruptek | when you sit down to write software, you usually have goals in mind. |
02:07:16 | disruptek | maybe one of those goals is to not think about parallelism. |
02:07:26 | disruptek | maybe one of those goals is memory consumption. |
02:07:35 | disruptek | maybe one of those goals is speed. |
02:07:45 | leorize | https://blog.container-solutions.com/surprise-golang-thread-scheduling |
02:07:49 | disruptek | everything is a trade-off. you don't get go's channels for free. |
02:08:01 | disruptek | with nim, you get to choose your trade-offs. |
02:08:59 | FromDiscord | <has1> Can you give me an example where go channels would be a bad solution? |
02:09:14 | FromDiscord | <has1> And tell me which nim solution would make more sense? |
02:09:47 | leorize | well you can use our Channel... |
02:09:51 | leorize | it's kinda the same |
02:10:21 | disruptek | i'm not really familiar with go, unfortunately. i only wrote a few thousand lines years ago. |
02:11:22 | leorize | I don't write go so I don't really know |
02:11:39 | * | owl_000 quit (Ping timeout: 240 seconds) |
02:12:22 | disruptek | i know it tends to be unwieldy at the high end. in terms of overhead, i mean. |
02:13:12 | leorize | @has1 hmm, each kind of concurrency/parallelism has their quirks and perks |
02:13:41 | leorize | it really depends on what you want to do |
02:13:55 | disruptek | i can tell you why i didn't stick with go, and it wasn't due to channels. |
02:14:25 | disruptek | just like the fact that i didn't choose nim for what came in the box. |
02:15:20 | FromDiscord | <has1> I didn't start out with c or C++, so concurrency and parallelism are new concepts for me and they seem to be connected but not the same, it's just hard to understand for me |
02:16:04 | leorize | so... what's your use case? |
02:17:44 | FromDiscord | <has1> I'll give an example, if I have 1 million numbers that I want to add together, I would just split the numbers into 100k each, call "go" to run them in their own goroutine and then sum the results together. Now this code scales very well because it runs well on a cpu with 1 core and it runs well on a cpu with 10 cores |
02:18:24 | FromDiscord | <has1> Next example, I have a web server. Once a request comes in I handle it in its own goroutine. This scales very well too |
02:18:45 | FromDiscord | <has1> Go can handle many thousands of requests and it's really fast |
02:21:25 | disruptek | well, there are libs you can use for your computation challenge. you don't really need anything special for i/o. |
02:22:08 | FromDiscord | <has1> so someone on here linked me to this https://github.com/yglukhov/threadpools |
02:22:08 | FromDiscord | <has1> But there doesn't seem to be any documentation for this, but there is also |
02:22:08 | FromDiscord | <has1> https://nim-lang.org/docs/threadpool.html |
02:22:24 | FromDiscord | <has1> From the nim stdlib |
02:22:24 | leorize | that one is kinda... broken |
02:22:38 | leorize | yglukhov's threadpool was meant to be the replacement |
02:23:10 | FromDiscord | <has1> but there is also |
02:23:10 | FromDiscord | <has1> https://nim-lang.org/docs/channels.html |
02:23:25 | FromDiscord | <has1> Which tells me to not "import it directly" |
02:23:50 | FromDiscord | <has1> And I also saw something about async procs and multisync |
02:24:28 | leorize | channels is a part of system |
02:24:40 | FromDiscord | <DeltaPHC> That message to not import it directly just means it's already imported. Because system is already imported |
02:24:40 | leorize | compile with --threads:on and you'll have it automatically |
02:25:13 | FromDiscord | <has1> Ahh, so that's what that means |
02:28:15 | disruptek | you can run `nim doc somefile.nim` to generate documentation for `somefile` module. |
02:28:45 | FromDiscord | <has1> I see |
02:30:33 | FromDiscord | <has1> But the channel thing doesn't solve the goroutine example for me. It seems like I want something like fibers (green threads?) That are lightweight will this threadpool library do this for me? |
02:30:47 | leorize | procs that are launched with threadpool can have their return value captured |
02:30:47 | * | laaron joined #nim |
02:30:54 | leorize | so you might not need channels as much as in go |
02:31:09 | disruptek | https://nim-lang.github.io/Nim/coro.html |
02:32:15 | FromDiscord | <has1> Wait but what's this now? |
02:32:27 | FromDiscord | <has1> What's the difference between coroutines and a thread pool? |
02:32:56 | disruptek | coroutines are lightweight pseudothreads. threads are os-level threads. |
02:34:01 | disruptek | libev was wrapped recently, too, so you could build something with that if you wanted that event-based interface. |
02:34:38 | FromDiscord | <has1> But don't coroutines actually run on os threads? |
02:35:17 | leorize | nope, it uses the same mechanism as go routines |
02:35:39 | FromDiscord | <has1> But goroutines run on an os thread though |
02:35:45 | leorize | but it's not really well maintained as no one use it |
02:35:47 | disruptek | they can. |
02:36:19 | disruptek | listen, i'm not gonna lie: go has the best implementation of goroutines. |
02:36:26 | leorize | goroutines is this mess of schrödinger thread :P |
02:36:31 | disruptek | if that's what you want, you can download it from golang.org. |
02:36:37 | leorize | on a good day it's actual OS thread |
02:36:50 | leorize | but it can also be green thread |
02:36:56 | leorize | no one knows |
02:37:35 | FromDiscord | <DeltaPHC> Goroutines multiplex themselves onto available cores. Each core might have more than one goroutine running |
02:37:43 | FromDiscord | <has1> https://rakyll.org/scheduler/ |
02:38:05 | FromDiscord | <has1> I'm coming from go and checking out nim |
02:38:14 | FromDiscord | <has1> I already use go and have that installed |
02:40:01 | disruptek | again, nim has many options. it all depends on what you're after. |
02:40:42 | disruptek | here's yet another option that some are working on: https://github.com/nim-lang/RFCs/issues/160 |
02:41:07 | disruptek | it sounds like you need to develop your problem before you choose your solution. |
02:41:25 | FromDiscord | <has1> Why would I use a thread pool instead of the goroutine style concurrency in go? |
02:41:47 | FromDiscord | <has1> Why would I use async instead of the way go does it? |
02:42:22 | disruptek | because async is faster and lighter for certain tasks. |
02:42:34 | disruptek | because a thread pool is faster and lighter for certain tasks. |
02:42:42 | leorize | because with threadpool you can always be sure that you own the thread |
02:42:49 | disruptek | because you cannot use goroutines in nim natively, as nim is not go. |
02:43:00 | leorize | with async you skip the pain of threading, and uses native os scheduler instead |
02:44:00 | FromDiscord | <has1> But now I need to declare my function as async right? |
02:44:56 | disruptek | i wouldn't bother. it doesn't sound like you have anything to run concurrently. |
02:47:42 | FromDiscord | <has1> I'm asking about how to deal with concurrency in nim |
02:48:00 | disruptek | well, it feels like trolling. |
02:48:26 | FromDiscord | <has1> That seems to be the problem for me, creating explicit async functions |
02:48:52 | FromDiscord | <has1> Instead of having one newHttpClient() function, now you have |
02:48:54 | FromDiscord | <has1> newAsyncHttpClient |
02:49:39 | disruptek | it's quite a hardship. |
02:49:57 | FromDiscord | <has1> If you do concurrency without the async thing, then you could just run the blocking code with go client.getContent() instead |
02:50:36 | disruptek | good idea. |
02:50:38 | FromDiscord | <has1> And I don't like the fact that you call me a troll for asking about concurrency tbh. |
02:51:12 | FromDiscord | <has1> I think that's a legitimate question. Because it sounds like you now need to have two implementations for sync and async code |
02:51:32 | FromDiscord | <has1> And indeed, the httpclient module seems to have that |
02:52:40 | disruptek | well, i don't like feeling trolled. and i'm not about to engage in a color debate with you. |
02:53:07 | disruptek | good luck with your research. |
02:53:32 | * | dddddd quit (Remote host closed the connection) |
02:53:50 | * | laaron quit (Quit: ZNC 1.7.4 - https://znc.in) |
02:54:18 | FromDiscord | <has1> Also this isn't even about nim specifically, rust and JavaScript seem to do the same thing here. |
02:55:15 | * | laaron joined #nim |
02:57:38 | FromDiscord | <treeform> async gives you Concurrency |
02:57:44 | FromDiscord | <treeform> threadpool gives you Parallelism |
02:58:22 | FromDiscord | <treeform> async gives you Concurrency in that you can hold 1000s connections, but the CPU only works on 1 at a time. |
02:58:58 | FromDiscord | <treeform> threadpool gives you Parallelism, here you can hold 100s of connections but, its slower to witch between them, but each core of your CPU can be doing work. |
02:59:10 | FromDiscord | <treeform> threadpool gives you Parallelism, here you can hold 100s of connections but, its slower to switch between them, but each core of your CPU can be doing work. |
02:59:55 | FromDiscord | <treeform> Parallelism is great for games or compilers where the CPU is doing work like math. |
03:00:10 | FromDiscord | <treeform> Concurrency is great for where you are not doing much CPU work but moving tons of bytes around like in a chat server. |
03:03:01 | FromDiscord | <treeform> Go language has a much better story around Concurrency and Parallelism then nim. |
03:03:10 | FromDiscord | <treeform> But that was the whole point of go to get that right. |
03:04:12 | * | laaron quit (Quit: ZNC 1.7.4 - https://znc.in) |
03:04:52 | * | laaron joined #nim |
03:05:06 | leorize | @has1: I think you should give all concurrency/parallel methods a try |
03:05:28 | leorize | that way you'll have a better idea of how that works outside of go |
03:07:47 | FromDiscord | <Shield> brainfuck censorship was a weird one, but hey, blame it on programmer humor |
03:09:03 | leorize | to be fair that language is still easy enough to write |
03:09:24 | leorize | there are creepier language that deserve that name more :P |
03:15:41 | FromDiscord | <Shield> why is creating explicit async functions is a bad thing? |
03:15:57 | leorize | because goroutines are magical |
03:16:48 | leorize | you call a routine with `go func()` and it just works |
03:17:05 | FromDiscord | <treeform> one one hand explicit async functions do document more what they are about, on the other thing there is more "crap" to write that is not your code. |
03:17:47 | leorize | to be fair, all the crap that powers goroutines are hidden in go's stdlib |
03:17:55 | leorize | not sure if they causes any overhead |
03:19:36 | leorize | goroutines is weird |
03:20:23 | leorize | you expect them to be a thread, but turns out some of your operations can block because they also uses green thread |
03:22:30 | * | shota quit () |
03:22:37 | FromDiscord | <Shield> nothing beats Lua's coroutines imo, but Nim requires as much care as when writing C code, especially when you do concurrency or multithreading, you need to be deliberate about it |
03:23:42 | FromDiscord | <Shield> async functions are already transformed to closures under the hood which helps with the syntax |
03:23:55 | FromDiscord | <Shield> but i don't think there's a magical way to hide everything |
03:24:26 | FromDiscord | <treeform> go routines do have downsides but they do work well |
03:25:05 | FromDiscord | <Shield> i'd like to see some benchmarks |
03:25:11 | FromDiscord | <treeform> what if all nims functions were async --- that is basically what go is |
03:25:31 | FromDiscord | <treeform> every call every standard library is async in go |
03:25:56 | FromDiscord | <Shield> like Araq said, green threads kinda fall appart when saving the stack is slow |
03:26:15 | FromDiscord | <treeform> I actually think its the OS that fails here |
03:26:37 | FromDiscord | <treeform> OS could provide lightweight fast threads |
03:26:57 | FromDiscord | <treeform> then we would just use normal threads for everything |
03:27:23 | FromDiscord | <treeform> but no we have to reimplement them user side |
03:27:46 | FromDiscord | <treeform> its the biggest OS issue I think |
03:27:56 | leorize | isn't the I/O dispatcher an attempt to do so? |
03:28:15 | FromDiscord | <treeform> in linux? |
03:28:37 | leorize | everywhere? |
03:29:11 | leorize | isn't asyncdispatch a kind of green thread backed by the os? |
03:30:08 | FromDiscord | <treeform> yeah it sure is |
03:30:39 | FromDiscord | <treeform> I am just saying OS should have provided lightweight threads as part of its offering... |
03:30:52 | FromDiscord | <treeform> so there would have been no need for go-lang or nim's aysnc |
03:31:03 | FromDiscord | <treeform> so there would have been no need for go-lang or nim's async |
03:31:23 | leorize | lightweight threads is userspace threads afaict |
03:31:37 | FromDiscord | <treeform> lightweight threads could be part of the OS |
03:31:43 | FromDiscord | <treeform> then all OS calls would know how to deal with them |
03:31:46 | FromDiscord | <robohack> This may be a dumb question, but what is the downside to using .async. ? I have been messing around with a hobby project (a Nim MUD Server) that has some async network and file procs. As a result, many other things have ended up being async. Initially I looked at threading also, but that seemed like it would get very complex very quickly (mutexes etc.). Any reason to be sparing with how many procs end up bein asyn? I mean, are there |
03:31:51 | leorize | isn't the point was to avoid syscalls? |
03:33:02 | leorize | in a way "heavy" threads are the same as these "lightweight" threads |
03:33:07 | leorize | the scheduler is in the kernel |
03:33:12 | FromDiscord | <treeform> @robohack, for a MUD server not much. If you start doing like complex simulations like gas propagation or pathfinding + async you might have issues. |
03:33:36 | leorize | and every primitives in the OS understood it |
03:33:40 | FromDiscord | <treeform> Issues in that if you would have written it differently your program might run a bit faster. |
03:33:55 | leorize | if you use the write() syscall, text will never overlap no matter how many threads you use |
03:34:02 | FromDiscord | <treeform> Yeas I think OS threads are great |
03:34:05 | * | rockcavera quit (Remote host closed the connection) |
03:34:31 | FromDiscord | <treeform> Except they are slow to create and they take up a bunch of memory. |
03:35:07 | leorize | that's the cost of syscalls |
03:35:13 | FromDiscord | <treeform> On linux new thread size is about 2mb. |
03:35:20 | leorize | use musl libc |
03:35:27 | leorize | the stack will be 8k |
03:35:44 | leorize | unless you widen them yourself |
03:35:49 | FromDiscord | <treeform> yeah that's what I want |
03:35:59 | FromDiscord | <treeform> 8k threads + easy to make/delete them |
03:36:07 | FromDiscord | <Shield> i hate how the stack is divided between threads |
03:36:28 | FromDiscord | <robohack> My understanding with asynchronous procs, you don'n need to care about data synchronization, since everything is happening on one thread. Is that correct? If you have multiple threads then you have to worry about sharing state between threads, meaning mutexes or similar? |
03:36:38 | leorize | yea |
03:36:55 | FromDiscord | <treeform> @robohack yes and no |
03:37:01 | FromDiscord | <Shield> it's even worse that hyperthreading makes the core share cache too |
03:37:28 | * | laaron quit (Remote host closed the connection) |
03:37:35 | FromDiscord | <treeform> so you can get into race conditions with anything |
03:37:35 | FromDiscord | <treeform> you don't have to care about low level mutexes |
03:37:35 | FromDiscord | <treeform> but the problem they solve also translate into higher level logic stuff |
03:37:35 | FromDiscord | <robohack> Been a while since I've done anything multithreaded, and that was in Java. |
03:37:45 | FromDiscord | <treeform> because it can live in your code not the libraries |
03:37:48 | FromDiscord | <Shield> async multithreading is still in the work |
03:38:28 | leorize | @Shield can you try chronos? |
03:38:49 | leorize | if the leak is in asyncdispatch, then I think chronos should have already solved it somehow? |
03:39:18 | * | laaron joined #nim |
03:39:58 | FromDiscord | <robohack> That was what I was looking for initially. Like a threadpool to handle new connections and process input from client, buy asunchronous file and network ops to not block the threads. @Shield Do you have more info on this? Is there a github issue or something? |
03:40:51 | leorize | https://github.com/nim-lang/Nim/pull/11724 |
03:41:53 | FromDiscord | <robohack> Thanks. |
03:42:01 | FromDiscord | <Shield> i'm not sure |
03:42:15 | FromDiscord | <Shield> will chronos be a part of the stdlib? |
03:42:41 | FromDiscord | <Shield> i was just checking weave for multithreading |
03:43:15 | leorize | nope, but it's useful to know if someone else have already managed to fix async |
03:44:08 | FromGitter | <awr1> does using `break` from a block call dtors |
03:44:40 | leorize | can you even use break from a block |
03:45:08 | FromGitter | <awr1> yes |
03:45:13 | FromDiscord | <Shield> you can break to a named outer block |
03:45:33 | leorize | dtors are only called at the end of a proc |
03:45:44 | FromGitter | <awr1> https://nim-lang.org/docs/manual.html#statements-and-expressions-block-statement |
03:46:18 | FromGitter | <awr1> i mean it is basically `goto` |
03:46:53 | leorize | only works in a loop-in-block though |
03:48:35 | FromDiscord | <robohack> Hmm, that wasn't what I understood from reading that doc, but what do I know. |
03:48:56 | FromDiscord | <robohack> Docs make it dound like labels and goto statements. |
03:49:14 | FromDiscord | <robohack> Docs make it sound like labels and goto statements. |
03:49:49 | FromDiscord | <Shield> sadly there are no goto statements |
03:50:09 | FromDiscord | <robohack> lol |
03:50:55 | FromDiscord | <robohack> I guess breaking out of a block is not the same aas goin t to a labeled block |
03:51:00 | leorize | here is a hack that I hope no one will ever use: https://play.nim-lang.org/#ix=1WPp |
03:59:45 | * | chemist69 quit (Ping timeout: 250 seconds) |
04:01:36 | * | chemist69 joined #nim |
04:06:17 | FromGitter | <awr1> oh god |
04:06:24 | FromGitter | <awr1> i wonder if you could make goto with macros |
04:09:15 | FromDiscord | <DeltaPHC> Not without summoning Chutulu |
04:10:44 | FromDiscord | <robohack> Hah! You can make anything with macros, can't you? I am new to metaprogramming (have done c macros, but that is different). Would macros be a decent way to implement a very basic scripting language (MUD hobby project)? |
04:11:17 | * | theelous3 quit (Ping timeout: 245 seconds) |
04:13:06 | FromDiscord | <robohack> As in read a file from dick, apply macros to translate script to nim code? |
04:13:22 | FromDiscord | <robohack> As in read a file from disk, apply macros to translate script to nim code? |
04:13:44 | FromDiscord | <robohack> As in read a script file from disk, apply macros to translate script to nim code? |
04:13:58 | FromDiscord | <DeltaPHC> The macro itself can read the script file from disk, afaik |
04:14:14 | FromDiscord | <DeltaPHC> And then generate the Nim syntax tree from it |
04:15:26 | FromDiscord | <DeltaPHC> (feel free to correct me if I'm wrong) |
04:17:50 | FromDiscord | <Shield> quick question, what does "static[int]" mean? |
04:19:33 | FromDiscord | <DeltaPHC> https://nim-lang.org/docs/manual.html#special-types-static-t |
04:20:03 | FromDiscord | <DeltaPHC> Basically a type that must be a constant expression. Where the value is known to the compiler |
04:28:24 | FromDiscord | <Shield> oh wow, it generates a new function per static argument |
04:28:43 | FromDiscord | <Shield> that will be certainly useful |
04:29:27 | * | laaron quit (Remote host closed the connection) |
04:29:45 | * | laaron joined #nim |
04:32:20 | sealmove | is it possible to turn-off type-checking for 1 line of code? |
04:33:51 | sealmove | I want to do `let x = if root == nil: result else: x` and I know that when `root == nil` then result definitely has the same type as x, but compiler doesn't know this. |
04:43:11 | leorize | you can't |
04:43:17 | leorize | can I have the full code? |
04:43:22 | leorize | it's kinda hard to imagine the use case |
04:46:40 | leorize | sealmove: I'd say fix the else branch |
04:46:58 | leorize | you can't have `else: x` when `x` is not defined yet |
04:47:10 | leorize | use `default(typeof result)` instead |
04:47:28 | leorize | or just bypass with `cast` |
04:47:51 | leorize | but if you have the code I can probably think of a better way |
04:50:00 | sealmove | well, let me show an example |
04:50:10 | sealmove | https://termbin.com/ujvi |
04:51:00 | * | LargeEpsilon joined #nim |
04:51:54 | sealmove | sorry, https://termbin.com/g76t |
04:51:54 | * | nsf joined #nim |
04:53:44 | sealmove | https://termbin.com/z1e7 |
04:54:19 | sealmove | yes, my current solution is cast, but it's ugly |
04:56:18 | sealmove | I think it's hard to explain actually... this code is auto-generated, so this pattern is convenient. Out of context this code seems stupid. |
05:09:51 | * | cornfeedhobo quit (Quit: ZNC - https://znc.in) |
05:15:42 | leorize | it looks to me that you're trying to re-invent inheritance |
05:16:22 | leorize | and/or object variant |
05:19:13 | sealmove | I try to avoid inheritance for the sake of speed, since the code is autogenerated |
05:20:23 | * | cornfeedhobo joined #nim |
05:21:39 | * | Vladar joined #nim |
05:23:08 | * | laaron quit (Quit: ZNC 1.7.4 - https://znc.in) |
05:27:54 | * | laaron joined #nim |
05:28:16 | * | owl_000 joined #nim |
05:31:21 | * | laaron quit (Client Quit) |
05:32:03 | * | gangstacat joined #nim |
05:39:19 | * | narimiran joined #nim |
05:41:37 | * | LargeEpsilon quit (Ping timeout: 240 seconds) |
05:58:03 | * | LargeEpsilon joined #nim |
05:59:16 | * | LargeEpsilon_ joined #nim |
06:03:22 | * | LargeEpsilon quit (Ping timeout: 265 seconds) |
06:03:48 | * | laaron joined #nim |
06:05:00 | * | laaron quit (Client Quit) |
06:07:10 | * | solitudesf joined #nim |
06:09:53 | leorize | sealmove: `cast` it is then |
06:10:13 | leorize | but what kind of code are you generating? |
06:11:06 | leorize | have you measured any meaningful overhead from inheritance? |
06:26:00 | * | PMunch joined #nim |
06:29:46 | * | laaron joined #nim |
06:30:27 | * | laaron quit (Client Quit) |
06:31:04 | FromDiscord | <Shield> is there a way to do this in Nim? https://youtu.be/ZHqFrNyLlpA?t=1512 |
06:32:11 | FromDiscord | <Shield> basically instead of having to type foo.bar.field you just type foo.field |
06:34:17 | * | Mister_Magister joined #nim |
06:35:28 | lqdev[m] | proc field*(foo: Foo): int = foo.bar.field |
06:38:23 | PMunch | I guess you could possibly create a macro to make those fields available in the current scope.. |
06:41:49 | Zevv | oi lqdev[m], fixed your generics yet? |
06:42:05 | Zevv | scrollback is too large to read up |
06:43:04 | PMunch | Shield, for the using on a parameter there was a pragma "this: self" that did something similar |
06:43:38 | FromDiscord | <Shield> yeah that's what i'm thinking, what's the priority for field/proc/template if they have the same name? |
06:43:43 | lqdev[m] | Zevv: nope, I'm at school now. |
06:43:50 | FromDiscord | <Shield> and you use the command call |
06:44:02 | lqdev[m] | it'll have to wait until afternoon |
06:44:04 | Zevv | lqdev[m]: ok! |
06:44:40 | Zevv | shield: cant watch your vid so not sure if this apply, but check the "with" nimble macro, that might help you out maybe |
06:45:18 | Zevv | s/apply/applies/, |
06:46:41 | PMunch | Zevv, link to that macro? |
06:47:02 | Zevv | https://github.com/zevv/with |
06:47:45 | PMunch | Ah yes, that is pretty much exactly what he wanted I think |
06:49:23 | leorize | @Shield: field have the highest priority |
06:49:30 | leorize | proc/template have equal priority |
06:49:39 | leorize | meaning: they will conflict |
06:51:25 | FromDiscord | <Shield> oh nice, now if only you can put multiple 'with' at the start of a function without having to make a new block per use |
06:53:33 | PMunch | Shield, you can pass a tuple of things |
06:54:06 | PMunch | https://github.com/zevv/with/blob/master/tests/tests.nim#L53-L61 |
06:54:42 | FromDiscord | <Shield> i missed that, thanks |
06:55:00 | PMunch | No problem |
06:55:19 | PMunch | Note that it works by rewriting the body though, so you can't move your logic to a template |
06:55:50 | leorize | you can |
06:55:56 | leorize | just make sure it's hygenic |
06:56:48 | PMunch | http://ix.io/1WQr/Nim I meant something like this |
06:57:15 | PMunch | Might not be that relevant for this macro, but just something I noticed with how Jester used to do `resp` |
06:57:40 | Zevv | hm should it also take a vararg instead of a tuple? |
06:58:02 | PMunch | Zevv, can you do varargs and then a block? |
06:58:28 | PMunch | Or do you mean take varargs[typed] and just assume the last element is the block? |
06:59:14 | PMunch | With Jester I set up a template that checked some DB stuff and did a "resp" with an error, but that failed since the resp didn't get rewritten |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:00:01 | Zevv | PMunch: nah, indeed, that will not work, there's a reason there's a tuple there of course |
07:03:04 | PMunch | Well the varargs[typed] and assume the last is a block should work shouldn't it? |
07:04:30 | leorize | `typed` would make the last typechecked before it got passed to the macro, no? |
07:05:38 | FromDiscord | <Kiloneie> Wau, quite a few views from just late night to early morning to my video, this is good ^^ |
07:07:35 | * | Kameleon joined #nim |
07:09:48 | PMunch | Kiloneie, link? |
07:10:12 | PMunch | Zevv, Shield, leorize: http://ix.io/1WQz/Nim |
07:10:31 | FromDiscord | <Kiloneie> one second |
07:10:46 | FromDiscord | <Kiloneie> https://youtu.be/5tVIsDYPClA |
07:11:03 | PMunch | That super simple macro just creates templates that will expand to the correct field access. This approach makes it possible to use templates within the with statement :) |
07:11:36 | PMunch | (That is similar to how Jester solved the issue IIRC) |
07:15:53 | * | laaron joined #nim |
07:19:49 | FromDiscord | <Shield> does it create templates and call the body within a new block? |
07:20:36 | PMunch | Yeah, pretty much |
07:21:04 | PMunch | From --expandMacro:with http://ix.io/1WQE/Nim |
07:21:36 | PMunch | Oh, that expanded it one step further :P |
07:22:08 | PMunch | Here is from echo result.repr right before the macro returns: http://ix.io/1WQF/Nim |
07:23:10 | leorize | you have successfully rendered Zevv's with obsolete :p |
07:23:50 | PMunch | Not quite :P Mine doesn't take tuples, and it doesn't take multiple arguments :) |
07:23:58 | PMunch | Those are both easy to fix though.. |
07:24:17 | Zevv | oh tell me, how did he dod that? |
07:26:56 | FromDiscord | <Shield> yeah, taking multiple arguments and emitting an error when name conflict happens would be nice |
07:29:03 | PMunch | Well, I kinda prefer it to just shadow the outer variable |
07:35:48 | Zevv | oh wait you're inserting templates? |
07:35:55 | * | asymptotically joined #nim |
07:36:15 | * | Vladar quit (Remote host closed the connection) |
07:36:28 | PMunch | Yup |
07:36:29 | Zevv | have you no shame |
07:36:37 | * | Vladar joined #nim |
07:36:40 | PMunch | Haha, it means Nim will do all the heavy lifting :) |
07:36:57 | Zevv | makes perfect sense, me gusta |
07:39:04 | Zevv | so, you're publishing pmunch/with, or do I recieve a PR with a rewrite? :) |
07:39:10 | * | ng0_ is now known as ng0 |
07:39:30 | PMunch | Oh, I wasn't thinking of putting it anywhere.. |
07:39:37 | PMunch | But I can make a PR if you like :) |
07:39:52 | Zevv | it's much better like that imho |
07:40:14 | Zevv | although it's always kind of risky, some of the semantics might change still, so it breaks for someone somewhere sometimes |
07:40:28 | Zevv | well, who cares, just let it be as it is then |
07:40:34 | Zevv | if it ain't broooke |
07:40:46 | * | narimiran_ joined #nim |
07:40:50 | PMunch | I will try to send it through your test suite :) |
07:42:03 | * | narimiran quit (Read error: Connection reset by peer) |
07:48:10 | * | laaron quit (Remote host closed the connection) |
07:48:39 | PMunch | Aha, it breaks on the "proc member" test Zevv |
07:49:59 | Zevv | https://i.imgur.com/RG0BS1U.gif |
07:50:51 | PMunch | That is actually one of the features I miss in Nim |
07:51:01 | PMunch | A way to completely transparently make one thing mean another thing |
07:51:14 | Zevv | becasue there is not yet enough confusion in the world already? |
07:52:22 | PMunch | It's like I say with meta-programming, it's a really powerful tool, but in the same way that a chainsaw is a powerful tool you must be careful how you use it |
07:52:59 | PMunch | Much easier to horrible mangle yourself when using a chainsaw than a hand saw, but if I'm chopping trees all day you can bet that's what I'd use |
07:53:11 | * | mpcjanssen joined #nim |
07:53:39 | PMunch | Same with meta-programming, if used carefully it is a great way to get things done. But use it incorrectly and it's easy to really mess things up |
07:53:50 | Zevv | of course |
07:56:15 | mpcjanssen | I am getting an error when trying to install jester using nimble: https://pastebin.com/vzaQGN1a . Am I missing something obvious? I am using nim from homebrew (1.0) |
07:59:54 | asymptotically | mpcjanssen: looks like something is borked with your installation https://github.com/dom96/jester/issues/207 |
08:02:44 | PMunch | mpcjanssen, what is your "nimble --version"? |
08:06:10 | * | navin joined #nim |
08:06:31 | mpcjanssen | nim --version |
08:06:33 | mpcjanssen | Nim Compiler Version 1.0.0 [MacOSX: amd64] |
08:07:18 | PMunch | Yeah but your nimble version |
08:07:23 | mpcjanssen | sorry :) |
08:07:34 | PMunch | No worries :) |
08:07:35 | Araq | also ... due to a "glitch", report the git commit hash |
08:07:46 | mpcjanssen | nimble --version |
08:07:48 | mpcjanssen | nimble v0.11.0 compiled at 2019-09-24 03:04:27 |
08:08:50 | mpcjanssen | git hash: couldn't determine git hash |
08:10:04 | PMunch | That one was for the Nim version |
08:10:39 | mpcjanssen | PMunch: nope, same for nimble |
08:10:48 | FromGitter | <alehander42> hm, it means it couldn't git rev-parse HEAD |
08:10:53 | FromGitter | <alehander42> while building |
08:11:02 | FromGitter | <alehander42> afaik |
08:11:20 | mpcjanssen | if the answer for now is, build nim yourself, that's ok |
08:11:34 | PMunch | I'd just use choosenim |
08:11:58 | PMunch | That way you can easily update, jump between versions, and generally just manage your Nim install better :) |
08:13:06 | mpcjanssen | PMunch: agreed. So I am not missing something obvious. |
08:14:07 | PMunch | Zevv, ooh another cool use of the `with` macro: with result |
08:14:19 | PMunch | Just assign stuff directly to your result variable |
08:14:40 | PMunch | Makes it quite hard to see what you're doing though, but might be practical for initialisers |
08:15:01 | PMunch | Basically those procs that just consist of a long list of result.<somevar> = <someval> |
08:15:56 | FromGitter | <alehander42> i mostly like |
08:16:02 | FromGitter | <alehander42> `update:` |
08:16:06 | FromGitter | <alehander42> or at least thats how i call it |
08:16:13 | FromGitter | <alehander42> when you need to update many fields of the same object |
08:16:16 | FromDiscord | <Shield> btw can you override an object constructor? |
08:16:24 | FromGitter | <alehander42> everything else seems a bit confusing to me |
08:16:44 | FromGitter | <alehander42> Shield object constructors are just functions |
08:16:51 | FromGitter | <alehander42> nothing special about them |
08:16:52 | FromGitter | <alehander42> iirc |
08:17:22 | FromGitter | <alehander42> if you talk about `A(b: ..)` synta |
08:17:25 | FromGitter | <alehander42> then not |
08:18:06 | FromGitter | <alehander42> which is a good question: maybe this can solve some of the "default value/always init with x" stuff |
08:18:54 | navin | Hi, i'm trying to working with encoding of utf strings using punycode module, seems like it is not always giving result as expected. |
08:19:30 | navin | https://play.nim-lang.org/#ix=1WQX if someone can please take a look. |
08:21:17 | FromDiscord | <Shield> it looks like you can't have a function the same name as the type, so Foo(...) doesn't work, so you have to call a custom constructor manually? is there no way to change the default |
08:21:53 | Araq | navin, punycode is old, you're better off with unidecode |
08:22:52 | Araq | Shield: use a constructor proc like everybody does |
08:23:07 | Araq | don't override "construction" |
08:23:30 | * | laaron joined #nim |
08:24:05 | Araq | alehander42: I think the time is ripe for making 'not nil' a reality |
08:25:26 | Araq | ref should not be nilable, 'nil ref T' means it can be 'nil', you need to check for '!= nil' before deref'ing |
08:25:31 | PMunch | Zevv, https://github.com/zevv/with/pull/2 |
08:26:04 | PMunch | Shield, no you can't override the default construction of objects |
08:26:08 | * | laaron quit (Client Quit) |
08:26:42 | Araq | we should use the existing control flow graph for it |
08:26:51 | Zevv | PMunch: passes them all? |
08:27:13 | PMunch | Shield, the normal way to do this is to have a initMyType procedere |
08:27:24 | PMunch | Zevv, yup, and the new test case I added |
08:27:26 | Araq | and instead of errors it'll produce warnings unless you use --strictNilChecks or something, smooth transition |
08:27:52 | Araq | C# managed to pull it off |
08:27:57 | Zevv | PMunch: "Complete rewrite that works without rewriting.". That sounds a bit like Gödels theorem |
08:28:16 | PMunch | Haha, yeah I didn't realise what I had written until I submitted the PR |
08:28:19 | PMunch | :P |
08:28:45 | Zevv | I trust you on this one, I just merge without reviewing! |
08:28:57 | Zevv | "hoepla" |
08:28:58 | PMunch | I of course meant rewriting the body, but the first line of a git commit can't be too long.. |
08:29:08 | PMunch | Oh, just realised that the README is now wrong.. |
08:29:13 | PMunch | Didn't look at that.. |
08:29:37 | Zevv | too late :) |
08:30:33 | FromDiscord | <Shield> lol |
08:31:20 | PMunch | I mean it's still pretty much the same.. |
08:31:37 | PMunch | The nimble version is also still 0.3.0 which isn't great.. |
08:32:58 | Zevv | Yeah, bumping only when everthing is ok of course |
08:33:11 | Zevv | I merge blindly, but I release carfully |
08:33:24 | PMunch | Creating a new PR now that updates the readme and version number |
08:33:35 | Zevv | oh sweet, I was just typing that in myself. Please do! |
08:33:51 | Zevv | I'll do the bump myself though, I like those in a separate commit |
08:33:56 | PMunch | What, but that means 0.3.0 can be two completely different implementations depending on when you installed it :S |
08:34:01 | PMunch | Ah okay |
08:34:05 | Zevv | no, it's about the tag |
08:34:11 | PMunch | Oh right |
08:35:09 | PMunch | Araq, not sure if you saw that earlier, but one feature I miss in Nim is the ability to make a symbol completely behave like some expansion. Like templates get you 90% of the way there, but things like the proc case from earlier doesn't work.. |
08:35:37 | FromGitter | <alehander42> Araq, i agre |
08:35:48 | FromGitter | <alehander42> i guess reusing the cfg makes sense |
08:35:49 | Araq | PMunch, I don't like aliases but there is a PR from timothee that implemented it |
08:36:30 | Araq | alehander42, yeah, so ... we start by writing a spec |
08:36:35 | FromGitter | <alehander42> ok |
08:36:57 | FromGitter | <alehander42> one thing i wondered is, in my old ast pr i tried to make the check a bit smarter |
08:37:08 | Araq | biggest problem that I can foresee is Table[string, ref T] |
08:37:29 | FromGitter | <alehander42> e.g. `if not a.field.field2.isNil: a.field.field2.field3 work` |
08:38:04 | * | Arrrrrrr joined #nim |
08:38:19 | Araq | inside the table implementation we do tab.data = newSeq[Value](someSize) |
08:38:40 | Arrrrrrr | Congratulations on the release. Where is the cake? |
08:38:42 | Araq | pre-allocating seqs can only work when you have a sentinel value |
08:38:47 | FromGitter | <alehander42> and `if not a[t].isNil: a[t].other should work` : should those be supported? (we mostly need to track that e.g. `t` isn't changed as well) |
08:39:14 | Araq | no, we don't support these, we support 'let' variables |
08:39:28 | PMunch | Arrrrrrr, here: 🎂 do you want a slice? |
08:39:29 | Araq | Arrrrrrr, thanks |
08:39:40 | * | PMunch slides 🍰 to Arrrrrrr |
08:40:14 | FromGitter | <alehander42> Araq, hmm, i still feel they should work in the obvious cases, but `let` is a good workaround indeed |
08:40:23 | PMunch | Araq, I can see why aliases in normal code might be confusing, but as a tool for generated macros I think they could be useful |
08:40:43 | PMunch | Like I wouldn't mind if it was only able as a procedure within the macros module |
08:42:23 | Araq | alehander42: much more pressing is what we do about the fact that default(ref T) does not exist anymore |
08:42:36 | Araq | default values crop up in array processing all the time |
08:43:15 | PMunch | Zevv, github.com/zevv/with/pull/3 |
08:43:19 | Araq | var s = newSeq[ref T](10); for i in 0..<s.len: s[i] = new(T) # save, but hard to prove it |
08:44:05 | Araq | this can be mitigated by a dedicated array construction syntax, var s = new(T) *& 10 |
08:44:23 | Araq | but it doesn't help for hash tables |
08:46:00 | FromGitter | <alehander42> what was default(ref(T)) |
08:46:02 | FromGitter | <alehander42> before? |
08:46:28 | * | laaron joined #nim |
08:47:44 | FromGitter | <alehander42> so, i am not sure what the problem about tables is: is it expected that `if a.hasKey(b): a[b].field` should just work |
08:47:46 | * | laaron quit (Client Quit) |
08:47:52 | FromGitter | <alehander42> without checking `a[b]` is nil? |
08:48:15 | FromGitter | <alehander42> if it's just about the internal implementation, i guess the internal procs can just use a pragma which says "dont check me" |
08:48:35 | Araq | it's about the implementation, yes |
08:49:27 | FromGitter | <alehander42> i see, so it's about optimizing perf, where we know checks aren't really needed? |
08:50:05 | * | krux02 joined #nim |
08:50:50 | Arrrrrrr | Talking about tables, why doesn't initTable()-initHashSet() call rightSize() under the hood? I see no benefit in having to do it explicitly. |
08:52:21 | Araq | Arrrrrrr, yeah, PR is welcome |
08:52:42 | Araq | alehander42: no, it's not about optimizing, we need an escape hatch, look |
08:53:17 | FromGitter | <alehander42> but all the newSeq in tables i see are with tuple elements etc, i dont see ref |
08:53:17 | Araq | var s: seq[ref T not nil] = @[] # ok, empty seq is fine |
08:53:27 | FromDiscord | <Shield> aliasing is great since i'm ditching inheritence and relying fully on composition |
08:53:34 | Araq | s.setLen(10) # needs to be forbidden |
08:53:56 | FromGitter | <alehander42> oh the setLen |
08:53:57 | FromGitter | <alehander42> problem |
08:54:17 | Araq | yes. |
08:54:49 | * | mibr joined #nim |
08:55:39 | FromGitter | <dumjyl> with generic constraints? `proc setLen[T: Nilable](len: int)` |
08:55:53 | FromGitter | <alehander42> yeah, it can be forbidden |
08:55:58 | FromGitter | <alehander42> i think the problem is that it's useful |
08:56:12 | FromGitter | <alehander42> in generic algo-s, e.g. sequtils |
08:56:36 | Zevv | PMunch: merged and tagged. Thanks a lot! |
08:56:59 | FromDiscord | <SodaScripter> what is the difference between a let and a const |
08:57:00 | FromGitter | <alehander42> and i guess auto-filling it with `new()` is out of the question, because allocations? |
08:58:27 | Araq | definitely |
08:59:04 | FromDiscord | <Kiloneie> @Araq Have you seem my video yet ? I would like your feedback the most 🙂 |
08:59:14 | Araq | setLen is the wrong interface btw, it should be 'shrink' (no problems with non-nilable types) |
08:59:20 | FromGitter | <alehander42> exactly |
08:59:22 | Araq | and 'grow' |
08:59:24 | FromGitter | <alehander42> shrinking is safe |
08:59:26 | FromGitter | <alehander42> growing not |
08:59:30 | Araq | and 'grow' should be marked as unsafe |
08:59:32 | FromGitter | <alehander42> i wondered how to catch that on CT |
08:59:46 | PMunch | Zevv, no problem :) |
08:59:57 | * | navin quit (Remote host closed the connection) |
09:00:11 | PMunch | SodaScripter, const must be known at compile time, while let can be assigned at runtime |
09:00:14 | PMunch | But both are immutable |
09:00:41 | FromGitter | <alehander42> maybe there can be something like growAlloc if people explicitly opt in to grow their not nil seq-s |
09:00:48 | * | SodaScripter joined #nim |
09:01:05 | Araq | alehander42: well 'grow' is not common and can be marked as "unsafe for not-nil" in the docs |
09:01:10 | SodaScripter | ok I'm on IRC now |
09:01:12 | SodaScripter | much comfier |
09:01:21 | Araq | but 'newSeq(lengthHere)' is common |
09:01:23 | FromGitter | <alehander42> or they can just have a GrowableAllocSeq |
09:01:25 | FromGitter | <alehander42> or something |
09:01:43 | FromGitter | <alehander42> that's true |
09:02:00 | SodaScripter | <PMunch> Oh, that makes sense, thanks for the explanation. |
09:02:05 | Araq | 'newSeq' is common and in generic code we need an unsafeNewSeq |
09:02:08 | FromGitter | <alehander42> well, maybe it's easy to replace newSeq with newSeqWith |
09:02:17 | FromGitter | <alehander42> for not nil ref seq-s |
09:02:30 | FromGitter | <alehander42> and forbid newSeq as well |
09:02:40 | FromGitter | <alehander42> for those |
09:02:57 | Araq | not good enough, consider that we don't have default(T) for not-nil refs |
09:03:19 | PMunch | SodaScripter, no problem :) |
09:03:22 | FromGitter | <alehander42> yes, and newSeqWith is a bad fit for ref-s |
09:03:39 | FromGitter | <alehander42> as one would easily point all the elements to the same init object by mistake |
09:03:43 | Araq | for tables we want to be able to say "look, it's nilable in the inside, but from outside it's what people declared it to be" |
09:04:21 | FromGitter | <alehander42> well, for tables i think we can just use the `{.nilCheck: off.}` |
09:04:24 | FromGitter | <alehander42> or something pragma |
09:04:29 | Araq | as both Table[K, ref T] and Table[K, ref T not nil] can just work |
09:04:36 | FromGitter | <alehander42> internally |
09:05:01 | Araq | yes but we need to be precise about what .nilCheck: off means |
09:05:17 | FromGitter | <alehander42> ah, but i see another meaning |
09:05:22 | * | couven92 joined #nim |
09:05:33 | Araq | and the problem pops up in array processing quite often. |
09:05:35 | FromGitter | <alehander42> what happens in generic code where T can be `nil` or `not nil` indeed |
09:05:44 | Araq | exactly |
09:05:48 | FromGitter | <alehander42> and isNil doesn't always work |
09:06:07 | * | dwdv joined #nim |
09:06:08 | * | laaron joined #nim |
09:06:27 | FromGitter | <alehander42> maybe somehow we can map isNil to genericIsNil before sem checking instantiations |
09:06:45 | FromGitter | <alehander42> and genericIsNil can be a safe noop for not nil |
09:07:46 | Araq | too complex, the T doesn't really cause problems |
09:07:50 | * | laaron quit (Client Quit) |
09:08:24 | Araq | the real underlying issue is that we need both default(T) and unsafeDefault(T) |
09:08:41 | Araq | so that we can sneak 'nil' into a not-nilable ref type |
09:09:09 | Araq | proc grow(x: seq[T]; n: int; value: T) # nothing unsafe about it |
09:09:31 | Araq | s.grow(10, default(T)) # ok |
09:09:42 | Araq | s.grow(10, default(ref T)) # nah, it has no default |
09:09:58 | Araq | s.grow(10, unsafeDefault(ref T)) # ok, you obviously know what you're doing |
09:10:32 | FromGitter | <alehander42> so we expect that the function which does the unsafeDefault grow |
09:10:39 | FromGitter | <alehander42> will fill correctly those new elements |
09:11:12 | FromGitter | <alehander42> it's interesting, because you can auto-test this in debug builds |
09:11:31 | FromGitter | <alehander42> e.g. if a function does this, and before return `s` has nil elements in the growed area |
09:11:58 | FromGitter | <alehander42> it broke the contract |
09:14:29 | * | neceve joined #nim |
09:14:50 | Araq | currently default(ref T not nil) gives you 'nil' iirc |
09:14:55 | * | laaron joined #nim |
09:15:01 | Araq | so the current default(T) is the unsafe variant |
09:15:19 | FromGitter | <alehander42> yes, the current one doesn't work well |
09:15:36 | * | navin joined #nim |
09:15:39 | Araq | hey, I used it extensively, what's wrong with it? |
09:15:51 | FromGitter | <alehander42> well, for this particular scenario obviously |
09:16:26 | Araq | ah ok |
09:16:44 | * | laaron quit (Client Quit) |
09:17:03 | FromGitter | <alehander42> but what i dont get fully is: in generic seq processing, doesn't this mean `default(T)` would just not work |
09:17:04 | * | Arrrrrrr quit (Remote host closed the connection) |
09:17:16 | FromGitter | <alehander42> as you always can have `T: ref` |
09:17:20 | Araq | yup |
09:17:31 | FromGitter | <alehander42> so people would just use `unsafeDefault` anyway |
09:17:46 | Araq | well they have to |
09:17:58 | Araq | in generic code |
09:18:07 | FromGitter | <arnetheduck> the c++ solution is kind of not that bad - you can use whatever subset of for example vector that your type supports - no zero-arg constructor? `resize` fails.. etc |
09:19:14 | * | SodaScripter quit (Quit: Leaving) |
09:19:27 | FromGitter | <alehander42> well, i think the `grow` / `shrink` think makes sense, as `resize` is too general on type level indeed |
09:19:32 | FromGitter | <alehander42> thing* |
09:19:37 | * | SodaScripter joined #nim |
09:20:02 | * | navin quit (Ping timeout: 245 seconds) |
09:20:26 | Araq | a different table implementation that uses a sum type internally doesn't have this issue |
09:20:28 | FromGitter | <alehander42> you have algorithms (e.g. filter etc) where you don't need to resize to a bigger seq, so forbidding that wouldn't make sense |
09:21:10 | Araq | but I don't think a design that forces us to rewrite tables is a good one |
09:21:13 | FromGitter | <arnetheduck> related: we were just hit by two nasty bugs related to types that are not all-zeroes-initialized (due to how the math / standards work). we missed them / they're hard to track down because the all-zeroes init happens in sometimes hidden places that can't be searched for, such as deep in an object graph.. `not nil` is just one special kind of default one wants to avoid, but there are others too: `not zero` |
09:22:23 | Araq | arnetheduck: yes, it's related to the fact that Nim has "the axiom of choice" / default(T) but a better design could do without |
09:23:36 | * | bertiebun joined #nim |
09:23:50 | * | alops joined #nim |
09:23:53 | FromGitter | <alehander42> but isn't this more related to limiting/overriding construction works |
09:24:10 | Araq | not in my opinion. |
09:24:34 | alops | Hi all. Congrats on 1.0. I cloned the snake example, ran nimble build, getting: Error: Downloaded package's version does not satisfy requested version range: wanted >= 0.1.1 got 0.0.1. |
09:24:38 | alops | Ideas? |
09:24:41 | FromGitter | <alehander42> and about tables, i see newSeq with seq of tuples |
09:24:41 | * | clyybber joined #nim |
09:25:08 | Araq | alehander42: the tuple can contain a 'not nil' type |
09:25:15 | FromGitter | <alehander42> ok, but i dont see `val` |
09:25:20 | FromGitter | <alehander42> being dereffed anywhere |
09:25:25 | FromGitter | <alehander42> in tables.nim |
09:25:40 | Araq | look, it doesn't matter. |
09:26:01 | Araq | var s = newSeq[ref T not nil)(1000) |
09:26:02 | SodaScripter | is there something like Ncurses for nim? |
09:26:18 | Araq | ^ it's the newSeq, that one already is unsafe |
09:26:32 | Araq | we there is no value we can use |
09:26:49 | FromGitter | <alehander42> but in tables, we only have newSeq[some tuple] |
09:26:52 | FromGitter | <alehander42> you said `but I don't think a design that forces us to rewrite tables is a good one` |
09:26:58 | FromGitter | <alehander42> i just dont see how tables is a block |
09:27:05 | Araq | common |
09:27:31 | Araq | it bubbles up, so Value = ref T not nil; tuple[... Value ...] is a type with no default(T) |
09:28:05 | Araq | SodaScripter, terminal.nim ? |
09:28:05 | PMunch | SodaScripter, well you can use ncurses: https://github.com/rnowley/nim-ncurses |
09:28:19 | FromGitter | <alehander42> ah true |
09:28:22 | FromGitter | <alehander42> sorry, well, tables.nim can use unsafeDefault |
09:28:30 | PMunch | Depends on how much of its functionality you need |
09:28:48 | FromGitter | <alehander42> it is a good example of a generic impl which should know what is doing |
09:28:52 | clyybber | Shouldn't a type with not-nil error when default(T) is invoked? |
09:29:07 | Araq | clyybber, yeah, we know |
09:29:23 | FromGitter | <alehander42> and when people use [] |
09:29:23 | PMunch | alops, hmm that's strange. I thought nimble was supposed to download it for you in that case |
09:29:24 | SodaScripter | Araq, Sorry, I'm not a very nimble nim user, haha. |
09:29:47 | clyybber | alehander42: Because it invokes default(T) ? |
09:29:53 | FromGitter | <alehander42> look, basically you can't have an error |
09:29:57 | alops | PMunch: what is "it" and how to solve? :) |
09:30:13 | FromGitter | <alehander42> because the only ways you can add values are e.g. `[]=` and others, which accept only not nil |
09:30:18 | FromGitter | <alehander42> and `[]` depends on hasKey |
09:30:40 | PMunch | alops, it appears like it's treeform/chroma that fails |
09:30:47 | FromGitter | <alehander42> so, if hasKey is true, somethign which added an actual not-nil value should have happened |
09:31:06 | FromGitter | <alehander42> and if it's not true, there should be a key missing error before |
09:31:10 | FromGitter | <alehander42> trying to return the value |
09:31:13 | * | laaron joined #nim |
09:31:27 | FromGitter | <alehander42> so unsafeDefault should be fine for tables |
09:31:53 | PMunch | Which is required from dom96's gamelight |
09:32:30 | Araq | alehander42: ok. problem solved. maybe |
09:32:51 | clyybber | Btw, can we override default(T) nowadays? |
09:33:03 | PMunch | Which is a bit weird, because chrome seems to have always been 0.0.1 |
09:33:09 | alops | oh well |
09:33:18 | alops | literally all examples I've tried today have failed |
09:33:21 | dom96 | what's up? |
09:33:25 | Araq | clyybber, nah |
09:33:47 | Araq | dom96, we're fixing 'nil' |
09:34:17 | PMunch | dom96, gamelight requires chroma 0.1.1, but the version in treeform/chroma is 0.0.1, which means that your snake game fails to build |
09:34:20 | * | navin joined #nim |
09:34:34 | PMunch | alops, well that's not good |
09:34:53 | alops | .cache/nim/fib_d/fib.nim.c:9:10: fatal error: 'nimbase.h' file not found |
09:34:55 | FromGitter | <alehander42> Araq, and from what i see in sequtils |
09:35:08 | FromGitter | <alehander42> shrink or newSeq with unsafeDefault |
09:35:09 | alops | the fib/C integration example fails with the above for instance |
09:35:11 | PMunch | alops, uhm, how did you end up with that error? |
09:35:14 | FromGitter | <alehander42> should be valid for most algo-s |
09:35:29 | alops | PMunch: followed the docs to the letter :D |
09:35:39 | clyybber | If we could overwrite default(T), implementing not-nil should be as simple (in principle) as adding {.error.} pragma to it. |
09:35:45 | * | laaron quit (Client Quit) |
09:35:45 | PMunch | alops, which docs? |
09:35:48 | alops | PMunch: https://nim-lang.org/docs/backends.html#backend-code-calling-nim-nim-invocation-example-from-c |
09:36:20 | Araq | clyybber, the problem is not "Nim produces an error", the problem is "how to fix nil and still have generic code" |
09:36:27 | clyybber | Araq: WDYT, should overriding default(T) be allowed? And is it a simple change? |
09:36:34 | clyybber | Araq: Ah, I see |
09:36:43 | FromGitter | <arnetheduck> one might ask oneself what the purpose of calling `unsafeDefault` is vs simply leaving the memory uninitialized, since accessing it remains invalid behavior |
09:37:01 | alops | PMunch: I'm a total Nim noob, so I'm literally just cloning repositories and trying examples in the docs. So far, nothing has worked as advertised. Hopefully just outdated docs. |
09:37:02 | FromGitter | <alehander42> it still calls `default` for most types |
09:37:30 | FromGitter | <arnetheduck> I'm asking about the non-most types |
09:37:44 | FromGitter | <alehander42> well, unsafeDefault is a generic call |
09:38:03 | FromGitter | <alehander42> for most types, it can resolve to default, for ref, it can resolve to a noop indeed |
09:38:18 | FromGitter | <alehander42> but you need it from a type level point of view |
09:38:24 | PMunch | alops, did you change the -Ipath/to/nim/lib to actually point to the Nim lib folder? |
09:38:29 | PMunch | Doing that made it work for me |
09:39:03 | PMunch | In the last command: gcc -o m -I$HOME/.cache/nim/fib_d -Ipath/to/nim/lib $HOME/.cache/nim/fib_d/*.c maths.c |
09:39:04 | alops | PMunch: I tried various things, what did you set it to? |
09:39:28 | PMunch | I set it to $HOME/.choosenim/toolchains/nim-1.0.0/lib |
09:39:37 | alops | how to know these things :D |
09:40:08 | PMunch | I guess you just have to have delved into these things before to know :P |
09:40:16 | FromGitter | <arnetheduck> so with that solution, you converge towards what c++ does, but without some of the tools it offers for a number of situations that arise (ie constructors) |
09:40:35 | PMunch | narimiran_, maybe that ^ should be mentioned in the docs? |
09:41:18 | alops | PMunch: I still get ~/Users/alops/.cache/nim/fib_d/fib.nim.c:9:10: fatal error: 'nimbase.h' file not found |
09:41:46 | Araq | if C++ constructors worked it wouldn't have make_shared, make_unique |
09:41:59 | PMunch | alops, does that folder exist on your system? How did you install Nim? |
09:42:14 | Araq | so what are these mystical "tools it offers" ? |
09:42:15 | * | narimiran_ is now known as narimiran |
09:42:21 | alops | PMunch: installed with brew |
09:42:27 | PMunch | Seeing that /Users path makes me think you might be on a Mac and installed trough homebrew? |
09:42:29 | PMunch | Ah yeah |
09:42:40 | PMunch | So you need to figure out where homebrew has put your files |
09:43:14 | alops | Should nim(ble) know these things? |
09:43:22 | alops | oh I guess gcc... |
09:43:23 | PMunch | Try "nim dump | grep lib" |
09:44:10 | PMunch | That should show you where the lib folder is located on your system |
09:45:02 | alops | yeah, that solved the nimbase.h, not it doesn't find fib.h |
09:45:07 | alops | now* |
09:45:17 | FromGitter | <alehander42> @arnetheduck how does c++ even prove you can deref safely? genuinely wondering, i am not an expert in modern c++ |
09:45:33 | PMunch | alops, that is because nim uses a different cache directory than on Linux |
09:46:07 | PMunch | You see those $HOME/.cache/nim/fib_d paths, that is where Nim places the C files it generated during compilation by default on a linux machine |
09:46:08 | alops | could Nim during install put these locations in an environment variable to make it easier? |
09:46:47 | PMunch | I guess, or just allow you to call "nim cachefolder" or something to get it |
09:46:59 | Araq | alehander42: it doesn't do anything like that, it gives you some control over the default value so that it can be 1 instead of 0. The problem remains that 'ref T not nil' has *no* default value. |
09:47:13 | FromGitter | <arnetheduck> in a way, it doesn't, except at runtime with special analyzers. generally, when you use reference types, the language prevents you in most ways to create instances that are not nil (for example, it prevents the equivalent of newSeq(1000) or resize), though there are some loopholes as well if you're adventerous |
09:47:21 | PMunch | But you can add a --nimcache:<folder> argument to the Nim command, that will tell nim to put these file in a specific directory |
09:48:04 | PMunch | So if you create a "nimcache" directory in the same folder as fib.nim and main.c and then run "nim c --nimcache:nimcache --noMain --noLinking --header:fib.h fib.nim" it should put the files there |
09:48:56 | FromGitter | <arnetheduck> in other words: as long as you stay within the reference system, it's not-null safe, but you can cont amine it if you start use pointers that you turn into references |
09:49:11 | PMunch | Then run "gcc -o m -Inimcache -I$HOME/.cache/nim/fib_d/fib.nim.c nimcache/*.c maths.c" and it should hopefully work :) |
09:49:17 | dom96 | PMunch it's possible I just typo'd that requirement |
09:49:31 | alops | PMunch: found paths manually, works now. Thanks! |
09:49:34 | * | ehmry quit (Ping timeout: 265 seconds) |
09:49:38 | Araq | alops, we don't produce the brew Nim |
09:49:38 | PMunch | dom96, But it's weird though, I'm pretty sure the snake game used to build |
09:49:47 | PMunch | alops, no problem. Now it's time for lunch :) |
09:49:49 | dom96 | PMunch of course, gamelight evolved |
09:50:02 | alops | Araq: if it's not in brew it doesn't exist. True for a lot of macOS users :D |
09:50:05 | dom96 | this is why we need lock files |
09:50:06 | FromGitter | <alehander42> yeah, so the default value of ref T not nil is basically "nil .. which you should fill with a non-nil value until the end of the function hopefully" |
09:50:22 | PMunch | dom96, oh right, gamelight added the chroma dependency since last time I tried to build it, makes sense. |
09:50:32 | Araq | alops, so write a bug report for this brew package |
09:50:46 | alops | uhg, what's the bug? |
09:50:52 | FromGitter | <alehander42> @arnetheduck i see, thanks for the explanation |
09:51:02 | Araq | that nothing works after 'brew install nim' ? |
09:51:03 | PMunch | Araq, I still think it would be nice if the Nim binary could tell you the location of its lib and cache folder in an easy way |
09:51:34 | alops | Araq: that's not brew's fault. The docs are wrong and the example above was wrong too, dom96 will fix it >D |
09:51:45 | Araq | how are the docs wrong? |
09:51:59 | FromGitter | <arnetheduck> PMunch `nim dump` will give you some hints at least |
09:52:20 | PMunch | Then you could do things like "gcc -o m -I`nim cachedirectory`/fib_d -I`nim libdirectory` `nim cachedirectory`/fib_d/*.c maths.c" |
09:52:37 | alops | one example is the websocket module. It contains examples calling methods that doesn't exist. Encountered lots of these today. And yes, I will file issues as I discover them. |
09:52:57 | alops | PMunch: I like that! |
09:53:17 | Araq | I don't even know what you're talking about, I never invoke gcc manually |
09:53:29 | FromGitter | <alehander42> Araq, there is another posiblity for generic: just have a `newSeqWithCode` overload which is a template which takes a type, len and a code block which should result in `T`: it sets the length, and fills each elements with the code |
09:53:36 | FromGitter | <alehander42> so e.g. newSeqWith |
09:53:37 | alops | Araq: the fib example does |
09:53:49 | Araq | fib example? |
09:53:51 | PMunch | arnetheduck, yeah that gives you all the paths, but I was thinking something like what various config utilities does. For an example wx-widgets have `wx-config --libs` which include all the libs needed to build it. |
09:53:53 | FromGitter | <alehander42> newSeqWithCodetype(init) (len): ⏎ init |
09:53:56 | alops | Araq: yes |
09:54:00 | PMunch | Araq, https://nim-lang.org/docs/backends.html#backend-code-calling-nim-nim-invocation-example-from-c |
09:54:04 | * | laaron joined #nim |
09:54:30 | Araq | https://nim-lang.org/docs/tut1.html#the-first-program |
09:54:36 | PMunch | But anyways, I'm off to lunch |
09:54:49 | alops | have a good one |
09:55:02 | Araq | you are not supposed to start the 'backends' guide |
09:55:23 | FromGitter | <alehander42> basically combine length + init logic in one invocation of a primitive which we know that fills all new elements with a valid value |
09:55:28 | FromGitter | <alehander42> (result of init) |
09:55:49 | FromGitter | <alehander42> but this works mostly for sequtils |
09:56:23 | alops | dom96: can I fix it manually locally somehow? |
09:56:25 | Araq | alehander42: you can name it anyway you want in the end you need a default value for 'not nil' in order to circumvent the overly strict type sytem |
09:57:09 | dom96 | alops: fix what? |
09:57:16 | alops | the snake error |
09:57:20 | FromGitter | <alehander42> you don't really: the pattern i showed seems quite applicable and you can have an escape hatch for a small number of cases as unsafeDefault |
09:57:38 | FromGitter | <zacharycarter> clyybber: playing around with vulkan using your bindings - thanks for making those! |
09:57:52 | * | ikan-keli_ quit (Ping timeout: 246 seconds) |
09:58:07 | Araq | alops, https://nim-lang.org/learn.html doesn't link to backends.hml |
09:58:11 | alops | chroma: Downloaded package's version does not satisfy requested version range: wanted >= 0.1.1 got 0.0.1 |
09:58:24 | FromGitter | <alehander42> it works for map newSeq(result, s.len): op(s[i]) |
09:58:27 | alops | Araq: I've read all that |
09:58:30 | FromGitter | <alehander42> newSeqWithCode* |
09:59:01 | Araq | it's listed here though https://nim-lang.org/documentation.html and meh, this document is old |
09:59:13 | alops | right |
09:59:35 | Araq | gonna remove this link from documentation |
09:59:46 | * | laaron quit (Quit: ZNC 1.7.4 - https://znc.in) |
09:59:55 | clyybber | zacharycarter: Cool, tell me when you need them to be updated, or find any other problem |
10:00:00 | alops | my primary use of Nim is going to be to interoperate with C |
10:00:04 | FromGitter | <zacharycarter> will do |
10:00:06 | alops | are there other docs on that? |
10:00:11 | * | ikan-keli_ joined #nim |
10:00:35 | leorize | so you want to call Nim from C or the other way around? |
10:00:53 | alops | both |
10:01:21 | leorize | alright, calling C from Nim is heavily documented |
10:01:29 | FromGitter | <alehander42> otherwise `nilCheck:off` would just turn off the cfg nilcheck pass for the given function: it would still count its `not nil` signatures etc |
10:01:35 | alops | well, it's going to be Nim -> call C with a Nim callback -> C calls back |
10:01:52 | leorize | that's simple |
10:01:57 | * | ehmry joined #nim |
10:02:06 | alops | leorize: good to hear :D |
10:02:06 | ronny | are there any suggested libs for deserialization/parsing/transforming json/cbor/msgpack to structs? |
10:02:15 | leorize | alops: make sure the callback is decorated with {.cdecl.} |
10:02:21 | leorize | and you're done :P |
10:02:26 | alops | sweet |
10:02:30 | Araq | ronny, PMuch's protobuf maybe |
10:02:34 | FromGitter | <alehander42> not sure if it makes sense to have `{.nilCheck:off.}` on a sub-function level tho .. but it can work in the same way |
10:02:36 | leorize | ofc you'd need to create a wrapper for the C function you're calling first |
10:02:43 | leorize | but I think that part is straightforward |
10:02:52 | alops | where are the docs for that? |
10:03:06 | ronny | i specifially have no use for protobuf however - i need json, cbor and msgpack |
10:03:25 | Araq | json.nim covers simple objects |
10:03:34 | leorize | alops: https://nim-lang.org/docs/manual.html#foreign-function-interface-importc-pragma |
10:03:43 | FromGitter | <alehander42> https://github.com/status-im/nim-json-serialization is another good json option |
10:03:55 | alops | leorize: perfect |
10:04:00 | FromGitter | <alehander42> seems like a newer cbor https://github.com/ehmry/nim-cbor |
10:04:17 | leorize | alops: for automated tools, look for c2nim and nimterop |
10:04:24 | FromGitter | <alehander42> and this one seems maintained https://github.com/jangko/msgpack4nim |
10:04:26 | leorize | the latter is newer |
10:04:57 | FromGitter | <alehander42> ronny ^ (links ) |
10:05:23 | ronny | currenctly checking, the json-serialization one us useless for me |
10:05:25 | ronny | *is |
10:06:18 | FromGitter | <alehander42> why? |
10:06:50 | alops | Anyway, I would fix the Snake example. It's featured prominently on the Features page. |
10:07:02 | ronny | i need deserialization first |
10:07:14 | ronny | hmm |
10:07:21 | FromGitter | <alehander42> but it does both |
10:07:24 | FromGitter | <alehander42> that's just the name |
10:08:04 | FromGitter | <alehander42> `Json.encode(@[1, 2, 3], pretty = false) == "[1, 2, 3]"` and `Json.decode("{....}", MyObj)` |
10:08:44 | leorize | alops: looks like it's broken due to an update in its dependency |
10:09:51 | ronny | are there any plans for tagged unions in nim (im looking at the cbor lib and it looks like a strange looking pattern is used to express the polimorphism of the values |
10:09:56 | ronny | i retract my statement about json-serialization, its indeed useful |
10:10:03 | * | laaron joined #nim |
10:10:34 | leorize | ronny: they're called object variants |
10:11:38 | ronny | are there any macros to derive the constructors/comparators for those, at first glance it looks something thats quite a step back from tagged unions |
10:12:16 | leorize | well it's a type-checked tagged union |
10:12:27 | FromGitter | <alehander42> constructing them is simple |
10:12:40 | FromGitter | <alehander42> comparator shortcuts would be useful indeed |
10:12:59 | FromGitter | <alehander42> but i would compare them a bit more to ADT-s |
10:15:50 | * | laaron quit (Quit: ZNC 1.7.4 - https://znc.in) |
10:16:54 | ronny | hmm, i just recall tagged unions from haskell (that has utilities to dreive operators/comparators and has direct consturction via the expressions, it seems quite a bit better than what i see in https://github.com/ehmry/nim-cbor/blob/master/src/cbor.nim#L28 and the following |
10:18:43 | alops | well, in Haskell sum types *are* the datatypes, so the language is optimized for it |
10:20:22 | leorize | Nim's version of this is much more customizable, but ofc it can be a bit of a mess when you don't need that |
10:20:39 | leorize | there's a macro somewhere that let you construct these similar to how haskell does it |
10:21:13 | leorize | here: https://github.com/andreaferretti/patty |
10:21:52 | * | abm joined #nim |
10:23:24 | * | navin quit (Ping timeout: 265 seconds) |
10:24:01 | * | abm quit (Client Quit) |
10:24:29 | * | navin joined #nim |
10:28:05 | ronny | patty looks exactly like what id need |
10:29:53 | ronny | another item i havent seen easiyl - has nm utilities for late binding polimorphism? (aka tools to declare subtypes later and have them participate) |
10:31:19 | ronny | hmm, nm, i tihnk i have found it, so methods are needed for the dispatch |
10:35:35 | Araq | ronny, I usually use proc vars / closures for dynamic binding |
10:35:46 | Araq | find it easier to work with |
10:36:00 | Araq | as you don't need an inheritance relationship for them |
10:36:51 | ronny | hmm, letss see if i can get myself used to that model |
10:40:56 | * | laaron joined #nim |
10:42:03 | * | laaron quit (Remote host closed the connection) |
10:53:45 | FromDiscord | <Kiloneie> @Araq you here ? |
10:55:37 | Araq | Kiloneie: haven't watched it yet, give me a link please |
10:56:01 | FromDiscord | <Kiloneie> https://youtu.be/5tVIsDYPClA |
10:57:20 | FromDiscord | <Kiloneie> The next video will get VS Code to full screen, and captions enabled for all to contribute, got that info from forums. Any more criticism is appreciated |
10:57:54 | * | shomodj joined #nim |
10:58:58 | SodaScripter | hold up gotta reboot |
10:59:03 | * | SodaScripter quit (Quit: Leaving) |
11:00:07 | * | NimBot joined #nim |
11:01:48 | alops | "The compiler ensures that every code path initializes variables which contain non nilable pointers. The details of this analysis are still to be specified here." |
11:01:53 | alops | Will this be added now that 1.0 is out? |
11:02:07 | PMunch | alops, just to answer your question, you can fix it manually. First, clone gamelight, then change the version in the .nimble file. Now run "nimble install" in the base directory. This should install gamelight. Now you can go to the snake game directory and run nimble build. |
11:02:08 | FromGitter | <alehander42> praise God, such a great weather today |
11:02:28 | alops | PMunch: oh thanks, will try |
11:02:42 | PMunch | alehander42, what do you mean, it's raining and pretty cold.. |
11:02:57 | alops | praise physics and local variations |
11:03:04 | Zevv | more recording-technical comments: try using a mic on a headset, or anything reducign your room's acoustics, and set your desktop resolution to 720p max so the resulting video is viewable at lower resolutions |
11:03:16 | Zevv | ^ that was @Kiloneie |
11:03:16 | * | laaron joined #nim |
11:03:21 | PMunch | alops, and of course you have the option to clone gamelight, push up the change, and PR it to dom96 :) |
11:03:39 | Araq | Kiloneie: put it on the desktop? brave... |
11:04:23 | FromDiscord | <Kiloneie> Isn't the background noise reduced to almost nothing ? |
11:04:34 | FromDiscord | <Kiloneie> i can't hear it at pretty high volume |
11:05:29 | FromDiscord | <Kiloneie> got my headphones HD 599 at 50%(which is quite high for good headphones) and i hear nothing |
11:06:30 | FromDiscord | <Kiloneie> Yeah my mic is on a stand on my desk... is that a problem ? vibrations somehow ? idk. |
11:07:13 | FromGitter | <alehander42> PMunch, it's just slightly cold here, fresh |
11:07:22 | Araq | Kiloneie: sound quality is bad, but apart from that I really like it! well done |
11:07:27 | FromDiscord | <Kiloneie> Wouldn't capturing VS Code directly and stretching it to full screen fix that problem of viewing at lower resolutions ? |
11:08:04 | PMunch | Kiloneie, Araq, not sure if background noise is the issue. I can't hear any of that. But it does sound a bit distant |
11:08:06 | FromDiscord | <Kiloneie> Thank you, i did try to find an actual microphone arm, but i can't find information if it will fit my old mic... it cost 100€ like 8 years ago <.< |
11:08:09 | Araq | I can tell you a secret: I didn't know about the F6 shortcut :D |
11:08:30 | alops | And it works on mac too |
11:08:33 | FromDiscord | <Kiloneie> You didn't ? how did you run your programs then xD ? |
11:08:58 | PMunch | alehander42, here it's 8 degrees. which is quite a bit warmer than yesterday |
11:09:15 | PMunch | Yesterday I had snow on my windshield when I went to work |
11:09:19 | FromGitter | <alehander42> Araq, i think growWithInit(int, untyped => T) / newSeqWithInit(int, untyped => T) are the perfect additions to grow and shrink: ⏎ shrink works, because no default needed, growWithInit works because it can still do a single allocation and run a loop which ensures filling with not nil, no default needed |
11:09:42 | FromGitter | <alehander42> so grow with unsafeDefault remains for just the other case |
11:09:53 | FromGitter | <alehander42> PMunchh, yes i am surprised its not hot |
11:09:53 | FromGitter | <alehander42> here |
11:10:00 | FromGitter | <alehander42> so different climate surely |
11:10:25 | * | SodaScripter joined #nim |
11:11:32 | FromDiscord | <Kiloneie> I know i sounded more distant on my introduction part of the video, it's quite noticable, i had my head turned to the right a bit, reading my second monitor script. |
11:11:32 | FromDiscord | <Kiloneie> |
11:11:32 | FromDiscord | <Kiloneie> But on the second part, it's better, is it too quiet being the main sound quality problem ? |
11:12:47 | FromDiscord | <Kiloneie> Which can be fixed by a mic arm, if i can find one... or buy a set ... (trying not to spend money so i can do this for longer, living on my savings atm, which can go as long as 6+ months) |
11:13:58 | PMunch | Not really volume that's the issue. I can't really explain it :P But don't get me wrong, you sound fine |
11:14:01 | narimiran | your current mic is probably fine |
11:14:15 | PMunch | The keyboard clicking might be a bit distracting to some though |
11:16:21 | Araq | alehander42: you can't use a "single" allocation most of the time anyway |
11:16:34 | narimiran | if your mic is on the table where your keyboard is, try putting a towel underneath mic base, it should dampen some of the vibratons |
11:16:36 | Araq | think about the aliasing problems this implies |
11:19:51 | FromDiscord | <Kiloneie> Hmm, i guess a microphone arm, if i can find it., sound volume is what it is, so that background noise is non existent or very low, will try a towel for the next video, and see if that helps |
11:20:39 | FromDiscord | <Kiloneie> and yeah my keyboard is loud... it's a mechanical one, for gaming xD... i have a much quieter for another computer, could use that for recording |
11:22:20 | FromGitter | <alehander42> Araq, i mean that newSeqWithInit and growWithInit just do a single |
11:22:29 | FromGitter | <alehander42> newSeq(len .. or setLe(len .. |
11:22:53 | FromGitter | <alehander42> but they combine it with a init logic loop |
11:23:00 | FromGitter | <alehander42> so the whole invocation preserves |
11:23:03 | FromGitter | <alehander42> not nil safety |
11:23:09 | solitudesf | trying to package choosenim for my distro, but `nimble build` fails with `Error: unhandled exception: cannot open: /tmp/nimblecache/nimscriptapi.nim [IOError]`. what could be the cause? |
11:24:42 | Araq | solitudesf, no idea, your disto hates /tmp? |
11:25:41 | solitudesf | im sure not. it was building fine with older/with-compiler version of nimble. |
11:32:43 | Araq | try 'koch nimble' instead |
11:33:04 | FromDiscord | <exelotl> @Kiloneie I'd recommend also doing some post processing on the audio. Use a gate to eliminate background noise, compressor to reduce the difference between loud and quiet sections and a limiter to maximise the volume without clipping |
11:33:29 | * | owl_000 quit (Ping timeout: 265 seconds) |
11:33:48 | FromDiscord | <exelotl> (out of those I'd say limiter is the most important) |
11:33:58 | FromDiscord | <Kiloneie> i already have those in obs |
11:34:19 | FromDiscord | <Kiloneie> that's how i can't hear my background noise |
11:34:36 | FromDiscord | <Kiloneie> let me check again though |
11:36:46 | FromDiscord | <Kiloneie> i put my volume to max, and i hear some static like sound maybe, but im pretty sure that's my computer |
11:37:07 | FromDiscord | <Kiloneie> which is a dark base 900 chasis, made to reduce noise |
11:37:12 | FromDiscord | <Kiloneie> idk |
11:37:21 | FromGitter | <alehander42> https://paste.ofcode.org/yGDVcfhgn5eTCyLEgBE4tx |
11:37:33 | FromDiscord | <Kiloneie> at 50% i hear none of those things, |
11:37:49 | clyybber | solitudesf: For void? |
11:37:56 | solitudesf | yes |
11:38:11 | * | laaron quit (Quit: ZNC 1.7.4 - https://znc.in) |
11:38:27 | FromGitter | <alehander42> Araq ^ something like this in ~pseudo code |
11:39:28 | * | laaron joined #nim |
11:39:56 | FromGitter | <alehander42> often processing code just copies other values from another collection/generates new ref values in a loop when grow/setLen is used |
11:40:10 | FromDiscord | <Kiloneie> Yeah okay 60% volume and up i can hear my computer, under that it's not there. Not much i can do about that though, it's already top of the line sound dampening, i could try to move my desk a bit away from it, or put some cardboard in between, maybe that would help some |
11:43:43 | FromDiscord | <Kiloneie> I will put a towel under my microphone stand, put some carboard seperating my computer, adjust my obs settings a bit more, now targeting max volume, and use a quieter keyboard, then make a video #2 with that, and hopefully it's gonna be much better. |
11:44:46 | * | endragor quit (Remote host closed the connection) |
11:48:02 | FromDiscord | <Mamy> offtopic: so updating fontconfig seems to have broken Gitter forever and the desktop client had no commits on master since 7 months :/ |
11:50:16 | FromGitter | <alehander42> there is a desktop client? |
11:53:15 | FromGitter | <alehander42> https://www.zerotier.com/zerotier-2-0-status/ "Go feels like a somewhat different animal geared toward rapidly developing high quality servers, interfaces, APIs, and management backends." i often felt this is a niche nim can shine in: all kinds of TUI-s/CLI-s and simple API-s/services |
11:53:43 | FromGitter | <alehander42> still dont understand why so many cli tools/interfaces are being written in go these days |
11:53:45 | clyybber | Araq: Found a cool bug: https://github.com/nim-lang/Nim/issues/12260 |
11:53:55 | clyybber | Its not deterministic afaict |
11:55:13 | alops | That's a lot of open issues :o |
11:56:03 | FromDiscord | <Mamy> @alehander: https://gitter.im/apps |
11:56:08 | Zevv | Does anyone know of a hack to get a fallthrough behaviour in a case or sequence of ifs? |
11:56:10 | FromDiscord | <Mamy> alehander42 ^ |
11:56:37 | clyybber | Zevv: Maybe with named blocks and break? |
11:56:48 | FromDiscord | <Mamy> I use goto 😛 |
11:57:04 | clyybber | Mamy: There is no goto in nim :p |
11:57:20 | Zevv | yeah, there is a kind-of-goto |
11:57:21 | FromDiscord | <Mamy> I beg to differ: https://github.com/mratsim/weave/blob/330a5113e62f332441397208b1084008a576f83f/e04_channel_based_work_stealing/runtime.nim#L988 |
11:58:01 | FromDiscord | <Mamy> but yeah named blocks + break work, I use them as well |
11:58:13 | Zevv | araq told me about that once, let me refresh my memory, mayby that can help me with new insights I have now |
11:58:45 | clyybber | Mamy: Oh, how does that work? Is there any documentation on this? |
11:58:59 | FromDiscord | <Mamy> no it's undocumented, but there is a test case |
12:00:01 | FromDiscord | <Mamy> ah, this: https://forum.nim-lang.org/t/1320#8332 |
12:00:03 | FromGitter | <alehander42> alops, not really: most languages have more issues |
12:00:18 | FromGitter | <alehander42> but this is normal, the more usage you have , the more issues |
12:00:23 | Zevv | basically, I have pretty long things like this http://ix.io/1WSN where a lot of cases require a loop iteration, while a fallthrough would suffice |
12:00:36 | FromDiscord | <Mamy> basically you have goto blocks as enum values |
12:00:55 | FromDiscord | <Mamy> change the enum values of your control variable and you change block |
12:01:39 | clyybber | Mamy: Ah, so its kind of equivalent to computedGoto |
12:01:53 | Zevv | Yes, but what I did not say: I also need to go to computed values |
12:01:59 | Zevv | so that was why this did not work for me |
12:02:01 | FromDiscord | <Mamy> @Zevv it seems like you want a Duff's device |
12:02:10 | Zevv | mamy: right indeed |
12:02:32 | clyybber | Zevv: What about the named blocks? |
12:02:45 | mpcjanssen | Using choosenim to install nim 1.0.0 fixes the nimble issue. Seems homebrew nim 1.0.0 is broken |
12:02:52 | Zevv | clyybber: how would that work, any examples anywhere? |
12:03:03 | clyybber | https://nim-lang.github.io/Nim/manual.html#statements-and-expressions-block-statement |
12:03:17 | clyybber | Zevv: Assuming I understand you correctly |
12:03:23 | FromDiscord | <Mamy> I have an example here: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/backend/openmp.nim#L55-L67 |
12:03:29 | FromDiscord | <Shield> sadly Duff's device isn't enough of an excuse to change Case behavior or even make a new keyword that doesn't break by default in each case |
12:04:11 | FromDiscord | <Mamy> so you would have nested named blocks just call "break mynameblock1" |
12:04:16 | clyybber | Zevv: Or do you want something like a C switch statement? |
12:04:42 | Zevv | clyybber: that is my intuition yes. What I *actually* would like is a 'goto whatever I say' :) |
12:04:58 | FromDiscord | <Mamy> use a computed goto otherwise |
12:05:15 | Zevv | but see my last ix.io example. The case 0 and case 1 both allow for fallthrough, but case 2 requires a jump-to-computed block |
12:05:23 | Zevv | which rulels out the {.goto.} |
12:05:40 | FromDiscord | <Mamy> computedGoto is different |
12:05:43 | FromGitter | <gour> @Araq my sincere congratulations for achieving 1.0 release as well as bulding nice community around the project! |
12:05:48 | FromDiscord | <Mamy> see second example here: https://github.com/status-im/nimbus/wiki/Interpreter-optimization-resources#nim-implementation-benchmark |
12:05:54 | Zevv | gour: the community was always nice :) |
12:06:34 | Zevv | mamy: that looks similar, let me check |
12:06:35 | FromDiscord | <Mamy> that's probably the best way to do what you want |
12:07:40 | FromDiscord | <Shield> did the goto pragma name changed or it has 2 names? |
12:07:47 | Zevv | ok, cumputedgoto is simply hinting at the C level that a computed goto would be appropriate here, although it will still hit the while() loop every iteration |
12:08:03 | Zevv | I'm micro-optimizing stuff away, but my inner loop now still eats about 15% of my performance |
12:08:29 | * | navin quit (Remote host closed the connection) |
12:08:30 | Zevv | I suspect branch prediction is also not optimal here |
12:10:07 | * | navin joined #nim |
12:11:14 | * | rockcavera joined #nim |
12:11:21 | FromDiscord | <Mamy> actually it generates a jump label table with &&something |
12:11:38 | PMunch | Zevv, we were just talking about this in #nim-offtopic: https://www.youtube.com/watch?v=r-TLSBdHe1A |
12:11:47 | PMunch | Might be interesting, especially the second part with the coz profiler |
12:12:02 | FromDiscord | <Shield> it looks like .goto. doesn't require being inside a while true loop, i didn't know that |
12:12:31 | alops | is there a big int library? |
12:12:39 | alops | arbitrary precision that is |
12:12:58 | FromDiscord | <Mamy> @PMunch here is coz wrapper for nim: https://github.com/mratsim/weave/blob/master/e04_channel_based_work_stealing/primitives/coz.nim |
12:12:59 | PMunch | There is Stint |
12:13:09 | FromDiscord | <Mamy> Stint is not arbitrary it's fixed |
12:13:17 | FromDiscord | <Mamy> there is a wrapper for gmp |
12:13:34 | FromDiscord | <Mamy> nim-bigint is available but it's not optimized |
12:13:39 | PMunch | Yeah I know, answered after having just read big int. |
12:13:54 | PMunch | Oh cool, that is for setting the progress thingies? |
12:14:08 | clyybber | Zevv: Maybe using templates and a single if statement would be faster? I suppose code size will suffer though |
12:14:15 | alops | can't use gmp wrapper due to its license |
12:14:16 | FromDiscord | <Mamy> if you look in coz repo, coz generates a file (json) tat you can paste on a website |
12:14:16 | clyybber | s/code size/binary size |
12:14:35 | Zevv | clybber: I don't really care about code size right now |
12:14:59 | FromDiscord | <Mamy> I plan to write a contant-time modular bigint for crypto, but never had the time, + I have a showstopper bug for my design :/ |
12:16:05 | Zevv | clyybber: and the function calls in my example are not really there, those are already expanded |
12:16:07 | FromDiscord | <Mamy> one thing that you can do |
12:16:33 | FromDiscord | <Mamy> is use this for the time being: https://github.com/status-im/nim-decimal |
12:16:53 | FromGitter | <gour> @Zevv, I meant to say in terms of "size" ;) |
12:17:15 | Zevv | ooh :) |
12:17:32 | * | gour joined #nim |
12:18:14 | FromDiscord | <Kiloneie> What is better, a big piece of wood(for a desk) or a lot of cardboard for sound insulation/dampening ? |
12:19:34 | clyybber | cardboard |
12:20:27 | clyybber | Best would be some stonewool/glasswool inside of plastic wrap |
12:20:38 | FromDiscord | <Kiloneie> lucky me i got a shit ton of that , just not the biggest of pieces |
12:20:43 | FromDiscord | <Kiloneie> don't have that |
12:21:13 | FromDiscord | <Kiloneie> imma build a wall next to my computer xD |
12:21:17 | clyybber | lol |
12:21:19 | alops | Mamy, trying nim-decimal, but unable to import it after install. Tried decimal, decimal/decimal, uppercase variants etc |
12:21:43 | FromDiscord | <Kiloneie> Make sound great again ! imma let myself out now. |
12:21:56 | clyybber | wait, Mamy, are you mratsim? |
12:22:33 | PMunch | Kiloneie, there is a guy on YouTube who does some DIY sound isolation stuff |
12:22:37 | PMunch | DIY Perks IIRC |
12:23:17 | gour | the other day I stumbled upon one app written in Eiffel(Studio) and out of curiosity installed that IDE (https://www.eiffel.com/) - it looks nice and wonder what could be missing in Nim's ecosystem to provide something similar (where it is applicable) considering the differences in programming paradigms between Nim & Eiffel? |
12:23:33 | Zevv | well yes, I tried {.computedGoto.} again, and this time it fit and worked, 25% improvement! |
12:23:34 | PMunch | Mamy, how does the channel based work stealing work in Nim? I've been looking at work stealing, but the separate heaps of the GC makes it not too trivial.. |
12:23:56 | Zevv | daang that's a pretty easy gain, 25% in 10 minutes. Thanks ppl! |
12:24:03 | FromDiscord | <Shield> amazing, {.goto.} isn't just a hint, it translates to goto |
12:24:25 | FromDiscord | <Kiloneie> @PMunch i will check that out |
12:24:26 | clyybber | Zevv: Nice, are you working on npeg? |
12:24:30 | Zevv | what else :) |
12:25:49 | clyybber | Nice, can npeg parse to an enum at compile-time? |
12:26:00 | Zevv | At my current work I can not get to concentrate on *anything* at all, it's different things twice a day, a lot of plumbing and ploughing to other peoples code. So my spare time is now filled with totally overengineering and microoptimizing. Every time I walk the dog something new comes to mind, it's great to go *deep* |
12:26:16 | Zevv | How do you mean 'parse to an enum'? |
12:26:19 | Zevv | example? |
12:26:31 | PMunch | phrasing.. |
12:26:54 | Zevv | .. |
12:26:55 | * | alops quit (Quit: leaving) |
12:28:42 | * | Hideki_ joined #nim |
12:29:13 | clyybber | Zevv: Something like this: http://ix.io/1WT6 |
12:29:37 | Zevv | yes. |
12:29:41 | Zevv | gimme a minute |
12:31:39 | * | Entropic is now known as icyphox |
12:33:38 | Zevv | http://ix.io/1WT9 |
12:33:50 | Zevv | --> @[door, wall, floor, window, pond, hole] |
12:34:47 | clyybber | Amazing, thanks! |
12:34:54 | clyybber | I have to dig into npeg |
12:35:08 | clyybber | Oh |
12:35:22 | clyybber | But Zevv, can I generate the enum at compile time? |
12:35:22 | Zevv | and the compile-time variant: http://ix.io/1WTc |
12:35:38 | clyybber | Like the type section itself? |
12:35:47 | gour | if nim project would need to include 3rd party C lib and build bindings for it which build system would you recommend or Nim's own ecosystem can handle it? |
12:36:12 | Zevv | clybber: then I still do not understand your question I think. This parses text and creates a const seq[someThing] from the text |
12:36:39 | clyybber | Zevv: And I want it to parse text and create an enum type from the text |
12:36:44 | Zevv | *create* an enum type |
12:37:04 | * | Zevv scratches his head |
12:37:48 | Zevv | well, I built you a const seq of strings. Can you create a macro that builds an enum type of that? :) |
12:38:07 | PMunch | gour, you can use c2nim or nimterop to generate the bindings, then Nim handles the rest. |
12:38:13 | clyybber | Zevv: Ah sure, thanks |
12:38:21 | * | laaron quit (Quit: ZNC 1.7.4 - https://znc.in) |
12:38:28 | Zevv | interesting use case though! |
12:38:50 | Zevv | I guess I should even be able to parse into NimNodes and parse another language and compile to nim |
12:39:07 | * | laaron joined #nim |
12:39:14 | Zevv | Not that that would be *fun* to do, but it should be very possible |
12:40:22 | FromGitter | <alehander42> you can do something like ⏎ ⏎ proc inLisp(e: int) {.lisp.} = ⏎ "(display (* e 2))" [https://gitter.im/nim-lang/Nim?at=5d8b6035309dc95e597a51fc] |
12:40:45 | shashlick | Wow 1500+ messages |
12:40:59 | shashlick | Gave up on catching up |
12:41:45 | FromGitter | <alehander42> sue me, but a chat with threads would work greatly for this |
12:41:52 | gour | PMunch: the build system is provided by nimble? |
12:41:58 | clyybber | Zevv, alehander42: That would indeed be very cool |
12:42:04 | clyybber | And !!FUN!! to build |
12:42:06 | clyybber | .. |
12:42:50 | * | laaron quit (Client Quit) |
12:43:04 | Zevv | alehander42: c'mon, of all things I can parse, you ask me to parse *lisp* |
12:43:38 | FromGitter | <alehander42> well, it's the factorial of syntaxes |
12:43:46 | FromGitter | <alehander42> parse C++ |
12:44:09 | FromGitter | <alehander42> come at it bro |
12:44:09 | clyybber | parse befunge |
12:44:24 | FromGitter | <alehander42> parse perl4 |
12:44:46 | * | laaron joined #nim |
12:46:20 | * | laaron quit (Client Quit) |
12:47:20 | Zevv | Here is your lisp parser: http://ix.io/1WTk |
12:47:32 | * | Hideki_ quit (Remote host closed the connection) |
12:47:35 | Zevv | and here is java1.6 http://zevv.nl/div/java.html |
12:47:47 | Zevv | I have heard rumours C++ can not be parsed |
12:48:01 | Zevv | mumble-numble-something-NP-numble |
12:48:38 | clyybber | What? |
12:48:47 | clyybber | Is parsing Cpp np hard? |
12:49:20 | Zevv | it must be |
12:49:23 | Zevv | I find C++ hard |
12:50:30 | Zevv | people complain that Nim has too many ways to do X or Y. I point them to C++ and they say, "Yeaaah, but C++ is different" |
12:50:33 | Zevv | booooh, I say |
12:51:36 | * | laaron joined #nim |
12:52:27 | PMunch | gour, yeah nimble can be used to build. But it is mostly for ensuring that you have the packages you need |
12:52:44 | PMunch | Not quite sure what kind of tasks you want from your build system |
12:52:51 | clyybber | If ppl want only one way to do anything they should write in pure lambda calculus and make a linter that simplifies the terms |
12:53:04 | Zevv | APL to the max |
12:54:08 | clyybber | I like these commit messages, he has been doing those for years lol: https://github.com/githwxi/ATS-Xanadu/commits/master |
12:55:01 | * | hhr quit (Ping timeout: 268 seconds) |
12:56:01 | PMunch | clyybber, what?! That's horrible! |
12:56:12 | FromDiscord | <Shield> https://github.com/b3liever/looper |
12:56:33 | FromDiscord | <has1> hi, i am getting an error when trying to install nim on linux mint |
12:56:53 | FromDiscord | <has1> ``` |
12:56:54 | FromDiscord | <has1> Extracting nim-1.0.0.tar.xz |
12:56:54 | FromDiscord | <has1> Building Nim 1.0.0 |
12:56:54 | FromDiscord | <has1> Exception: Execution failed with exit code 1 |
12:56:54 | FromDiscord | <has1> ... Command: sh build.sh |
12:56:54 | FromDiscord | <has1> ... Output: # OS: linux |
12:56:55 | FromDiscord | <has1> ... # CPU: amd64 |
12:56:57 | FromDiscord | <has1> ... gcc -w -O3 -fno-strict-aliasing -Ic_code -c c_code/1_2/stdlib_assertions.nim.c -o c_code/1_2/stdlib_assertions.nim.o |
12:56:59 | FromDiscord | <has1> ... In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed/syslimits.h:7:0, |
12:57:01 | FromDiscord | <has1> ... from /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed/limits.h:34, |
12:57:03 | FromDiscord | <has1> ... from c_code/nimbase.h:257, |
12:57:05 | FromDiscord | <has1> ... from c_code/1_2/stdlib_assertions.nim.c:6: |
12:57:08 | FromDiscord | <has1> ... /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed/limits.h:194:15: fatal error: limits.h: No such file or directory |
12:57:09 | PMunch | has1, again with the multi-line pastes.. |
12:57:10 | FromDiscord | <has1> ... #include_next <limits.h> /* recurse down to the real one */ |
12:57:11 | FromDiscord | <has1> ... ^~~~~~~~~~ |
12:57:13 | FromDiscord | <has1> ... compilation terminated. |
12:57:14 | FromDiscord | <has1> Cleaning failed build |
12:57:16 | FromDiscord | <has1> Error: Build failed |
12:57:16 | Zevv | stop that |
12:57:17 | FromDiscord | <has1> ``` |
12:57:20 | FromDiscord | <Shield> "Same functionality can be achieved with two templates" this exactly what happened to me when i spent a couple of days learning macros to unroll loops, then i did it in 3 lines with templates |
12:57:20 | clyybber | lol |
12:57:21 | FromDiscord | <has1> what can i do about that? |
12:57:23 | FromDiscord | <Shield> holy shit has1 |
12:57:31 | clyybber | has1: Use hastebin |
12:57:36 | PMunch | Or ix.io |
12:57:40 | FromDiscord | <has1> ahh true, i forgot |
12:58:02 | lqdev[m] | Zevv: I have a great idea for you. if you really don't want all of this colorful syntax highlighting, only green on black, how about making keywords bold and some other parts dark |
12:58:06 | lqdev[m] | this is just perfect |
12:58:18 | PMunch | But yeah, someone should fix FromDiscord to do that automatically.. |
12:58:23 | * | matlock quit (Ping timeout: 276 seconds) |
12:58:38 | * | SodaScripter quit (Ping timeout: 245 seconds) |
12:58:46 | FromDiscord | <has1> so this is the error https://pastebin.com/Xgg7VWSM |
12:59:00 | Zevv | lqdev[m]: naaaah, I'm fine :) |
12:59:50 | FromDiscord | <Shield> yeah, the bot should detect multiline code blocks and just trim them or auto dump them in a ix.io |
12:59:57 | lqdev[m] | has1: check out termbin or ix |
13:00:40 | lqdev[m] | @Shield the gitter bot can do that, it's just the discord bot that's broken |
13:00:43 | leorize | @has1: have you installed `build-essentials`? |
13:00:57 | * | laaron quit (Quit: ZNC 1.7.4 - https://znc.in) |
13:01:10 | leorize | lqdev[m]: the gitter bot can because you can see a discussion without logging in |
13:01:14 | FromDiscord | <has1> its bare installation |
13:01:18 | FromDiscord | <has1> so i dont think so |
13:01:35 | leorize | yea, you need to install that package before you can do any C building |
13:01:47 | clyybber | Shield: FYI you can do `while (name = readLineFromStdin("Enter your name: "); name.len == 0): echo "Empty value. Try again."` |
13:01:51 | FromDiscord | <has1> which package exactly? |
13:01:54 | clyybber | Found out yesterday |
13:02:01 | FromDiscord | <has1> ```sudo apt-get install build-essentials``` this one doesnt exist |
13:02:31 | leorize | try removing the `s` at the end |
13:02:38 | clyybber | Shield: You can even introduce new variables in the block before the condition and they will be in the scope of the while block |
13:02:38 | leorize | I'm not sure what's the exact name |
13:02:54 | FromDiscord | <has1> ah its the name, you are right |
13:03:31 | clyybber | Hey, our issue to star ratio is ~16% |
13:03:38 | clyybber | For reference rust is at ~13% |
13:03:40 | FromDiscord | <Shield> that is actually pretty neat clyybber |
13:03:54 | PMunch | clyybber, is that a useful metric? |
13:04:00 | clyybber | PMunch: Not really |
13:04:05 | PMunch | Haha |
13:05:06 | PMunch | I mean my toy language stacklang has inf% star to issue ratio. alehander42 stared it, and I have no issues :) |
13:06:00 | clyybber | Hehe, but the issue to star ratio is still at 0.. |
13:06:17 | clyybber | Which is what I was referring to |
13:06:18 | FromDiscord | <has1> hi |
13:06:27 | clyybber | has1: hi |
13:06:45 | FromDiscord | <has1> shouldn't the install instructions be updated to mention the dependency on build-essential ?? |
13:07:01 | FromDiscord | <has1> or shouldn't the script itself install build-essential ?? |
13:07:05 | leorize | well, not everyone runs a debian-derivative |
13:07:40 | FromGitter | <alehander42> PMunch i've thoguth about |
13:07:44 | FromGitter | <alehander42> pagerank for github start |
13:07:44 | leorize | and if you do development knowing that you need to install `build-essential` is common sense |
13:07:45 | FromGitter | <alehander42> for a while |
13:07:52 | FromGitter | <alehander42> because e.g. i starred a lot of stuff before |
13:08:14 | FromDiscord | <has1> So its ok for it not to work out of the box for the most widely used linux distros out there? |
13:08:22 | FromGitter | <alehander42> but on the other hand that's a pretty petty thing to add to a simple star rated site |
13:08:38 | FromGitter | <alehander42> so i am glad it isnt there |
13:09:09 | FromDiscord | <has1> @leorize golang works fine without this and I did not know that you need to install it |
13:09:25 | FromDiscord | <has1> So i guess i dont have common sense, that's a nice way to talk to new users |
13:09:37 | leorize | because go is packaged by your distribution |
13:09:49 | leorize | they already included the needed dependency when you install it |
13:09:51 | FromGitter | <alehander42> `You probably already have a compiler installed. If not, use your package manager to install either gcc or clang.` |
13:09:55 | FromGitter | <alehander42> isn't this enough? |
13:10:02 | leorize | no |
13:10:03 | FromDiscord | <has1> no. I downloaded it from https://golang.org/ |
13:10:04 | solitudesf | fetch random github repo, do `make` in it and see if it works |
13:10:10 | FromGitter | <alehander42> is there anything else needed by build-essential |
13:10:15 | leorize | debian-derivative split stuff into `libc-dev`, etc |
13:10:20 | leorize | because "headers are heavy" |
13:10:28 | FromGitter | <alehander42> ah |
13:10:40 | FromDiscord | <has1> @leorize so you are wrong. |
13:10:41 | FromGitter | <alehander42> well, then it can be mentioned for debian i guess |
13:11:07 | leorize | @has1 i stand corrected |
13:11:21 | leorize | but don't quote me as if I'm authorative in this project :P |
13:11:50 | leorize | just stating my experiences of developing on *nix |
13:12:25 | leorize | @has1: https://github.com/nim-lang/Nim |
13:12:34 | leorize | the dep is already mentioned in the README |
13:12:58 | * | owl_000 joined #nim |
13:13:30 | leorize | build_all.sh is made for the compiler devs to quickly rebuild a newer version |
13:13:42 | leorize | which explains why it doesn't have all the dep checking |
13:15:10 | FromDiscord | <has1> doesn't that defeat the purpose? choosenim is supposed to make it easy to install nim, correct? If i have to manually install stuff myself then it kinda defeats the purpose, doesn't it? |
13:15:14 | * | navin quit (Ping timeout: 240 seconds) |
13:15:22 | leorize | oh, so you got it from choosenim? |
13:15:28 | leorize | please file an issue there then |
13:15:37 | leorize | I thought you were compiling Nim from the git repo |
13:15:38 | FromDiscord | <has1> yes |
13:16:24 | FromDiscord | <Shield> i'm using spartan mode, aka renaming nim folder to switch versions lol |
13:16:39 | solitudesf | https://github.com/dom96/choosenim#dependencies |
13:16:43 | shashlick | Choosenim doesn't install compiler except on Windows |
13:17:10 | leorize | federico3: do you have a ppa for linux mint? it might be useful for new users to skip all the building stuff |
13:18:03 | federico3 | leorize: no need for a ppa, Nim is in Debian |
13:19:00 | federico3 | doesn't mint has a process to ingest packages from Ubuntu or Debian? |
13:19:19 | narimiran | mint takes from ubuntu LTS, IIRC |
13:19:37 | leorize | you can't get the latest version of Nim unless you also runs the latest version of debian |
13:19:59 | federico3 | LTS? For a desktop distribution? |
13:21:07 | leorize | ubuntu still recommends LTS iirc |
13:21:26 | leorize | also, wouldn't you need to be on debian unstable to get the latest nim? |
13:22:02 | * | hhr joined #nim |
13:22:07 | federico3 | yes, albeit you can pull the package from Unstable. However I can do an official backport |
13:22:18 | PMunch | clyybber, oh issue to star ratio... Yeah that is at 0%, but you want that to be the case right? |
13:23:07 | clyybber | Yeah :p |
13:23:35 | federico3 | leorize: how can you ask for a package inclusion in Mint? |
13:24:18 | leorize | no idea |
13:24:19 | shashlick | Both the nim website and choosenim talk about dependencies |
13:24:41 | shashlick | As a new user, you are expected to read some documentation |
13:25:20 | shashlick | People are happy to help here as well as learn from new user experience |
13:25:46 | FromDiscord | <has1> @shashlick https://nim-lang.org/install_unix.html |
13:25:57 | FromDiscord | <has1> where does that say to install build-essential ? |
13:26:04 | PMunch | has1, if you get choosenim from your package manager it should grab build-essentials as well as a dependency. And I agree that 90% of devs will already have this, if it wasn't pre-installed on their distro to begin with. And "why not just install it automatically" is exactly what your package manager is for, which is why grabbing it from there should solve this issue. |
13:26:11 | solitudesf | `The Nim compiler needs a C compiler in order to compile software. ` |
13:26:13 | solitudesf | here |
13:26:13 | shashlick | It says to install your c compiler |
13:26:36 | sealmove | leorize: https://github.com/kaitai-io/kaitai_struct_compiler |
13:26:41 | shashlick | Is it really sensible to document install instructions for every single distro |
13:26:41 | leorize | on debian and its derivative, installing the c compiler is never enough |
13:27:02 | shashlick | Then that's a Debian doc issue |
13:27:04 | sealmove | No, haven't done any measurements, but apart from this edge case, inheritance is not needed. |
13:27:10 | federico3 | not everybody wants to use Nim with the compiler |
13:27:16 | FromDiscord | <has1> @PMunch i was installing it from the website https://nim-lang.org/install_unix.html |
13:27:38 | FromDiscord | <has1> @solitudesf i already had gcc installed and it still didnt work |
13:27:42 | PMunch | But you didn't follow the instructions to have a C compiler? |
13:27:57 | leorize | they already have gcc |
13:28:02 | PMunch | Ah, I guess it could mention that you need build-essentials as well.. |
13:29:07 | leorize | you probably wouldn't need the entire set |
13:29:08 | FromDiscord | <has1> @PMunch "Linux |
13:29:08 | FromDiscord | <has1> |
13:29:09 | FromDiscord | <has1> You probably already have a compiler installed. If not, use your package manager to install either gcc or clang." |
13:29:15 | leorize | just libc-dev should be fine |
13:29:15 | FromDiscord | <has1> and i already have gcc |
13:29:24 | * | BigEpsilon joined #nim |
13:29:30 | shashlick | Google Debian c compiler |
13:29:44 | federico3 | has1: what's the error message? |
13:30:08 | FromDiscord | <has1> by the way though, this part is way down under "manual installation" |
13:30:09 | shashlick | Every link talks about build-essential |
13:30:23 | * | navin joined #nim |
13:30:26 | leorize | #include_next <limits.h> no such file or directory |
13:30:29 | federico3 | I'm adding a Recommends: for build-essential |
13:30:44 | FromDiscord | <has1> as a user, why would i scroll down there if i dont want to do a manual installation? And it still doesnt mention build-essential |
13:31:06 | FromDiscord | <has1> @shashlick "Every link talks about build-essential" which link? |
13:31:11 | FromDiscord | <has1> you mean the github? |
13:31:15 | shashlick | This is really ridiculous |
13:32:08 | shashlick | You don't expect to read the docs but want this documented |
13:32:12 | PMunch | Every link that comes up when you google the kind of errors yo have |
13:32:25 | leorize | to be fair, for a beginner tool like `choosenim`, some instructions should be there |
13:32:53 | Cadey | let's go file a PR |
13:32:58 | Cadey | nim has the distros module |
13:33:03 | PMunch | Yeah I agree that choosenim, if not installing it automatically could at least do a check to see if it isn't installed and stop, giving a more straight error to the user that they are missing something. |
13:33:05 | Cadey | https://nim-lang.org/docs/distros.html |
13:33:22 | FromDiscord | <has1> @shashlick i read the website. It gives me this 1 command to install nim using "choosenim", below that i get instructions for "Manual installation" |
13:33:29 | * | LargeEpsilon_ quit (Ping timeout: 276 seconds) |
13:33:44 | FromDiscord | <has1> but even in the Manual installation, it doesn't mention build-essential, it mentions gcc (which i have installed) |
13:33:46 | Cadey | foreignDepInstallCmd("build-essential") |
13:33:59 | Cadey | or foreignDepInstallCmd("alpine-sdk") |
13:34:01 | Cadey | etc |
13:34:24 | Cadey | i misread |
13:34:29 | Cadey | i'm tired |
13:34:34 | Cadey | foreignDep* |
13:35:01 | shashlick | So if it said c compiler instead of gcc, would it be any clearer? |
13:35:10 | FromGitter | <alehander42> yes, choosenim can check/doc that |
13:35:15 | shashlick | You'd still run into the issue |
13:35:24 | Cadey | it would be nice if there was a function in distros that returned your current distro |
13:35:31 | Cadey | i wonder how difficult that would be to implement |
13:35:38 | PMunch | has1, I guess no one every really came across this as most of us already have build-essentials installed. It's good to get new users so we can see what friction there is to the install process for complete beginners. |
13:35:53 | shashlick | Add a line saying check your distro docs how to do get a c compiler and call it |
13:35:55 | leorize | Cadey: it's easy thanks to systemd :P |
13:36:14 | PMunch | Cadey, probably does that in the macro from distros.nim |
13:36:15 | federico3 | Cadey: there is but some distros don't even bother... |
13:36:16 | Cadey | i don't use systemd on most of my nim installs |
13:36:20 | PMunch | So you could have a look at how it does it. |
13:36:24 | FromDiscord | <has1> @shashlick well not for me at least. My understanding is that gcc IS a c compiler. If i already have that installed, why would i need build essential? I dont know what that is. |
13:36:25 | FromDiscord | <has1> |
13:36:25 | FromDiscord | <has1> but that is besides the point. I would expect choosenim to install those dependencies for me (i thought that is kind of the point of it) |
13:36:25 | FromDiscord | <Kiloneie> is it harder to install on mac os and linux ? |
13:36:44 | Cadey | with macos you need to install the xcode command line tools |
13:36:46 | FromDiscord | <Delta231> it takes time |
13:36:48 | Cadey | which is a trivial thing |
13:36:53 | solitudesf | you expect choosenim to handle every dependency on every linux distro? |
13:37:06 | PMunch | choosenim is meant to choose the version of Nim |
13:37:12 | Cadey | solitudesf: if we can at least get debian and ubuntu we should be okay |
13:37:26 | PMunch | So you can switch between versions, grab the latest devel, or update the stable channel easily. |
13:37:29 | FromDiscord | <has1> I also have some good news though, the visual studio code extension works on ubuntu correctly when you set the nim binary in your .bashrc file (This didn't work on manjaro, i had to set the path inside /etc/profile ) |
13:37:36 | FromDiscord | <Delta231> |
13:37:36 | FromDiscord | <Delta231> https://cdn.discordapp.com/attachments/371759389889003532/626411986367807488/unknown.png |
13:37:53 | PMunch | It's mostly a tool to keep your Nim install up to date and allow you to move between versions (which might become less common now that 1.0 is out). |
13:38:19 | FromDiscord | <Kiloneie> Whever i installed any software and any programming language i just took the default stuff that is guaranteed to work. Shouldn't everyone do that first ? |
13:39:21 | Cadey | PMunch: i don't see a macro in distros.nim |
13:39:32 | FromDiscord | <Kiloneie> i honestly wouldn't use a compiler you used for Visual Studio, just because you used it with c++. |
13:39:36 | Cadey | oh i see |
13:39:38 | Cadey | you do it backwards |
13:40:07 | Cadey | i'll submit a PR |
13:40:29 | FromDiscord | <has1> @solitudesf yes, or at least tell me about the things i need to install on the website (github seems to mention build-essential but the website does not) |
13:40:58 | leorize | @Delta231 do you happen to be using gentoo? |
13:41:52 | FromDiscord | <Delta231> wsl |
13:42:01 | shashlick | You cannot document everything, especially since you can fix your issue in 30 seconds with Google |
13:42:06 | FromDiscord | <Shield> windows installation was super easy |
13:42:14 | FromDiscord | <Kiloneie> MinGW being default compiler for Nim is used for a reason of speed and minimalism correct ? |
13:42:21 | FromDiscord | <Kiloneie> Portability maybe too ? |
13:43:04 | FromDiscord | <Shield> minGW works, clang is awful |
13:43:15 | FromDiscord | <Shield> i keep getting dll related problems |
13:43:28 | FromDiscord | <Delta231> I don't wanna use mingw |
13:43:35 | shashlick | Being new to something means being open to learning stuff that you don't know or haven't experienced |
13:43:50 | shashlick | It does not mean more documentation |
13:44:08 | shashlick | Note also that people are willing to help here, stack overflow and that not |
13:44:31 | shashlick | Everything isn't wrong or broken needing fixing all the time |
13:45:11 | FromDiscord | <Shield> pretty much, programming is all about problem solving, being on linux already means a minimum tolerance for stuff breaking *cough* configs *cough* |
13:45:25 | solitudesf | website and tools are open. submit a pr if you think that documentation is lacking. |
13:45:41 | FromDiscord | <Shield> btw @shashlick how's your editor project going? did you try the newruntime? |
13:46:52 | leorize | @Shield use a proper distro :P |
13:47:50 | Cadey | submitting a PR |
13:48:02 | PMunch | Cadey, oh template sorry |
13:48:05 | FromDiscord | <Shield> sadly no distro can fix intel drivers for old graphic cards |
13:48:12 | Cadey | https://github.com/dom96/choosenim/pull/138 |
13:48:33 | FromDiscord | <Cadey~> @has1 is this a good start? I can PR the website after work |
13:49:19 | FromDiscord | <Shield> but out of curiosity, what's a proper distro? the only one i had fun with was puppylinux, i love live cd distros |
13:49:25 | FromDiscord | <has1> yes anything helps, either a message, warning, or installing it by default |
13:49:44 | shashlick | @Shield no luck, just tried yesterday cc @Araq - feud is still broken on 1.0 |
13:49:59 | Araq | shashlick, with --gc:boehm ? |
13:50:07 | shashlick | Ran in 32 bit but crashes in 64 bit |
13:50:08 | shashlick | Yes |
13:50:47 | federico3 | https://github.com/nim-lang/Nim/wiki/Common-Criticisms somebody should update this |
13:50:57 | FromDiscord | <Shield> is it hard to rewrite it to use newruntime? what's broken about it exactly? |
13:51:16 | Araq | Shield: we don't know, need to investigate |
13:52:29 | shashlick | Basically table is created by exe and modified by dll |
13:52:45 | shashlick | It then gets garbage collected probably cause it becomes empty |
13:53:10 | shashlick | Dll is also Nim binary |
13:53:33 | Araq | the DLLs all should be built with --gc:boehm |
13:54:11 | FromGitter | <alehander42> very interesting how the julia people were up in arms about x being the same as X |
13:54:36 | FromGitter | <alehander42> you can never predict all the possible issues /misconceptions for different auditory |
13:55:10 | FromDiscord | <Shield> ah, i'm looking at that issue about tables crashing and i can't seem to find it, the other one was related to loading multiple libraries causing problem depending on the order |
13:55:32 | shashlick | Yes it is also being built with boehm - I'll check to be sure though |
13:56:44 | FromDiscord | <Shield> i lowkey want to make a minimal plugin system with newruntime, but i still don't know how to monitor memory leaks properly on windows |
13:58:04 | clyybber | Araq: Is `array[someEnum, something]` a valid type? |
13:58:11 | leorize | yes |
13:58:13 | Araq | certainly |
13:58:32 | leorize | if the enum is w/o holes iirc |
13:59:09 | * | BigEpsilon quit (Ping timeout: 268 seconds) |
13:59:11 | clyybber | Ok, then this should work: http://ix.io/1WTS ? |
13:59:26 | FromGitter | <alehander42> Shield, i guess valgrind? |
13:59:37 | leorize | valgrind don't run on windows |
13:59:39 | FromGitter | <alehander42> or do you mean, while working normally |
13:59:41 | FromGitter | <alehander42> ohhhh |
13:59:58 | FromGitter | <alehander42> well, what are the window equivalents |
14:00:45 | leorize | @Shield a proper distro depends a lot on your use case :P |
14:01:11 | leorize | I found that Arch gives me the least amount of problems |
14:01:24 | PMunch | leorize, ditto |
14:01:33 | * | nif quit (Quit: ...) |
14:01:43 | * | nif joined #nim |
14:01:43 | PMunch | clyybber, not sure you can initialise an array that way.. |
14:01:48 | Cadey | the distros module leaves a lot to be desired :( |
14:02:13 | shashlick | I think config files might be my problem |
14:02:19 | shashlick | Need to test the theory |
14:02:23 | narimiran | alehander42: thanks for replying there on julia forum |
14:02:24 | * | dddddd joined #nim |
14:02:35 | clyybber | PMunch: Lets ask Araq |
14:02:40 | * | hhr quit (Quit: WeeChat 2.4) |
14:02:46 | clyybber | PMunch: If you are referring to the explicit indexes, that should work |
14:02:52 | clyybber | its in the manual |
14:03:16 | Araq | it's also covered by tests |
14:03:27 | PMunch | Huh, never seen that before |
14:03:35 | PMunch | But yeah, that works.. |
14:03:35 | clyybber | Ok, so this is a bug? |
14:03:58 | clyybber | Error: type mismatch: got <array[0..3, int]> but expected 'Tile = CompositeTypeClass' |
14:04:16 | FromDiscord | <Shield> yeah windows debug tools are lacking, there's a tool for detecting memory leaks but apparently if it's reachable it's not a leak |
14:04:26 | FromDiscord | <Shield> only segfaults are easy to detect |
14:04:27 | PMunch | clyybber, yeah that makes sense |
14:04:32 | clyybber | That error isn't particularily great either. I came across that ` = CompositeTypeClass` in error messages often recently |
14:04:33 | Araq | Cadey, why, it's aweseom |
14:04:38 | * | nif quit (Client Quit) |
14:04:59 | * | nif joined #nim |
14:05:03 | Cadey | Araq: it is, but i'd like to be able to get the list of commands for the current OS |
14:05:14 | Araq | Tileset[n: enum] = array[n, Discriminator[n]] # ok, so it's a generic |
14:05:27 | PMunch | You try to cast [Air: 1, Land: 0, Water: 0, Wall: 0], an array of four ints into a Tile which is an object with twe fields `a` the array your probably trying to assign, and `collapsed` a bool. |
14:05:27 | Araq | ah never mind |
14:05:46 | Araq | Cadey, what "commands"? |
14:05:51 | * | krux02 quit (Remote host closed the connection) |
14:05:56 | leorize | @Shield: then it's a logical leak |
14:06:28 | Cadey | Araq: https://github.com/nim-lang/Nim/blob/version-1-0/lib/pure/distros.nim#L185 |
14:06:31 | leorize | those are terrible |
14:07:17 | clyybber | PMunch: Ah right |
14:07:32 | * | bertiebun quit (Remote host closed the connection) |
14:08:06 | * | nif quit (Client Quit) |
14:08:17 | * | nif_ joined #nim |
14:08:18 | Araq | Cadey, it's private, use the API |
14:08:30 | Araq | if detectOs(Ubuntu): foreignDep "lbiblas-dev" foreignDep "libvoodoo" |
14:08:45 | Cadey | yes but how do i get the contents of that without implicitly echoing them? |
14:09:05 | Araq | it's for the Nimble integration |
14:09:17 | Cadey | ref: https://github.com/dom96/choosenim/pull/138#pullrequestreview-293091480 |
14:09:36 | clyybber | Araq, PMunch: Ok this one is definitely a bug: http://ix.io/1WTY |
14:09:45 | clyybber | Spits out an internal error |
14:10:18 | FromGitter | <alehander42> i didnt know this syntax exist |
14:10:47 | PMunch | Yes, that is an error. But it's probably caused by you not specifying `n` for your tile. |
14:10:57 | PMunch | clyybber, if you change them to Tile[Tiles](a: [Air: 1, Land: 0, Water: 0, Wall: 0], collapsed: false) it works fine |
14:11:12 | * | nif_ quit (Client Quit) |
14:11:21 | * | nif joined #nim |
14:11:33 | Araq | Cadey, ah, hmm, well it was written for Nimble and it shows |
14:11:41 | clyybber | PMunch: Shouldn't the type inference be smart enough? |
14:11:42 | Araq | however I can offer you a hack |
14:12:08 | PMunch | clyybber, yes, and it should also make tea |
14:12:17 | PMunch | Oh shit, I've gotta run! |
14:12:19 | * | PMunch quit (Remote host closed the connection) |
14:12:49 | Cadey | Araq: i'm half considering just pr-ing a function to the distros module that returns either a copy of the seq[string] or allows you to run your own function on the contents of it |
14:12:51 | Araq | Cadey, 'include distros' instead of 'import distros' and then you have access to the internals |
14:13:02 | Cadey | i love and hate that |
14:13:05 | Araq | :D |
14:13:21 | Cadey | nim amazes me daily |
14:14:07 | Araq | and watch out that you include it only once |
14:14:16 | * | BigEpsilon joined #nim |
14:14:18 | Araq | to prevent duplicated symbols and code bloat |
14:14:51 | FromGitter | <alehander42> clybber, thats where its hard for coffeescript |
14:14:53 | FromGitter | <alehander42> making tea |
14:14:59 | FromDiscord | <Shield> we need a page for cool things nim can do but aren't obvious |
14:16:45 | clyybber | alehander42: lol |
14:16:59 | FromDiscord | <DeltaPHC> `concept` seems pretty cool and underutilized. Though maybe for good reason :P |
14:17:06 | Yardanico | @Shield you mean manual :P |
14:17:23 | clyybber | DeltaPHC: It can make your compile times boom exponentially :D |
14:18:02 | Cadey | i've had great luck with concepts as used in an astar package |
14:21:17 | * | matlock joined #nim |
14:21:41 | * | zyklon joined #nim |
14:23:30 | FromDiscord | <Kiloneie> i think i know what you guys were talking about my video's sound quality, i think you guys are hearing the freaking creek like 20 meters away from my window |
14:24:19 | sealmove | how to specify type for a seq literal like `@[1, 2, 3]`. For example if I want it to be of type seq[byte]. is casting the only option? |
14:25:20 | FromDiscord | <Shield> did you remove the noise and such? i've found that even my phone using discord noise cancellation will net a really clear voice |
14:25:29 | * | uvegbot quit (Ping timeout: 250 seconds) |
14:25:41 | FromDiscord | <Shield> my pc headphone doesn't even come close to that |
14:26:35 | leorize | Kiloneie: try listening via a common audio source (ie. your phone) |
14:27:02 | Yardanico | sealmove: let a = @[1.byte, 2, 3] |
14:27:43 | FromDiscord | <Kiloneie> on my computer i hear a watery sound, which is the creek, i will check via phone now |
14:28:06 | sealmove | mm I see, but it won't work in my case, the items are generated, so I can't touch them. |
14:28:24 | Yardanico | sealmove: let a = @[myitem.byte, myitem2, myitem3] |
14:28:28 | Araq | generate 1'u8 literals then |
14:28:36 | Araq | nkUInt8Lit iirc |
14:33:45 | leorize | in the aftermath of Nim 1.0 release, nim.nvim gains... 1 star :P guess there aren't many people that uses neovim |
14:33:45 | FromDiscord | <Kiloneie> on my phone i hear a slight coil whine like sound which is my computer, and yes the intro to setup sounds weird, because the distance where i am speaking is a bit different, which will remain trough out the tutorials to what it was after the intro, i can't fix that one without a mic arm. the noise in the background i think i can, i will up the noise supressor, and try to noise gate some more, i played around with compressor like some tutor |
14:34:40 | sealmove | wanted to avoid this, since the code is more generic (works for types over than numbers), without having to take cases, but I guess this is the proper way.. |
14:34:50 | sealmove | other than* |
14:35:35 | FromDiscord | <Kiloneie> the weird noise is mostly in the after the intro part, when there are parts where i don't talk, then that wobbly watery sound kicks in a bit |
14:38:10 | Cadey | Araq: on stable: ... /home/cadey/.choosenim/toolchains/nim-1.0.0/lib/pure/distros.nim(144, 54) Error: cannot evaluate at compile time: unameRes |
14:38:39 | Araq | meh |
14:38:53 | Cadey | http://ix.io/1WUh |
14:39:32 | Araq | 'if' not 'when' |
14:39:48 | shashlick | i keep getting this - oserr.nim(94) raiseOSError |
14:39:48 | shashlick | Error: unhandled exception: The filename, directory name, or volume label syntax is incorrect. |
14:39:51 | shashlick | any ideas |
14:40:23 | leorize | did you trip on any windows-reserved names? |
14:40:45 | FromDiscord | <Shield> Araq is there a clear distinction of what's inlined and what's computed at compile time for templates? |
14:41:04 | leorize | templates don't do compile time computation... |
14:41:11 | FromDiscord | <Mamy> templates are inlined |
14:42:21 | FromDiscord | <Shield> the template parameters certainly turn into a constant when you recurse |
14:42:30 | Cadey | changing when to if gives me different errors |
14:42:39 | leorize | @Shield no |
14:42:40 | Cadey | but |
14:42:44 | Cadey | outside of the file i'm working on |
14:42:54 | leorize | template parameters are AST trees slotted directly into the template body |
14:48:13 | FromDiscord | <Shield> is there a way to dump a template code? |
14:48:40 | FromDiscord | <Shield> i just look at the generated c code |
14:49:06 | Araq | there is only --expandMacro:foo |
14:49:18 | Araq | put your template in a macro, maybe lol |
14:50:00 | FromDiscord | <Mamy> you can use getAst too I think |
14:50:19 | leorize | echo getAst template() |
14:50:54 | Araq | oh, never tried that |
14:51:20 | Yardanico | lol |
14:51:46 | Yardanico | btw, I just found a compiler crash with getAst + const, should I report it? |
14:51:58 | leorize | yes :P |
14:52:09 | FromGitter | <alehander42> i wonder if anybody tried |
14:52:12 | FromGitter | <alehander42> to fuzz the compiler |
14:52:15 | FromGitter | <alehander42> for similar crashes |
14:52:44 | leorize | llvm has a fuzzer I think |
14:53:37 | Araq | alehander42: there was a tool but I never tried it because we have plenty of real bugs, discovered by real users who maybe appreciate bugfixes |
14:55:06 | FromDiscord | <Shield> i get 'Error: request to generate code for .compileTime proc: $' |
14:55:16 | FromGitter | <alehander42> Araq, was it nim specific? |
14:55:20 | Araq | yes |
14:55:33 | FromGitter | <alehander42> interesting, do you have a name/link |
14:55:50 | FromDiscord | <Shield> because i'm using echo to see the parameters |
14:55:59 | owl_000 | https://www.youtube.com/watch?v=zb3Sqs7lNJo gem [add in nim archive] |
14:56:04 | leorize | @Shield: put it in a static block |
14:56:19 | FromGitter | <alehander42> https://github.com/nim-lang/Nim/wiki/Fuzzing-your-nim-code-to-rabbit-out-all-the-hard-bugs ? |
14:56:28 | FromDiscord | <Mamy> are you holding your mic like a rapper? :p |
14:57:07 | Araq | leave me alone, I'm shy |
14:57:16 | Araq | never watch my own videos :P |
14:57:58 | Yardanico | i like programming videos where you can hear a person typing and maybe his comments |
14:58:10 | FromDiscord | <Kiloneie> wait what |
14:58:21 | Yardanico | like https://www.youtube.com/watch?v=JO0iqGDgFqA |
14:58:26 | FromDiscord | <Kiloneie> i literarlly went to get a different keyboard because my keyboard is loud as fuck |
14:58:33 | FromDiscord | <Shield> using static i get 'Error: Invalid node kind nnkStmtList for macros.`$`' |
14:58:35 | Yardanico | well I'm not a majority |
14:58:41 | * | hades__ joined #nim |
14:58:44 | Zevv | What is with the @ signs in my nimcache? |
14:58:50 | FromDiscord | <Kiloneie> mine is like slamming on the keyboard |
14:59:02 | FromDiscord | <Kiloneie> mechanical keyboards D: |
14:59:10 | FromDiscord | <Shield> i like loud mechanical keyboards too |
14:59:19 | Cadey | Araq: i have to have other people edit my own videos because i can't stand the sound of my recorded voice |
14:59:53 | Yardanico | @Kiloneie I have a cheap mechanical keyboard which has "Outemo Blue" switches, they're also loud but typing is really satisfying |
15:00:03 | FromGitter | <awr1> if the compiler becomes significantly more stable in a few years fuzzing could be desirable |
15:00:43 | owl_000 | now nim version is 1, it started like that way, wow, that video is a history. great araq |
15:01:11 | FromDiscord | <Mamy> a stable compiler is a dead compiler :p |
15:02:08 | FromGitter | <alehander42> @awr1 agree |
15:02:27 | FromGitter | <alehander42> mamy how is discord |
15:02:31 | FromGitter | <alehander42> isn't it very meme-y |
15:03:18 | FromGitter | <awr1> how do you mean meme-y |
15:03:37 | FromGitter | <awr1> like in terms of community or UI? |
15:03:46 | FromGitter | <alehander42> like, i feel the community is more |
15:03:48 | FromGitter | <alehander42> like that |
15:03:58 | FromGitter | <alehander42> but i remembered the prog lang discord seems serious |
15:04:03 | FromGitter | <alehander42> so probably not like telegram |
15:04:20 | FromDiscord | <Shield> lol |
15:05:08 | FromGitter | <awr1> generally when most people talk shop it moves away from memes and similar bullshit |
15:06:00 | FromGitter | <awr1> but like a comet that comes around periodically, so too does that sort of stuff come back every so often |
15:06:06 | FromDiscord | <Mamy> I'm only on serious discord communities, nee more nim-offtopic :p |
15:06:16 | FromDiscord | <Mamy> need* |
15:06:21 | lqdev[m] | huh, that's really strange https://play.nim-lang.org/#ix=1WUC |
15:06:23 | lqdev[m] | I'll report this |
15:06:34 | FromDiscord | <Kiloneie> okay i will keep the keyboard then, i don't wanna use a different keyboard if quite a few of the audience actually likes that lol |
15:06:49 | FromDiscord | <Yardanico> @Mamy I made you a moderator on Discord just in case 😄 |
15:06:55 | FromDiscord | <Mamy> @lqdev, Positive is >= 1 |
15:07:14 | lqdev[m] | right, so what? this should work |
15:07:29 | FromDiscord | <Mamy> U is initialized to 0 by default |
15:07:30 | FromDiscord | <Kiloneie> also iwas about to start YouTube like 8 years ago, making Game maker games, the moment i heard my voice, i was No NO NO, DONE, and it was over till my friend convinced me half a year ago that since i got REALLY good at gaming, i should make videos |
15:07:36 | * | owl_000 quit (Ping timeout: 265 seconds) |
15:07:36 | lqdev[m] | oh gosh |
15:07:43 | lqdev[m] | that's pretty weird |
15:07:48 | FromDiscord | <Kiloneie> nobody likes their voice( i do like it a ton more now though) |
15:08:00 | FromGitter | <awr1> @lqdev[m] that is interesting |
15:08:06 | narimiran | lqdev[m]: will `Natural` work? |
15:08:10 | FromDiscord | <Mamy> yes |
15:08:13 | lqdev[m] | it should, let me try |
15:08:14 | FromGitter | <awr1> why does it not compile without `FloatGen` |
15:08:22 | FromGitter | <alehander42> i also feel strange about my voice on audio |
15:08:27 | FromGitter | <alehander42> but this is usually an illusion |
15:08:47 | FromDiscord | <Shield> expandMacros helps expanding the template but it only works on one level |
15:08:48 | Araq | yay playground is on version 1.0.0 |
15:08:50 | lqdev[m] | nope, https://play.nim-lang.org/#ix=1WUE |
15:08:55 | lqdev[m] | Natural doesn't help |
15:09:23 | FromDiscord | <Mamy> seems like a compiler bug |
15:09:24 | Araq | result.a = [] is invalid |
15:09:32 | FromGitter | <alehander42> Araq, when the spec for not nil is ready, i can try to do some work on the impl, if you guys need contributors |
15:09:43 | Araq | always |
15:09:45 | lqdev[m] | int does the same thing |
15:09:55 | lqdev[m] | Araq: how so? |
15:10:00 | Araq | look arrays have a fixed size, like [0, 0] |
15:10:11 | FromDiscord | <Mamy> you don't need the [] line |
15:10:17 | lqdev[m] | aah, that makes sense |
15:10:32 | Araq | alehander42: where to find the spec? |
15:10:33 | lqdev[m] | that array should be initialized to zeroes anyways |
15:10:39 | FromDiscord | <Shield> how to recurse expand templates? |
15:10:41 | lqdev[m] | and it doesn't matter in a ring buffer |
15:10:51 | FromDiscord | <Shield> expand recused templates* |
15:10:52 | lqdev[m] | but still, that doesn't explain the bad compiler error message |
15:11:06 | Araq | sure, that's a bug. a regression, in fact, I think |
15:11:09 | * | owl_000 joined #nim |
15:11:12 | Araq | yay new bugs |
15:11:15 | Araq | more bugs |
15:11:44 | disruptek | the b-word is fair game today. |
15:11:47 | FromGitter | <alehander42> Araq well, you said you want to write a spec for the `not nil` refs first |
15:12:00 | FromGitter | <alehander42> at least iirc |
15:12:17 | lqdev[m] | I'll report the bug on github |
15:12:18 | disruptek | there's no way to `unexport` a symbol, right? |
15:12:32 | Araq | I misread |
15:12:40 | Araq | I read "the spec ... is ready" |
15:12:42 | Araq | :P |
15:12:48 | Yardanico | disruptek: well, you can import everything from the module except something |
15:13:08 | Yardanico | but I don't think there's a way to unexport an already imported symbol once you're past the import stage |
15:13:15 | Araq | you can also do 'from x import nil' |
15:13:33 | disruptek | yeah, i'm trying to allow the user to unexport something in generated code; best i can do is macro the removal of the `*`. |
15:14:14 | FromGitter | <alehander42> Araq well, I know the spec is important :P but i feel like most of it should be relatively clear by now |
15:14:29 | Araq | not good enough, write it |
15:15:25 | leorize | @Shield try macros.expandMacros |
15:18:05 | * | owl_000 quit (Ping timeout: 268 seconds) |
15:19:07 | FromGitter | <alehander42> i can write it |
15:19:28 | FromDiscord | <Shield> i'm using it, having trouble to expand correctly, the template calls itself and expandMacros only expands one level |
15:20:52 | * | Trustable joined #nim |
15:21:17 | * | BigEpsilon quit (Ping timeout: 245 seconds) |
15:23:36 | leorize | the template calls itself? |
15:23:51 | leorize | shouldn't that results in infinite expansion? |
15:24:01 | leorize | or does the template have some mechanism to prevent that? |
15:24:38 | FromDiscord | <Shield> yeah i'm using when to break out, the template has a counter |
15:24:59 | FromDiscord | <Shield> it's basically unroll n times |
15:25:22 | leorize | try this: --expandMacro:expandMacros |
15:25:24 | Araq | sounds to me you want to write a macro instead |
15:26:14 | leorize | from PMunch's demonstration of his `with` rewrite, it seems like that switch will expand indefinitely |
15:29:50 | * | gour quit (Ping timeout: 265 seconds) |
15:31:19 | FromDiscord | <Shield> i think an easy why to expand templates recursively will be helpful, expandMacros kinda works |
15:31:46 | Araq | don't write recursive templates, write a macro instead |
15:31:58 | * | gour joined #nim |
15:32:04 | Araq | Nim is not some shitty FP language where you need to fake iteration with recursion |
15:32:30 | FromGitter | <zetashift> oh damn Araq bringing the heat to FP languages |
15:32:46 | FromDiscord | <Shield> actually never mind, expandMacros does work recursively, i forgot to change the parameter |
15:34:47 | clyybber | Araq: Is there a spec of how signature matching works? I remember seeing it but cant find it anymore |
15:35:10 | FromDiscord | <Mamy> I have a bug where I detail that @clyybber |
15:35:44 | FromDiscord | <Mamy> see: https://github.com/nim-lang/Nim/issues/11142#issuecomment-487776827 |
15:36:19 | Araq | clyybber, overloading resolution? |
15:37:10 | FromDiscord | <Mamy> you can change the traceTypeRel constant to true for debugging |
15:37:25 | FromGitter | <zetashift> A lot of questions about Nim being asked here without answer: https://www.reddit.com/r/rust/comments/d8ygfm/nim_programming_language_10/ |
15:37:42 | Araq | narimiran, ^ answer |
15:38:35 | FromGitter | <zetashift> `borrowed too many Pascal features without stopping to think about whether they were a good idea` was this ever true? |
15:38:46 | Araq | no. |
15:38:50 | narimiran | depends on who you ask, i guess :) |
15:38:59 | clyybber | Araq: Yeah |
15:39:05 | Araq | it's bullshit |
15:39:09 | clyybber | mratsim: Thanks |
15:40:11 | clyybber | Araq: Ah, sry found it. But yeah it was overloading resolution |
15:42:22 | clyybber | Araq: Is that algorithm from the spec in the implementation still, or has the implementation diverged too far to pinpoint where it is exactly? |
15:42:46 | FromGitter | <awr1> again this is the issue of hearing about the language secondhand contradicts actually using the language |
15:45:13 | Araq | what does he know about Pascal anyway, ':=' vs '=' not copied, 'function' vs 'procedure' not copied, operator precedence not copied, silly {$IO+} switch not copied, "strings start at index 1" not copied, "const required in parameters for speed" not copied |
15:45:47 | Araq | 'class' not copied |
15:45:47 | FromGitter | <awr1> "oh i've been using nim for a month and here are my concerns" is obviously a stronger critique than "i heard from some cool guy on HN 5 years ago that you had to import a module to get unsigned ints and that seems like the worst idea, of all time" |
15:45:49 | * | theelous3 joined #nim |
15:48:16 | FromDiscord | <Shield> good thing Nim doesn't use ':=' |
15:48:36 | FromDiscord | <Shield> it looks ugly, part of the reason i never bothered with Go |
15:49:51 | * | hades__ quit (Quit: leaving) |
15:50:08 | FromGitter | <zetashift> @awr1 it's why I linked the thread, a lot of comments seemed to be giving off a wrong image. Hoping more experienced people here could chime in and clarify |
15:50:17 | * | hades joined #nim |
15:50:29 | FromDiscord | <Kiloneie> the less symbols all over the place, the less typing, quicker reading and understanding |
15:50:40 | * | hades is now known as Guest96751 |
15:51:29 | narimiran | "It was pointed out previously that it is possible to create UB (undefined behaviour) in Nim, because it translates directly to C which has UB everywhere. Nim didn't (at that time) protect from C's UB." |
15:51:39 | narimiran | Araq: opinion about ^ ? |
15:52:06 | narimiran | (hopefully one i can copy-paste there, not the one with swearing :P :D ) |
15:52:20 | Araq | we still lack the NULL/nil protection but it's being worked on |
15:52:40 | Araq | which doesn't come up all that often |
15:52:53 | FromDiscord | <Kiloneie> everyone compares Nim with D and Rust, i can't look at D <.<... bloody c family syntax |
15:53:05 | Araq | and there are C compiler switches to mitigate |
15:53:44 | rayman22201 | People hear about the "result" variable and have Pascal anxiety all of a sudden. I don't understand... I also love that feature. But what do I know |
15:53:58 | * | LargeEpsilon joined #nim |
15:54:05 | Araq | Eiffel also has 'result' |
15:54:11 | Araq | and so does Go iirc |
15:54:13 | leorize | people argue that it's redundant |
15:54:17 | Araq | but in Go you can choose the name |
15:54:17 | FromDiscord | <Kiloneie> i don't get why they hate it, they DON'T have to use it |
15:54:23 | FromDiscord | <Kiloneie> it's there, and optional |
15:54:50 | leorize | all of them be like: "but you can just `var result =`" like C does it |
15:54:50 | FromDiscord | <Kiloneie> it makes things a bit quicker to write, i don't get the hate |
15:54:51 | rayman22201 | It's the argument that "there should only be one way to do something" |
15:55:15 | leorize | and "less is better" |
15:55:28 | FromDiscord | <Mamy> var result is a recipe for strange shadowing disasters |
15:55:31 | FromDiscord | <Kiloneie> honestly if everything is well done, having multiple ways of doing it is a good thing, as long as best practices are upheld |
15:55:58 | Araq | Mamy: the compiler warns about shadowing 'result' |
15:56:05 | FromDiscord | <Kiloneie> in Game Maker everyone freaking used their own style and people produced literal walls of text, i ain't even kidding, completely unreadable |
15:56:16 | leorize | eh, people were paranoid about Nim's style-insensitivity because they thought the world will use it the the worst way possible |
15:57:11 | lqdev[m] | I think I'm gonna simplify that ring buffer to a classic static-size array with some utility functions |
15:57:14 | * | clyybber quit (Quit: WeeChat 2.6) |
15:57:15 | * | MrAxilus left #nim ("User left") |
15:57:22 | FromDiscord | <Mamy> 10 years ago that might have been true to be fair. But 20 years ago, plenty of development was done in silos with strange coding conventions if the language permitted them |
15:57:41 | FromDiscord | <Kiloneie> Yep |
15:57:52 | Araq | C has 3 ways to increment 'i' by 1 |
15:57:52 | FromDiscord | <Kiloneie> check out CNC programming of old, LOL, shoot me |
15:57:56 | Araq | actually 4. |
15:58:08 | Araq | i++; ++i; i += 1; i = i + 1 |
15:58:10 | FromDiscord | <Shield> style insensivity is the best thing that ever happened |
15:58:27 | leorize | rust itself have 3 ways to return a value |
15:58:27 | Araq | nobody gives a fuck about it, it's C |
15:58:49 | FromDiscord | <Kiloneie> everyone uses different naming convention, so if they wanna go crazy with it, let them ... i think |
16:00:15 | FromDiscord | <Shield> i see that a lot of hate come from people who only like C style languages |
16:00:15 | rayman22201 | @narimiran: I would ask the guy specifically what UB he cares about? C has a lot of UB lol. It's a big topic... |
16:00:33 | * | navin_ joined #nim |
16:00:53 | Araq | he doesn't care about it, it's just another "cool, I don't have to check it out, saved my time" |
16:01:19 | rayman22201 | Yeah. Seems like a troll question. |
16:01:44 | leorize | https://old.reddit.com/r/rust/comments/d8ygfm/nim_programming_language_10/f1dor7k/ |
16:01:50 | leorize | ^ anyone wanna argue about that? |
16:04:15 | * | navin quit (Ping timeout: 264 seconds) |
16:06:40 | sealmove | "only 1 way of doing things" is an important choice for the language. It has to do with consistency vs flexibility tradeoff. |
16:06:52 | FromGitter | <zetashift> wow comparing goto to an implicit result variable |
16:07:03 | FromGitter | <mratsim> Gnome vs KDE |
16:07:23 | leorize | gnone vs kde still makes sense :P |
16:07:23 | FromGitter | <mratsim> Mac vs Linux |
16:07:27 | solitudesf | kde |
16:07:33 | Yardanico | kde |
16:07:38 | lqdev[m] | gnome |
16:07:42 | leorize | i3 |
16:07:49 | lqdev[m] | pantheon |
16:07:53 | Yardanico | well I use i3 as well, but IMO KDE > GNOME :P |
16:08:21 | leorize | kde scored too low on the 'default styling' for me |
16:08:33 | Yardanico | I'm having an argument with Juan right now in Telegram, so basically, will .nims eventually fully replace .cfg? And also, is it a good thing to define some big constant strings in .cfg instead of creating a new file which would export these constant strings or just defining them in the modules that need it? |
16:08:39 | Yardanico | we're arguing about .nims vs .cfg |
16:08:50 | lqdev[m] | kde scores too low on the aesthetics part for me, it's UI design is really cluttered |
16:09:08 | leorize | they're going to fix that iirc |
16:09:18 | leorize | i'm interested in their efforts |
16:09:20 | Araq | there are always multiple ways to accomplish the same, even Python has 'lambda' though it could do without |
16:09:49 | leorize | sealmove: for certain places |
16:10:04 | leorize | not everything should have only one way of doing things |
16:10:05 | Araq | it's just a marketing gag, no substance to the claim |
16:10:35 | narimiran | xfce >> kde and gnome |
16:10:36 | sealmove | but for example Go is stupid on purpose so that everyone has to write code in same way. it's definitely a sacrifice of power for the sake of forcing consistency. |
16:10:44 | leorize | there should be reasonable ways to do things, rather than only one way |
16:10:50 | narimiran | "i use i3, btw" |
16:11:05 | federico3 | sealmove: while being inconsistent with itself |
16:11:18 | Araq | the way I structure my code, how I break it up into functions is not enforced by Go. |
16:11:59 | Araq | and Go has 'var x = 0' vs 'x := 0' or something like that |
16:12:00 | sealmove | obviously you can't enforce everything, but some languages try to enforce as much as possible and leave as little style choices to programmer as possible. |
16:12:12 | Araq | yeah but then even Go doesn't, see := |
16:12:43 | Yardanico | things I like in Nim the most are actually indentation-based syntax without using parenthesis when you can live without them (e.g. in an if expression or a while loop), and UFCS |
16:12:54 | sealmove | that's true, I find this weird, why they have both `var x = 0` and `x := 0` |
16:13:15 | leorize | turns out that typing less is actually a feature |
16:13:23 | Cadey | sealmove: := works on multiple returns |
16:13:29 | Cadey | foo, err := bar() |
16:13:36 | sealmove | oh right, that's why |
16:13:42 | sealmove | forgot |
16:13:48 | Yardanico | leorize: yes and I like it a lot |
16:13:52 | Araq | they also have both 'break' and 'goto' iirc |
16:13:55 | asymptotically | leorize: i learned that after coming from java, with IAbstractBeanFactoryTestTestImplTestFactories. its very refreshing :) |
16:14:15 | Cadey | Araq: goto is actually useful in some edge cases, it just requires a certain level of insanity |
16:14:27 | Araq | not the point, I don't mind 'goto'. |
16:14:33 | leorize | some day I'll have to learn java just to understand all the memes |
16:14:34 | Araq | but if you have it, you can remove 'break' |
16:14:38 | Yardanico | I tried Zig for a bit, but it's still very incomplete (you need to look in source for stdlib to find functions you need), and you need to type much more than you do in Nim |
16:15:03 | sealmove | I love the break _with label_ feature nim has, it's something like goto but saner and covers most cases you would want to use a goto |
16:15:56 | leorize | I consider Zig to be a low-level system language |
16:16:20 | leorize | it appears to have removed general types like `int`, `float` and settled on explicitly specifying the size |
16:16:21 | Cadey | zig is C |
16:16:25 | disruptek | i struggled with UFCS style for the longest. my current style is to use whatever reads easiest, and name symbols according to what will be most readable. but, point remains that finding the right balance in UFCS was the biggest struggle i had with the "look" i wanted. |
16:16:43 | narimiran | disruptek: how so? |
16:17:25 | FromDiscord | <Shield> i didn't understand what zig is trying to solve, you don't type less than C |
16:17:30 | narimiran | i changed my ufcs style over the years, but calling it "the biggest struggle" is another league.... :) |
16:17:47 | leorize | zig is trying to be a safer C I think |
16:18:05 | disruptek | what can i say? i haven't changed much of my other initial syntax decisions. except maybe for the for loops. |
16:18:07 | Cadey | it'd be interesting to see a zig backend for nim |
16:18:35 | disruptek | but path.encoded or encodePath(path) ... that changed. |
16:18:48 | Araq | it'd be a futile excercise accomplishing nothing whatsoever, Cadey |
16:18:57 | leorize | since `path` is a string, I use `encodePath()` :p |
16:19:06 | Cadey | Araq: zig has a webassembly backend tho |
16:19:08 | Araq | we already have NLVM, Nim targeting LLVM directly |
16:19:13 | Cadey | ah |
16:19:21 | disruptek | the llvm backend is the future, i hope. |
16:19:43 | leorize | llvm does bring some nice stuff, but I doubt it would be a major step |
16:19:51 | Araq | disruptek, if history is a guide, there is no chance we'll compile to C for forever |
16:20:08 | Yardanico | there were some plans to change default backend to C++ some time ago, are they still here? |
16:20:13 | Araq | C++ started as a translator to C too, as did Objective C |
16:20:34 | leorize | even haskell started off by translating to C |
16:20:45 | leorize | or at least GHC |
16:20:51 | Araq | interesting |
16:21:09 | Cadey | (part of the GHC bootstrap process still involves compiling a C version of GHC and using that to compile the haskell one, then the haskell one to compile itself again) |
16:21:12 | disruptek | it'd be a big step for me because then i could finish my graal/klee ecosystem effort. |
16:21:36 | leorize | klee has a problem of being too slow for practical usage though |
16:22:04 | leorize | also you can already compile to llvm by going through clang |
16:22:04 | disruptek | what a strange thing to say. |
16:22:31 | Araq | a klee, yeah, well, tried NLVM with it? |
16:22:53 | disruptek | yeah. |
16:22:53 | sealmove | what's the idiomatic Nim way to have an optional object field. add a corresponding flag field, use `Option`, or something else? |
16:23:05 | leorize | disruptek: https://stackoverflow.com/questions/5742618/limits-of-klee-the-llvm-program-analysis-tool |
16:23:32 | disruptek | leorize: what's your point? |
16:23:43 | leorize | that klee is not really scalable :( |
16:23:53 | disruptek | you don't have the resources to devote 89hrs of computer time to debuging your code? |
16:24:34 | disruptek | anyway, don't use it if you don't like it. do you want to argue about the merits of graal instead? |
16:24:51 | Cadey | sealmove: how optional is it? |
16:25:12 | FromGitter | <awr1> i'm team GNOME |
16:25:41 | FromDiscord | <treeform> sealmovie, "Nim way to have an optional object field" I think that's cbject variants. https://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants |
16:25:47 | sealmove | Cadey: it's initially empty, later gets filled-in always (so not exactly optional). but need to have a way to know if it's filled-in yet. |
16:25:49 | lqdev[m] | GAAH https://termbin.com/4rmf |
16:25:51 | FromDiscord | <treeform> sealmovie, "Nim way to have an optional object field" I think that's object variants. https://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants |
16:25:51 | leorize | disruptek: i won't, but I wonder if there's any faster alternative out there |
16:26:00 | lqdev[m] | it doesn't work even though I removed all the gc code from here |
16:26:01 | Cadey | sealmove: i'd say option then |
16:26:03 | solitudesf | sealmove, option |
16:26:22 | sealmove | ty |
16:26:30 | FromGitter | <awr1> you can use object variants with bools btw if you dont want to use enums |
16:26:30 | Cadey | there, now you have consensus! |
16:26:44 | Cadey | awr1: options are safer in this case |
16:26:44 | disruptek | it's often possible to write tests of code that are smaller than the applications in which they enter production. |
16:26:48 | FromDiscord | <treeform> yeah for 1 thing I agree option is better. But if you have many fields object variants are better. |
16:27:29 | disruptek | bugs found outside production which nonetheless emerge during production workloads are no less valuable than those found in production. |
16:28:08 | lqdev[m] | ah I see, it crashes on raiseIndexError2 |
16:28:54 | disruptek | they just cost less. |
16:29:32 | disruptek | leorize: https://github.com/mre/awesome-static-analysis |
16:32:34 | leorize | nice |
16:32:57 | * | MrAxilus joined #nim |
16:33:19 | leorize | even crystal have a static analyzer :P we need one for Nim |
16:33:51 | disruptek | there are already efforts to do this in the compiler. |
16:33:57 | lqdev[m] | oh god, look at the amount of analyzers for PHP |
16:34:08 | lqdev[m] | I guess people are sick of bugs in this piece of crap |
16:34:22 | * | MrAxilus left #nim ("Kicked by @appservice-irc:matrix.org : issued !quit command") |
16:34:26 | FromDiscord | <Mamy> = vs == vs === |
16:34:33 | leorize | you can always use the php backend of Nim |
16:34:36 | lqdev[m] | ooooh yesss |
16:34:36 | leorize | oh wait that one is removed |
16:34:41 | lqdev[m] | haha |
16:36:03 | FromDiscord | <Mamy> it was removed in may and it's self contained (in jsgen.nim :D) |
16:36:15 | FromDiscord | <treeform> i wonder who removed it and why... |
16:36:22 | FromDiscord | <Mamy> it was Araq |
16:36:40 | FromDiscord | <Mamy> no tests? And a silly when defined(php) 😛 |
16:37:13 | livcd | btw is not -d:danger still a bit of a problem ? |
16:38:00 | FromGitter | <awr1> somehow i have been spared of the need to write anything in PHP |
16:38:09 | FromGitter | <awr1> but if it's anything like perl i can only imagine |
16:38:39 | federico3 | no, they are very different |
16:38:54 | FromGitter | <awr1> ah, ok |
16:39:29 | FromGitter | <awr1> perl for me is probably the worst "real-world" language i've ever used |
16:40:15 | leorize[m] | !eval echo float64 high uint64 |
16:40:18 | NimBot | -1.0 |
16:40:59 | leorize[m] | is that a bug? |
16:41:18 | sealmove | !eval echo high uint64 |
16:41:20 | NimBot | 18446744073709551615 |
16:41:24 | * | asymptotically quit (Remote host closed the connection) |
16:41:31 | FromGitter | <awr1> yeah seems to me it's a bug |
16:41:31 | * | asymptotically joined #nim |
16:41:48 | disruptek | man, i guessed 18446744073709551616. stupid off-by-one error. |
16:41:52 | disruptek | i'm an idiot. |
16:42:00 | FromGitter | <kaushalmodi> !eval echo float64 high uint32 |
16:42:03 | NimBot | 4294967295.0 |
16:42:04 | federico3 | leorize: what is your use case for a static analyzer? |
16:42:07 | Zevv | @clybber, mamy: the inner loop is now completely gone, another 7%. Guess I reached the optimum here! |
16:43:36 | leorize | wait until someone brings the big 'ol book of handwritten assembly out :P |
16:44:06 | Zevv | Oh I got my copies :) "Hackers delight" is one of my favorites :) |
16:44:35 | leorize | federico3: mainly to catch stupid stuff I might have written half asleep |
16:44:35 | Zevv | I know most of the the tricks in C, i'm pretty pleased that Nim now optimizes away to the same level |
16:44:59 | leorize | well assembly might be too overkill for now, so... simd? |
16:45:01 | federico3 | leorize: anything more specific? |
16:46:42 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:46:43 | Zevv | simd will not really help me here - last low hanging fruit would be to try to inject some 'likely' or 'unlikelies', but there is not much control flow left. I have a theory about spawning a thread when reaching a choice operator, and having both threads continue parsing their own part of the tree. Any thread that fails the parsing dies, and the only survivor parsed the string. |
16:47:12 | disruptek | Zevv: i am working on that idea inside cloud functions. |
16:47:22 | Zevv | cloud functions? |
16:47:42 | Zevv | is that a proc running on someone elses computer? |
16:47:47 | leorize | using a threadpool would help mitigate the overhead |
16:47:53 | disruptek | i'll have some nim that compiles to aws lambda and when you paralellize something, it runs in the cloud across multiple nodes. |
16:48:14 | Zevv | Oh dang it is *really* cloud functions. I was joking, I thought :/ |
16:48:26 | Zevv | well, but that makes sense indeed |
16:48:33 | leorize | federico3: mostly always true/false expressions |
16:48:43 | livcd | btw is not -d:danger still a bit of a problem ? |
16:49:04 | FromDiscord | <Mamy> so did you remove the innerloop via inline assembly? or computed gotos? |
16:49:07 | disruptek | it's like your idea in that maybe you only care about the winners. |
16:49:18 | disruptek | kinda like quantum computing. |
16:49:38 | FromDiscord | <Mamy> likely/unlikely pretty much doesn't do anything anymore, apart from removing cmov 😛 |
16:49:54 | Zevv | I know, I *never* managed to speed up an algorithm with that |
16:49:59 | leorize | livcd: what do you mean? |
16:50:04 | Zevv | branch predictors are simply smarter then me |
16:50:13 | disruptek | i've always said that about you. |
16:50:21 | Zevv | I know |
16:50:25 | disruptek | `dumber than a branch predictor`. |
16:50:27 | Zevv | but I don't care |
16:50:36 | Zevv | because I know who's saying that \o/ |
16:50:37 | disruptek | it's okay; you're much better looking. |
16:50:46 | lqdev[m] | dear god i'm fed up with these stupid crashes, I'm trying so hard not to swear the hell out right now |
16:50:49 | disruptek | `cuter than a branch predictor`. |
16:50:55 | Zevv | lqdev[m]: still your audio thread? |
16:51:01 | lqdev[m] | yes |
16:51:13 | * | navin_ quit (Remote host closed the connection) |
16:51:26 | lqdev[m] | I can't even debug this god damn thing properly because any echo I try to do results in an immediate segmentation fault |
16:51:32 | Zevv | Yeeah :) |
16:51:57 | lqdev[m] | I guess gdb to the rescue |
16:52:03 | Zevv | lqdev[m]: been there. Don't rely on *anything* there. The rule is basically: don't do any stdlib calls, and check your generated C code |
16:52:22 | FromDiscord | <Shield> aren't they using unlikely to make exceptions cost free? |
16:52:24 | Zevv | In my SDL audio callback I only do a c_memcpy() and an assignment |
16:52:41 | leorize | @Shield nah, they use some weird dwarf table magic |
16:53:28 | lqdev[m] | Zevv: I set my buffer size to 32768 out of frustration to prevent the crashing at least for a short while and all I can hear is silence. |
16:53:32 | FromDiscord | <Shield> btw Zevv how did you optimize the inner loop away? spill the beans |
16:53:41 | leorize | lqdev[m]: try importing `printf` then print the stuff out |
16:53:51 | leorize | it will avoid the allocations from the gc |
16:53:58 | leorize | which might be a problem on its own |
16:55:23 | Zevv | Shield: well, in the end the c compiler does the hard work. The computed goto is a table with goto offsets which get jumped to, and gcc seems to understand my intentions well enough. The loop instruction pointer is the index into this jump table, and nim generates stuff like "ip = 132; goto _TMP[ip]". Which becomes one jmp |
16:55:34 | lqdev[m] | leorize: yeah it seems like that's a problem |
16:55:44 | lqdev[m] | it always crashes on some GC-related shit |
16:55:54 | Zevv | which is has the right to do. You violate the contract |
16:56:00 | Zevv | you suffer |
16:56:17 | Araq | setupForeignThreadGC(), lqdev[m] |
16:56:31 | Zevv | He went there, but came back crying as well |
16:56:40 | * | navin joined #nim |
16:56:42 | Zevv | if I remember correctly |
16:56:53 | Araq | use araq's GC then. |
16:57:07 | shashlick | i'm also running into https://github.com/nim-lang/Nim/issues/12242 |
16:57:08 | leorize | github.com/Araq/araqsgc |
16:57:17 | lqdev[m] | Araq: I have no control over the startup of that thread |
16:57:54 | leorize | just call it before you do anything in the thread |
16:58:11 | lqdev[m] | but anyways, how can I try your GC out? |
16:58:14 | Araq | shashlick, working on it... |
16:58:21 | FromDiscord | <Shield> interesting, it's always nice when the compiler does most of the work |
16:58:30 | leorize | Araq, shashlick: https://github.com/nim-lang/Nim/pull/12265 |
16:58:34 | Araq | lqdev[m], hardly, it's WIP and as usual bugfixes take up all our resources |
16:58:35 | shashlick | @Araq - there's a patch here - https://github.com/Endeg/Nim/commit/04fb6d649c35db7de5dd2a63564d84c61ed090f9 not sure if it works |
16:58:53 | Araq | lqdev[m], I can explain how it works though and you can take over its development |
16:58:57 | Araq | :-( |
16:59:24 | FromDiscord | <Mamy> @Zevv just beware that we had a stackoverflow issue with computed gotos in Nimbus: https://github.com/status-im/nimbus/blob/7d74d38530881e883c408d55d8213fea31f247a3/nimbus/vm/interpreter_dispatch.nim#L266-L267 |
16:59:38 | leorize | we need to clone Araq :P |
16:59:45 | FromDiscord | <Mamy> I didn't revisit that (uint256 arithmetic is quite stack space consuming) |
16:59:58 | Zevv | mamy: where does the stack go? |
17:00:00 | Araq | Mamy: stack overflow? as in "compiler crashes"? |
17:00:17 | lqdev[m] | Araq: sadly, I have no experience in garbage collectors and advanced memory management |
17:00:32 | Zevv | lqdev[m]: you're working on that! :) |
17:00:40 | Zevv | in a few days you will be the expert here |
17:01:08 | Araq | lqdev[m], it's actually quite simple, the debugging will kill you though |
17:01:26 | Zevv | Mamy: I don't see how that can happen |
17:02:43 | FromDiscord | <DeltaPHC> It's kinda why memory safety is such a concern in modern times |
17:02:48 | FromDiscord | <DeltaPHC> among other reasons |
17:04:03 | FromDiscord | <Mamy> @Zevv, @Araq, not sure, it was @jangko who removed the computedGoto |
17:04:43 | Araq | that means that it compiles/d |
17:04:44 | FromDiscord | <Mamy> it's a runtime one |
17:04:57 | Araq | makes no sense to me but ok |
17:05:05 | FromDiscord | <Mamy> I agree 😉 |
17:05:19 | Zevv | just put it back in and dont tell him :) |
17:05:35 | FromDiscord | <Mamy> but we have a 256-bit VM so maybe that + holding all the opcodes addresses on the stack was too much? |
17:05:45 | Zevv | the're not on the stack |
17:05:54 | lqdev[m] | wait, .computedGoto was removed completely? |
17:05:59 | lqdev[m] | I wasn't following on the discussion |
17:06:02 | Zevv | non just from their code |
17:06:06 | Zevv | they dont use it anymore |
17:06:09 | lqdev[m] | ah fine |
17:06:31 | shashlick | @Araq - i checked again, all DLLs are compiling with --gc:boehm but feud still doesn't work |
17:06:34 | Zevv | not sure when I last ran out of stack anyway in lin |
17:06:43 | Zevv | linxu userland. the stack is just extended when needed |
17:06:57 | disruptek | 1991 for me. |
17:07:49 | lqdev[m] | damn it. open jam 2019 is starting on friday and my audio engine doesn't work at all. |
17:08:00 | lqdev[m] | what an idiot I am for not working on this earlier. |
17:09:23 | FromDiscord | <Shield> what's wrong with it Lqdev[m]? |
17:09:27 | leorize | lqdev[m]: have you tried to use printf to debug print? |
17:09:48 | lqdev[m] | leorize: ah right, I started but never finished lol |
17:10:01 | lqdev[m] | Shield: it doesn't work. no audio, constant segfaults, lots of annoyance. |
17:10:16 | * | LargeEpsilon quit (Ping timeout: 240 seconds) |
17:11:08 | Araq | lqdev[m], GC_disable() at startup and enable it in strategic places? |
17:11:17 | Araq | er, make that GC_disable() in your wild thread |
17:12:28 | FromDiscord | <Shield> i was looking for an audio library myself |
17:13:07 | Araq | SDL2 ? |
17:13:23 | * | Araq actually only knows a single library for everything, SDL2 |
17:14:04 | livcd | leorize: i thought that the safety vs performance ratio was a problem. That we eventually dont want to use -d:danger |
17:14:29 | lqdev[m] | wait, so GC_disable works per thread? |
17:14:36 | FromDiscord | <Mamy> yes, compiler is much slower for example |
17:14:39 | Araq | yeah, everything does |
17:14:42 | lqdev[m] | I thought it's global for all working threads |
17:14:56 | Araq | it is not, heaps are tied to threads |
17:14:56 | FromDiscord | <Mamy> and on laser -d:danger is 5x slower |
17:15:12 | Araq | what? you mean 'faster' right? |
17:15:23 | lqdev[m] | -d:danger doesn't work with my game, lmao |
17:15:35 | lqdev[m] | it crashes immediately after startup |
17:15:44 | lqdev[m] | without it, everything just works |
17:16:01 | Araq | you should definitely use valgrind. now. |
17:16:04 | FromDiscord | <Shield> so far i found one of those one header sound library, SDL2, SFML bindings, Fmod |
17:16:15 | leorize | Araq: they're on windows |
17:16:22 | leorize | it's soundio iirc |
17:16:23 | FromDiscord | <Shield> but i might do bindings for Sunvox |
17:16:37 | FromDiscord | <Shield> because i want to have some effects and disable channels and such |
17:16:39 | shashlick | Soloud |
17:16:44 | Araq | run a Linux VM |
17:16:54 | Araq | I do too. sometimes. |
17:17:50 | FromDiscord | <Shield> why is synchronizing code with sound is so hard |
17:19:15 | FromDiscord | <Mamy> time is hard |
17:20:43 | lqdev[m] | leorize: I'm not on windows anymore. thankfully |
17:23:53 | * | shomodj joined #nim |
17:30:05 | lqdev[m] | printf works, I suppose |
17:30:09 | lqdev[m] | it doesn't crash |
17:30:25 | lqdev[m] | also, I went ahead and added GC_disable as Araq suggested |
17:30:35 | FromDiscord | <treeform> printf works but echo does not? I had this issue with iOS and Android. |
17:30:55 | FromDiscord | <treeform> I needed to call NimMain manually to setup the GC and objects. because iOS and Android have their own mains. |
17:34:25 | * | navin quit (Remote host closed the connection) |
17:34:56 | * | navin joined #nim |
17:39:07 | * | navin quit (Remote host closed the connection) |
17:39:24 | * | navin joined #nim |
17:39:38 | * | navin quit (Remote host closed the connection) |
17:46:11 | planetis[m] | hi all, check out the new zip macro: https://gist.github.com/b3liever/caf536f34b5791afbc61a5d75e0de405 |
17:46:57 | solitudesf | can this be in sequtils? |
17:47:08 | shashlick | What package can I use to build a rest API |
17:47:20 | disruptek | the openapi one you made me write. |
17:47:21 | * | matlock quit (Read error: Connection reset by peer) |
17:47:29 | lqdev[m] | can anyone explain to me why `system.cpuRelax` exists/how is it used? |
17:47:57 | Cadey | shashlick: i'd suggest either jester or rozencrantz, i'm working on a blogpost i'm calling "Jester: The Missing Manual" atm |
17:49:09 | * | neceve quit (Ping timeout: 252 seconds) |
17:50:18 | * | narimiran quit (Remote host closed the connection) |
17:50:40 | Yardanico | shashlick: I think jester is quite good for a REST API |
17:50:58 | Cadey | i should really write up that jester the missing manual guide |
17:51:01 | Cadey | ugh |
17:51:05 | Cadey | i'll do that after work |
17:51:49 | planetis[m] | sure, will make a PR, once there are no bugs left. Could use someone to test it. |
17:52:04 | shashlick | Cool |
17:52:28 | shashlick | @disruptek - that's a client, and great work by the way! |
17:52:37 | shashlick | I need something lightweight |
17:52:45 | shashlick | I'll check both out |
17:52:48 | Cadey | what does "lightweight" mean? |
17:53:00 | Cadey | that word is notoriously meaningless in programming terms |
17:53:02 | disruptek | so add the server portion for me. |
17:54:17 | shashlick | Well basically I'm looking at converting my plug-in system to communicate over rest |
17:54:29 | FromDiscord | <exelotl> @Shield oh! I did sunvox bindings, but never published them |
17:54:30 | disruptek | for feud? |
17:54:39 | shashlick | Yes |
17:54:43 | FromDiscord | <exelotl> I'll share when I get home |
17:54:52 | shashlick | Will allow communicating with remote machines for free |
17:54:53 | disruptek | why not use something more local, like dbus? |
17:55:15 | Cadey | dbus is okay if you are using only linux |
17:55:15 | shashlick | Remote editing |
17:56:01 | disruptek | remote editing could be amazing if it was really don't write. |
17:56:05 | disruptek | right, too. |
17:56:06 | shashlick | I need Windows |
17:56:10 | disruptek | really done, too. |
17:56:18 | disruptek | i really shouldn't write. |
17:56:21 | Cadey | words is hard |
17:57:01 | shashlick | What's the best way to communicate then - I don't like the idea of inventing an api |
17:57:02 | * | SodaScripter joined #nim |
17:57:05 | disruptek | well, write it in openapi. you can use the generator that hideki wrote. |
17:57:12 | disruptek | though, it's written in java iirc. |
17:57:38 | shashlick | I just want various components of my app to talk to each other |
17:58:17 | disruptek | hard to beat something rest-like for portability. treeform has a websockets impl you can use for transport. |
17:58:29 | shashlick | Each plug-in will offer a subset of functionality |
17:58:35 | shashlick | And will need to talk to other plugins |
17:58:47 | shashlick | In my case, even the GUI is a plug-in |
17:59:18 | shashlick | Can I use web sockets with rest |
17:59:23 | shashlick | Jester |
17:59:32 | disruptek | yes, though it's kinda early days there. |
17:59:53 | shashlick | I don't want to do any bleeding edge stuff anymore |
17:59:53 | Cadey | i need to do some experimentation on that front |
18:00:02 | shashlick | Have thrown out enough code |
18:00:17 | disruptek | well, contribute your fixes and they won't be thrown out. |
18:00:25 | shashlick | I have an nng wrapper which works well |
18:00:32 | disruptek | shashlick: you really outta try contributing more. 😉 |
18:00:52 | shashlick | I've thought about it, but lack the brain cells |
18:01:32 | zedeus | what about something like zeromq? |
18:01:51 | disruptek | the only thing i'd be worried about with ws is the client keep-alive stuff, but it shouldn't be hard for you to write a quick poc to see how robust it is. |
18:02:37 | disruptek | zmq is pretty great, but it could create a needless barrier of entry for ad hoc clients. |
18:02:39 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:03:03 | lqdev[m] | could someone test if there's any audio output from tests/taudio? https://github.com/liquid600pgm/rapid |
18:03:35 | FromGitter | <alehander42> Araq, an early draft |
18:03:46 | FromGitter | <alehander42> https://github.com/alehander42/Nim/commit/ad21855a7b63235019a120a979a8f59537400933 |
18:03:46 | lqdev[m] | I get silence and pavucontrol doesn't list my device. No idea why. soundio reports zero errors along the way. |
18:04:13 | lqdev[m] | s/device/application |
18:04:58 | Araq | alehander42: nice, but make it a document of its own please |
18:05:18 | FromDiscord | <Shield> @exelotl that would be very nice of you, make it public too, i like sunvox gui too, too bad the dev didn't share that, will build something similar |
18:05:18 | Araq | spec, impl, fixed spec --> manual entry is the order |
18:06:36 | shashlick | If anything I'll use nng, no need for zeromq |
18:06:48 | shashlick | But will look into jester as well |
18:07:27 | shashlick | Anyway I'm not going to get tricked into debugging gc's! |
18:07:47 | Cadey | i've been working on a STOMP library i rescued from bitbucket |
18:09:35 | FromGitter | <alehander42> Araq, ahok |
18:09:52 | * | NimBot joined #nim |
18:11:20 | Araq | echo nilable.a # OK |
18:11:20 | Araq | call() # maybe sets nilable to `nil`? |
18:11:20 | Araq | echo nilable.a # warning/error: `nilable` might be nil |
18:11:31 | Araq | ^ no... call() doesn't affect 'nilable' |
18:11:56 | FromGitter | <alehander42> Araq, the document should be still `rst` not markdown? |
18:12:05 | Araq | but you need to be precise about what locations can be used in 'isNil(location)' for deref to be allowed (let vars, local vars) |
18:12:19 | FromGitter | <alehander42> hmm, but what happens when nilable is aliased to a global |
18:12:36 | FromGitter | <alehander42> ok, this case is not really possible |
18:12:40 | Araq | we have been through this, there is no way to "alias" it through a global |
18:12:54 | Araq | it would be a pointer to a pointer then, different |
18:13:11 | FromGitter | <alehander42> yes , yes, so only stuff like call(nilable) |
18:13:16 | FromGitter | <alehander42> where call takes a `var` ? |
18:14:01 | Araq | yes |
18:14:14 | FromGitter | <alehander42> i expect that `location` can be a let var, a local var or an arg for now |
18:14:32 | Araq | yes |
18:19:30 | FromGitter | <alehander42> hmm |
18:19:35 | FromGitter | <alehander42> call() can still lead to nil |
18:19:49 | FromGitter | <alehander42> if you assign a closure to a global |
18:20:04 | Araq | no. |
18:20:23 | FromGitter | <alehander42> i wrote a program which does it |
18:20:24 | * | thomasross joined #nim |
18:20:30 | disruptek | you're still wrong. |
18:20:46 | FromGitter | <alehander42> ix.io/1WW9/nim |
18:21:03 | FromGitter | <alehander42> it's very nonsensical |
18:21:08 | FromGitter | <alehander42> i admit |
18:21:59 | FromGitter | <alehander42> and i guess this is not hard to check for |
18:22:04 | Araq | a is not a local, it escapes |
18:22:09 | Araq | it's transformed into |
18:22:14 | Araq | closure.a |
18:22:39 | FromGitter | <alehander42> ah, so in this moment in the sempass it's a field of this `b`? |
18:22:41 | Araq | you do the check after lambda-lifting |
18:22:52 | Araq | and then it simply works (TM) |
18:23:12 | FromGitter | <alehander42> ok |
18:23:55 | * | whaleman joined #nim |
18:25:33 | FromGitter | <alehander42> is the end of `tracProc` in `sempass2.nim` such a place, i remember i saw dfa stuff there before and figured that's where usually cfg stuff runs? |
18:26:59 | Araq | the order might be wrong and the cfg is only done in the backend |
18:27:00 | * | whaleman quit (Remote host closed the connection) |
18:27:07 | Araq | we need to watch out |
18:27:20 | * | disruptek 👀 |
18:27:26 | Araq | also the CFG doesn't track conditions properly for the purpose |
18:27:36 | Araq | it needs to be patched |
18:27:42 | Araq | also and more importantly |
18:27:45 | Araq | is this allowed: |
18:27:49 | Araq | if x == nil: return |
18:27:56 | Araq | x[] |
18:28:20 | disruptek | you're gonna make him impl that? |
18:28:48 | Araq | disruptek, I'm trying, but this example is not hard, the CFG does the hard work for this |
18:28:55 | FromGitter | <alehander42> yes, i mostly wanted to see listings of the current cfg on small test programs to get a better idea |
18:29:04 | FromGitter | <alehander42> but i figured out how to echo them |
18:29:26 | FromGitter | <alehander42> well, oh yeah |
18:29:35 | FromGitter | <alehander42> i think this should be supported, at least i did in my previous pr |
18:30:16 | disruptek | if you make that work, then i will look into fixing try/except and maybe even the case clause. |
18:30:55 | disruptek | i thought cfg was further away from readiness, honestly. |
18:30:57 | FromGitter | <alehander42> but yeah, i remember try/except was a harder thing to support |
18:31:07 | FromGitter | <alehander42> but that's why i wanted to see how this all looks on cfg level |
18:31:16 | FromGitter | <alehander42> because it simplifies many of those constructs |
18:31:20 | sealmove | is there a way to make option unpacking automatical when accessing fields? for example if Type1 has a field called x, then if y is of type Option[Type1] you can do y.x instead of get(y).x |
18:31:44 | disruptek | did you look into impl `.`? |
18:31:51 | sealmove | no |
18:32:05 | Araq | sealmove, it would defy the purpose of Option[T] |
18:32:13 | disruptek | speaking of hacks, shashlick, did that env hack work? |
18:32:22 | sealmove | I thought about overloading it, but I have no idea how that works |
18:32:31 | FromGitter | <alehander42> also i think stuff like if x == nil or y == nil: stuff else: x.a + y.a |
18:32:37 | FromGitter | <alehander42> should work |
18:33:04 | sealmove | Araq: I know, but my I want to automate that for some auto-generated tests and still get to use Option |
18:33:29 | Araq | alehander42: meh, 'x != nil and y != nil' is good enouhg, 'or' is complex. but that's exactly what the spec should cover |
18:34:03 | * | SodaScripter quit (Ping timeout: 245 seconds) |
18:34:12 | FromGitter | <alehander42> but i need to know a bit more about the low level repr for that |
18:34:25 | FromGitter | <alehander42> e.g. i guess the logical operators are all expressed in a simpler way |
18:34:35 | FromGitter | <alehander42> (all of them can be expressed as and + not comb?) |
18:35:01 | sealmove | so `.` is overloadable? |
18:35:15 | FromDiscord | <Rika> oh wow only realized the irc bridge is working again |
18:35:16 | FromGitter | <alehander42> so basically if the low level repr uses only those, probably we can always say `all high level logical operators are taken into consideration` |
18:35:47 | Araq | alehander42: they are mapped to control flow |
18:36:15 | FromGitter | <alehander42> but i mean, do we have `or` in the cfg |
18:36:26 | Araq | no, we have jumps |
18:36:32 | Araq | control flow. |
18:36:59 | FromDiscord | <DeltaPHC> I think overloadable `.` is an experimental feature? |
18:37:15 | Araq | yes, but it exists |
18:38:34 | sealmove | experimental is good enough for me |
18:39:04 | disruptek | the stones on this guy... |
18:39:22 | FromDiscord | <DeltaPHC> What makes it experimental, out of curiosity? Design not final? |
18:39:54 | Araq | it kinda sux |
18:40:20 | Araq | for instance if you write x.y in a template, the template does not bind `.` |
18:41:01 | Araq | it's the old "1 letter is fine, 0 letters are from hell" misdesign |
18:41:28 | Araq | see also: implicit items iterators, converters |
18:41:54 | Araq | the `()` operator |
18:43:23 | Araq | or the {.this: self.} idea |
18:43:39 | Araq | features work better when they work together |
18:45:40 | * | daddoo joined #nim |
18:49:38 | * | exelotl joined #nim |
18:50:04 | FromDiscord | <treeform> wow so many new issues: https://github.com/nim-lang/Nim/issues |
18:50:16 | FromDiscord | <treeform> this 1.0 is a flood of people trying things out |
18:50:34 | * | SodaScripter joined #nim |
18:51:00 | FromDiscord | <Kiloneie> this is why i have to pump out a lot of videos to get them to watch D: |
18:51:09 | FromDiscord | <Kiloneie> and it's hard QQ |
18:51:33 | Araq | treeform: that's why you release version 1.0.*0* |
18:51:58 | Araq | you will never find all the bugs on your own, waiting for perfection is silly |
18:52:56 | FromDiscord | <Kiloneie> why is it so hard to speak freely, i gotta start streaming one day, my english free talk sucks |
18:53:13 | Cadey | to be fair |
18:53:23 | FromDiscord | <Shield> always script your videos |
18:53:28 | Cadey | english is about as simple as latin-family gender declensions |
18:54:16 | * | laaron joined #nim |
18:55:09 | FromDiscord | <Kiloneie> i am scripting them, and then it sucks and im fixing them, and.... blah D: |
18:56:05 | Araq | Kiloneie: I'm working on a video too, I feel the pain |
18:59:28 | FromGitter | <alehander42> Araq, ok, ill just see what the current cfg does |
18:59:33 | FromDiscord | <Kiloneie> ^^ i hope i can finish it tonight |
19:00:40 | FromGitter | <alehander42> btw i still think we should add to locations fields of local vars/let: because iirc often in existing code people already have stuff like if not a.b.isNil: a.b stuff and making them rewrite it to `let newvar = a.b` would be probably hard |
19:01:18 | FromGitter | <alehander42> we can just invalidate those field locations on every call indeed (or maybe not, if we have some logic for "is this local var escaped/visible from outside") |
19:01:33 | FromGitter | <alehander42> but not too important |
19:01:35 | Araq | too hard to prove correct |
19:01:37 | FromGitter | <alehander42> to have that |
19:01:42 | Araq | introduces aliasing problems |
19:01:54 | FromGitter | <alehander42> well, it seems the same to me with more conservativeness |
19:01:55 | Araq | we want it to be sound |
19:02:02 | FromGitter | <alehander42> if the location is used directly after the check |
19:02:04 | FromGitter | <alehander42> its' fine |
19:02:18 | FromGitter | <alehander42> if not, we can still warn |
19:02:36 | * | daddoo quit (Quit: Leaving) |
19:02:36 | FromGitter | <alehander42> but this can be added later, if it seems useful |
19:02:48 | FromGitter | <alehander42> for enough % of cases |
19:03:50 | FromDiscord | <treeform> Araq, yesterday I did some experiments with GC arenas. Where you have like a "whole game arena", "level arena" and "frame arena". You clear the level arena when you switch game levels and clear the frame arena every frame. What are your thoughts on an arena based GC? |
19:04:44 | Araq | covered by our upcoming "allocator API" |
19:04:47 | FromDiscord | <treeform> Most GC's frees are per object. Event with manual C style frees it's per object. But with an Arena you can just "clear" the whole thing. |
19:05:09 | Araq | I tried it with --gc:regions |
19:05:20 | FromDiscord | <treeform> Oh is that still in? |
19:05:48 | Araq | kind of, all these ideas are getting combined |
19:06:38 | Araq | but it's the most inflexible way to manage memory than I found |
19:06:42 | Araq | *that |
19:06:56 | FromDiscord | <Mamy> regions per type would be nice |
19:07:07 | FromDiscord | <Mamy> but I think we call that an object pool |
19:07:52 | Araq | and I prefer solutions that are fluent, "I need to get shit done. Ok, now let me optimize this..." |
19:08:59 | Araq | if you start with your arenas idea, Nim is already there, 'ptr T' is a thing, it's not going away |
19:09:25 | FromDiscord | <treeform> Memory arena regions appear to work with tons of usage patterns that are comment - game frames or http requests. |
19:09:35 | FromDiscord | <treeform> But I have never programmed with them - so I don't know. |
19:09:43 | FromDiscord | <treeform> They could totally sux |
19:10:08 | FromDiscord | <treeform> yeah I was using ptr T for my experiments |
19:10:20 | FromDiscord | <Kiloneie> the next video will be like 4 minutes long xD... gonna try to make the next one a bit longer |
19:10:39 | FromDiscord | <Mamy> short videos are good |
19:10:40 | FromDiscord | <Shield> regions is very not flexible, the problem is that you can only work on one region at a time |
19:11:01 | FromDiscord | <Mamy> for presentations you want to showcase very short videos |
19:11:33 | FromDiscord | <Kiloneie> it's gonna be called How Programs work, showing that programs are written and executed from top to bottom, echo with multiple parameters, that you can do calculations and some basic data type info |
19:11:44 | * | mibr quit (Ping timeout: 246 seconds) |
19:12:00 | FromDiscord | <treeform> @Shield, I think thats API depended. For system I would defined regions ahead of time. And I could allocate to any region at any time. And free them at any time. |
19:12:09 | FromDiscord | <treeform> @Shield, I think thats API depended. For system I defined regions ahead of time. And I could allocate to any region at any time. And free them at any time. |
19:12:33 | lqdev[m] | hey guys, I don't want to brag but someone please test tests/taudio. I don't know if the issue I'm having is specific to my machine or not and I really need to know https://github.com/liquid600pgm/rapid |
19:13:00 | lqdev[m] | doesn't matter what OS, just try to run it |
19:13:08 | lqdev[m] | and tell me if you get any sound |
19:13:55 | FromDiscord | <treeform> man audio is so hard to get right, its so hard to get rid of the clips... |
19:14:14 | Araq | treeform: well in game programming regions/arenas are very common indeed. |
19:14:40 | FromDiscord | <treeform> I think if most http servers were written with C++, they would be common there too? |
19:14:49 | Araq | and yeah, you can use them for servers too. it's also very easy to use up more memory with them than a GC takes |
19:14:52 | FromDiscord | <treeform> if most http servers were written like games? |
19:15:01 | FromDiscord | <Shield> the problem is that i wasn't sure if things stayed in their right regions when I copy stuff around when working on another region, just concatinating strings and displaying text became a problem |
19:15:18 | FromDiscord | <Mamy> you use them for multithreading runtimes as well |
19:15:24 | FromDiscord | <Shield> @lqdev[m] sadly i'm on windows and using minGw |
19:15:26 | FromDiscord | <Mamy> and big int |
19:15:34 | FromDiscord | <Mamy> and tensor libraries |
19:17:56 | lqdev[m] | Shield: the compilation issue is fixed, go ahead and try |
19:18:00 | Araq | the real problem is not how to do better than a GC, that's easy |
19:18:06 | FromDiscord | <treeform> @Shield I think big thing with GC regions is some thing like a "dev time leak detector" some thing that can detect pointing from other regions into regions that is bering freed. |
19:18:12 | * | justsomeguy joined #nim |
19:18:49 | Araq | the real problem is to come up with a scheme that works for "average library code" out there that is not tied to an application |
19:18:50 | lqdev[m] | treeform: I don't care about stuttering right now. I just want to hear something other than silence. |
19:18:56 | FromDiscord | <treeform> Kind of what Araq was doing for --newruntime do the debugging in dev with more tools, don't do that in release mode. |
19:19:45 | FromDiscord | <treeform> lqdev, I used openAl for my project. worked really well. https://github.com/treeform/openAL |
19:20:01 | lqdev[m] | openal is proprietary |
19:20:20 | Araq | application development is easy, library development is hard, take json.nim. can we assume all the json ends up in a region? why? how? |
19:20:41 | lqdev[m] | and I'm fine with my current audio model. |
19:21:16 | Araq | do we really want to have a parameter 'a: Allocator' in every proc we write? |
19:21:23 | FromDiscord | <treeform> Araq, yeah thats tough |
19:21:34 | FromGitter | <alehander42> Araq, it's strange, i get ` `false` dfa construction pass requires the elimination of 'defer' ` |
19:21:38 | FromDiscord | <treeform> a global `a: Allocator` or a global allocator stack could work... |
19:21:42 | FromGitter | <alehander42> when constructing the current dfa |
19:21:54 | FromGitter | <alehander42> treeform, i think there is an easier way to pass Allocator |
19:21:56 | Araq | treeform: that's --gc:regions then |
19:22:14 | FromGitter | <alehander42> with a global or stack |
19:22:18 | FromDiscord | <treeform> Yeah I want to learn more about --gc:regions |
19:22:23 | FromGitter | <alehander42> with a helper like https://github.com/nim-lang/RFCs/issues/165 |
19:22:48 | * | SodaScripter quit (Ping timeout: 245 seconds) |
19:23:42 | justsomeguy | Just spend my first five minutes with Nim and it seems like a mash-up of Python, ES6, and Haskell -- but in a good way. Seems amazingly accessible for what it is, actually. |
19:23:48 | justsomeguy | s/spend/spent/ |
19:24:02 | FromGitter | <alehander42> nice, welcome <3 |
19:24:08 | Araq | memory management is the heart of a programming language. Python uses refcounting everywhere, it's slow but at least it works independent of the size of the heap and all 3rd party addons obey |
19:24:22 | FromDiscord | <treeform> justsomeguy, yeah nim is great, I came here for the python and speed part, stayed because of everything else. |
19:25:57 | FromDiscord | <treeform> Araq, also python's ref counting was very consistent until they added a cycle detector. I like consistent. I which it would tell me about cycles at "dev time" only so that I could compile that out. |
19:26:21 | Araq | still possible to disable the cycle detector in Python |
19:26:39 | Araq | and set things to None manually to break up cycles |
19:26:40 | FromDiscord | <treeform> yeah but it does not tell you when you have cycles so it's easy to accidentally get them. |
19:27:13 | FromDiscord | <treeform> if they added a function like "check for cycles" I could run at "dev time" that would be great. |
19:27:35 | Araq | well anyway, "slower but works with the rest of an entire ecosystem" wins over "fast and specialized" |
19:27:48 | FromDiscord | <treeform> thats true |
19:28:37 | Araq | and that's why development on 'owned' was paused. |
19:28:50 | FromDiscord | <treeform> it got too complex? |
19:29:20 | Araq | no, I found an alternative |
19:29:40 | FromDiscord | <treeform> have you written stuff about the alternative? |
19:29:53 | Araq | which gives us the same benefits without splitting the language |
19:30:04 | Araq | no .... i'm working ... on it. |
19:30:34 | FromDiscord | <treeform> I started to write "--newruntime for beginners" post/doc, but myself got confused - i was the beginner 🙂 |
19:31:04 | Araq | well --newruntime is still the MUCH better --gc:none solution |
19:31:14 | Araq | much much better. |
19:31:29 | FromDiscord | <treeform> does your new solution work with threads? |
19:31:38 | Araq | of course |
19:31:55 | FromDiscord | <treeform> cool |
19:32:23 | Araq | but as I said elsewhere, the design that supports 'async' first wins |
19:33:29 | Araq | but be my guest, we need more and better libraries and using 'ptr' and arenas and marking the library as "for games or servers" is nice |
19:33:32 | FromDiscord | <treeform> something like "gc regions stack" would not work with async at all. |
19:34:16 | Araq | it kinda works, but you need to be careful and most people are forced into writing servers and are careless about everything |
19:34:32 | FromDiscord | <treeform> The thing is with games you don't need to do the high performance GC stuff in many places. You could have an area marked ... CRAZY GC RULES HERE ... and use normal gc everywhere else. |
19:35:07 | Araq | I would love to see an EASTL for Nim :-) |
19:35:38 | Araq | we simply get most libraries wrong and we're not alone, C++ had the same problem |
19:36:14 | FromDiscord | <treeform> I think people writing servers are getting wiser slowly. |
19:36:50 | FromDiscord | <treeform> I think the moore law (on single core speed) not working is slowly catching up. |
19:37:08 | Araq | we introduced -d:safe vs -d:release because of that, people compiled the servers in -d:release, all the time |
19:37:10 | FromDiscord | <treeform> Why run 1000 servers when you can run 100 and save $$$. |
19:38:41 | * | gangstacat quit (Ping timeout: 246 seconds) |
19:39:31 | Araq | er, I mean -d:danger |
19:39:51 | FromDiscord | <treeform> Hmm I compile my servers with -d:release .. but I also add --d:nimTypeNames --d:stackTrace --d:lineTrace |
19:39:58 | FromDiscord | <treeform> What should I to instead? |
19:40:12 | Araq | it's fine now, -d:release does the right thing for servers |
19:40:18 | Araq | we changed it :-) |
19:42:14 | * | SodaScripter joined #nim |
19:42:49 | FromDiscord | <Kiloneie> you know the feeling, when you ended one part of a video with one voice and start the other with another and you take 15 minutes to fix it and nothing works ? yolo... |
19:45:16 | Araq | er no, I only have one voice |
19:45:21 | * | SodaScripter quit (Remote host closed the connection) |
19:46:18 | FromDiscord | <Kiloneie> no i mean, you were talking louder more casual in one part, then you start the other HEI GUYS !!!! |
19:46:25 | FromDiscord | <Kiloneie> something like that xD.. |
19:46:36 | FromDiscord | <has1> hi, two questions |
19:47:12 | FromDiscord | <has1> It seems like i didnt find maps in nim yet, where are those? (i am looking for a map like in go) |
19:47:34 | * | SodaScripter joined #nim |
19:47:38 | * | theelous3 quit (Ping timeout: 240 seconds) |
19:47:52 | FromDiscord | <has1> and second question, what is a "placeholder" type? In Go it is "interface{}" auto doesn't seem to work |
19:47:53 | FromGitter | <alehander42> kiloneie i dont really think thats bad |
19:48:02 | FromGitter | <alehander42> has1 tables |
19:48:46 | Araq | has1 there is RootRef but I never use it, Nim has generics it doesn't need interface{} |
19:49:16 | FromDiscord | <Kiloneie> well you will tell me once i post it, i can definetly hear that someone glued it together O,O |
19:49:38 | FromDiscord | <has1> @gitterirc So i am trying to parse some json, it has this kind of structure |
19:50:28 | FromDiscord | <has1> https://play.nim-lang.org/#ix=1WWN |
19:50:37 | * | justsomeguy left #nim (#nim) |
19:51:30 | solitudesf | @has1 `gitterirc` is relay account |
19:51:36 | FromDiscord | <has1> inside the handleEvent proc, i am manually parsing the json though, I would like to avoid that and just check for the type itself |
19:51:36 | * | gangstacat joined #nim |
19:52:18 | Araq | calling a simple string case "manually parsing" should be a sin |
19:52:36 | Araq | ;-) |
19:52:58 | FromDiscord | <has1> what i mean is that i am parsing the json to the object based on the name of the thing |
19:53:49 | Araq | you can hide it in a macro |
19:54:11 | FromDiscord | <has1> but it doesnt work in this simple form |
19:54:18 | FromDiscord | <has1> because i cant use the type string |
19:54:28 | FromDiscord | <has1> because its an object |
19:54:33 | Araq | you can use a 'case' object, maybe |
19:55:37 | FromDiscord | <has1> so which type do i use for payload? |
19:55:56 | * | shomodj joined #nim |
19:57:47 | FromDiscord | <has1> oh, so i am just trying things out |
19:57:54 | * | gour quit (Remote host closed the connection) |
19:57:54 | FromDiscord | <has1> and it seems like i can just use ```JsonNode``` |
19:57:56 | FromDiscord | <has1> as type |
19:58:09 | FromDiscord | <treeform> @has1 I think the way you are doing it fine? JSON type system does not match nim's type system so you have to convert. |
19:58:37 | Araq | https://play.nim-lang.org/#ix=1WWQ |
19:59:12 | FromDiscord | <treeform> @has1 I have a ton of code like this because my JSON is generated by some one else does not fit into nim's object structure. |
19:59:22 | Araq | but I doubt it'll work out, in the end you have the stuff in a "single type" but then you need to do event specific things anyway |
19:59:58 | Araq | and that's what the 'case' is, it's a dispatching mechanism, you can't avoid it, nor is it wise to hide it |
20:00:12 | Araq | "manually parsing" has nothing to do with dispatching. |
20:00:20 | FromDiscord | <has1> i was hoping for some nice solution. I was using go before and i was using interface{} for it, i thought maybe nim could help me here with generics and macros and everything |
20:01:17 | Araq | maybe it can but it depends on the JSON |
20:01:36 | * | SodaScripter quit (Remote host closed the connection) |
20:01:54 | Araq | and as I said, once it's all in the 'Event' type, what are you gonna do with it? |
20:02:20 | FromDiscord | <has1> i want to handle it in an event handler |
20:03:18 | Araq | and what does the event handler do with the message? dump to somewhere else? because for everything else there would be a dispatching step |
20:04:57 | Araq | it's like: heterogenous input (json) --> single type --> heterogenous handling |
20:05:20 | Araq | see the problem? the type in the middle is a lie. |
20:07:20 | FromGitter | <alehander42> has1 can you give an example of your json |
20:08:15 | Araq | he did, it's the usual message setup, a message has a kind and depending on the kind ("name" in this case) a different payload with different fields in it |
20:08:21 | FromDiscord | <Rika> its in the playground link he sent |
20:08:49 | FromGitter | <alehander42> well that's a typical `case object` has1, perfectly type safe imho |
20:09:45 | FromGitter | <alehander42> tho i have to admit maybe not perfectly, because of field name |
20:09:46 | FromDiscord | <Shield> @lqdev[m] having trouble with nimterop, can't get the test to compile |
20:10:09 | Araq | argh, now I need to write a macro... |
20:10:51 | * | krux02 joined #nim |
20:11:13 | FromDiscord | <Shield> i tend to avoid anything c++, i'm in library hell and i get error messages to run the compiled exe, can't run toast.exe, damn windows |
20:11:50 | FromDiscord | <has1> i created an example |
20:11:58 | Araq | has1: one sec please |
20:12:22 | FromDiscord | <has1> https://play.nim-lang.org/#ix=1WWU |
20:12:40 | FromDiscord | <Shield> dependencies are my heart breakers |
20:13:47 | lqdev[m] | Shield: what's the error? |
20:14:02 | lqdev[m] | if it's something with GLFW, try again. seems to be a weird bug with git or something |
20:14:04 | FromDiscord | <has1> there is no error |
20:14:40 | FromDiscord | <treeform> @has1, I think your code is fine. |
20:14:44 | FromDiscord | <has1> but, i have to do the "manual" json parsing inside the case |
20:15:41 | FromDiscord | <treeform> I think your manual step is fine instead of some complex macro thing |
20:15:59 | Araq | bummer I was about to show the macro |
20:16:08 | * | paxis joined #nim |
20:16:12 | FromDiscord | <treeform> once you have different versions of events or need to clean up old json data you would need to do it manually |
20:16:33 | FromDiscord | <treeform> Araq, show us the macro then |
20:16:39 | FromDiscord | <exelotl> I want to see the macro |
20:17:04 | Araq | I suck at macros lol |
20:17:18 | Araq | but let me try... |
20:17:25 | FromDiscord | <exelotl> lmao |
20:17:40 | FromDiscord | <treeform> well you set yourself up for that one |
20:17:54 | Araq | hey, I rarely get to write Nim user level code |
20:18:04 | * | nsf quit (Quit: WeeChat 2.5) |
20:18:23 | rockcavera | Hi Araq. Since you designed the language, you wanted to know how to calculate the space occupied by a sequence in memory. I tried with this code to confirm my theory that it would be 8 bytes per sequence plus 1 byte per int8 in an sequence of sequence of int8: https://pastebin.com/NhWQe3i1 |
20:18:26 | FromDiscord | <Shield> git.nim(25, 12) `ret == 0` Command failed: (128, false) ccmd: cmd /c cd "D:\gamedev rebirth\sandbox\rapid\rapid-master\src\rapid\lib\soundio_src" && git remote add origin https://github.com/andrewrk/libsoundio |
20:18:26 | FromDiscord | <Shield> result: fatal: remote origin already exists [AssertionError] |
20:18:47 | FromDiscord | <Kiloneie> what font did you guys use in you black nim logo ? |
20:18:53 | * | Trustable quit (Remote host closed the connection) |
20:19:09 | lqdev[m] | Shield: try removing src/lib/soundio_src |
20:20:07 | FromGitter | <alehander42> rockavera cool! |
20:20:13 | FromGitter | <alehander42> rockcavera * |
20:20:55 | Araq | rockcavera, er... thanks but I don't really remember |
20:21:00 | FromGitter | <alehander42> Araq, so liftLambdas and transf are called .. in cgen? does this mean cfg taking that in account has to be called after that as well |
20:21:11 | FromGitter | <alehander42> i expected they are in sempass2 |
20:22:36 | * | uu91 joined #nim |
20:23:57 | Araq | alehander42: as I said, we will need to change the order |
20:24:19 | FromDiscord | <Kiloneie> Okay Video #2 is done, but i put it as unlisted because i don't really feel like it's as good as the first one... idk, if you guys like it i will make it public |
20:24:19 | FromDiscord | <Kiloneie> |
20:24:19 | FromDiscord | <Kiloneie> LINK: https://youtu.be/wD-p06zbY1g |
20:24:28 | FromDiscord | <Shield> no luck, the folder is empty, deleted all of them, now it says the same error for ogg_src |
20:24:59 | FromGitter | <alehander42> Araq no problem, i echo the cfg after transformBody now |
20:25:15 | FromGitter | <alehander42> so i can see how it looks, that's enough to understand it for me |
20:26:19 | FromDiscord | <has1> Alright so this is the go solution (for reference) |
20:26:19 | FromDiscord | <has1> https://play.golang.org/p/47D91Dv2iqb |
20:26:23 | rockcavera | Araq thanks for answering. If you remember, please let me know, as I have so far failed to come up with a solution. |
20:27:19 | FromGitter | <alehander42> so in this case we have to specify the nil check doesnt work for captured locals |
20:27:56 | FromDiscord | <has1> the problem is that i am using the actual even objects and store them as "interface{}", that means go know what type it is. |
20:27:56 | FromDiscord | <has1> If the events come via json, then the interface{} loses its type information and this code doesn't work |
20:29:05 | FromDiscord | <Shield> hold on, i'm getting a new error |
20:29:19 | FromDiscord | <has1> it will store the payload as a map instead of the actual object. |
20:29:19 | FromDiscord | <has1> Long story short, basically you guys told me the same thing that the Go guys told me, which is to unmarshal in case after checking for the event name |
20:29:42 | FromDiscord | <has1> it will store the payload as a map instead of the actual object. |
20:29:42 | FromDiscord | <has1> Long story short, basically you guys told me the same thing that the Go guys told me, which is to unmarshal in the "case" after checking for the event name |
20:30:01 | Araq | maybe the Go guys had a point |
20:30:08 | FromGitter | <alehander42> well, you can have all the payloads inherit a common EventBase object maybe |
20:33:07 | Araq | has1: here you go, https://play.nim-lang.org/#ix=1WWU |
20:33:19 | Araq | er sorry |
20:33:22 | Araq | wrong link |
20:33:43 | Araq | https://play.nim-lang.org/#ix=1WX0 |
20:36:20 | FromDiscord | <Shield> @lqdev[m] now I get nimPNG.nim(333, 18) Error: type mismatch: got <seq[RGBA8], typeof(nil)> |
20:37:54 | lqdev[m] | woah, that's strange |
20:38:05 | lqdev[m] | what version of Nim are you running? |
20:40:03 | FromDiscord | <Shield> 0.20.99, i'm still using a previous nightly build |
20:40:26 | FromDiscord | <exelotl> When my friend updated to Nim 0.20 the other week, he couldn't build some of my code that used NimPNG. I told him to reinstall via nimble in case there was a newer version. |
20:40:49 | FromDiscord | <exelotl> The version of nimpng hadn't changed but he overwrote it anyway, and then the problem went away |
20:43:09 | Araq | you just described how computers work. all good after a reboot |
20:43:55 | FromDiscord | <Shield> the weirdest thing was one of the libraries complaining that i should have --threads:on and --tlsEmulation:off |
20:44:24 | FromDiscord | <Kiloneie> I almost thought you were talking to me xD... |
20:46:39 | FromDiscord | <Kiloneie> Anyone watched my #2 yet ? should i make it public, is it any good ? Did any of that sound quality problem go away ? Im not sure at all. |
20:46:54 | * | Vladar quit (Remote host closed the connection) |
20:53:03 | FromDiscord | <Shield> okay, nimble install nimpng fixed it |
20:53:44 | FromDiscord | <Shield> i dunno why there was an error, the nimble installed it automatically |
20:54:46 | FromDiscord | <Shield> @lqdev[m] rejoice! it plays the sound onces and freezes my computer since it ate all cpu until i killed it, is that because of the 'while true' loop? |
20:54:55 | FromDiscord | <Shield> once* |
20:56:00 | FromDiscord | <Shield> @Kiloneie dem keyboard sounds, pretty satisfying |
20:56:10 | FromDiscord | <Kiloneie> xD |
20:56:26 | FromDiscord | <Kiloneie> and everything else ? |
20:56:48 | FromDiscord | <exelotl> Looks like the sunvox header changed a little since I wrote the binding last year, bringing it up to date now |
20:57:05 | FromDiscord | <Shield> sound quality is clear, the voice is level is consistent, good job |
20:57:39 | FromDiscord | <Shield> i wasn't aware of nimtrop, it looks like you can use it to generate bindings automatically |
20:57:42 | FromDiscord | <Kiloneie> i put 5 hard cardboards infront of my computer, 2 towels on it, a towel under mic, played with audio settings for 2-3 hours D: |
20:57:50 | Yardanico | lol |
20:58:34 | FromDiscord | <Kiloneie> so that's good, how about the actual tutorial part ? im so unsure about it, feels kinda off to me. |
20:58:50 | FromDiscord | <Kiloneie> i can re do it tomorrow, but if it's good i can make it public before i go to bed |
20:59:47 | FromDiscord | <Kiloneie> i mean i did watch thenewboston youtube guy i used to watch years ago a bit before my videos, taking notes, and he gave 0 fucks what he was talking about or how xD |
21:00:03 | FromDiscord | <Kiloneie> and yet people watched it a ton |
21:00:14 | FromDiscord | <Shield> "" turned into "hello" through the magic of editing, i can't comment much on the very beginner stuff |
21:01:02 | FromDiscord | <Kiloneie> yeah i know i fucked that part up D:, you didn't see anything xD, |
21:02:05 | FromDiscord | <Shield> oh wow i'm getting those random '@' in path and i can't compile a second time, i thought that happened only on v1 |
21:02:32 | shashlick | Same bug |
21:03:19 | shashlick | https://github.com/nim-lang/Nim/pull/12265 |
21:04:28 | * | dwdv_ joined #nim |
21:07:32 | * | dwdv quit (Ping timeout: 245 seconds) |
21:08:38 | FromDiscord | <Kiloneie> Okay after watching my video again, ehhhh it's not that bad, imma make it public, better than to waste all the time invested |
21:10:52 | * | laaron quit (Quit: ZNC 1.7.4 - https://znc.in) |
21:11:53 | dom96 | anyone with macOS 10.14.6 (or thereabouts)? |
21:11:55 | * | laaron joined #nim |
21:15:27 | FromDiscord | <Shield> @shashlick I applied the changes in the PR and the bug still persists |
21:18:07 | * | asymptotically quit (Quit: Leaving) |
21:18:52 | FromDiscord | <Shield> @lqdev[m] I can only run taudio, have trouble compiling/running the other tests, maybe focus on audio tests without including glfw and i'll try them |
21:20:04 | * | solitudesf quit (Ping timeout: 268 seconds) |
21:25:30 | FromDiscord | <Shield> reopen this |
21:25:30 | FromDiscord | <Shield> https://github.com/nim-lang/Nim/issues/12249 |
21:26:27 | FromDiscord | <Shield> oh wait, do i need to recompile nim? |
21:27:12 | * | doesntgolf joined #nim |
21:31:39 | * | clyybber joined #nim |
21:35:06 | * | daddoo joined #nim |
21:39:54 | * | SodaScripter joined #nim |
21:42:58 | dom96 | I totally forgot about Snake |
21:43:10 | dom96 | Just restarted the server and there are like 5 people playing :O |
21:43:34 | FromDiscord | <Kiloneie> Wait what ? |
21:43:44 | dom96 | https://nim-lang.org/features.html |
21:43:49 | dom96 | middle of that page |
21:44:01 | FromDiscord | <Kiloneie> yeah i thought you meant that xD |
21:44:03 | FromDiscord | <Kiloneie> lol |
21:44:45 | FromDiscord | <Kiloneie> it's a great example |
21:45:30 | clyybber | Araq: WDYT about https://github.com/nim-lang/Nim/pull/12220/files#diff-92288f1d4e61a914791381a2f5e440caR50 should that be allowed? |
21:46:04 | Araq | nah, '.val' is not a type |
21:46:18 | Araq | var x: typeof(Foo[int].val) |
21:46:18 | dom96 | I should probably recompile with Nim 1.0 |
21:46:29 | dom96 | server will likely be more reliable then |
21:48:38 | clyybber | Araq: Cool, I agree on that |
21:50:06 | clyybber | Araq: But `var x: Foo.val` compiles too, when Foo is not a generic |
21:50:20 | clyybber | So I think it makes sense for Foo[int].val to compile too? |
21:50:36 | Araq | no, it's shit |
21:51:05 | FromDiscord | <treeform> dom96, I am on the mac you want macOS 10.14.6 |
21:51:05 | Araq | and shouldn't work |
21:51:19 | clyybber | Araq: You mean the whole Foo.val thing? |
21:51:33 | clyybber | Araq: As in using fields of types as types? |
21:51:38 | Araq | yes |
21:52:00 | clyybber | It has its use cases I suppose |
21:52:08 | Araq | offsetof(Foo.val) oh, so it's not a type as types have no offset |
21:52:22 | Araq | dangerous stuff, bad it already works |
21:53:48 | dom96 | treeform: can you repro https://github.com/dom96/choosenim/issues/139 ? |
21:53:52 | clyybber | Araq: Seems more like a problem of offsetof ? To be sound it should be offsetof(Foo, val) as offsetof *has* to consider the object val is a field of internally |
21:54:34 | Araq | the point is that fields are not types |
21:54:43 | Araq | and could be interpreted differently |
21:55:17 | clyybber | Yeah, I get that. But what is Foo.val then? |
21:55:28 | clyybber | Its certainly not a value |
21:55:40 | clyybber | And according to you not a type |
21:55:46 | clyybber | Or shouldn't be |
21:55:52 | clyybber | But what else should it be then? |
21:56:11 | clyybber | invalid? |
21:56:38 | FromDiscord | <treeform> dom96, I alreayd have nim installed |
21:56:49 | FromDiscord | <treeform> how to remove it to a fresh state? |
21:56:57 | FromDiscord | <treeform> on man i hope this does not go badly |
21:57:18 | dom96 | treeform: you can mv ~/.choosenim/ ~/.choosenim.bak |
21:57:25 | Araq | clyybber, it's nothing |
21:57:47 | FromDiscord | <treeform> dom96, I put my trust in your tool |
21:58:40 | dom96 | the only other files it generates are ~/.nimble/bin/nim etc. and those it happily overwrites so it's all good :) |
21:59:11 | clyybber | Araq: Sounds like that would create problems with typeof(Foo[int].val) if `Foo[int].val` would indeed be nothing |
22:00:30 | FromDiscord | <SrMordred> Hello people. hot code reloading are a experimental feature? i´m trying to test it on windows without success |
22:01:57 | FromDiscord | <treeform> dom96, everything worked for me see my reply: https://github.com/dom96/choosenim/issues/139 |
22:02:05 | Araq | it's experimental but for me it worked well, SrMordred |
22:03:10 | dom96 | treeform: strange, thanks for testing. |
22:03:33 | FromDiscord | <SrMordred> hmm. for ex: `nim c --hotcodereloading:on nim_server.nim` this don´t create any .exe |
22:08:09 | Araq | https://nim-lang.org/docs/hcr.html read this? |
22:09:07 | * | LargeEpsilon joined #nim |
22:13:14 | * | LargeEpsilon quit (Ping timeout: 240 seconds) |
22:15:51 | FromDiscord | <SrMordred> oh, i think the main proc is needed, right? |
22:15:51 | FromDiscord | <SrMordred> now i´m getting could not load: nimhcr.dll |
22:17:34 | FromDiscord | <SrMordred> (after successfully created the .exe) |
22:28:08 | shashlick | @shield did recompile help? |
22:29:44 | FromDiscord | <Shield> recompile what? the compiler? |
22:37:09 | clyybber | narimiran[m]: I would really love to get https://github.com/nim-lang/Nim/pull/10515 merged, should I open a PR with a rebase or do you usually rebase yourself? |
22:39:28 | shashlick | ya, code change is in compiler file so need to recompile nim to fix that issue |
22:40:35 | FromDiscord | <Shield> I don't know how to recompile it >.> |
22:41:04 | Araq | clyybber, I think he is sleeping |
22:41:27 | Araq | re-create the PR so that we get all the new CI checks |
22:41:31 | Araq | good night |
22:43:37 | shashlick | nim c -r koch boot -d:danger |
22:43:46 | clyybber | Araq: Fine, gn8 |
22:44:39 | * | dwdv_ quit (Quit: quit) |
22:45:11 | * | daddoo quit (Quit: Leaving) |
22:49:52 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
22:55:21 | FromDiscord | <Shield> it doesn't work like the fix fixed the issue, i'll wait for the nightlies to confirm |
22:56:24 | * | clyybber quit (Quit: WeeChat 2.6) |
23:00:53 | * | owl_000 joined #nim |
23:05:35 | * | MrAxilus joined #nim |
23:09:26 | * | laaron quit (Quit: ZNC 1.7.4 - https://znc.in) |
23:09:35 | * | shomodj quit (Quit: Textual IRC Client: www.textualapp.com) |
23:10:22 | * | laaron joined #nim |
23:10:59 | * | theelous3 joined #nim |
23:23:03 | * | krux02_ joined #nim |
23:25:43 | * | krux02 quit (Ping timeout: 245 seconds) |
23:30:50 | * | snooptek quit (Remote host closed the connection) |
23:32:01 | * | snooptek joined #nim |
23:35:01 | * | couven92 quit (Quit: Client Disconnecting) |
23:38:20 | SodaScripter | how get good at programming |
23:38:39 | disruptek | practice. |
23:38:54 | disruptek | though, i can't say it always works. |
23:39:08 | SodaScripter | nim tutorials are really confusing to my peanut prain |
23:40:11 | disruptek | write what you know and slower accrete new technique as you get comfortable. |
23:40:19 | disruptek | ^slowly, too. |
23:42:57 | * | snooptek quit (Remote host closed the connection) |
23:43:47 | * | snooptek joined #nim |
23:57:30 | * | krux02_ quit (Remote host closed the connection) |
23:59:12 | Cadey | tbh |
23:59:22 | Cadey | the best way to get good at something is to first be awful at it |