00:00:08 | FromDiscord | <ikrima> meta comment: gotta say, i am loving this experience with nim. in less than a day, pain point fixed 🙂 |
00:02:36 | FromDiscord | <ikrima> follow-up ask: what's the norm in terms of being on language versions:? e.g. only language devs use devel vs. generally safe for everyone to be on devel for non production code? |
00:02:52 | Yardanico | well second is true I would say |
00:02:56 | leorize | it's safe enough for non-production code |
00:03:03 | Yardanico | devel works usually |
00:03:07 | Yardanico | but there might be new regressions and stuff |
00:03:21 | Yardanico | but also new fixes and new additions :) |
00:03:33 | leorize | well this is non production code that we are talking about :P |
00:04:17 | FromDiscord | <ikrima> gotcha; trying to set level set my expectations between "bleeding-edge nightly" vs. "dev" vs. "LTS release" |
00:05:02 | Yardanico | well devel really just works in most cases |
00:05:08 | Yardanico | it's really rarely broken as in you can't run it |
00:05:16 | Yardanico | because we have a nice CI setup nowadays :) |
00:05:34 | Yardanico | which tests the whole test suite and also some third-party packages |
00:06:15 | FromDiscord | <ikrima> 👍 |
00:22:17 | Yardanico | what do you guys think about https://github.com/nim-lang/RFCs/issues/240 ? maybe i'm missing some obvious case where it can lead to bugs? |
00:22:19 | disbot | ➥ Make "unreachable statement" error a warning ; snippet at 12https://play.nim-lang.org/#ix=2q6i |
00:31:39 | * | dmi00 joined #nim |
00:32:48 | * | polypus74 quit (Quit: WeeChat 2.8) |
00:33:57 | * | dmi0 quit (Ping timeout: 258 seconds) |
00:59:03 | * | Tongir quit (Ping timeout: 265 seconds) |
01:10:14 | * | oddp quit (Ping timeout: 240 seconds) |
01:24:58 | * | Tongir joined #nim |
01:25:43 | * | Tongir quit (Remote host closed the connection) |
01:34:32 | * | Tlongir joined #nim |
01:50:40 | * | oculuxe quit (Ping timeout: 256 seconds) |
01:52:27 | * | chemist69 quit (Ping timeout: 240 seconds) |
01:54:38 | * | chemist69 joined #nim |
01:58:13 | FromDiscord | <speckledlemon> Could someone clarify this comment (https://github.com/nim-lang/Nim/issues/2361#issuecomment-82210180) regarding `openArray`? I don't understand how you could violate memory safety when the length is known and you're just reading. |
01:58:15 | disbot | ➥ Illegal capture on async proc (except when the argument is `seq`) ; snippet at 12https://play.nim-lang.org/#ix=2q6q |
02:00:14 | leorize | it's due to async |
02:00:30 | leorize | what async does is that it creates a closure iterator, capturing all elements |
02:01:07 | leorize | since the closure iterator is not dependant on the stack, it's not possible to guarantee that a value originated from the parameter list will still be there the next time the iterator is resumed |
02:01:12 | leorize | this is why it's dangerous |
02:01:35 | leorize | (ok I lied a bit, it's possible, but our tracking tech is not that good yet) |
02:02:04 | FromDiscord | <speckledlemon> hmmm maybe that's a bad example. I'm encountering a similar error but async is nowhere in my code. Not sure how to isolate a MWE yet... |
02:02:22 | leorize | well the same applies to closure |
02:11:12 | * | rockcavera joined #nim |
02:13:03 | * | oculux joined #nim |
02:18:34 | FromDiscord | <speckledlemon> ugh, I knew this was a bug. there is no closure inside the code that takes an openArray, and none of the tests trigger it. It happens when I call the code from another package, and specifically it's because of the `high`: `func bisectRight*[T](a: openArray[T], x: T, lo: Natural = 0, hi: int = high(a)): int = ...`. If I replace it with 5 (just an example), it compiles |
02:19:29 | leorize | hmm that sounds weird |
02:19:49 | leorize | can you isolate a small sample out? |
02:20:05 | FromDiscord | <speckledlemon> I'm going to try now that I know the origin. I already reported https://github.com/nim-lang/Nim/issues/14587 |
02:20:06 | disbot | ➥ Can't use `Natural` with result of `int` function call in default argument |
02:21:29 | * | endragor joined #nim |
02:43:47 | * | muffindrake quit (Ping timeout: 240 seconds) |
02:46:23 | * | muffindrake joined #nim |
03:22:11 | FromDiscord | <Jasper> When a param references another param, the referenced param gets lifted into a temp. This currently happens after it has been converted to an openarray, which can't be assigned (captured) into a local. You must be within a function to reproduce. I believe there is already a bug report. https://play.nim-lang.org/#ix=2q6z |
03:29:37 | FromDiscord | <Bawbby> is there something in nim to allow for things like interfaces? |
03:30:00 | FromDiscord | <Bawbby> interfaces like in java* |
03:30:44 | FromDiscord | <Yardanico> Not really, we have concepts but they're compile time |
03:31:13 | leorize | !repo interface |
03:31:15 | disbot | https://github.com/andreaferretti/interfaced -- 9interfaced: 11 15 23⭐ 4🍴 & 29 more... |
03:31:56 | leorize | you can also write your own simple method tables, like how the streams module work |
03:32:55 | FromDiscord | <Bawbby> sorry to ask but what do you mean by method tables? |
03:34:24 | FromDiscord | <Bawbby> i'll take a look at that library though, thanks. |
03:34:24 | leorize | https://nim-lang.org/docs/streams.html#StreamObj |
03:34:54 | FromDiscord | <Bawbby> oh I see what you mean, thanks for that as well. |
03:35:06 | leorize | np |
03:35:43 | leorize | the interface pattern is rarely used here, so no one has really established a standard on how they should be done |
03:53:49 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.8) |
04:06:38 | * | supakeen joined #nim |
04:18:35 | * | dddddd quit (Ping timeout: 258 seconds) |
04:20:57 | FromDiscord | <Yardanico> So out of boredom I'm searching for "Nim" in vlang's discord and read the results |
04:21:00 | FromDiscord | <Yardanico> Found this gem |
04:21:22 | FromDiscord | <Yardanico> "I think v may be one of the factors that made 4raq (Nim's creator) to finally bump the version number of nim to 1.0 ." (A replaced with 4) |
04:28:46 | * | FromDiscord quit (Remote host closed the connection) |
04:29:01 | * | FromDiscord joined #nim |
04:31:20 | FromDiscord | <Elegant Beef> lol |
04:32:17 | * | nsf joined #nim |
04:32:36 | FromDiscord | <Elegant Beef> Cause it's worthwhile to get buggy software out as 1.0 |
04:33:52 | * | rockcavera quit (Remote host closed the connection) |
04:35:48 | FromDiscord | <Elegant Beef> I searched for nim in a gamedev discord and before me talking about it a lot it was just people trying out nim and not really liking it |
04:44:01 | leorize | definitely not because everyone has been bugging him about it lol |
04:46:37 | FromDiscord | <impbox> Is anyone here doing windows -> linux cross compiling with nim, if so what compiler setup do you use? |
04:47:42 | FromDiscord | <Yardanico> Well if you use W10 I think WSL would be the best choice, although I don't use Windows for quite a long time now |
04:49:20 | FromDiscord | <impbox> @Yardanico that runs a linux VM right? |
04:49:30 | FromDiscord | <impbox> (i'm not really familiar with how WSL works) |
04:49:36 | FromDiscord | <Elegant Beef> 1.0 ran like wine |
04:49:50 | FromDiscord | <Elegant Beef> 2.0 runs more like a VM yes |
04:49:57 | FromDiscord | <Elegant Beef> Atleast that's my understanding |
04:50:13 | FromDiscord | <impbox> mmm I see, trying to avoid using a VM |
04:51:23 | FromDiscord | <impbox> but might be the easiest way |
04:51:33 | FromDiscord | <impbox> or just switch back to linux, cross compiling to windows was easy |
04:51:39 | FromDiscord | <Elegant Beef> -d:mingw 😄 |
04:51:51 | FromDiscord | <Elegant Beef> that's wrong isnt it? |
04:52:02 | FromDiscord | <impbox> i've never tried that, i'm using mingw though |
04:52:04 | FromDiscord | <Elegant Beef> Eh i dont do windows cross compilation since the only application i wanted to usues nimarchive |
04:52:18 | FromDiscord | <Elegant Beef> and i cant compile nimarchive on linux for windows |
04:52:39 | shashlick | Hopefully we can solve that some day |
04:52:49 | FromDiscord | <impbox> i had a linux -> osx cross compile setup, but it was super convoluted to set up |
04:53:29 | shashlick | Mingw is Linux or osx to windows, not the other way |
04:53:40 | FromDiscord | <Elegant Beef> That's what i was referencing |
04:54:15 | shashlick | Ok |
04:55:12 | shashlick | Maybe zig could pull it off, never tried though |
04:55:42 | FromDiscord | <impbox> pull off every zip |
04:55:44 | FromDiscord | <impbox> (edit) 'zip' => 'zig' |
04:57:09 | FromDiscord | <impbox> i should try zig |
04:59:25 | shashlick | Check this out https://win.musl.cc/ |
04:59:42 | shashlick | Took a while to find it again |
04:59:52 | FromDiscord | <impbox> nice |
04:59:53 | FromDiscord | <impbox> thanks |
05:04:24 | FromDiscord | <slymilano> hey gang, i'm using threadpool on a pretty simple project i feel and my memory usage keeps increasing. as far as I can tell I'm closing my httpclient's. https://github.com/sergiotapia/torrentinim/blob/master/src/torrentinim.nim#L18↵↵maybe I'm running the crawlers too fast and the gc isn't running fast enough to let go of the claimed memory? |
05:13:52 | FromDiscord | <Yardanico> The problem might be that you call your crawlers recursively |
05:15:16 | FromDiscord | <Yardanico> Also you don't really need spawn since you can use use threads |
05:16:04 | FromDiscord | <Yardanico> So you might want to create a proc which will spawn threads with all crawlers, wait for their completion, sleep 30 seconds and do that again |
05:16:10 | FromDiscord | <Yardanico> Not sure if that'll solve the issue but it might |
05:20:55 | * | narimiran joined #nim |
05:22:16 | FromDiscord | <slymilano> i thought spawn, spawns threads. do you have a link handy for some light nim thread reading? |
05:23:07 | Yardanico | not really, but here's some code explaining what I meant https://play.nim-lang.org/#ix=2q6T |
05:24:46 | FromDiscord | <slymilano> thanks, i'll read a bit more on what spawn does in depth |
05:24:57 | Yardanico | also you should probably add locks when you're calling insert_torrent |
05:25:24 | Yardanico | ah no nvm |
05:25:30 | Yardanico | you're opening the DB each time, so you won't need that |
05:31:13 | Yardanico | I'll try running torrentinim locally with my changes |
05:42:43 | FromDiscord | <slymilano> thanks i appreciate your help |
05:45:11 | Yardanico | well I'm getting a different error probably related to SSL, anyway try doing this: |
05:46:23 | Yardanico | https://gist.github.com/Yardanico/b0da44ff5eeab56173ed42d69150df84 |
05:50:59 | Yardanico | but really you should probably rewrite your crawlers to be async :P |
05:54:08 | * | letto quit (Quit: Konversation terminated!) |
05:55:46 | * | letto joined #nim |
05:57:07 | * | solitudesf- joined #nim |
06:03:33 | * | opDispatch quit (Quit: Konversation terminated!) |
06:19:40 | * | PMunch joined #nim |
06:33:04 | * | marnix joined #nim |
06:38:30 | * | fredrikhr joined #nim |
06:41:59 | FromGitter | <alehander92> how do you |
06:42:00 | * | zedeus quit (Read error: Connection reset by peer) |
06:42:01 | FromGitter | <alehander92> gen doc ? |
06:42:01 | * | zedeus_ joined #nim |
06:42:09 | Yardanico | , |
06:42:11 | Yardanico | ? |
06:42:12 | FromGitter | <alehander92> i try to use the same flags (except stuff like codegen) |
06:42:15 | FromGitter | <alehander92> but it fails |
06:42:18 | FromGitter | <alehander92> with strange errors |
06:42:21 | Yardanico | what errors? |
06:42:38 | FromGitter | <alehander92> like just very random mismatch and others |
06:42:41 | FromGitter | <alehander92> which dont make sense to me |
06:43:36 | FromGitter | <alehander92> but ok, i mean |
06:43:41 | FromGitter | <alehander92> do i need to nim doc finalfile.nim |
06:43:52 | FromGitter | <alehander92> and does it recursively nim doc my imports |
06:44:37 | FromGitter | <alehander92> the problem is : if i do nim c flags |
06:44:44 | FromGitter | <alehander92> it seems to work, if i do with nim doc i get errors? |
06:45:56 | FromDiscord | <lqdev> if you want it to recursively doc you need to pass --project to nim doc |
06:46:02 | FromDiscord | <lqdev> also what are the errors? |
06:46:45 | * | opal quit (Remote host closed the connection) |
06:47:05 | FromDiscord | <impbox> mmm i got errors with mine too doing nim doc |
06:47:12 | FromDiscord | <impbox> will have to investigate further later |
06:47:18 | FromDiscord | <impbox> with the nico codebase |
06:47:59 | * | opal joined #nim |
06:48:44 | FromGitter | <alehander92> e.g. stuff like attempting to call routine: 'startIPC' ⏎ found 'startIPC' of kind 'unknown' |
06:49:09 | FromGitter | <alehander92> and startIPC is just a normal function async |
06:53:03 | FromGitter | <alehander92> and many other even stdlib errors |
06:53:14 | * | oddp joined #nim |
06:53:34 | FromGitter | <alehander92> but thanks for the index / project option: it works, i just dont get all functions |
07:02:30 | * | sepplesWoona joined #nim |
07:10:02 | * | dzamo[m] quit (*.net *.split) |
07:10:03 | * | codic quit (*.net *.split) |
07:10:03 | * | BitPuffin quit (*.net *.split) |
07:10:03 | * | watzon quit (*.net *.split) |
07:10:04 | * | sepples quit (*.net *.split) |
07:13:24 | PMunch | Man, inim is pretty neat |
07:13:29 | PMunch | Just used it to debug some X11 stuff |
07:14:50 | * | drdee joined #nim |
07:17:04 | * | dzamo[m] joined #nim |
07:17:07 | * | codic joined #nim |
07:18:00 | * | watzon joined #nim |
07:18:16 | * | BitPuffin joined #nim |
07:20:19 | FromGitter | <YusufCakan> Hi, whenever i try to rename a variable in vscode, i find that it doesnt find all the references. Does anyone else have this problem |
07:21:43 | FromDiscord | <impbox> YusufCakan I don't use vscode, but maybe it's because in nim the variable could be spelt differently in different places? |
07:21:53 | FromDiscord | <impbox> is there anything unusual about the ones it doesn't find? |
07:25:14 | Yardanico | @YusufCakan it should work just fine |
07:25:27 | Yardanico | but yeah, it doesn't care for nim's partial case insensitivity I guess |
07:25:36 | Yardanico | ah wait actually it does |
07:25:39 | Yardanico | at least the vscode-nim extension |
07:25:44 | FromGitter | <YusufCakan> It mainly just replaces the names in the current open file and nowhere else in the project |
07:25:49 | Yardanico | oh you mean that |
07:26:11 | FromDiscord | <impbox> maybe use nimgrep |
07:26:13 | FromGitter | <YusufCakan> I want to rename a variable across all files. |
07:26:28 | FromDiscord | <impbox> `nimgrep -! -r foo bar` i think |
07:26:36 | FromDiscord | <impbox> (edit) 'bar`' => 'bar .`' |
07:27:16 | Yardanico | nimgrep --replace --recursive toReplace newName . |
07:27:24 | Yardanico | same as impbox but for explanation with full args :P |
07:27:30 | Yardanico | so yeah, use nimgrep |
07:28:10 | Yardanico | *tfw I really never use nimgrep, but I really should sometimes* |
07:28:23 | FromDiscord | <Yardanico> its a good tool |
07:28:40 | FromDiscord | <Firefell> Somebody has try QtCreator with the Nim plugin ? |
07:28:44 | FromDiscord | <Yardanico> yeah I did |
07:28:47 | FromDiscord | <Yardanico> it works fine |
07:28:54 | FromDiscord | <Firefell> cool |
07:29:06 | FromDiscord | <Firefell> and the debug ? good ? |
07:29:13 | Yardanico | idk, I didn't try |
07:29:15 | FromGitter | <YusufCakan> thanks. what does -! do in the above example |
07:29:33 | Yardanico | @YusufCakan check my nimgrep command |
07:29:39 | Yardanico | it's the same as impbox sent, but with full names |
07:29:41 | Yardanico | -! is --replace |
07:29:44 | Yardanico | -r is --recursive |
07:29:54 | Yardanico | @Firefell it would be the same as in vscode |
07:29:57 | FromGitter | <YusufCakan> ok many thanks |
07:30:04 | FromDiscord | <impbox> confused me for a while because i was using -r for replace |
07:30:07 | Yardanico | i wouldn't expect it to be better since the debug info is still the same |
07:33:56 | FromGitter | <jquiterio> hi guys, ⏎ I’m getting a errors trying to convert from json to a type. ⏎ var req = to(jsonRequest, SomeType) |
07:34:12 | Yardanico | what error? compile-time? runtime? |
07:34:18 | Yardanico | show the code (json and the type definition) |
07:34:25 | FromGitter | <jquiterio> (JsonNode, typeof(nil)) |
07:34:34 | Yardanico | ? |
07:34:47 | FromGitter | <jquiterio> I mean… this is not working now after I upgraded nim to 1.2.2 |
07:35:03 | Yardanico | why do you need typeof(nil) ? |
07:35:25 | FromGitter | <jquiterio> i don’t need it :D |
07:35:55 | Yardanico | well, as I said show the code, because I can't really help without it :D |
07:36:54 | FromDiscord | <Rika> I don't understand why you're converting json into a nil |
07:37:04 | FromGitter | <jquiterio> Error: ambiguous call; both json.==(a: JsonNode, b: JsonNode) [declared in /usr/local/Cellar/nim/1.2.2/nim/lib/pure/json.nim(397, 6)] and rethinkdb.==(a: JsonNode, b: JsonNode) [declared in /Users/me/dev/urlstrap/src/rethinkdb.nim(226, 10)] match for: (JsonNode, typeof(nil)) |
07:37:21 | FromGitter | <jquiterio> this is not my idea |
07:37:38 | FromGitter | <jquiterio> I’m trying to convert json to a nim type |
07:38:15 | FromDiscord | <Yardanico> well, the error is really clear |
07:38:23 | FromDiscord | <Rika> Go to your rethinkdb import and add an except `==` to it |
07:38:34 | FromDiscord | <Yardanico> both of these procs have the same definition |
07:38:38 | FromDiscord | <Yardanico> so the compiler doesn't know which one to call |
07:38:50 | FromDiscord | <Rika> Why do you have another == anyway |
07:39:07 | FromGitter | <jquiterio> ok, ok |
07:39:24 | FromGitter | <jquiterio> I have this on rethink db: template `==`*(a, b: JsonNode): JsonNode = binOp(Command.EQ, a, b) |
07:39:42 | Yardanico | yeah I found it |
07:39:42 | Yardanico | https://github.com/jquiterio/urlstrap/blob/master/src/rethinkdb.nim#L226 |
07:40:12 | FromGitter | <jquiterio> Ya |
07:40:14 | Yardanico | you might want to create a type like "type RethinkDbNode = distinct JsonNode" |
07:40:23 | Yardanico | so that you can define procs/templates for this type instead |
07:40:25 | Yardanico | and they won't conflict |
07:40:42 | Yardanico | but you'll have to explicitly convert from RethinkDbNode to JsonNode and back (but that'll be zero-cost anyway) |
07:41:27 | FromGitter | <jquiterio> this make sense… ⏎ I’m just wondereing now, why it worked before 1.2.2 :( |
07:42:08 | Yardanico | really not sure |
07:42:39 | Yardanico | Also did you try https://github.com/OpenSystemsLab/rethinkdb.nim ? |
07:46:10 | * | zedeus_ quit (Ping timeout: 246 seconds) |
07:48:15 | * | zedeus_ joined #nim |
07:58:21 | * | NimBot joined #nim |
08:01:31 | * | vikfret quit (Quit: Leaving) |
08:16:49 | FromGitter | <jquiterio> hi, sorry for delay |
08:17:09 | FromGitter | <codenoid> hi folks, it's 25-06-2020 how you doing, hope everything getting better |
08:17:41 | FromGitter | <jquiterio> Yes, I tried this rethinkdb version from OpenSystemsLab, but seems complicated to "handle" |
08:22:22 | Araq | the new github UI is worse :-/ |
08:22:42 | FromDiscord | <Rika> i dont know anyone who disagrees with you |
08:22:52 | Prestige | Yep |
08:23:30 | Prestige | Change for the sake of change |
08:25:22 | * | mklooste joined #nim |
08:25:27 | * | letto quit (Quit: Konversation terminated!) |
08:26:09 | * | livcd joined #nim |
08:26:11 | FromDiscord | <Rika> so just like the master name change? |
08:26:12 | FromDiscord | <Rika> xd |
08:26:22 | Yardanico | well master name change is probably only for new repos |
08:26:44 | Prestige | That's even worse |
08:27:14 | * | marnix quit (Ping timeout: 240 seconds) |
08:28:01 | livcd | we need to get rid of american tech |
08:29:08 | FromGitter | <jquiterio> @Yardanico it worked fine by changing just two things according to your recommendations: ⏎ type RethinkdbJson = distinct JsonNode ⏎ template `==`*(a, b: RethinkdbJson): JsonNode = binOp(Command.EQ, a, b) |
08:29:23 | FromGitter | <jquiterio> but… this smells me a "work arround" :D |
08:29:28 | Yardanico | well yeah, but it would be better if you change the whole module to RethinkDbJson |
08:29:31 | FromGitter | <jquiterio> I’ll have to work on this code a bit more |
08:29:31 | Yardanico | and no, not really a workaround |
08:29:50 | Yardanico | if you want to use same JsonNode and still export the procedures on it, you should rename your == procs then |
08:29:57 | Yardanico | or as I suggested, make a distinct type |
08:30:03 | FromGitter | <jquiterio> the whole code will be a permanent change |
08:31:30 | FromGitter | <jquiterio> rename your == procs then is an option as well |
08:32:22 | FromGitter | <jquiterio> creating another type distinting from JsonNode seems more stable and a better idea |
08:37:45 | FromGitter | <alehander92> wow |
08:37:48 | FromGitter | <alehander92> whats the master change |
08:39:22 | Yardanico | it's better to discuss it in offtopic because it's quite a bit political, but - https://www.bbc.com/news/technology-53050955 |
08:42:06 | Araq | first they ban words and then they burn books |
08:43:32 | FromGitter | <alehander92> newspeak stuff |
08:43:54 | Yardanico | also btw, I wonder which colors would be good for gource? right now I have these (ignore the title, it's from when I was doing it on september 2019) - https://i.imgur.com/LHZ3ad4.png |
08:44:10 | Yardanico | there are too much users because I set 0.01s per day for testing |
08:45:34 | * | letto joined #nim |
08:45:47 | FromDiscord | <Shucks> Shouldn't that work to redirect any output to a file? ```discard stdout.reopen("C:\\Foo.txt")↵echo "Test"``` |
08:46:16 | FromDiscord | <Shucks> Fails with `Error: unhandled exception: index -1 not in 0 .. 4 [IndexError]` |
08:46:27 | Yardanico | works on linux |
08:46:45 | Araq | we need to remove io.nim from system |
08:46:55 | Araq | so that we can develop it well |
08:47:33 | Araq | we can do that minor code breakage if we had better support for auto imports |
08:48:20 | FromDiscord | <Shucks> I was pretty sure it worked on 1.2.0 aswell |
08:48:44 | FromDiscord | <gokr> I have battled my way through the ORX wrapper and I aaaaalmost build sample project and then I stumbled on `Error: internal error: getTypeDescAux(tyBuiltInTypeClass)` |
08:49:18 | FromDiscord | <gokr> It's related to a call into ORX that's supposed to take three callback procs as arguments. |
08:49:38 | Yardanico | maybe it's one of these :) |
08:49:39 | Yardanico | https://github.com/nim-lang/Nim/issues?q=is%3Aissue+is%3Aopen+getTypeDescAux |
08:49:55 | Yardanico | but yeah, show the definition for that call |
08:50:13 | FromDiscord | <gokr> Holy moh. 🙂 I only found one of those when I searched for the error earlier. |
08:50:21 | FromDiscord | <gokr> One sec... |
08:51:05 | FromDiscord | <gokr> Let me push so I can point to github |
08:51:34 | Yardanico | guess I shouldn't go fast with this gravatar and make a proper nim program to download all github avatars |
08:51:50 | Araq | so ... I think the C codegen is past its lifetime |
08:52:10 | Araq | who is gonna replace it with something that actually was designed? |
08:52:51 | FromDiscord | <Rika> 😰 |
08:53:04 | FromDiscord | <Rika> time for a rust codegen? |
08:53:12 | Yardanico | Zig* |
08:53:13 | Araq | lol no |
08:53:15 | Yardanico | XD |
08:53:36 | FromDiscord | <gokr> Call is here: <https://github.com/gokr/norx/blob/master/src/norx.nim#L54> (the Init one is the error) |
08:53:41 | Araq | I'm talking about patching Rope to become a real tree |
08:53:57 | FromDiscord | <gokr> You find Init on line 14. |
08:54:22 | FromGitter | <alehander92> why not just using strings |
08:54:23 | FromDiscord | <gokr> The locks thing I just threw in, don't know what I am doing there 😉 |
08:54:45 | Araq | proc Update(pstClockInfo: ptr orxCLOCK_INFO, pContext: ptr object) is a generic |
08:55:10 | Araq | so cast[orxCLOCK_FUNCTION](Update) cannot work |
08:55:15 | FromGitter | <alehander92> and pooling/caching them more efficient; |
08:55:53 | Yardanico | it's not about speed at this point |
08:56:02 | Araq | instead of 'ptr object' use something like 'type Context = object; ptr Context' |
08:56:27 | FromDiscord | <gokr> And here are the ... types for the callbacks <https://github.com/gokr/orx/blob/master/code/include/base/orxModule.nim#L75> |
08:56:50 | Araq | gokr: I replied to you |
08:56:56 | FromDiscord | <gokr> @Araq Ok! Yes, I saw |
08:58:19 | Araq | so ... x86 will finally be replaced by ARM, at least Apple does that |
08:59:24 | vegai | took a sweet time |
08:59:30 | Yardanico | well, nim is ready :P |
08:59:46 | vegai | I remember reading an article about Acorn Archimedes in the 90s |
09:01:25 | FromDiscord | <gokr> Yeah, I got myself a little Beelink GT King, it has an Amlogic ARM SoC in it. It costs $100 and is basically a fully complete computer, normal people don't need much more and in fact, there are similar a bit slower boxes for $50. It kinda ... made it obvious that ARM is taking over. |
09:04:19 | Yardanico | I have an android TV box I installed Arch Linux ARM on, I got it for like $40 and it has an 8-core Amlogic S912 (aarch64, but cores are pretty slow), 3gb DDR3 |
09:04:55 | FromDiscord | <gokr> Similar, yeah. |
09:06:42 | FromDiscord | <Shucks> That works. |
09:06:42 | FromDiscord | <Shucks> sent a code paste, see http://ix.io/2q7t |
09:08:36 | * | Tlongir quit (Quit: Leaving) |
09:09:04 | FromGitter | <alehander92> is arm nicer |
09:09:06 | FromGitter | <alehander92> for something |
09:09:12 | Yardanico | usually much more energy efficient |
09:09:30 | Yardanico | also less legacy :) |
09:10:17 | FromDiscord | <lqdev> but also less powerful (no SIMD) |
09:10:25 | Yardanico | ARM has NEON though |
09:10:37 | FromDiscord | <lqdev> is that some SIMD alternative? |
09:10:37 | Yardanico | which is SIMD |
09:10:39 | Yardanico | yes |
09:10:43 | Yardanico | "Arm Neon technology is an advanced Single Instruction Multiple Data (SIMD) architecture extension for the Arm Cortex-A and Cortex-R series processors." |
09:10:48 | FromDiscord | <lqdev> cool |
09:10:50 | Yardanico | it's available on most modern ARM CPUs nowadays |
09:11:34 | Zevv | It's the ARM equivalent of MMX / SSE |
09:11:38 | FromDiscord | <lqdev> it'd be interesting to see the world move over to ARM but even if Apple does that with their macbooks I doubt the rest of the world will care |
09:11:46 | FromDiscord | <lqdev> ARM has pretty poor software support as of now |
09:11:59 | FromDiscord | <gokr> @Araq It built! Thanks man. Now... of course, it doesn't run yet, but... that's something else. |
09:12:10 | Zevv | Well, 98% of the debian packages runs fine on ARM. |
09:12:18 | Yardanico | exactly |
09:12:33 | FromDiscord | <lqdev> yes, but practically no commercial software does. |
09:12:54 | FromDiscord | <lqdev> unless you use emulation software, of course, which makes the programs run much slower. |
09:12:55 | FromDiscord | <gokr> (I used "pointer" because... that argument was one of those "void *" for "stuff I will send you when I make the callback") |
09:12:55 | Zevv | that's not something I care about. I run literally 0% commercial software. |
09:12:59 | FromDiscord | <Elegant Beef> wel amd64 emulation on arm seems promising with rpi and mac both having solutions |
09:13:26 | FromDiscord | <Elegant Beef> I say rpi since it's the most mainstream arm device with tinkerers |
09:13:45 | FromDiscord | <gokr> "ARM pretty poor software support"... eh... 100% of embedded and 100% of smartphones is ARM. |
09:14:04 | Yardanico | well, not 100% embedded but a lot, yeah :) |
09:14:13 | FromDiscord | <gokr> (sure, not 100, but hey...) |
09:14:38 | FromDiscord | <Elegant Beef> i believe when talking about software people mean serious applications |
09:14:52 | * | Senny quit (Ping timeout: 256 seconds) |
09:14:56 | FromDiscord | <Rika> i just got an rpi 😄 |
09:14:57 | FromDiscord | <gokr> IIRC the newest fastest super computer in Japan is also ARM. Announced the other day. |
09:15:04 | FromDiscord | <Elegant Beef> Adobe suite, 3D modelling programs, video editors, and the like |
09:15:15 | FromDiscord | <Elegant Beef> Yea but that's a super computer |
09:15:37 | FromDiscord | <Elegant Beef> Take a single top of the line amd64 and put it against arm |
09:15:45 | FromDiscord | <Elegant Beef> Hell i dont even know what the top of the line arm is |
09:16:23 | FromDiscord | <gokr> @Elegant Beef Thing is, mobile is eating the world. You sound like IBM talking about Power or Sun talking about Sparq. It's the way of the Dodo to ignore where the MASS production is. |
09:16:33 | Yardanico | @Elegant server-grade models |
09:16:34 | FromDiscord | <Elegant Beef> What |
09:16:35 | FromDiscord | <gokr> Just my 2 c of course. |
09:17:08 | FromDiscord | <Rika> are there any issues with adopting arm? |
09:17:21 | Yardanico | also Amazon is pushing towards ARM with their own ARM-based CPUs too |
09:17:24 | FromDiscord | <lqdev> nobody mentioned games? |
09:17:30 | FromDiscord | <Elegant Beef> Everyone is pushing for arm |
09:17:33 | FromDiscord | <gokr> Chromebooks are ARM too. Both my daughters got those at school. Made by Lenovo. |
09:17:35 | FromDiscord | <Elegant Beef> Google, MS, Apple |
09:17:39 | FromDiscord | <Elegant Beef> Well that's not true |
09:17:41 | Yardanico | which is not bad |
09:17:44 | FromDiscord | <Elegant Beef> Chromebooks are both arm and amd64 |
09:17:56 | FromDiscord | <gokr> Ah, ok. |
09:18:02 | FromDiscord | <Rika> i still dont know the issue with arm being adopted |
09:18:26 | FromDiscord | <gokr> There is no "issue" - just a small off topic discussion on it 😉 |
09:18:30 | FromDiscord | <Elegant Beef> Well my issue isnt with it being adopted, more just it seems it's not nearly as capble atm vs their counterparts |
09:18:39 | FromDiscord | <Elegant Beef> Cause a majority of the chips are low spec |
09:18:58 | FromDiscord | <Rika> but thats not because of arm itself |
09:19:02 | FromDiscord | <Elegant Beef> Yea i know |
09:19:04 | FromDiscord | <Rika> just that higher end chips arent made |
09:19:23 | Yardanico | btw we have #nim-offtopic :P |
09:19:30 | Yardanico | not that we have any discussions here rn |
09:20:19 | FromGitter | <alehander92> zevv commercial software is ok |
09:20:34 | FromGitter | <alehander92> i keep wondering how else would we fund software |
09:20:43 | FromGitter | <alehander92> except for ads/donations |
09:22:58 | FromDiscord | <Rika> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/725642178625273928 |
09:23:27 | FromDiscord | <Yardanico> same name different types? |
09:23:40 | FromDiscord | <Rika> oh yeah fuckin |
09:23:43 | FromDiscord | <Rika> remember why now |
09:23:52 | FromDiscord | <Rika> jester uses re and im using regex |
09:23:53 | FromDiscord | <Rika> aaaa |
09:24:02 | Yardanico | lol |
09:24:03 | FromDiscord | <Rika> thanks |
09:24:07 | Zevv | alehander92_: sure, I'm not saying it is not. But I just don't happen to do the kind of work and have the kind of hobbies that require me to use it. |
09:24:17 | Zevv | I *write* commercial software, so how could I be opposed. |
09:24:44 | Zevv | Oh, I lied, I bought BitWig |
09:25:26 | FromGitter | <alehander92> ah okk |
09:25:29 | FromGitter | <alehander92> yeah makes sense |
09:27:26 | * | arecaceae quit (Remote host closed the connection) |
09:27:55 | * | arecaceae joined #nim |
09:47:16 | * | mklooste is now known as marnix |
10:10:22 | Yardanico | seems like I'm getting gource avatars and names in a better shape |
10:13:12 | FromDiscord | <Shucks> So since noone was able to answer my debug question for libraries on windows (yet) on the forum, I'm redirecting stderr to a file. A simple `assert(1==0)` is raised. That works on binaries but not on a loaded library. Do I need some extra compile flags? |
10:15:09 | FromDiscord | <mratsim> --assertions:on? |
10:18:49 | * | CcxWrk quit (Read error: Connection reset by peer) |
10:18:51 | FromGitter | <thomastay> I'm wondering how I could take a ptr to the middle of a string without creating a copy? For context, here is what I'm trying to do: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ expects_c_ptr is a C FFI function that takes as input a char*. I want this char* to point to somewhere in the middle of the original string. However, as I'm aware, slicing a string creates a new copy. Any way I can get around that? |
10:18:51 | FromGitter | ... [https://gitter.im/nim-lang/Nim?at=5ef47a0bc4bdd8347504dfe9] |
10:19:13 | * | CcxWrk joined #nim |
10:19:51 | Yardanico | addr mystr[5] |
10:20:03 | Yardanico | will give you an address of the 5th element and you can pass it to C FFI |
10:20:41 | FromGitter | <thomastay> great, thought something like that might be possible but was not sure. Cheers |
10:24:08 | Yardanico | with avatars its already much nicer https://i.imgur.com/tHCLM4z.png |
10:24:26 | Yardanico | (dont worry for too much text, I'm just testing at 0.01s per day) |
10:32:37 | Yardanico | every time I watch it it's cool https://i.imgur.com/4V7pgr5.png :P |
10:47:10 | * | abm joined #nim |
10:51:24 | Yardanico | damn with the current speed at the end of the whole run 4raq and timo still have some work to do (so even when gource stopped at today's date, they are still doing actions in their queue :P) |
10:51:35 | Yardanico | gonna make users faster |
11:02:07 | * | xet7 quit (Ping timeout: 260 seconds) |
11:19:57 | * | D_ quit (Ping timeout: 260 seconds) |
11:22:10 | FromDiscord | <KrispPurg> Is there a way to make oldFoo have the foobaz field have the value of "moment"?↵https://play.nim-lang.org/#ix=2q7V↵I want it to be a ref object. |
11:22:23 | * | lritter joined #nim |
11:23:07 | * | D_ joined #nim |
11:33:51 | * | Vladar joined #nim |
11:36:59 | Araq | hmm the proc is called "elifIsEasy" and yet my compiler cannot handle it |
11:40:25 | FromDiscord | <Yardanico> @KrispPurg deepCopy is one way |
11:40:39 | FromDiscord | <Yardanico> (I mean one of the ways) |
11:40:41 | FromDiscord | <Yardanico> ```↵let oldFoo = deepCopy(bar["foobar"])↵``` |
11:40:55 | FromDiscord | <KrispPurg> I just found a solution lol |
11:41:01 | narimiran | @KrispPurg just as a warning, don't use `add` with tables. you'll shoot yourself in foot, sooner or later |
11:41:09 | FromDiscord | <KrispPurg> it was deepCopy |
11:41:18 | FromDiscord | <KrispPurg> wdym? narim |
11:42:45 | Araq | don't use deepCopy |
11:42:52 | Araq | arc doesn't have it :P |
11:42:53 | narimiran | tell me what does this print WITHOUT running the code: https://play.nim-lang.org/#ix=2q7X |
11:43:59 | FromDiscord | <KrispPurg> Araq, what are the alternatives of deepCopy then? |
11:44:48 | Araq | use more "object" and fewer "ref object" |
11:45:58 | FromDiscord | <KrispPurg> I mean in my library I use ref object when to assign fields like for example guild names |
11:46:33 | narimiran | @KrispPurg surprised by the actual printed stuff or not? |
11:46:48 | Yardanico | XDD |
11:46:52 | narimiran | compare it to: https://play.nim-lang.org/#ix=2q82 |
11:46:53 | FromDiscord | <Vindaar> @KrispPurg well, there's https://github.com/nim-lang/Nim/issues/13997 for a reason I guess |
11:46:54 | disbot | ➥ ARC: deepCopy in new runtime feature missing, do we have alternatives? |
11:46:58 | FromDiscord | <KrispPurg> oh I see |
11:47:06 | FromDiscord | <KrispPurg> I'm aware of that narim |
11:50:58 | Araq | narimiran: so deprecate 'add' finally |
11:51:19 | Araq | IMO it's totally intuitive, that's why it exists |
11:51:28 | Araq | but I noticed nobody agrees with me :P |
11:51:32 | narimiran | i would, but there's that one guy, Araq or something, who doesn't want to get rid of it ;) |
11:52:38 | PMunch | I mean it makes sense if you know about it |
11:52:42 | PMunch | It's just a gotcha |
11:52:50 | Yardanico | Araq: is it too early to share code samples which don't compile with https://github.com/nim-lang/Nim/pull/14790 or not yet? :D |
11:52:50 | disbot | ➥ scoped memory management |
11:52:57 | narimiran | yeah, IFF :) |
11:53:15 | narimiran | (to throw in another famous complaint :)) |
11:54:37 | * | drdee quit (Ping timeout: 260 seconds) |
11:56:24 | * | tane joined #nim |
11:56:40 | FromDiscord | <Shucks> Is there a way to redirect tracebacks to a file? Just like stderr.reopen and stdout.reopen |
11:57:04 | Araq | >2& |
11:57:47 | Araq | in fact, I can never remember the shell syntax |
11:58:34 | Araq | it's one of the rare cases where I always get it wrong, no matter how often I use it. of course the real solution is to never use stderr for anything, ever. |
11:59:41 | FromDiscord | <lqdev> uh, isn't it just `./program 2> file`? |
12:00:29 | PMunch | That's not a solution, that's running away from a problem.. |
12:01:40 | supakeen | Araq: 2>&1 '2 to reference 1' or something is how I remember to redirect stderr to stdout. |
12:02:46 | Araq | PMunch: running away can be a solution |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.8) |
12:06:39 | * | supakeen joined #nim |
12:16:19 | FromGitter | <alehander92> yeah its very hard to remember the 2& |
12:16:31 | FromGitter | <alehander92> but stderr is a good idea in principle |
12:19:43 | FromDiscord | <Shucks> So its frustrating. Im finally able to log exceptions from my library but not tracebacks. Funny thing is that this works for binaries. https://play.nim-lang.org/#ix=2q8m |
12:24:34 | FromDiscord | <Shucks> I mean there is actually no way to debug your nim library in any form. Atleast on windows. |
12:25:03 | FromDiscord | <Yardanico> Why you can't log tracebacks? |
12:25:20 | FromDiscord | <Shucks> The log file is just empty. Raised exceptions get logged |
12:25:50 | FromDiscord | <Yardanico> Well you should probably have a top try except in your lib |
12:25:52 | * | vsantana joined #nim |
12:25:54 | FromDiscord | <Yardanico> To catch everything |
12:26:00 | Araq | alehander92: I think "in principle" the idea is ad-hoc and bad |
12:26:25 | Araq | why not 2 standard input streams too then? one for programs, one for humans |
12:26:49 | Araq | why not 3 output streams for when you need to produce warnings in addition to errors? |
12:27:00 | Araq | it's stupid |
12:27:02 | FromGitter | <alehander92> yeah well |
12:27:05 | FromGitter | <alehander92> its kinda minimal |
12:27:11 | FromGitter | <alehander92> but it probably made sense in the past |
12:27:19 | FromGitter | <alehander92> like, one visible to end user and one not |
12:27:27 | FromGitter | <alehander92> by default |
12:27:42 | FromGitter | <alehander92> i mean, its too easy to over-generalize an abstraction |
12:32:38 | FromDiscord | <Shucks> @Yardanico Still. The tool which loads that library just crashes. The traceback doesn't gets catched https://play.nim-lang.org/#ix=2q8s |
12:34:08 | Araq | Shucks: attaching GDB to a DLL can work |
12:35:07 | Araq | alehander92: the minimal solution is input/output though and it works much better as it doesn't force you to review every 'echo' call for "oh, should this have been stderr instead?" |
12:36:30 | FromDiscord | <Shucks> Well I'm not sure how. I've tried to attach to the process which loads the dll. Already asked it here: https://forum.nim-lang.org/t/6466 |
12:36:30 | Araq | stdout/stderr is neither minimal nor a nice generalization, it's just more cruft you have to deal with every day. but it's software, cannot change software. you can only move entire ecosystems over to ARM |
12:37:21 | FromDiscord | <Yardanico> @Shucks well there can be something weird going on if you inject the DLL or something |
12:38:26 | FromDiscord | <Shucks> At the moment I'm using a c++ program which has 3 lines. ``` std::cout << "Tool Running!\n";↵ LoadLibrary(L"mydll.dll");↵ while (true) {};``` |
12:39:44 | * | tinga joined #nim |
12:42:09 | FromDiscord | <Rika> is there a reason asynchttpclient doesnt use timeout |
12:46:52 | * | zedeus_ quit (Ping timeout: 256 seconds) |
12:47:14 | * | rockcavera joined #nim |
12:47:36 | * | filcuc joined #nim |
12:48:49 | * | zedeus_ joined #nim |
12:55:50 | leorize[m] | @Rika asyncdispatch.withTimeout is your friend |
12:55:52 | * | nikita` joined #nim |
12:56:36 | leorize[m] | though the real reason is that we don't have proper cancellation support |
12:56:56 | * | zedeus_ is now known as zedeus |
12:57:09 | FromDiscord | <Rika> nice |
12:57:45 | FromDiscord | <Rika> is there any issues to using withTimeout? because of that next message you sent im kinda scared now |
12:58:55 | leorize[m] | if you really want to cancel on timeout, you have to close the httpclient once the timeout happened and open a new one |
12:59:42 | leorize[m] | you can kinda see why that can be an issue |
13:10:23 | leorize[m] | @Shucks isn't -s the flag to... strip the resulting binary? |
13:10:41 | leorize[m] | wouldn't that just remove the debug info? |
13:11:32 | leorize[m] | also you can perfectly write DllMain in Nim :p |
13:28:50 | PMunch | What would a good operator to convert a hex string to a colour be? |
13:28:54 | PMunch | I obviously can't use # |
13:30:34 | FromDiscord | <mratsim> `<^>` |
13:30:39 | leorize[m] | you can just use hex numbers :p |
13:30:43 | FromDiscord | <mratsim> (why? no idea) |
13:30:48 | leorize[m] | .color |
13:31:18 | FromDiscord | <mratsim> asRGB |
13:31:45 | PMunch | leorize[m], good point.. |
13:31:56 | PMunch | But I need them to at least be a distinct type |
13:32:02 | PMunch | .color would work I guess.. |
13:32:05 | leorize[m] | .Color |
13:32:13 | leorize[m] | yep |
13:32:17 | PMunch | But it would be a bit annoying in a config where most of them are colours.. |
13:32:38 | FromDiscord | <impbox> hmm is it possible to update github's nim syntax highlighting? https://github.com/ftsf/nico/blob/master/examples/webrtc/src/main.nim seems to fail on `1.0'f` float32 constants |
13:32:40 | FromDiscord | <mratsim> don't put operators in config file |
13:32:47 | PMunch | I guess I could have an auto-converter from int to Colour |
13:32:49 | leorize[m] | you can make a small `c` template to convert it |
13:32:50 | FromDiscord | <mratsim> people will get confused |
13:33:01 | PMunch | @mratsim, why? |
13:33:16 | FromDiscord | <mratsim> alos they won't be able to search "what does <^> means in PMunch config files" |
13:33:37 | PMunch | I'm making a general purpose configuration DSL thingy |
13:33:46 | PMunch | And I want it to look as clean as possible |
13:33:51 | leorize[m] | @impbox yes, it's in github/linguist |
13:33:56 | FromDiscord | <mratsim> c(0x123456) |
13:34:00 | leorize[m] | the current syntax file is from nimlime |
13:34:15 | FromDiscord | <impbox> http://impbox.net/niconet/ test of nico webrtc/peerjs networking if anyone wants to test |
13:34:54 | FromDiscord | <lqdev> PMunch: `hex"FF00FF"` |
13:35:01 | FromDiscord | <lqdev> or `hex"#FF00FF"` |
13:35:03 | FromDiscord | <lqdev> is what I use |
13:35:11 | * | zedeus quit (Ping timeout: 260 seconds) |
13:35:22 | FromDiscord | <impbox> 8565 |
13:37:03 | * | zedeus joined #nim |
13:38:27 | PMunch | @lqdev, oh that's nice |
13:38:34 | FromDiscord | <impbox> leorize thanks, i'll file an issue |
13:39:02 | PMunch | I guess rgb"FF00FF" would work as well, that way I could allow people to define colours as other things as well |
13:39:34 | FromDiscord | <lqdev> I just do separate `rgb(uint8, uint8, uint8)` and `hex"RRGGBB"` |
13:39:58 | PMunch | But what if you want to do hex"HHSSLL"? |
13:40:16 | PMunch | Having rgb with uint8 and str overloads seems cleaner |
13:40:26 | PMunch | Or at least more flexible |
13:40:31 | FromDiscord | <lqdev> `hsl(float, float, float)` |
13:40:43 | FromDiscord | <lqdev> I've never seen HSL in hex form |
13:43:17 | PMunch | Because people like you don't think to implement it :) |
13:43:55 | FromDiscord | <lqdev> doesn't seem very useful though |
13:43:57 | leorize[m] | hex form of color is restricted to rgb most of the time, probably to avoid confusion |
13:44:07 | * | rockcavera quit (Remote host closed the connection) |
13:44:13 | leorize[m] | and it's not like you can't convert rgb to hsl... |
13:45:50 | * | endragor quit (Remote host closed the connection) |
13:46:50 | * | endragor joined #nim |
13:47:56 | * | waleee-cl joined #nim |
13:48:15 | PMunch | I'm having way too much fun just passing images of colour spectrums through my script :P |
13:48:57 | zedeus | share the results! |
13:49:16 | PMunch | Just run it yourself :P |
13:49:28 | PMunch | Since I included the data file the plotpng script is really fast |
13:51:16 | PMunch | https://uploads.peterme.net/disk.png |
13:51:29 | PMunch | https://uploads.peterme.net/cube.png |
13:52:46 | FromDiscord | <Rika> nice visualizations |
13:53:19 | * | endragor quit (Ping timeout: 246 seconds) |
13:53:51 | PMunch | https://uploads.peterme.net/all16million.png |
13:54:04 | PMunch | Based on this image: https://en.wikipedia.org/wiki/Color_depth#/media/File:16777216colors.png |
13:54:58 | Zevv | that's a pretty smart but totally useless representation of color space :) |
13:55:08 | PMunch | Haha |
13:55:10 | FromDiscord | <Rika> thats a beautiful looking image from afar |
13:55:38 | * | drdee joined #nim |
13:55:53 | zedeus | neat |
13:56:14 | FromDiscord | <lqdev> PMunch: give me the raw data, I'll load it into my aglet volume cloud |
13:56:50 | FromDiscord | <lqdev> preferably in a texture with each Z layer stacked vertically |
13:56:50 | PMunch | https://github.com/PMunch/colourfinder |
13:57:14 | PMunch | All the valid colours are in goodcolours.png |
13:57:26 | FromDiscord | <lqdev> that's a thicc file damn |
13:57:34 | FromDiscord | <lqdev> those are hexcodes? |
13:57:37 | PMunch | Haha, what did you expect :P |
13:57:38 | PMunch | Yup |
13:57:55 | * | dddddd joined #nim |
13:58:25 | PMunch | Those are all the colours out of the 16 million 24-bit RGB codes that are far enough from every language in Linguist to be used for other languages |
13:59:09 | FromDiscord | <lqdev> generating this texture will take a while I guess |
13:59:14 | PMunch | My favourite representation is still my original one |
13:59:31 | PMunch | So cool to see visually the different languages |
14:00:31 | PMunch | Oooh, what would be cool is to create one transparent PNG per language, which blacks out the colours taken by that language |
14:01:50 | FromDiscord | <lqdev> https://media.discordapp.net/attachments/371759389889003532/725712359745650728/unknown.png |
14:01:58 | FromDiscord | <lqdev> I like how firefox has a stroke downloading this file |
14:02:12 | PMunch | Haha :P |
14:03:37 | * | endragor joined #nim |
14:08:38 | * | endragor quit (Ping timeout: 260 seconds) |
14:12:33 | FromDiscord | <lqdev> my big brain decided that it'd be a *brilliant* idea to import and process the entire file at compile time… |
14:18:26 | FromDiscord | <mratsim> compile-time gone wrong |
14:21:26 | FromGitter | <ynfle> Can someone help me with this code? https://play.nim-lang.org/#ix=2q94 I am getting weird behaviour when I cast `int` to `set[<enum type>]` and there are more bit in the `int` the elements of the enum type |
14:22:40 | FromGitter | <ynfle> https://play.nim-lang.org/#ix=2q97 Here is with the output inlined |
14:23:18 | leorize | what are you trying to do? |
14:23:28 | FromDiscord | <Rika> whats the intended output |
14:24:03 | leorize | also casts to set[T] are pretty much undefined |
14:24:15 | FromGitter | <ynfle> When the int has more bits, then the set wraps around and includes the first element when converted to a seq |
14:25:11 | leorize | there's nothing much that can be done tbh |
14:26:18 | FromGitter | <ynfle> Wdym? |
14:26:43 | leorize | cast[set[T]]() are undefined |
14:26:51 | leorize | you're in danger zone there :P |
14:27:00 | FromGitter | <ynfle> Ok |
14:27:07 | leorize | there's exactly one case where it's defined actually |
14:27:29 | leorize | ~bitfield |
14:27:29 | disbot | no footnotes for `bitfield`. 🙁 |
14:27:39 | leorize | https://nim-lang.org/docs/manual.html#set-type-bit-fields |
14:28:08 | FromDiscord | <mratsim> If you interface with Pascal, I thin Nim sets have the same format as Pascal sets |
14:29:07 | FromGitter | <ynfle> @leorize, I am doing exactly that |
14:29:15 | leorize | I think we should make our bitsets a bit deterministic so we can safely interfacing with them via C |
14:29:42 | FromGitter | <ynfle> I'm casting an int so a set of enum typs |
14:29:43 | FromDiscord | <mratsim> but C doesn't have bitsets? or you mean C flags? |
14:30:12 | leorize | yep, anything really |
14:30:34 | leorize | just so it's easier to just write the Nim version of an interface instead of having to "translate" it to C :P |
14:30:42 | FromDiscord | <mratsim> we just need a "Flag" module: https://github.com/numforge/laser/blob/master/laser/photon_jit/photon_osalloc.nim#L50-L61 |
14:31:01 | FromDiscord | <mratsim> feel free to add this 20 lines module to fusion and open the door to leftpad 😉 |
14:31:39 | FromGitter | <ynfle> @leorize, I'm using a bit set |
14:31:58 | FromGitter | <ynfle> Do I have explicitly decalre the size for this to work? |
14:32:14 | leorize | I need to see your code, actually |
14:32:28 | leorize | though I wouldn't count on this working really well for C interfacing |
14:32:28 | FromGitter | <ynfle> https://play.nim-lang.org/#ix=2q97 |
14:32:37 | leorize | something like @mratsim module will work better |
14:32:41 | FromGitter | <ynfle> I'm not interfacing with C |
14:32:49 | FromDiscord | <mratsim> what you are doing is not a C bitfield |
14:32:58 | leorize | then why do you want to cast? |
14:33:08 | leorize | storage? |
14:34:05 | FromGitter | <ynfle> I'm doing a coding exercise, but the idea is to encode enum options in binary and be able to convert back and forth |
14:34:47 | FromGitter | <ynfle> I'm accepting an int as input |
14:34:56 | * | PMunch quit (Quit: Leaving) |
14:37:12 | leorize | I don't think you can reliably do it like this |
14:37:24 | leorize | the set format is pretty sensitive to any changes in bits |
14:37:27 | disruptek | type MyOpt {.size: sizeof(cint).} = enum ... cast[cint](set[MyOpt]) |
14:37:37 | disruptek | rtfm |
14:38:06 | leorize | if you have more bits than the set it's still gonna cause issues |
14:38:22 | leorize | this is just how those things work, really |
14:38:28 | FromGitter | <ynfle> The set isn't affected |
14:39:04 | leorize | it just doesn't appear to |
14:39:05 | FromGitter | <ynfle> It's just like that when I convert to seq |
14:39:11 | FromGitter | <ynfle> Aha |
14:39:54 | leorize | the iterator that run through the set got caught by those extra bits |
14:40:10 | FromGitter | <ynfle> Ok |
14:40:27 | leorize | and I'm not even sure how this would affect normal set operations |
14:41:14 | leorize | btw welcome back disruptek, someone was looking for you yesterday |
14:43:03 | * | krux02 joined #nim |
14:43:09 | FromDiscord | <Clyybber> o/ disruptek |
14:43:35 | FromDiscord | <Clyybber> are we talkimg about set or seq now? |
14:43:51 | * | pietroppeter quit (Quit: Connection closed for inactivity) |
14:44:23 | FromDiscord | <Clyybber> because bitsets *are* used for interfacing with C. Its stable and we would notice really hard if it were broken |
14:45:17 | * | leorize quit (Quit: WeeChat 2.8) |
14:45:23 | * | endragor joined #nim |
14:46:26 | FromDiscord | <Shucks> in nim ther doesn't exists something like the arrow operator to access pointer objects huh? Its just `.` for nim right? https://www.tutorialspoint.com/cplusplus/cpp_member_operators.htm |
14:46:35 | FromDiscord | <Shucks> (edit) 'ther' => 'there' |
14:47:00 | FromGitter | <matrixbot> `konez2k` hey, is there any way in nim to benchmark a function by returning ops/s? |
14:47:15 | FromDiscord | <exelotl> @Shucks indeed, in nim there's only `.` |
14:49:39 | FromDiscord | <Clyybber> konez2k, I think I saw something like that in @mratsim s repos |
14:49:51 | FromDiscord | <Clyybber> or maybe it was zevv |
14:57:22 | FromGitter | <ynfle> @Clyybber set and seq |
14:58:22 | * | D_ quit (Ping timeout: 260 seconds) |
14:59:34 | FromDiscord | <Clyybber> oh, looking at your code, yeah, you are getting some overlap |
14:59:42 | FromDiscord | <Clyybber> but the code doesn't make sense :D |
14:59:46 | FromGitter | <ynfle> If there are more bits in the `int` that is cast to `set[<enum type>]`, then when converting to a `seq` it wraps the enum |
14:59:51 | FromGitter | <ynfle> Why? |
15:00:32 | * | D_ joined #nim |
15:02:07 | FromDiscord | <Clyybber> I think its because the cast doesn't do much |
15:02:22 | FromDiscord | <Clyybber> because the set has a size thats multiple of 8s probably |
15:02:39 | FromDiscord | <Clyybber> so the set retains at least some of those bits |
15:02:45 | FromGitter | <ynfle> > but the code doesn't make sense :D ⏎ why? |
15:02:51 | FromDiscord | <Clyybber> and the items iterator for a set can access them |
15:03:17 | FromGitter | <ynfle> > but the code doesn't make sense :D ⏎ ⏎ why? |
15:03:52 | FromDiscord | <Clyybber> because you add integers, and then cast them to a set :P |
15:04:05 | FromDiscord | <Clyybber> and they have no correlation to the set enum |
15:04:34 | * | endragor quit (Ping timeout: 240 seconds) |
15:08:45 | * | endragor joined #nim |
15:10:35 | FromDiscord | <Clyybber> hmm, there is something weird going on though, because I can't reproduce it in a manual items(someSet) |
15:11:51 | FromDiscord | <Clyybber> @ynfile I'm curious though, why are you encountering this issue? |
15:12:16 | FromDiscord | <Clyybber> There must be something wrong with the data you are deserializing if you get this kind of behaviour |
15:13:57 | FromGitter | <ynfle> Wdym? |
15:14:05 | FromGitter | <ynfle> https://play.nim-lang.org/#ix=2q97 |
15:14:08 | * | endragor quit (Ping timeout: 256 seconds) |
15:14:11 | FromGitter | <ynfle> This is everything |
15:16:22 | FromDiscord | <Clyybber> I mean that converting that integer (15+16+32) to a set[Code] is wrong |
15:18:43 | FromGitter | <ynfle> Why? |
15:19:34 | FromDiscord | <l1pz> When I use the proc moveDir, i get access is denied exceptions and i can't figure out why... |
15:19:36 | FromDiscord | <l1pz> I can easily move the files manually. I am on Windows. Any ideas why? |
15:20:55 | FromDiscord | <Clyybber> @ynfle: Ah found the issue! toSeq creates a new seq with len x.len |
15:21:10 | FromDiscord | <Clyybber> And that initializes the last element to a |
15:21:17 | FromDiscord | <Clyybber> So thats the whole magic cause |
15:21:51 | FromDiscord | <Clyybber> @ynfle: If you go over it manually like so `for code in x: echo code` you'll get what you expect to |
15:23:48 | FromDiscord | <Clyybber> so its x.len thats 6 because of the trailing bits |
15:24:03 | * | opal quit (Ping timeout: 240 seconds) |
15:25:49 | leorize[m] | this just shows how `set[T]` can't just be converted between ordinal types safely |
15:25:56 | leorize[m] | (well it's gated behind `cast` for a reason after all) |
15:26:55 | * | opal joined #nim |
15:26:57 | leorize[m] | to "safely" convert, use a set that has all elements set as a mask |
15:27:11 | FromDiscord | <Clyybber> Yep, thats the best solution |
15:27:24 | leorize[m] | apply the mask on an `int` value and it should trim off any excess bits |
15:27:25 | FromDiscord | <Clyybber> @l1pz Hmm, thats weird |
15:27:29 | FromDiscord | <Clyybber> No idea sorry |
15:27:33 | FromDiscord | <l1pz> Also copyDir seems to copy the contents of a directory. Is that the expected behaviour? |
15:27:36 | FromDiscord | <l1pz> (edit) 'behaviour?' => 'behavior?' |
15:27:57 | FromDiscord | <l1pz> Copying works, it's just moving that doesn't |
15:28:52 | * | endragor joined #nim |
15:30:23 | FromDiscord | <Clyybber> Ah, you probably don't have permissions for the source dir |
15:30:31 | FromDiscord | <Clyybber> or the source dir is on a different drive? |
15:31:08 | FromDiscord | <l1pz> No. They are all on the same drive. They both the source and the destination is a subdirectory inside my project. |
15:31:12 | FromDiscord | <l1pz> Next to the source files |
15:31:18 | FromDiscord | <Clyybber> does a mv work? |
15:31:35 | FromDiscord | <l1pz> My structure is something like this. out -> folder1 -> folder2 -> file.txt |
15:31:51 | FromDiscord | <l1pz> I'd like to move the folder2 to out and delete folder1 |
15:32:50 | FromDiscord | <l1pz> copyDir("out/folder1", "out") does what I want, but I think it shouldn't. |
15:33:24 | FromDiscord | <l1pz> It should be copyDir("out/folder1/folder2", "out"), but then it moves file.txt to out, not the folder itself |
15:34:50 | FromDiscord | <l1pz> And when I change copyDir to moveDir I get Exception: Access is denied |
15:35:15 | FromDiscord | <l1pz> I think I check the source so I can see what's up |
15:35:40 | leorize[m] | @ynfle https://play.nim-lang.org/#ix=2q9u |
15:35:54 | FromDiscord | <Clyybber> moveFileExA is failing, so its windows related, not sure whats going on there |
15:37:20 | FromDiscord | <Clyybber> can you try running it as admin? |
15:37:55 | * | endragor quit (Ping timeout: 260 seconds) |
15:38:02 | leorize[m] | unicode in file name I guess? |
15:38:54 | FromDiscord | <Clyybber> oh, right, @l1pz can you try compiling with -d:winUseUnicode? |
15:39:06 | FromDiscord | <Clyybber> (edit) '-d:winUseUnicode?' => '-d:useWinUnicode?' |
15:39:09 | FromDiscord | <l1pz> I'll check |
15:39:50 | FromGitter | <ynfle> @leorize[m] thx! |
15:40:01 | FromDiscord | <l1pz> I still fails. |
15:40:15 | FromDiscord | <Clyybber> Are you sure? I changed the message because I made a typo |
15:41:15 | FromDiscord | <l1pz> Yeah. |
15:41:34 | FromDiscord | <l1pz> Additional info: "(\"D:\\\\Projects\\\\Nim\\\\mudl\\\\out\\\\gmtyyzsswkge\", \"D:\\\\Projects\\\\Nim\\\\mudl\\\\out\")" [OSError] |
15:41:39 | leorize[m] | useWinUnicode is defined by default |
15:41:46 | FromDiscord | <l1pz> There are the directories |
15:42:15 | FromDiscord | <Clyybber> leorize: Oh |
15:42:17 | FromGitter | <ynfle> @Clyybber makes sense |
15:43:59 | FromGitter | <ynfle> It initializes it to `Code(low(code))` |
15:44:15 | FromDiscord | <Clyybber> yep |
15:44:26 | FromDiscord | <Clyybber> and since len is just a bitCount it also counts the erraneous bits |
15:45:05 | Zevv | zone2k: yeah I kind of hacked together a rudimentary VM profiler |
15:45:39 | Zevv | you just get the top #N inclusive compile time procs, so nothing like ops/s |
15:53:35 | * | endragor joined #nim |
15:55:48 | FromGitter | <ynfle> @Clyybber Should `.len` be different for set? For this situation? |
15:56:01 | FromDiscord | <Clyybber> I don't think so |
15:56:13 | FromDiscord | <l1pz> I got the folder moving working. |
15:56:21 | FromGitter | <ynfle> Why? |
15:56:25 | FromDiscord | <Clyybber> ynfile Its correct as long as your set is correct |
15:57:10 | FromDiscord | <l1pz> It was trying to overwrite files, because I didn't add a folder name to the destination. |
15:57:18 | FromDiscord | <Clyybber> ah! |
15:57:26 | FromDiscord | <l1pz> Just a folder, where I wanted the src directory to placed into. |
16:00:04 | leorize[m] | @ynfle reminder that set[T] is a high speed bitset and we can't really afford any inefficiencies, such as doing type reflection to ensure that sets can only have a max amount of values |
16:00:18 | leorize[m] | also that `cast` is unsafe by definition |
16:01:26 | * | endragor quit (Ping timeout: 265 seconds) |
16:02:55 | FromGitter | <ynfle> Ok |
16:03:52 | * | endragor joined #nim |
16:06:46 | * | vsantana quit (Quit: leaving) |
16:08:34 | * | endragor quit (Ping timeout: 240 seconds) |
16:15:57 | FromDiscord | <Shucks> I might be wrong but I think im running into gc issues. Im reading with a library the internal process data. Thats what im using: ```proc read*[T](address: ByteAddress, t: typedesc[T]): T =↵ result = cast[ptr t](address)[]``` |
16:16:15 | FromDiscord | <Shucks> I know its fancy stuff. But how unsafe is that? And if yes what could work better? |
16:17:11 | FromDiscord | <mratsim> it's perfect |
16:17:12 | leorize[m] | unless I have all the typedefs, I can't say for sure |
16:17:34 | * | marnix quit (Ping timeout: 240 seconds) |
16:18:11 | FromDiscord | <Shucks> Weird. https://prnt.sc/t6einx↵https://prnt.sc/t6eiu3 |
16:18:34 | FromDiscord | <Shucks> And shouldn't segfaults be able to catch with `import segfaults`? |
16:19:04 | FromDiscord | <Rika> not a great idea to catch segfaults |
16:19:19 | leorize[m] | never a great idea |
16:19:54 | leorize[m] | I think the only thing segfaults give you is the ability to see the stacktrace (in release mode) |
16:20:08 | * | Vladar quit (Quit: Leaving) |
16:20:33 | FromDiscord | <Shucks> Im not able to catch it anyways, thats why im asking |
16:20:55 | * | filcuc quit (Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/) |
16:21:17 | FromDiscord | <mratsim> ah, the nice bugs in rawAlloc |
16:21:32 | FromDiscord | <Clyybber> @Shucks How do try to catch it? |
16:21:54 | FromDiscord | <mratsim> In my case it often happens when I have a buffer overflow and I overwrite the refcount of the object |
16:22:23 | FromDiscord | <Clyybber> @mratsim What bugs does rawAlloc have? |
16:22:44 | FromDiscord | <mratsim> it's easy to oerwrite the refcount in case of a stack/buffer overflow |
16:22:48 | FromDiscord | <mratsim> not sure if a bug :p |
16:23:22 | FromDiscord | <mratsim> it did have bugs also in the past but AFAIK I didn't had new ones since the past 4 months or so |
16:23:39 | FromDiscord | <Shucks> just a simple try except with imported segfaults. The library still causes a crash. Also tried to change the gc with no success yet |
16:24:20 | FromDiscord | <Rika> no success getting it to work with another gc or no success changing the gc? |
16:24:38 | FromDiscord | <Shucks> getting it to work with another gc |
16:25:49 | FromDiscord | <Clyybber> @mratsim Are those older bugs reported/fixed? |
16:25:59 | FromDiscord | <mratsim> yes |
16:26:21 | FromDiscord | <Clyybber> all fixed? |
16:26:37 | FromDiscord | <mratsim> https://github.com/nim-lang/Nim/issues?q=is%3Aissue+is%3Aopen+rawAlloc |
16:27:30 | FromDiscord | <mratsim> the one I was referring to was: https://github.com/nim-lang/Nim/issues/13598 |
16:27:32 | disbot | ➥ GC refcounting bug ; snippet at 12https://play.nim-lang.org/#ix=2q9T |
16:28:24 | FromDiscord | <mratsim> in particular a cast hidden in a proc that threw off refcounting |
16:28:39 | FromDiscord | <Clyybber> ah I see |
16:30:46 | FromDiscord | <Shucks> --gc:none works lol |
16:31:09 | FromDiscord | <Rika> memory go 📈 |
16:31:19 | FromDiscord | <Shucks> Yay ;p |
16:31:20 | FromDiscord | <Rika> stonks 📈 |
16:32:11 | FromDiscord | <Shucks> just gonna try every gc now.. >.< |
16:32:30 | FromDiscord | <mratsim> Boehm and mark-and-sweep are likely to work |
16:32:57 | FromDiscord | <mratsim> but I think you have a bug somewhere just like I had with my cast |
16:33:32 | FromDiscord | <Shucks> Well the standard one just randomly failed on any string definition with rawAlloc |
16:34:00 | FromDiscord | <mratsim> the bug I had makes it that the stacktrace showed the next allocation, not where the bug happens |
16:34:45 | FromDiscord | <mratsim> i.e. memory corruption bugs might show already corrupted stacktrace, not where the actual corruption happened |
16:37:43 | * | rockcavera joined #nim |
16:47:41 | FromDiscord | <willyboar> https://www.infoq.com/news/2020/06/facebook-ai-transpiler/ |
16:49:20 | FromDiscord | <Clyybber> I hope they don't actually use it |
16:49:35 | FromDiscord | <Clyybber> otherwise a new era of buggy software will be upon us |
17:02:06 | * | bung_ quit (Quit: Lost terminal) |
17:03:00 | FromDiscord | <mratsim> Facebook won't use it, but I bet web shop will transform JS code to C 😛 |
17:12:22 | * | endragor joined #nim |
17:14:13 | Zevv | Shucks: do you have something small that reproduces? |
17:16:58 | * | Senny joined #nim |
17:17:06 | * | endragor quit (Ping timeout: 256 seconds) |
17:19:52 | * | fredrikhr quit (Read error: Connection reset by peer) |
17:20:22 | * | fredrikhr joined #nim |
17:23:43 | FromDiscord | <mratsim> omg, those github notifications, I have 50 notifications per 10 minutes :/ |
17:26:14 | * | endragor joined #nim |
17:31:26 | FromDiscord | <Rika> is there a reason string's `[]` doesnt use substr? |
17:32:33 | FromDiscord | <mratsim> what is substr? |
17:32:52 | FromDiscord | <mratsim> oh TIL |
17:33:13 | * | endragor quit (Ping timeout: 264 seconds) |
17:34:20 | FromDiscord | <Rika> yeah same |
17:34:31 | FromDiscord | <Rika> learned it because of parseutils |
17:39:52 | * | endragor joined #nim |
17:45:43 | * | endragor quit (Ping timeout: 246 seconds) |
17:50:08 | * | sacredfrog quit (Quit: ZNC 1.8.1 - https://znc.in) |
17:51:43 | * | sacredfrog joined #nim |
17:52:33 | * | a_b_m joined #nim |
17:54:40 | * | Trustable joined #nim |
17:54:54 | * | abm quit (Ping timeout: 240 seconds) |
18:00:07 | Zevv | Can I force openarrays to be of the same dimensions using generics? |
18:00:57 | FromGitter | <timotheecour> openarray len is a runtime value, i don’t see how that could work |
18:01:45 | Zevv | no, I just realized that after hitting enter :) |
18:13:46 | * | leorize joined #nim |
18:14:50 | * | fredrikhr quit (Ping timeout: 265 seconds) |
18:16:28 | FromDiscord | <mratsim> you can use your custom ptr + len type with static length |
18:20:09 | Zevv | hmm that makes sense |
18:28:49 | * | haxscramper joined #nim |
18:31:09 | haxscramper | There is no way to simpliy 'return' value from a macro (in general)? The closest thing is to generate code that would construct original object at runtime. Something like `macro makeStr(...): untyped = newLit("result")`. |
18:33:34 | haxscramper | By 'return' I mean: replace macro invocation with something that could be considered 'equal' (for example `==`) to original object. |
18:33:53 | leorize | use `newLit`? |
18:34:50 | leorize | newLit can create a NimNode from an object |
18:35:22 | haxscramper | It does not work for things like tables, sequences and case objects. I want more general solution. `newLit` works only for simple types (string, integer etc.) |
18:37:11 | leorize | it does work for complicated things, but you must have full access to the type |
18:37:43 | leorize | I guess at best you can construct a genSym-ed `const` and use it |
18:41:19 | * | endragor joined #nim |
18:43:40 | Prestige | Finished! |
18:43:49 | Prestige | wrong chat lol |
18:47:59 | * | endragor quit (Ping timeout: 258 seconds) |
19:01:20 | * | polypus74 joined #nim |
19:02:10 | * | polypus74 quit (Client Quit) |
19:02:29 | * | polypus74 joined #nim |
19:04:52 | * | polypus74 quit (Client Quit) |
19:05:10 | * | polypus74 joined #nim |
19:06:52 | FromDiscord | <KrispPurg> Is there a way to check if the user has put `--gc:arc` when they are running the script? |
19:07:05 | FromDiscord | <KrispPurg> I've tried when defined |
19:08:00 | FromDiscord | <lqdev> when compileOption("gc", "arc") |
19:08:03 | FromDiscord | <mratsim> in the gc.nim there must be the appropriate when defined |
19:08:42 | leorize | use `defined(gcDestructors)` |
19:08:54 | * | a_b_m quit (Read error: Connection reset by peer) |
19:11:20 | FromDiscord | <KrispPurg> thank you |
19:12:01 | leorize | why do you need to detect arc though? |
19:12:22 | FromDiscord | <KrispPurg> because deepCopy does not work in arc |
19:12:37 | leorize | can't you just use `not declared(system.deepCopy)`? |
19:14:18 | FromDiscord | <KrispPurg> does deepCopy not work when it's ORC? |
19:14:34 | leorize | yes |
19:14:51 | FromDiscord | <KrispPurg> I see. |
19:14:52 | leorize | deepCopy is not available for anything based of --gc:destructors |
19:15:00 | leorize | (which includes arc, orc) |
19:15:47 | leorize | the flag is gone now but the define is still there to support already written code, so you don't have to worry about it not being defined |
19:19:00 | * | haxscramper quit (Remote host closed the connection) |
19:23:47 | * | drdee quit (Ping timeout: 260 seconds) |
19:25:00 | FromDiscord | <Firefell> Hello how I can get IP adresse with a AsyncSocket ? |
19:29:10 | FromDiscord | <Yardanico> getPeerAddr if you mean the client address |
19:31:14 | FromDiscord | <Firefell> yes |
19:31:44 | FromDiscord | <Firefell> Thanks |
19:35:17 | * | vsantana joined #nim |
19:43:23 | * | nsf quit (Quit: WeeChat 2.8) |
19:54:55 | * | vsantana_ joined #nim |
19:55:16 | * | vsantana_ quit (Client Quit) |
19:55:45 | * | endragor joined #nim |
19:58:22 | * | vsantana quit (Ping timeout: 246 seconds) |
20:00:22 | * | endragor quit (Ping timeout: 256 seconds) |
20:06:13 | * | endragor joined #nim |
20:10:47 | * | endragor quit (Ping timeout: 258 seconds) |
20:28:48 | FromDiscord | <lqdev> can .since be used to annotate procs in my own library? like, I have a proc and I'd like to annotate it with `{.since: (0, 2).}`, would that work, or is it Nim version exclusive? |
20:29:04 | leorize | it wouldn't work |
20:29:14 | leorize | also, the since pragma is not exported anywhere outside of the stdlib |
20:29:26 | FromDiscord | <lqdev> ah |
20:29:58 | leorize | with that said, nothing really stop us from making a superior `{.since.}` though :P |
20:30:04 | leorize | it's just a template afterall |
20:30:15 | FromDiscord | <lqdev> what does it do? |
20:31:00 | leorize | when (NimMajor, NimMinor) > (x, y): body |
20:31:21 | FromDiscord | <lqdev> ah, so it's for version emulation |
20:31:44 | FromDiscord | <lqdev> looking at the name I thought it only affected doc gen |
20:31:56 | leorize | it never touched docgen lol |
20:32:27 | leorize | we can make a macro that's superior by actually adding a footer like: "Available since: 1.2.0" |
20:32:27 | FromDiscord | <lqdev> ohhhh |
20:32:57 | FromDiscord | <lqdev> I'll probably add a macro for aglet which switches GL versions |
20:33:24 | FromDiscord | <lqdev> so you can do `-d:aglOpenGl=3.3` to limit yourself to GL 3.3 features only |
20:33:32 | FromDiscord | <lqdev> (edit) '3.3' => '<=3.3' |
20:33:41 | leorize | nice |
20:34:09 | FromDiscord | <lqdev> but right now it isn't really needed because I didn't implement anything beyond 3.3 anyways :P |
20:35:09 | FromGitter | <ynfle> Is there a way to define my own compilation options eg. `--file:path/to/my/file`? |
20:35:46 | FromDiscord | <lqdev> nope |
20:35:48 | leorize | nope |
20:35:57 | Yardanico | @lqdev you can use it, yes |
20:36:03 | Yardanico | but I don't think it would be useful |
20:36:09 | Yardanico | @ynfle you can use defines |
20:36:19 | Yardanico | like -d:myFile=path/to/my/file |
20:36:38 | FromDiscord | <lqdev> @ynfle the only way is through using `defined`, there's also `.strdefine` and `.intdefine` pragmas which allow you to pass arguments to defines |
20:36:50 | FromDiscord | <lqdev> eg. `const myFile {.strdefine.} = "some/default/value"` |
20:36:55 | Yardanico | yeah, it's a nice feature |
20:37:14 | * | narimiran quit (Quit: leaving) |
20:37:19 | FromGitter | <ynfle> Thx @lqdc |
20:37:24 | FromGitter | <ynfle> Looks cool |
20:38:06 | Yardanico | @lqdev see https://github.com/nim-lang/Nim/blob/fbc97e712a67f30076f7633880383c8c4ae7866f/tests/stdlib/tsince.nim |
20:38:30 | * | endragor joined #nim |
20:47:14 | * | endragor quit (Ping timeout: 240 seconds) |
20:48:26 | FromDiscord | <Zachary Carter> what's the equivalent of the `#` expand token C preprocessor functionality for a template? |
20:50:33 | FromDiscord | <lqdev> `astToStr`? |
20:50:37 | FromDiscord | <lqdev> idk what the operator does |
20:50:43 | FromDiscord | <lqdev> does it stringify tokens? |
20:50:50 | FromDiscord | <Zachary Carter> yes |
20:50:59 | FromDiscord | <Zachary Carter> ```Another potentially useful macro option is to turn a token into a string containing the literal text of the token. This might be useful for printing out the token. The syntax is simple--simply prefix the token with a pound sign (#).``` |
20:51:10 | FromDiscord | <lqdev> `astToStr(x)` should work |
20:51:16 | FromDiscord | <Zachary Carter> thanks! |
20:53:34 | FromDiscord | <Rika> i-is it normal for -d:release to be much faster than -d:danger? |
20:53:41 | Yardanico | no |
20:53:44 | Yardanico | but maybe your nim is old? |
20:53:48 | FromDiscord | <Rika> im on devel |
20:53:59 | Yardanico | are you perhaps specifying -d:danger in a file? |
20:54:03 | FromDiscord | <Rika> no |
20:54:06 | Yardanico | then idk |
20:54:18 | Yardanico | -d:danger on devel will also define -d:release |
20:54:19 | FromDiscord | <Rika> i've threads on, maybe that? dunno |
20:55:00 | FromDiscord | <Rika> d:release gives me a few microseconds per request, d:danger does a millisecond per request, dunno why |
20:55:06 | FromDiscord | <Rika> request as in http request |
20:55:15 | FromDiscord | <Rika> im running web server |
20:55:20 | FromDiscord | <Rika> a* web server |
20:56:47 | leorize[m] | just use d:release, you will want those assertions to avoid someone breaking the server |
20:57:12 | Yardanico | yeah, people sometimes forget that -d:danger is not magic |
20:57:23 | Yardanico | it just disables all checks, you can disable the ones you don't need manually |
20:57:44 | FromDiscord | <Rika> yeah i also got an out of memory on d:danger lmao i dont wanna find that bug in my code rn so ill just *sweeps under rug* |
20:58:36 | FromDiscord | <Rika> now i need to figure out tls... |
20:58:39 | * | disruptek quit (Quit: bye) |
20:58:39 | * | disbot quit (Quit: oops) |
21:15:07 | * | disruptek joined #nim |
21:16:06 | * | disbot joined #nim |
21:23:00 | * | NimBot joined #nim |
21:25:06 | FromDiscord | <willyboar> @Rika still benchmarking? |
21:25:26 | FromDiscord | <Rika> no, something else |
21:27:08 | FromDiscord | <willyboar> I will ping awesome-nim creator to pass me the repo. I will take care the web section but I want some volunteers for other sections |
21:27:20 | Yardanico | first thing you will want to do for awesome-nim |
21:27:37 | Yardanico | is incorporate https://github.com/nim-lang/Nim/wiki/Curated-Packages and https://github.com/happycodrz/nim-world |
21:27:41 | Yardanico | into it |
21:28:05 | FromDiscord | <willyboar> Yes I am aware of curated packages |
21:28:28 | FromDiscord | <willyboar> But it's not a common source for new people |
21:28:38 | Yardanico | well yes, but you still should take all packages from it :) |
21:30:13 | FromDiscord | <willyboar> The problem is not to take current packages. Problem is to stay updated |
21:30:42 | FromDiscord | <willyboar> I think the best is to have 2 people per section |
21:30:47 | Yardanico | ?? |
21:30:58 | Yardanico | there was a reason awesome-nim stopped updating btw |
21:31:11 | Yardanico | because of curated packages i think :) |
21:31:17 | FromDiscord | <willyboar> Nope |
21:31:21 | Yardanico | then why? |
21:31:35 | FromDiscord | <willyboar> Because owner don't have time |
21:31:49 | Yardanico | well i hope you have the time then :P |
21:31:50 | * | solitudesf- quit (Ping timeout: 246 seconds) |
21:31:57 | Yardanico | also awesome lists are of course opinionated |
21:32:00 | Yardanico | what to include in them? |
21:32:07 | Yardanico | all nim packages or good ones? how to determine if a package is good? |
21:32:26 | FromDiscord | <willyboar> Awesome are mostly updated with prs |
21:32:38 | Yardanico | yes, but it's also harder than editing the wiki |
21:32:49 | Yardanico | I mean updating the wiki is faster and easier than creating a PR |
21:33:09 | Yardanico | you can just make a github ci action thing to mirror the wiki page to some repo :P |
21:33:26 | FromDiscord | <willyboar> Yes but everyone can add to the wiki I think |
21:33:31 | Yardanico | by default - yes |
21:33:35 | Yardanico | and I don't see a problem with that really |
21:33:40 | Yardanico | it's true for wikipedia for most articles too |
21:34:17 | FromDiscord | <willyboar> Also wiki is not common |
21:34:27 | * | endragor joined #nim |
21:34:48 | FromDiscord | <willyboar> When I was discovered Nim one of the first repos I checked was awesome-nim |
21:35:05 | Yardanico | as Isaid |
21:35:11 | Yardanico | we can just make a mirror of the wiki page to some repo then |
21:35:12 | FromDiscord | <willyboar> It tends to be something standard |
21:35:36 | Yardanico | awesome lists are just some libs/apps written in a programming language |
21:35:39 | Yardanico | with a short description |
21:36:16 | Yardanico | but yeah, do it if you have time :P |
21:36:25 | * | nikita` quit (Quit: leaving) |
21:37:57 | FromDiscord | <willyboar> Well it's easy to just merge prs but I can't check all the packages alone. |
21:39:41 | FromDiscord | <willyboar> That's why I have proposed to move it into nim-lang and add some collaborators |
21:39:52 | Yardanico | hm |
21:40:30 | FromDiscord | <willyboar> I volunteer for the web related section |
21:40:40 | FromDiscord | <willyboar> 😋 |
21:41:18 | * | endragor quit (Ping timeout: 260 seconds) |
21:41:25 | Yardanico | make an RFC |
21:41:31 | Yardanico | https://github.com/nim-lang/RFCs |
21:41:43 | Yardanico | just open an issue explaining what, why and how :) |
21:46:25 | FromDiscord | <willyboar> I will think about it. Maybe I will open a forum thread first to see what other people think |
21:46:36 | Yardanico | well RFCs are for that exact reason too :) |
21:46:41 | Yardanico | you can open an RFC and make a forum thread for it |
21:46:47 | Yardanico | RFC stands for "Request for comments" |
21:47:30 | FromDiscord | <willyboar> I want my first RFC to be successful |
21:47:33 | Yardanico | lol |
21:47:34 | FromDiscord | <willyboar> 🤣 |
21:47:48 | Yardanico | my first and only RFC is https://github.com/nim-lang/RFCs/issues/240 |
21:47:49 | disbot | ➥ Make "unreachable statement" error a warning ; snippet at 12https://play.nim-lang.org/#ix=2q6i |
21:48:06 | * | endragor joined #nim |
21:48:12 | FromGitter | <ynfle> If someone comments isn't that successful? |
21:48:39 | Yardanico | "succesful" RFC is the one which was accepted :P |
21:48:49 | FromDiscord | <willyboar> Exactly |
21:49:20 | FromGitter | <ynfle> I wasn't a serious comment |
21:49:25 | Yardanico | yeah I know :P |
21:49:34 | FromDiscord | <willyboar> Exactly |
21:50:12 | FromGitter | <alehander92> willyboard just chill |
21:51:23 | FromDiscord | <lqdev> ~~systemd-willyboard~~ |
21:51:31 | Yardanico | no systemd in my backyard |
21:51:37 | FromDiscord | <lqdev> same here |
21:52:26 | FromDiscord | <lqdev> ~~it's just that whenever I see some word with an extra d attached to it this it the first thing that comes to my mind~~ |
21:53:00 | Yardanico | GNU/systemd |
21:53:03 | Yardanico | it's the future you chose |
21:53:13 | Yardanico | https://pics.me.me/gnu-systemd-dont-call-it-a-grave-its-the-future-19490809.png |
21:53:31 | Yardanico | also offtopic too, but https://ghnou.su/systemd |
21:54:03 | * | endragor quit (Ping timeout: 260 seconds) |
21:54:21 | FromDiscord | <lqdev> XDDD |
21:55:39 | FromDiscord | <willyboar> Alehander92 I am one of the most chilled person you are ever meet |
21:55:56 | FromDiscord | <willyboar> 😋 |
21:56:17 | leorize | damn, someone predicted systemd-oomd before it's even out |
21:58:03 | FromGitter | <alehander92> welel i hope |
21:58:08 | FromGitter | <alehander92> you are not ice cream |
22:02:57 | FromDiscord | <willyboar> Just think that I live together with 5 women 🤣 🤣 |
22:03:11 | Yardanico | nice anime harem protagonist |
22:04:55 | FromDiscord | <willyboar> 4 of them are my daughters so nah |
22:06:19 | FromDiscord | <Shucks> you gonna continue till you get a son? ;D |
22:06:41 | FromDiscord | <Shucks> while not son: continue |
22:06:52 | FromDiscord | <willyboar> No. I want one more daughter |
22:06:57 | Yardanico | i feel too young now |
22:07:07 | FromDiscord | <willyboar> You are |
22:08:09 | FromDiscord | <Clyybber> Yardanico: When you put the unreachable statement in a block it works :p |
22:08:14 | Yardanico | lol |
22:08:18 | Yardanico | well yeah I know |
22:08:20 | Yardanico | same as Timo said |
22:08:29 | Yardanico | if you put "if true" it works too |
22:08:56 | FromDiscord | <Clyybber> oh, but I don't mean the return |
22:09:06 | FromDiscord | <Clyybber> I mean the unreachable statement itself |
22:09:21 | Yardanico | oh |
22:09:26 | Yardanico | lol |
22:10:00 | * | Trustable quit (Remote host closed the connection) |
22:10:00 | FromDiscord | <Clyybber> discovered by looking at the implementation :D |
22:11:25 | FromDiscord | <Clyybber> Yardanico: Btw, what do you think of renaming it to "unreachable code" ? |
22:11:44 | FromDiscord | <Clyybber> since it might not only be one statement thats unreachable |
22:11:56 | FromDiscord | <Clyybber> maybe "unreachable statements" ? |
22:12:38 | Yardanico | well I don't have a strong opinion on the naming |
22:12:44 | Yardanico | so yeah, I guess it would be fine |
22:17:06 | * | tane quit (Quit: Leaving) |
22:27:47 | Yardanico | Hmm, @Clyybber I found this https://github.com/nim-lang/Nim/issues/11984#issuecomment-523407422 |
22:27:49 | disbot | ➥ unreachable statement after 'return' statement ; snippet at 12https://play.nim-lang.org/#ix=2qbR |
22:27:52 | Yardanico | the whole thread |
22:28:03 | Yardanico | ah nvm no, it's not a problem |
22:31:45 | FromDiscord | <Clyybber> yeah, I already read that issue |
22:32:03 | FromDiscord | <Clyybber> PR is up btw |
22:34:40 | Yardanico | i'm about to update ircord, hope we don't have regressions, expect a bit of downtime :) |
22:35:18 | * | FromDiscord quit (Remote host closed the connection) |
22:35:51 | * | FromDiscord joined #nim |
22:35:54 | Yardanico | Kappa 123 |
22:36:03 | Yardanico | ok at least it started, let's see how stable it is |
22:36:50 | Yardanico | @KrispPurg ^ :P |
22:37:04 | FromDiscord | <KrispPurg> aaaa |
22:41:23 | disruptek | you really shouldn't use return at all, imo. |
22:41:40 | FromDiscord | <willyboar> Disruptekkkkkkkk |
22:41:51 | disruptek | what is up mister boar? |
22:41:55 | FromDiscord | <Recruit_main707> return can be useful |
22:42:04 | disruptek | return is for wussies. |
22:42:28 | FromDiscord | <willyboar> Wrong channel by the way |
22:42:42 | disruptek | as far as i'm concerned, any channel i'm in is the Right one. |
22:42:59 | disruptek | i'm about as Left as they come, and you guys are in serious danger right now. |
22:44:45 | FromDiscord | <willyboar> -d: danger ? |
22:45:48 | disruptek | yes, d as in danger. |
22:45:57 | disruptek | d rhymes with t. |
22:46:01 | disruptek | t rhymes with p. |
22:46:07 | disruptek | p stands for POOL. |
22:46:19 | FromDiscord | <Recruit_main707> *the pool is danger* |
22:46:55 | disruptek | pool to the left of me, jokers to the right; |
22:46:57 | disruptek | here i stand, |
22:47:02 | disruptek | stuck in the middle with hugh. |
22:49:02 | FromDiscord | <willyboar> Disruptek I don't forget you but I have some troubles with my mac |
22:49:11 | disruptek | aiiieeee! |
22:49:44 | FromDiscord | <willyboar> I setup my old laptop and I will try it these days |
22:50:23 | FromDiscord | <willyboar> I installed manjaro to try it |
23:16:49 | * | endragor joined #nim |
23:21:38 | * | endragor quit (Ping timeout: 260 seconds) |
23:25:40 | * | endragor joined #nim |
23:32:37 | * | endragor quit (Ping timeout: 264 seconds) |
23:33:28 | * | endragor joined #nim |
23:41:34 | * | endragor quit (Ping timeout: 240 seconds) |
23:42:44 | * | krux02_ joined #nim |
23:45:07 | * | krux02 quit (Ping timeout: 240 seconds) |
23:50:02 | * | endragor joined #nim |
23:52:00 | * | fredrikhr joined #nim |
23:58:51 | * | fredrikhr quit (Read error: Connection reset by peer) |
23:59:16 | * | fredrikhr joined #nim |