00:00:06 | * | Trustable quit (Remote host closed the connection) |
00:02:43 | * | awe00 quit (Ping timeout: 265 seconds) |
00:04:54 | FromDiscord | <martinium> is this incorrect syntax to send a json body on a put request?↵```↵let resp = await client.putContent(url, body=params)↵``` |
00:05:27 | FromDiscord | <kodkuce> hmm just do echo req |
00:05:54 | FromDiscord | <kodkuce> you can read whole request and see if json is broken, but dont think it is |
00:05:57 | FromDiscord | <martinium> params = let body = %*{"enabled": true, "name": sitesMap.getOrDefault(ids) & " - Weekly", "notification": "SMTP", "recipients": recipients["recipients"].getElems(), "relayServer": "yadda", "senderEmailAddress": "yadda"} |
00:06:44 | FromDiscord | <martinium> i tried breaking down the array elem but thats not the case |
00:06:58 | * | Jesin joined #nim |
00:07:44 | FromDiscord | <kodkuce> this jester or asynchttp? |
00:07:55 | * | synshroud quit (Quit: ZNC 1.7.5 - https://znc.in) |
00:09:11 | * | synshroud joined #nim |
00:09:58 | FromDiscord | <martinium> asynchttpclient |
00:10:03 | FromDiscord | <kodkuce> @martinium you need to pass stirng not json i think |
00:10:13 | FromDiscord | <martinium> yeah it says to pass as string |
00:10:14 | FromDiscord | <kodkuce> body = $params |
00:10:27 | FromDiscord | <martinium> when I pass it to function I pass as $params |
00:10:35 | FromDiscord | <martinium> still get the assertion error of doom |
00:10:49 | FromDiscord | <martinium> let me post full code on a gist |
00:12:17 | FromDiscord | <kodkuce> so it dose not crash when you create body, ↵```let body = %*{"enabled": true, "name": sitesMap.getOrDefault(ids) & " - Weekly", "notification": "SMTP", "recipients": recipients["recipients"].getElems(), "relayServer": "yadda", "senderEmailAddress": "yadda"}``` ? |
00:12:31 | FromDiscord | <kodkuce> (edit) 'body, ↵```let' => 'body ?↵```let' | removed '?' |
00:12:47 | FromDiscord | <martinium> it only crashs on assert error |
00:12:50 | FromDiscord | <martinium> https://gist.github.com/martinium/6ce1feccb73bdd2e998e434372bc909f |
00:14:22 | FromDiscord | <martinium> (edit) 'crashs' => 'crashes' |
00:14:45 | FromDiscord | <martinium> definitely have it narrowed down to a malformed request though |
00:16:00 | disruptek | you can't pass a jsonnode to the client; just give it a string. |
00:16:15 | FromDiscord | <kodkuce> hmm i would put echo 54, echo 55, echo 56, echo 57, just to be sure |
00:16:22 | FromDiscord | <kodkuce> he is $ fing it |
00:17:38 | FromDiscord | <martinium> I am passing it as a string on line 56 |
00:18:02 | FromDiscord | <martinium> line 54 with {} instead of [] gives 400 bad request |
00:18:22 | FromDiscord | <martinium> so has to be that I am either forming request wrong |
00:18:31 | FromDiscord | <martinium> should this be multipart data vs body |
00:18:43 | FromDiscord | <martinium> (edit) 'multipart data' => 'multipartdata' | 'body' => 'body?' |
00:19:15 | FromDiscord | <kodkuce> (%* {"t": "r", "i":r, "p": game.rockets[r].pos}) this is my json but ye i think its good |
00:19:42 | FromDiscord | <kodkuce> i asked to write echo 1,2,3,4,5 bewine each line just to be sure where it exploeds |
00:19:52 | FromDiscord | <kodkuce> tough i am no pro :) |
00:21:21 | * | theelous3 quit (Ping timeout: 258 seconds) |
00:22:01 | FromDiscord | <kodkuce> https://media.discordapp.net/attachments/371759389889003532/748336481755463771/2020-08-27_022004.png |
00:22:21 | FromDiscord | <kodkuce> better sure then sorry :) |
00:23:11 | FromDiscord | <martinium> so I did it and the eror happens here let data2 = await putReq(fmt"sites/{ids}/alerts/smtp", $body) |
00:23:12 | FromDiscord | <kodkuce> i think error heppends on body |
00:23:20 | FromDiscord | <martinium> yeah it does |
00:23:22 | FromDiscord | <kodkuce> (edit) 'i think error heppends on body' => 'hmm' |
00:23:34 | FromDiscord | <martinium> I did echo 1 right before it and the 1 printed before error |
00:23:40 | FromDiscord | <martinium> so def a malformed request |
00:23:46 | FromDiscord | <kodkuce> w8 it heppens on let body or on let data2 |
00:24:03 | FromDiscord | <martinium> switching to curlies gives this Exception message: 400 Bad Request↵Exception type: [HttpRequestError] |
00:24:14 | FromDiscord | <martinium> for line 56 |
00:24:22 | FromDiscord | <martinium> it happens on let data2 |
00:25:53 | FromDiscord | <kodkuce> and putReq is a proc you wrote |
00:27:20 | FromDiscord | <kodkuce> https://media.discordapp.net/attachments/371759389889003532/748337821386932304/2020-08-27_022530.png |
00:27:38 | FromDiscord | <kodkuce> or i wronk |
00:28:10 | FromDiscord | <kodkuce> are you sending request to your api? |
00:28:25 | FromDiscord | <kodkuce> and werent an error json one not http one |
00:29:13 | FromDiscord | <martinium> putReq is my function that inside has client.putContent(url, body=params) |
00:29:15 | FromDiscord | <kodkuce> 400 can mean maybe wrong url too, echo url and try in browser |
00:29:23 | FromDiscord | <martinium> I pass the params as a string |
00:30:10 | FromDiscord | <martinium> url is confirmed to be correct |
00:30:48 | FromDiscord | <martinium> I am trying to do same thing as python's request libraries json={"key": value} |
00:30:58 | FromDiscord | <martinium> as part of the put request |
00:31:11 | FromDiscord | <martinium> (edit) 'libraries' => 'library's' |
00:31:23 | FromDiscord | <kodkuce> did you write thise echos |
00:31:24 | FromDiscord | <kodkuce> :) |
00:31:42 | FromDiscord | <martinium> eror happens at let data2 |
00:31:57 | FromDiscord | <kodkuce> but let data calls putReq function |
00:31:59 | FromDiscord | <kodkuce> you wrote |
00:32:08 | FromDiscord | <kodkuce> so error probbaly heppend in it |
00:32:39 | FromDiscord | <kodkuce> thats why i say echo like img up |
00:32:59 | FromDiscord | <martinium> python would be requests.put(url, json=body) |
00:33:45 | FromDiscord | <kodkuce> echo echo echo, its like 4 lines of code you can tell me that i am stupid leater if want |
00:35:00 | FromDiscord | <martinium> think I figured it out |
00:35:12 | disruptek | i don't believe it. |
00:35:31 | FromDiscord | <martinium> api docs say body needs to be sent as an array of json |
00:35:41 | FromDiscord | <martinium> [{yadda:yadda}] |
00:36:09 | FromDiscord | <kodkuce> thats probbaly reason why you get 400 bad req |
00:36:13 | FromDiscord | <martinium> yup |
00:37:25 | FromDiscord | <martinium> bahaha now I get 500 error |
00:37:35 | FromDiscord | <martinium> going to have to use a post request vs a put |
00:38:42 | FromDiscord | <martinium> post gets 400 error |
00:38:55 | FromDiscord | <kodkuce> duno if not your api maybe use postman/curl or whatwer to figure out exact data format |
00:39:01 | FromDiscord | <martinium> can I turn the json node in body into an array by just wrapping it in []? |
00:39:23 | FromDiscord | <martinium> (edit) removed 'json node in' |
00:39:30 | * | synshroud quit (Quit: ZNC 1.7.5 - https://znc.in) |
00:39:35 | FromDiscord | <martinium> or do I need to do seq[] |
00:39:48 | * | synshroud joined #nim |
00:41:12 | FromDiscord | <kodkuce> hmm duno xD |
00:41:37 | FromDiscord | <kodkuce> https://play.nim-lang.org/ |
00:41:39 | FromDiscord | <kodkuce> try here |
00:42:34 | FromDiscord | <kodkuce> i think you can wrap with [ ] |
00:43:03 | FromDiscord | <kodkuce> https://play.nim-lang.org/#ix=2vm7 |
00:43:58 | FromDiscord | <kodkuce> anyway i need to go sleep its 02:42 at me |
00:44:16 | FromDiscord | <martinium> thanks for your help |
00:44:19 | FromDiscord | <martinium> have a good night |
00:45:18 | FromDiscord | <kodkuce> and also care duno what api you sening request, but some have limit on requests per some time and simliar |
00:45:20 | FromDiscord | <kodkuce> good night |
00:45:32 | FromDiscord | <kodkuce> np hope i helpd you at least some :) |
00:55:05 | * | Tanger quit (Ping timeout: 258 seconds) |
00:57:47 | * | kinkinkijkin quit (Ping timeout: 260 seconds) |
00:59:55 | * | vicfred quit (Ping timeout: 240 seconds) |
01:03:02 | * | synshroud quit (Quit: ZNC 1.7.5 - https://znc.in) |
01:03:19 | * | synshroud joined #nim |
01:05:54 | * | kinkinkijkin joined #nim |
01:07:55 | * | bra-ket quit (Ping timeout: 240 seconds) |
01:13:30 | * | zyklon joined #nim |
01:15:56 | kinkinkijkin | i need to figure out why this object loader is a data bomb |
01:16:07 | kinkinkijkin | fills my 16gb of ram in 20 seconds |
01:16:12 | kinkinkijkin | for a 13mb file |
01:16:31 | disruptek | so, less than a gig a second? doesn't sound like nim. |
01:17:05 | kinkinkijkin | it's a databomb but it tries to do more calculations than stores :p |
01:20:21 | * | bunbunbunbunny joined #nim |
01:21:33 | kinkinkijkin | oh i know what im doing wrong |
01:21:51 | kinkinkijkin | im not clearing temp single-item variables |
01:22:51 | kinkinkijkin | that's... oh god |
01:22:58 | kinkinkijkin | that would've taken a very long time to stop |
01:31:20 | * | kenran joined #nim |
01:36:13 | * | kenran quit (Ping timeout: 246 seconds) |
01:41:10 | * | apahl quit (Ping timeout: 244 seconds) |
01:42:20 | * | apahl joined #nim |
01:45:18 | * | bunbunbunbunny quit (Quit: leaving) |
02:08:24 | kinkinkijkin | aaaaand im having the issue i went about before |
02:08:42 | kinkinkijkin | how do i make sure a variable is rewritten for a seq? |
02:08:49 | kinkinkijkin | in this case, a tuple |
02:09:32 | Prestige | kinkinkijkin: what do you mean by rewritten? |
02:09:34 | kinkinkijkin | im looking for a blanket solution that doesn't require messy tricks like adding .toSeq |
02:10:10 | kinkinkijkin | prestige, normally a seq will reference any memory put into it, which is fine if you're putting literals or file items into it |
02:10:25 | kinkinkijkin | but when you're putting live variables into it, often they'll disappear |
02:11:19 | kinkinkijkin | the only solution ive been given for this so far was years ago, and that was to explicitly re-type the variable to the type that it already is on the .add |
02:11:42 | kinkinkijkin | i was expecting that there would be a better solution by now |
02:11:48 | Prestige | Can you give an example? I'm curious |
02:12:19 | kinkinkijkin | yeah, do you want pseudocode, working nim, or a description? |
02:12:27 | Prestige | working nim |
02:12:31 | kinkinkijkin | welp~ |
02:12:35 | kinkinkijkin | welp* |
02:12:46 | Prestige | well, the recreated problem |
02:12:59 | kinkinkijkin | okay |
02:13:01 | kinkinkijkin | just a sec |
02:17:03 | kinkinkijkin | https://dpaste.org/KW9b this is just an example |
02:17:45 | kinkinkijkin | given a file that has multiple lines, that will return only the values from one line |
02:17:46 | kinkinkijkin | sometimes two |
02:19:20 | Prestige | hmm interesting |
02:20:12 | kinkinkijkin | in that case chaning tmptmpvarvar.add(tmpvar) to tmptmpvarvar.add(tmpvar.toSeq) fixes that |
02:20:43 | kinkinkijkin | but that's... messy, unclear |
02:21:13 | Prestige | Could make a template or just comment for clarity ig |
02:21:30 | kinkinkijkin | im just looking for a real solution |
02:21:39 | * | Tanger joined #nim |
02:22:12 | kinkinkijkin | whether it's using different types for this, or using gc magic, or both |
02:23:32 | * | muffindrake quit (Ping timeout: 244 seconds) |
02:23:48 | Prestige | maybe doesn't suit your actual problem, but what about initializing a new variable there? |
02:23:52 | leorize[m] | what are you trying to do? |
02:24:37 | * | konkrrrrrr joined #nim |
02:24:48 | * | kinkinkijkin quit (Disconnected by services) |
02:24:52 | * | konkrrrrrr is now known as kinkinkijkin |
02:25:26 | * | Jesin quit (Ping timeout: 240 seconds) |
02:25:58 | * | muffindrake joined #nim |
02:35:59 | * | bung joined #nim |
02:43:02 | * | thomasross_ joined #nim |
02:43:02 | * | thomasross quit (Killed (card.freenode.net (Nickname regained by services))) |
02:43:02 | * | thomasross_ is now known as thomasross |
02:51:03 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
02:57:46 | * | bung quit (Ping timeout: 246 seconds) |
03:07:22 | disruptek | a real solution is never a good idea. |
03:07:32 | * | letto quit (Quit: Konversation terminated!) |
03:08:15 | * | letto joined #nim |
03:32:12 | * | kenran joined #nim |
03:35:26 | * | bung joined #nim |
03:37:14 | * | kenran quit (Ping timeout: 260 seconds) |
03:42:25 | * | apahl quit (Ping timeout: 240 seconds) |
03:43:32 | * | apahl joined #nim |
03:50:06 | * | bra-ket joined #nim |
03:50:35 | * | zyklon quit (Read error: Connection reset by peer) |
03:52:03 | * | vicfred joined #nim |
03:55:06 | * | arecacea1 quit (Remote host closed the connection) |
03:55:30 | * | arecacea1 joined #nim |
04:04:35 | * | pbb quit (Remote host closed the connection) |
04:05:47 | * | pbb joined #nim |
04:05:52 | FromDiscord | <martinium> question how are you supposed to send json data in an http request in Nim? Are you supposed to use ```body = data``` or ```multipart = data```? |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:34 | * | supakeen joined #nim |
04:06:45 | * | thomasross quit (Ping timeout: 240 seconds) |
04:15:42 | * | ptdel joined #nim |
04:18:54 | disruptek | surprise me. |
04:20:31 | FromDiscord | <martinium> body = data |
04:20:53 | FromDiscord | <martinium> (edit) 'data' => '$data' |
04:22:03 | disruptek | sounds good. |
04:24:26 | FromDiscord | <martinium> sigh |
04:24:34 | FromDiscord | <martinium> I need to get a handle on this language does it |
04:24:45 | * | Jesin joined #nim |
04:25:00 | FromDiscord | <martinium> did what I needed to in Python but def want to know how to get it done with Nim so I can use this always vs Python |
04:32:19 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
04:32:27 | * | njoseph joined #nim |
04:32:29 | * | njoseph quit (Client Quit) |
04:32:35 | * | njoseph joined #nim |
04:33:30 | * | njoseph quit (Client Quit) |
04:33:38 | * | njoseph joined #nim |
04:33:43 | * | njoseph quit (Client Quit) |
04:33:50 | * | njoseph joined #nim |
04:37:55 | * | narimiran joined #nim |
04:43:47 | * | synshroud_ joined #nim |
04:44:25 | * | synshroud quit (Ping timeout: 240 seconds) |
04:48:40 | FromDiscord | <Elegant Beef> @martinium reimplement it in nim, best way to learn it! 😄 |
05:10:40 | * | arecacea1 quit (Remote host closed the connection) |
05:11:08 | * | arecacea1 joined #nim |
05:14:26 | FromDiscord | <dk> Is it """normal""" for OS to totally hang up on infinite template call recursion? |
05:15:47 | bung | is https://github.com/JohnAD/decimal128 suit of encoding for mysql float ? |
05:20:27 | * | synshroud_ quit (Quit: ZNC 1.7.5 - https://znc.in) |
05:20:42 | * | synshroud joined #nim |
05:21:03 | FromGitter | <halloleo> Hi! Does anybody have experience with using D3 (https://d3js.org/) from Nim with the JS backend? |
05:25:45 | * | kenran joined #nim |
05:36:32 | FromDiscord | <martinium> how can I check the type of an object? |
05:36:36 | FromDiscord | <martinium> is there a proc for that? |
05:37:06 | FromDiscord | <martinium> it's weird but a value for a jsonnode key happens to be an array |
05:37:19 | FromDiscord | <martinium> but it's saying its an openArray vs a JArray |
05:43:34 | bung | `aVal is AType` |
05:44:20 | FromDiscord | <Rika> `aVal.kind == JArray`? |
05:48:56 | FromDiscord | <Elegant Beef> `object of T` |
05:49:15 | FromDiscord | <martinium> when I echo a parent json array with a bunch of keys the key I want to access prints its values |
05:49:32 | FromDiscord | <martinium> the key I want to access has an array of strings as its values |
05:49:38 | FromDiscord | <Elegant Beef> shit is it of... cant recall |
05:49:43 | FromDiscord | <martinium> when I try to access this key directly it prints out empty keys |
05:49:53 | FromDiscord | <Elegant Beef> ah it is of |
05:58:52 | FromDiscord | <Rika> so root is obj, next is arr, next is string, right?↵so something like ["key"][index].getStr() right? |
05:59:59 | FromDiscord | <martinium> wow I finally got it |
06:00:22 | FromDiscord | <martinium> I had to specify a damn index after main json array |
06:00:39 | FromDiscord | <martinium> main array I want to access is called resources |
06:01:21 | FromDiscord | <martinium> so data{"resources"}{0}{"recipents"}.getElems() |
06:01:24 | FromDiscord | <martinium> that finally worked |
06:01:34 | FromDiscord | <martinium> why did it need an index........ |
06:02:09 | FromDiscord | <martinium> it's always going to be 0 since it is iterating through each object.... |
06:02:29 | * | Zectbumo joined #nim |
06:02:34 | FromDiscord | <martinium> (edit) 'data{"resources"}{0}{"recipents"}.getElems()' => '```data{"resources"}{0}{"recipents"}.getElems()```' |
06:02:45 | FromDiscord | <martinium> omg |
06:03:00 | FromDiscord | <martinium> because resources is an array containing a bunch of objects |
06:03:20 | FromDiscord | <martinium> so each object has an index value |
06:03:23 | FromDiscord | <martinium> ughhhhhhhhhhh |
06:03:42 | FromDiscord | <martinium> glad I finally figured it out |
06:03:48 | FromDiscord | <martinium> time for bed now |
06:03:49 | FromDiscord | <martinium> later |
06:03:52 | FromDiscord | <Rika> bruh |
06:04:00 | FromDiscord | <Rika> gn to you |
06:04:13 | FromDiscord | <martinium> thanks man same to you |
06:04:23 | FromDiscord | <martinium> 2AM here and I work in the morning |
06:04:24 | FromDiscord | <martinium> lol |
06:04:28 | FromDiscord | <martinium> later |
06:06:03 | FromDiscord | <Rika> "same to me" but its not night for me xd |
06:06:52 | * | solitudesf joined #nim |
06:15:02 | * | letto quit (Quit: Konversation terminated!) |
06:15:48 | * | ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
06:19:55 | * | elijahr joined #nim |
06:20:56 | * | letto joined #nim |
06:28:47 | * | Vladar joined #nim |
06:31:01 | ForumUpdaterBot | New thread by Halloleo: List with the modules of the Standard library which do not work with the JS backend, see https://forum.nim-lang.org/t/6731 |
06:33:14 | * | mal`` quit (Quit: Leaving) |
06:33:30 | * | mal`` joined #nim |
06:41:21 | * | PMunch joined #nim |
06:43:56 | * | kinkinkijkin quit (Read error: Connection reset by peer) |
06:44:40 | * | kinkinkijkin joined #nim |
07:09:16 | * | elijahr quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
07:10:15 | * | elijahr joined #nim |
07:21:39 | PMunch | Hmm, is there a way to undeclare a variable? |
07:22:04 | FromDiscord | <mratsim> put it's use in a "block:" |
07:22:11 | FromDiscord | <mratsim> scope its* |
07:22:18 | PMunch | Ah, it's an argument to a function |
07:22:35 | PMunch | And I have a pragma that I want to hide it |
07:22:53 | FromDiscord | <mratsim> shadow it with `let a = "THOU SHALL NOT REUSED US"` |
07:22:58 | FromDiscord | <Rika> was gonna say |
07:23:05 | PMunch | Well that's just ugly |
07:23:13 | PMunch | What if `a` was a string to begin with |
07:23:16 | FromDiscord | <mratsim> ugly is in the eye of the beholder |
07:23:35 | FromDiscord | <Rika> make a new type |
07:23:38 | FromDiscord | <mratsim> type ShadowVariable = enum |
07:23:43 | FromDiscord | <Rika> type DoNotUse = object |
07:23:45 | FromDiscord | <Rika> or something |
07:24:13 | PMunch | That's just a different form of ugly, but still ugly :P |
07:24:57 | PMunch | What I could do is create two procedures, one with all the arguments and one without one of them |
07:25:08 | PMunch | And then call the one without the argument from the one with |
07:25:30 | PMunch | But that adds a procedure call.. And a template won't work.. |
07:25:34 | FromDiscord | <mratsim> or use a default parameter? |
07:25:38 | PMunch | I guess I could add {.inline.} |
07:25:49 | FromDiscord | <mratsim> inline would apply to any caller |
07:25:57 | PMunch | Well, that won't work for this usecase |
07:26:17 | FromDiscord | <mratsim> but you can do fooImpl, and have a foo1 and foo2 with different number of args |
07:26:22 | PMunch | I'm looking at the `withNone` pragma @Elegant wrote |
07:26:46 | PMunch | Basically it checks if all Option[T] arguments given to a procedure are `none` |
07:27:05 | FromDiscord | <mratsim> if procs are declared in the same module and the inner one is private, the compiler will auto-inline it if necessary so don't worry too much |
07:29:12 | PMunch | The `withSome` he wrote unpacks `a: Option[T]` to `a: T` in the procedure, so I was wondering if it would make sense to hide `a` when using the `withSome` pragma |
07:29:28 | PMunch | when using the `withNone` proagma* |
07:30:43 | * | elijahr quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
07:31:12 | PMunch | If we just had something like `undef a` or `without(a):` then I could just use that |
07:41:18 | FromDiscord | <mratsim> template a: {.error: "Don't use".} |
07:41:48 | FromDiscord | <mratsim> so without should use identifier construction |
07:42:59 | * | krux02 joined #nim |
07:44:04 | FromDiscord | <mratsim> sent a code paste, see https://play.nim-lang.org/#ix=2vne |
07:44:20 | FromDiscord | <mratsim> change nkSym to nkIdent actually* |
07:44:48 | FromDiscord | <mratsim> oh and put those in a "block: " |
07:45:20 | FromDiscord | <mratsim> sent a code paste, see https://play.nim-lang.org/#ix=2vnf |
07:45:38 | FromDiscord | <mratsim> (edit) 'https://play.nim-lang.org/#ix=2vnf' => 'https://play.nim-lang.org/#ix=2vng' |
07:46:03 | FromDiscord | <mratsim> @PMunch ^ |
07:46:31 | FromDiscord | <Elegant Beef> does that `untyped{kind}` work for user defined types aswell? |
07:47:00 | FromDiscord | <mratsim> afaik only nimnode |
07:47:04 | FromDiscord | <Elegant Beef> Ah |
07:47:12 | FromDiscord | <Elegant Beef> Damn that's cool syntax for procs for specific variants 😄 |
07:47:14 | FromDiscord | <mratsim> but there is a RFC for better verification of variant types |
07:47:32 | FromDiscord | <mratsim> it's not an overload, it throws a "runtime" (VM runtime) error |
07:47:41 | FromGitter | <alehander92> there is a plan for that |
07:47:41 | FromDiscord | <Elegant Beef> Ah |
07:47:47 | FromGitter | <alehander92> but is there a rfc? |
07:47:57 | PMunch | Had to change nkStmt to nkStmtList, but seems to work well :) |
07:48:02 | FromDiscord | <mratsim> it's the same as "assert symbol.kind in {nkIdent}" at the beginning of the proc |
07:48:26 | FromDiscord | <Elegant Beef> Yea i suppose a macro that does that is rather simple |
07:48:38 | PMunch | https://play.nim-lang.org/#ix=2vni |
07:50:04 | PMunch | Hmm, that `untyped{}` syntax would be useful for pragmas that has to be attached to procedures as well |
07:50:18 | FromDiscord | <mratsim> maybe there isn't a RFC @alehander42 and I saw that mentioned somewhere else |
07:50:20 | PMunch | `func` is still a nnkProcDef right? |
07:50:28 | FromDiscord | <mratsim> no it's nnkFuncDef |
07:50:45 | PMunch | Ah.. |
07:51:02 | FromDiscord | <alehander42> yeah i mentioned |
07:51:08 | FromDiscord | <alehander42> i wanted to write one 😦 😄 |
07:51:13 | FromDiscord | <alehander42> sorry for being late |
07:51:41 | FromDiscord | <mratsim> xD |
07:53:59 | FromDiscord | <mratsim> Added to my budding cookbook - https://github.com/status-im/nim-cookbook |
07:58:26 | Araq | https://nim-lang.org/araq/writetracking_2.html feedback appreciated but do not share the link yet |
07:58:57 | * | bunbunbunbunny joined #nim |
07:59:02 | PMunch | Hmm @Elegant, withSome/withNone doesn't work with `var` arguments.. |
08:00:03 | FromDiscord | <Elegant Beef> I dont like the `..` it makes me think you are upset with me 😛 |
08:02:00 | PMunch | Haha, not at all :P |
08:04:26 | FromDiscord | <mratsim> @Araq, sounds good, ypu might want to add `The reason is that while n itself is a parameter and immutable, n.data remains mutable due to the pointer indirection!` (This was called "shallow immutability" in the past) |
08:11:06 | * | myphs joined #nim |
08:18:37 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
08:23:17 | FromDiscord | <Elegant Beef> pmunch seems sorta weird to use the macro with var options, any good reason to support this? |
08:23:19 | PMunch | Hmm, should "nimble test" also generate the documentation in order to test "runnableExample"s? |
08:23:36 | PMunch | @Elegant, why would that be weird? |
08:23:43 | PMunch | I've already implemented a fix for it :) |
08:23:59 | FromDiscord | <Elegant Beef> Cause if you're passing a var option you'd expect to set it if it's none |
08:24:20 | FromDiscord | <Elegant Beef> So i guess it has point with `withNone` |
08:24:22 | PMunch | Or set it to none after the execution |
08:26:00 | FromDiscord | <Elegant Beef> So were you using my macros and ran into that? |
08:30:49 | PMunch | I was just cutting a new release, and when writing some more documentation I noticed a couple small things I wanted to change |
08:33:36 | PMunch | @Elegant: https://github.com/PMunch/nim-optionsutils/commit/3810fdad719abcb3994bafee91a0fed350c0a7fc |
08:34:02 | PMunch | Hmm, does `:` in a highlight work? |
08:34:10 | PMunch | @Elegant ^ |
08:34:23 | FromDiscord | <Elegant Beef> It pinged me yes |
08:34:48 | PMunch | Ah okay, cool |
08:36:23 | PMunch | Hmm, I guess I could've implemented a similar thing for `ptr` and `ref` options as well |
08:37:26 | FromDiscord | <Elegant Beef> ref/ptr options, sounds weird |
08:37:58 | PMunch | Definitely, not used very often |
08:38:22 | FromDiscord | <Elegant Beef> I mean it's sorta against the idea of options, so yea 😛 |
08:40:28 | * | myphs quit (Ping timeout: 256 seconds) |
08:40:31 | FromDiscord | <Elegant Beef> Do really like the added undefining |
08:40:58 | PMunch | Yeah it's nice :) Thanks @mratsim |
08:41:28 | PMunch | Plays well into the whole "safe options" thing that it has going |
08:42:13 | Araq | mratsim: ok, thanks |
08:44:13 | FromDiscord | <Elegant Beef> Im just happy my macro wasnt abhorrent 😄 |
08:44:31 | FromDiscord | <Elegant Beef> Which reminds me, i probably should redo my constructors macro |
08:45:31 | PMunch | I like it :) Can certainly see how it could be useful |
08:46:02 | FromDiscord | <Elegant Beef> I more mean that it was cleaner than this implementation↵https://github.com/beef331/constructor |
08:49:34 | PMunch | Hmm, that's a pretty cool package TBH |
08:49:48 | PMunch | (Didn't look at the implementation) |
08:50:36 | FromDiscord | <Elegant Beef> I realized i do need to have a body to call after |
08:50:54 | FromDiscord | <Elegant Beef> So you can do subscription and the like after it's created |
08:53:19 | FromDiscord | <Elegant Beef> I know someone from a gamedev discord that uses Swift and named parameters as much as possible that was peturbed by that |
08:53:42 | FromDiscord | <Elegant Beef> "Why would you not want named parameters?!" |
08:54:16 | PMunch | I try to use them when it's not clear what the arguments are |
08:54:55 | FromDiscord | <alehander42> hmm |
08:55:00 | PMunch | Example: "createNew(SuperHero, height = 210)" |
08:55:07 | FromDiscord | <Elegant Beef> I only use them when specifying values of optional parameters |
08:55:10 | FromDiscord | <Elegant Beef> Since they're basically forced |
08:55:31 | PMunch | I don't use `kind = SuperHero` because it's kinda obvious, but `height` can't really be guessed just from `210`, so I name it |
08:55:32 | FromDiscord | <Elegant Beef> Cause fuck populating the entire proc signature for the 13th entry |
08:55:45 | * | Zectbumo quit (Quit: 64bits!) |
08:55:54 | PMunch | Heh, yeah it really also depends on how often I use something :P |
08:56:28 | Araq | anybody else? |
08:56:32 | FromDiscord | <Elegant Beef> I see how they can be nice, but it just adds a lot of text and they also do the whole block declaration |
08:56:38 | FromDiscord | <Elegant Beef> Other than good job, nope 😄 |
08:56:44 | PMunch | If you use a proc 13 times you kinda expect the user to know what the arguments are. But if you use it once then it might be nice to specify. |
08:56:57 | FromDiscord | <Elegant Beef> i didint say 13 times |
08:57:03 | FromDiscord | <Elegant Beef> I said 13 variable entry |
08:57:12 | PMunch | Araq, anybody else what? |
08:57:16 | FromDiscord | <Elegant Beef> (edit) '13' => '13th' |
08:57:19 | FromDiscord | <Elegant Beef> On his musings |
08:57:27 | Araq | PMunch, please read my linked article |
08:57:28 | PMunch | Oh, missed that link |
08:58:32 | PMunch | Maybe link "Clyybber" to their GitHub? |
08:59:02 | FromDiscord | <Elegant Beef> I do have to ask does this immutabillity only apply to `noSideEffects` or does it also apply to `procedures` non `var` arguments? |
09:00:16 | FromDiscord | <Elegant Beef> I know it'd break a ton of code, but having true immutabillity on non variable arguements would be interesting 😄 |
09:01:25 | PMunch | Also the "7 years ago I wrote how Nim would get "write tracking"" part should include a link |
09:02:02 | Araq | hmm ok |
09:02:31 | Araq | <Elegant Beef> it applies to .noSideEffect procs |
09:02:49 | Araq | ('func' remains syntactic sugar) |
09:02:58 | Araq | and it's inferred |
09:03:08 | Araq | just like it used to be |
09:05:04 | FromDiscord | <alehander42> 🙂 |
09:06:27 | FromDiscord | <alehander42> yeah this is what side effect |
09:06:29 | FromDiscord | <alehander42> sounds like |
09:06:45 | FromDiscord | <alehander42> but isn't this a big breaking change |
09:07:03 | FromDiscord | <Elegant Beef> Only for people that were using impure funcs |
09:07:15 | FromDiscord | <alehander42> well .. sorry but this is how they were defined |
09:07:38 | FromDiscord | <Elegant Beef> It is also expiremental atm, so no it doesnt 😄 |
09:07:56 | Araq | I ported some code over, mostly it just works |
09:08:19 | FromDiscord | <alehander42> but all code that mutates refs should break no? |
09:08:24 | Araq | in rare cases you need a {.noSideEffect.}: block to override the compiler's thinking |
09:09:46 | FromDiscord | <Elegant Beef> Anything that modifies a non `var` argument will break |
09:10:20 | Araq | <alehander42>: well there is considerable overlap between using funcs and not using much of true mutation |
09:10:23 | FromDiscord | <Elegant Beef> Which is kinda fine since the entire point of a `func` is to have no state changes |
09:11:03 | FromDiscord | <Elegant Beef> I feel like anyone that'd contemplate using a func would realize they're mutating objects and go "Well this isnt the job for a func" |
09:11:53 | FromDiscord | <Elegant Beef> But i've literally never used a `func` so what do i know |
09:12:09 | Araq | you don't have to use 'func', it's inferred :P |
09:12:19 | FromDiscord | <Elegant Beef> oh |
09:13:00 | PMunch | This is a great feature! |
09:13:15 | PMunch | And the article describes it well |
09:13:19 | FromDiscord | <Elegant Beef> So what your're saying is that Nim has been making me write functional programming without me knowning, this is absurd! |
09:13:34 | FromDiscord | <Elegant Beef> (edit) 'knowning,' => 'knowing,' |
09:13:50 | PMunch | Haha, well you can call something declared as a `proc` from a `func` as long as the `proc` isn't mutating anything |
09:14:06 | PMunch | In that case the `proc` could've been a `func` |
09:14:19 | FromDiscord | <Elegant Beef> Well yea |
09:14:35 | Araq | if you phrase it this way and it might be "absurd" then. but in reality we infer a subset of what people mean when they say FP |
09:15:08 | Araq | and with the --experimental switch we infer it differently |
09:15:22 | FromDiscord | <Elegant Beef> Yea i was mostly just joking. Think it's cool. |
09:16:03 | FromDiscord | <Elegant Beef> If im not asking for help, or helping someone there is an extremely high chance my sincereity is less than 0 |
09:16:14 | Araq | in reality I don't care about you mutating your stuff, I care about my optimizer to perform well ;-) |
09:16:49 | FromDiscord | <Elegant Beef> See Pmunch i told you Araq doesnt care about you |
09:20:49 | * | beatmox- quit (Ping timeout: 244 seconds) |
09:22:09 | FromDiscord | <Varriount> Oh look, an RFC |
09:22:32 | FromDiscord | <Varriount> I shall pounce on it like a cat with a ball of yarn |
09:23:34 | * | Tanger quit (Quit: Leaving) |
09:23:58 | * | awe00 joined #nim |
09:24:05 | FromDiscord | <Rika> cute |
09:24:06 | * | beatmox joined #nim |
09:24:43 | FromDiscord | <Elegant Beef> All i learned is that varriount jumps on cats whilst he holds a ball of yarn |
09:24:47 | FromDiscord | <Elegant Beef> Pretty metal if you ask me |
09:25:17 | FromDiscord | <Varriount> I like cats. I intend to adopt one at some point |
09:25:39 | FromDiscord | <Varriount> Mainly when I feel like I'm responsible enough |
09:25:50 | FromDiscord | <Elegant Beef> I mean that's cruel adopt a cat just to jump on it |
09:31:36 | FromDiscord | <Elegant Beef> Reading RFC#247, couldnt the ref objects be solved by storing all the objects in the graph, then instead of storing a reference just storing the index inside the json, so then you can reconstruct on deserialization? |
09:31:52 | FromDiscord | <Elegant Beef> But it's too late for me |
09:32:00 | FromDiscord | <Elegant Beef> So i go now, my shitty jokes leave with me |
09:33:32 | Araq | that's what marshal.nim does |
09:34:02 | Araq | it translates refs into integer IDs. |
09:34:23 | Araq | but when I use a web API that sends me some JSON it doesn't do that |
09:34:51 | Araq | it's about interop with foreign systems, you don't get to define the rules of play |
09:35:31 | Araq | and so we shouldn't "guess", in the end the programmer needs to say what he needs, we can only automate part of the problem domain |
09:40:34 | * | Vladar quit (Quit: Leaving) |
09:42:08 | FromDiscord | <mratsim> FP aren't the only users of func |
09:42:25 | FromDiscord | <mratsim> I'm more interested in writing bug-free / surprise-free code |
09:43:54 | * | kinkinkijkin quit (Read error: Connection reset by peer) |
09:44:13 | FromDiscord | <mratsim> on that band-wagon, I would love if large objects that are passed by pointers in the backend also get tagged with __restrict. I have some poor extra "mov" generated by the compiler. |
09:44:35 | * | kinkinkijkin joined #nim |
09:45:40 | Araq | will give you a .restrict pragma but f(x, x) implies it cannot always be restrict |
09:47:42 | FromDiscord | <mratsim> restrict at the function parameter level? |
09:48:21 | FromDiscord | <mratsim> Because restrict for variable is already possible with: https://github.com/numforge/laser/blob/master/laser/compiler_optim_hints.nim#L23-L26 |
09:53:01 | Araq | I know it's possible but that's hacky |
09:56:15 | FromDiscord | <mratsim> My code is a collection of hacks 😉 |
09:56:57 | * | FromGitter quit (Remote host closed the connection) |
09:56:57 | * | oprypin quit (Quit: Bye) |
09:57:15 | * | oprypin joined #nim |
09:57:28 | * | FromGitter joined #nim |
09:58:06 | FromDiscord | <mratsim> anyway restrict on param would help avoiding very large function prologue/epilogue when passing big object like arrays of bytes from hashes with arrays of bytes from bigint for example. |
10:00:06 | FromDiscord | <mratsim> in this function, I have unexplained 50 cycles cost even if it's completely empty ... https://github.com/mratsim/constantine/blob/master/constantine/tower_field_extensions/quadratic_extensions.nim#L55-L139 |
10:00:53 | FromDiscord | <mratsim> sorry 23 cycles* |
10:01:05 | FromDiscord | <mratsim> but still almost 10% of the function time |
10:01:59 | * | theelous3 joined #nim |
10:03:49 | * | Trustable joined #nim |
10:04:11 | FromGitter | <alehander92> mratsim FP is about bug-free code usually |
10:08:26 | FromDiscord | <mratsim> but it's also slow |
10:09:29 | FromGitter | <alehander92> mratsim eh .. |
10:09:36 | FromGitter | <alehander92> it depends on too many factors |
10:09:53 | FromDiscord | <mratsim> There are plenty of domains where you want the compiler to help you track bugs as much as possible, but FP isn't suitable because it assumes a GC or allocates lot of intermediate compute |
10:10:02 | FromGitter | <alehander92> but harder to optimize/low level is true |
10:10:23 | FromGitter | <alehander92> fp doesn't have to assume a GC |
10:10:25 | FromGitter | <alehander92> imho |
10:11:11 | FromGitter | <alehander92> allocations can be controlled, but I agree that it's a harder model for this kind |
10:11:28 | FromGitter | <alehander92> but imperative shell, functional core still sounds reasonable for some projects |
10:12:17 | FromDiscord | <mratsim> FP does assume a GC, there are no FP language out there that doesn't use one. |
10:12:49 | FromDiscord | <mratsim> The basic Fp data structure, the singly linked list requires some form of memory management. |
10:13:25 | FromGitter | <alehander92> you're right in practice |
10:13:34 | FromGitter | <alehander92> but on theory i don't think it's impossible |
10:13:38 | FromDiscord | <mratsim> All the closures for Higher Order functions also requires a GC |
10:14:19 | FromGitter | <alehander92> hm, it's a good question |
10:14:43 | FromGitter | <alehander92> still, i'd say some form of deterministic GC + strict typing might |
10:14:49 | FromGitter | <alehander92> get you an almost fp-language |
10:14:52 | Araq | well you can emulate a GC to some extend with "memory regions" but then the memory region becomes mutable and against the FP mantra |
10:14:55 | FromGitter | <alehander92> something like rust lite |
10:15:37 | FromGitter | <alehander92> another option is effect systems for memory |
10:16:16 | FromGitter | <alehander92> which somehow encode the used regions in a way that is checkable |
10:16:35 | Araq | region inference was done for ML |
10:16:43 | FromDiscord | <mratsim> Yes, some kind of borrow checker + a proof system 😉 |
10:16:44 | FromGitter | <alehander92> similarly to the way IO usage is encoded but haskell still does it in "pure" |
10:17:06 | Araq | one problem was that a valid outcome is always "just use a single region for the entire program" |
10:17:07 | FromGitter | <alehander92> yeah: probably not a great fit |
10:17:45 | FromGitter | <alehander92> so immutability is what makes it hard |
10:18:27 | FromGitter | <alehander92> i'll ask the proglangdesign channel for other examples |
10:18:53 | Araq | please spare me :P |
10:19:07 | Araq | I've been there... |
10:19:33 | FromGitter | <alehander92> hahahaha |
10:20:05 | FromGitter | <alehander92> they know some obscure stuff: i like those folks |
10:20:10 | FromGitter | <alehander92> but think about it |
10:20:29 | FromGitter | <alehander92> we can have a more generalized immutability to mutable equivalent tool |
10:20:51 | FromGitter | <alehander92> after all, once we've proved some code doesn't mutate stuff |
10:20:59 | FromGitter | <alehander92> all kinds of optimizations including totally rewriting it |
10:21:02 | FromGitter | <alehander92> should be possible |
10:21:15 | FromGitter | <alehander92> and this might be easier than encoding manually regions and |
10:21:31 | FromGitter | <alehander92> combining it with hard type stuff |
10:21:45 | * | bunbunbunbunny quit (Ping timeout: 240 seconds) |
10:21:58 | Araq | you don't have a cost model about memory consumption. |
10:22:15 | Araq | you can optimize the program to a bump pointer allocator |
10:22:28 | Araq | and it works just fine for small input and dies with OOM on bigger inputs |
10:22:46 | FromGitter | <alehander92> yeah cost model is hard |
10:22:49 | Araq | that's how to think about it. |
10:22:57 | * | bunbunbunbunny joined #nim |
10:23:12 | FromGitter | <alehander92> but the compiler can generate that for you |
10:23:27 | FromGitter | <alehander92> it can say "ok this code would use ~X relatively" |
10:23:33 | FromGitter | <alehander92> before/after optimization |
10:23:51 | FromGitter | <alehander92> again, not great for writing a kernel probably |
10:24:52 | Araq | the problem is not about writing a kernel. the problem is that you enjoy thinking and then stop at the 60-80% solution and way before you wrote a single line of code. |
10:24:54 | * | bunbunbunbunny quit (Client Quit) |
10:25:01 | FromDiscord | <mratsim> For low-level code, I want tools to help me verify soundness/ensure safety. I can handle the perf. |
10:25:27 | FromGitter | <alehander92> mratsim same |
10:25:32 | FromDiscord | <mratsim> Ah yes, reading papers without code is like that ... |
10:25:36 | FromGitter | <alehander92> i don't want immutability at all costs |
10:25:41 | Araq | so everything always remains "theoretically" possible |
10:25:52 | FromDiscord | <mratsim> The so called "implementation details" |
10:25:54 | FromGitter | <alehander92> Araq you mean people or me |
10:26:16 | Araq | you, personally. |
10:26:20 | FromGitter | <alehander92> yeah well i should get to the 90% solution |
10:26:21 | FromGitter | <alehander92> right |
10:27:07 | Araq | and I'm not trying to be offensive here, it's fine to enjoy musing about things |
10:27:16 | FromGitter | <alehander92> "Araq's musings" |
10:27:35 | FromDiscord | <mratsim> It's like people recommending O(n^2.7) algorithms for matrix multiplication, while the problem is not the number of low-level operation but the cache hierarchy of your actual CPU. You spend time on theoretical speed improvement that don't materialize in reality. |
10:27:42 | Araq | but it does get tiresome to have you explain to me thing that I mused over myself for 7 years |
10:27:49 | FromGitter | <alehander92> sorry |
10:27:56 | FromGitter | <alehander92> i just try to see if it makes sens |
10:28:10 | FromGitter | <alehander92> so it's very helpful to talk with experienced people :D |
10:28:17 | FromGitter | <alehander92> to not try it again |
10:28:33 | FromGitter | <alehander92> i have many ideas, but that's it : they are weak |
10:28:35 | FromGitter | <alehander92> at some point |
10:28:51 | FromGitter | <alehander92> so if one waits for the perfect concepts/plans, probably one would never write down anything |
10:29:39 | FromGitter | <alehander92> maybe small prototypes should be a better talking point |
10:30:27 | FromDiscord | <mratsim> That's how I started Weave, but it's costly in time. I created a prototype in July a year ago, wrote the RFC, then rewrote it completely from scratch in November. |
10:30:38 | FromGitter | <alehander92> yeah it takes time |
10:31:25 | FromDiscord | <mratsim> This is also why having a way to evolve/deprecate/replace the standard library is so important. |
10:31:34 | FromGitter | <alehander92> and i want something useful for job search right now (that's why i am trying to write c -> asm compiler in haskell .. |
10:31:41 | FromDiscord | <mratsim> i.e. the protocol discussion mentioned |
10:32:14 | FromDiscord | <mratsim> OCaml seems to be the defacto standard for compilers Proof of concepts |
10:32:28 | FromGitter | <alehander92> eh they're both pretty standard |
10:32:58 | FromDiscord | <Clyybber> alehander92: Try to mold your ideas into algorithms |
10:33:24 | FromGitter | <alehander92> good advice! |
10:33:31 | FromGitter | <alehander92> ah another idea i wondered about was |
10:34:05 | FromGitter | <alehander92> fusing passes : the problem with many optimization/other passes is that they still slow down a compiler ⏎ but what if one could describe them in more rewriting way |
10:34:16 | FromGitter | <alehander92> as rewrite rules, e.g. optimizations |
10:34:21 | FromGitter | <alehander92> and fuse some of them automatically |
10:34:35 | FromDiscord | <Clyybber> The issue is that many passes aren't that local |
10:34:36 | FromGitter | <alehander92> this way you get both cleaner arch and faster runtime |
10:34:49 | FromGitter | <alehander92> we're talking about local |
10:34:58 | FromDiscord | <Clyybber> And it doesn't jump out to me what could be fused |
10:35:03 | FromGitter | <alehander92> imagine a backend which has 20 possible local optimizations |
10:35:09 | FromDiscord | <Clyybber> Because many passes strictly depend on the previous pass |
10:35:27 | FromDiscord | <mratsim> I've seen some talks that walk through graph rewrite with an AST in python that were easy to follow |
10:35:31 | FromGitter | <alehander92> that's also true: but that's the rewrite rule point |
10:35:58 | FromGitter | <alehander92> you detect which can be combined and an optimal way to order them |
10:36:10 | FromGitter | <alehander92> i guess there is some theory on that |
10:36:18 | FromDiscord | <Clyybber> probably |
10:36:27 | FromDiscord | <Clyybber> but I don't think it will help the nim compiler that much |
10:36:34 | FromGitter | <alehander92> oh no it's very theoretical |
10:36:35 | FromDiscord | <Clyybber> but the only way to know is to try :) |
10:37:30 | FromDiscord | <Clyybber> What orders of performance increase are you thinking about? |
10:37:37 | FromGitter | <alehander92> about nim my biggest guess is still the approach with parallel/IC submodules |
10:37:43 | Araq | see the "Burg" code generator for the lcc C compiler, written in 1995 |
10:37:48 | FromGitter | <alehander92> but i need to write that prototype as well |
10:37:51 | FromGitter | <alehander92> finish |
10:39:35 | Araq | (did I read the book? yes, I did. maybe you should too.) |
10:39:36 | * | synshroud quit (Quit: ZNC 1.7.5 - https://znc.in) |
10:40:08 | FromGitter | <alehander92> yeah i tried to find |
10:40:10 | FromGitter | <alehander92> the paper |
10:40:13 | FromGitter | <alehander92> https://c9x.me/compile/bib/iburg.pdf ? |
10:40:20 | FromGitter | <alehander92> sorry https://dl.acm.org/doi/abs/10.1145/131080.131089?download=true |
10:40:22 | * | synshroud joined #nim |
10:41:46 | FromGitter | <alehander92> clyybber no idea, mostly wondering if it's viabl |
10:41:53 | FromGitter | <alehander92> mratsim yeah maybe similar |
10:43:52 | FromDiscord | <Clyybber> alehander92: Assuming a 10 to 20 percent performance increase I don't think it is |
10:44:09 | FromDiscord | <Clyybber> it will make the code harder to write since we have to restrict ourselves more |
10:44:20 | FromDiscord | <Clyybber> and harder to debug since it will be mixed together |
10:46:36 | FromGitter | <alehander92> about fusing/rewrite ? this is just a toy idea, i dont think it even matters to nim |
10:46:47 | FromGitter | <alehander92> as it would apply to e.g. a backend |
10:47:23 | FromGitter | <alehander92> IC is where it is for nim |
10:51:12 | Araq | yeah that paper. |
10:51:27 | Araq | as an exercise, rewrite the algorithms it uses to be purely functional |
10:52:17 | FromGitter | <alehander92> can't buy it man |
10:52:45 | FromGitter | <alehander92> but i'll keep it in mind (i have to read much more before it anyway :D) |
10:53:06 | FromDiscord | <Clyybber> psst scihub |
11:05:43 | FromGitter | <alehander92> hm, but which one is the "book" |
11:06:03 | FromDiscord | <dom96> Araq: ready to release that article yet? |
11:07:16 | * | myphs joined #nim |
11:08:57 | * | qwertfisch quit (Quit: ZNC - http://znc.in) |
11:15:46 | Araq | book is here, https://www.amazon.de/Retargetable-Compiler-Design-Implementation/dp/0805316701 |
11:17:12 | FromDiscord | <mratsim> You can get the paper here: file:///home/beta/Research/Compiler/Burg%20fast%20optimal%20instruction%20selection.pdf |
11:17:22 | FromDiscord | <Clyybber> lol? |
11:17:41 | federico3 | well, technically it' not wrong |
11:17:50 | FromDiscord | <dom96> hah |
11:17:58 | FromDiscord | <Clyybber> @mratsim press the (+) to the left of the message box to upload stuff |
11:18:17 | FromDiscord | <mratsim> https://www.researchgate.net/profile/Christopher_Fraser/publication/2856341_Burg_---_Fast_Optimal_Instruction_Selection_and_Tree_Parsing/links/09e4150c61da64007b000000/Burg---Fast-Optimal-Instruction-Selection-and-Tree-Parsing.pdf?origin=publication_detail |
11:20:04 | federico3 | [I just joined acm.org - because of Nim] |
11:21:53 | FromGitter | <alehander92> mratsim haha |
11:22:12 | FromGitter | <alehander92> huh how did you find it |
11:23:31 | FromGitter | <alehander92> hm 40$ an year is not so much |
11:27:18 | FromGitter | <alehander92> thanks Araq for the book link |
11:27:40 | FromGitter | <alehander92> seems cool, but for now I'll try using online resources |
11:28:09 | federico3 | hm, Vala is getting quite some traction https://en.wikipedia.org/wiki/Elementary_OS - I really feel the need for stable gtk3+libhandy wrappers for Nim |
11:28:41 | FromGitter | <alehander92> one friend gave me https://www.amazon.de/Engineering-Compiler-Keith-Cooper/dp/012088478X/ref=pd_sbs_14_1/261-4787818-2240533?_encoding=UTF8&pd_rd_i=012088478X&pd_rd_r=5c7135aa-b3aa-4fcd-8556-c202ba35da60&pd_rd_w=h9T1L&pd_rd_wg=HTWDg&pf_rd_p=d5022659-416a-420a-bccc-de3cf1d7297a&pf_rd_r=N1QJSNYFWZPTVKATKQKY&psc=1&refRID=N1QJSNYFWZPTVKATKQKY as a present : I might take a look at it as well again |
11:30:35 | FromDiscord | <dom96> federico3: Elementary OS has been around for years, did something change recently that gave it more traction and as a result given Vala more traction too? |
11:32:01 | federico3 | dom96: libhandy came out recently and the new gtk-based smartphones gathered a developer community very quickly |
11:33:34 | FromDiscord | <dom96> Interesting. But I've personally lost my faith in GTK. |
11:37:05 | FromDiscord | <dom96> I would much rather put work in to make Karax work natively on mobile ala React Native (or just React Native itself) |
11:37:12 | FromDiscord | <dom96> (edit) 'I would much rather put work in to make Karax work natively on mobile ala React Native (or just ... React' => 'I would much rather put work in to make Karax work natively on mobile ala React Native (or justuse' |
11:37:37 | FromDiscord | <Clyybber> GTK disabling disabling CSD really sucks |
11:38:12 | federico3 | I've yet to see a UI library that I like, but gtk is what is being adopted |
11:38:40 | FromDiscord | <Clyybber> Qt is perfect from a user perspective |
11:38:49 | FromDiscord | <Clyybber> and seems fine from a devs perspective too |
11:38:58 | federico3 | qt is a nightmare |
11:39:03 | FromDiscord | <Clyybber> is it? |
11:39:16 | FromDiscord | <dom96> QML seems like a nice light alternative |
11:43:37 | Araq | alehander42: I cannot comment on "Engineering a Compiler", didn't read it |
11:43:37 | * | kinkinkijkin quit (Read error: Connection reset by peer) |
11:44:10 | * | kinkinkijkin joined #nim |
11:47:46 | FromDiscord | <mratsim> @alehander42 I just googled it |
11:49:10 | FromDiscord | <mratsim> Plus I have over 8GB of papers on my machine so I learned how to avoid paywalls |
11:49:49 | FromDiscord | <Clyybber> Araq: I have to change the spec with my PR the typed example here https://nim-lang.github.io/Nim/manual#templates-passing-a-code-block-to-a-template works now |
11:50:02 | Araq | sure, go for it |
12:06:02 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:33 | * | supakeen joined #nim |
12:09:49 | ForumUpdaterBot | New thread by ElAfalw: Handling in-place functions efficiently, see https://forum.nim-lang.org/t/6732 |
12:14:54 | PMunch | Hmm, what does this error mean? Error: system module needs: appendString |
12:15:39 | * | Senketsu joined #nim |
12:28:38 | FromDiscord | <Clyybber> PMunch: Somehow appendString is not available |
12:29:23 | FromDiscord | <Clyybber> do you use os:standalone or some other funky stuff that might cause appendString to not be defined? |
12:30:04 | PMunch | Yup, I'm compiling for an Arduino |
12:30:11 | PMunch | It works in -d:danger mode |
12:30:31 | PMunch | But I had some weird behaviour so I tried to go back to a regular release in order to see if I was missing some obvious error |
12:32:01 | FromDiscord | <Clyybber> any reason you are not using os:ansic? |
12:32:33 | FromDiscord | <Clyybber> if it works in danger but not in release its the error messages, they probably use `&` to concatenate the strings |
12:32:48 | FromDiscord | <Clyybber> and that calls appendString, which is not available on os:standalone |
12:32:58 | * | Senketsu quit (Ping timeout: 260 seconds) |
12:33:57 | FromDiscord | <Yardanico> You mean --os:any :) |
12:35:03 | FromDiscord | <Clyybber> right |
12:35:29 | FromDiscord | <Clyybber> probably remembered the PR name or somethign :D |
12:35:51 | PMunch | With --os:any: /home/peter/.choosenim/toolchains/nim-#devel/lib/system/osalloc.nim(306, 10) Error: Port memory manager to your platform |
12:37:33 | FromDiscord | <Clyybber> yeah, you need to provide malloc |
12:38:34 | FromDiscord | <Clyybber> or maybe just -d:useMalloc to use malloc itself |
12:48:06 | * | arecacea1 quit (Remote host closed the connection) |
12:48:34 | * | arecacea1 joined #nim |
12:52:00 | * | NimBot joined #nim |
12:57:23 | FromDiscord | <Clyybber> Araq: https://github.com/nim-lang/Nim/pull/15158 is ready, I had to go with the shadow scope approach in the end to avoid resemming the argument |
12:57:24 | disbot | ➥ Fix #5691 |
12:57:43 | FromDiscord | <Clyybber> But it turned out to relatively simple actually |
13:01:38 | Araq | if I write 'noMatch(); return' everywhere do you think I don't know I could make it part of the template instead? |
13:02:01 | Araq | I choose not to hide the control flow |
13:02:05 | Araq | *chose |
13:03:11 | FromDiscord | <Clyybber> ok, thought it was just an oversight |
13:05:13 | FromDiscord | <Clyybber> Araq: Are you ok with renaming it to noMatchReturn then ? |
13:05:29 | FromDiscord | <Clyybber> It prevents one from calling noMatch and forgetting the return |
13:07:51 | Araq | your way is fine |
13:07:53 | * | waleee-cl joined #nim |
13:08:00 | Araq | don't need the 'return' in the name |
13:09:04 | FromDiscord | <Clyybber> oh, okay :) |
13:14:49 | Araq | dom96: ok, ready to relase my article |
13:24:49 | Araq | Clyybber: what about generated generics? |
13:24:56 | Araq | do we have to undo them on block exit? |
13:26:29 | FromDiscord | <Ricky Spanish> is it possible in nim to link a dll like this```const LibName = "mydll/mydll.dll"↵{.push callconv:cdecl, dynlib: LibName.}↵{.push importc.}↵``` and then include the header file with ```{.emit: """#include "../some_header.h"""".}``` and then call the functions from that header in nim procedures? |
13:26:38 | * | Vladar joined #nim |
13:28:15 | Araq | you need to decide whether you interface to a DLL or to a C header file |
13:31:03 | FromDiscord | <Ricky Spanish> the C header has the definitions of the types i can use from nim in the dynlib so dont i need to link like above and includes the header as usual or is there something im missing |
13:32:46 | FromDiscord | <Ricky Spanish> or against the lib rather |
13:33:14 | leorize[m] | you can't just "include" a header then call it from Nim. You will still need to translate the procs in the header to Nim |
13:33:24 | leorize[m] | nimterop is a seamless way to do this |
13:36:18 | bung | anyone know how to pack json param in mysql binary protocol ? I packed it as 1 byte(filed type,) a byte(0),variable-length(json string without quote) it has no problem with 5.7, with 8 it throw `Incorrect arguments to mysqld_stmt_execute` |
13:36:57 | bung | I searched hours no luck. |
13:37:48 | leorize[m] | are you trying to interface with mysql through the wire without using the library or smt? |
13:38:32 | bung | yeah, I write a lib amysql in pure nim |
13:39:02 | bung | so it need implement mysql protocol its self. |
13:40:57 | * | hackePelle joined #nim |
13:42:51 | * | hackePelle quit (Quit: Connection closed) |
13:44:55 | * | myphs quit (Ping timeout: 240 seconds) |
13:45:19 | FromDiscord | <dom96> Well, I submitted Araq's article to HN in case anyone wants to give it a little upvote |
13:45:58 | FromDiscord | <Clyybber> Araq: IMO no, its only about scoping |
13:50:26 | * | Kaivo quit (Ping timeout: 260 seconds) |
13:51:10 | FromDiscord | <dom96> Araq: Your blog needs opengraph tags |
13:52:45 | * | Kaivo joined #nim |
13:53:45 | FromDiscord | <Clyybber> Zevv: ready to work on cps again? |
13:54:38 | Zevv | slowly, slowly |
13:54:45 | Zevv | having my last beers |
13:54:55 | Zevv | tomorrow morning taking the ferry back home |
13:55:05 | Zevv | you did notice I did not do any of the work, right? |
13:55:12 | Zevv | I just nag disruptek |
13:55:41 | Zevv | I decided after years of refusing manager or teamlead roles to give it a try for once |
13:55:57 | FromDiscord | <haxscramper> On wrapping C++ again - I made libclang wrapper https://github.com/haxscramper/hcparse - right now this is just some convenience sugar on top of things like getting kind/type of the node etc. There are of course some rough edges (because well, *c++*), but it looks manageable. |
13:56:44 | FromDiscord | <haxscramper> For /wrapping/ things. libclang also has access to documentation, types and other similar things. |
13:58:16 | FromDiscord | <haxscramper> And I also made macro for creating visitor callbacks to traverse AST - it was a bit of a paint to use, mainly due to `{.cdecl.}` calling convention on visitors. |
13:59:24 | Araq | dom96: what are "opengraph" tags? |
13:59:50 | Araq | <haxscramper>: yay, now please take over c2nim and make it use clang's parser |
14:00:26 | FromDiscord | <haxscramper> Not right now but maybe in future :) |
14:01:32 | FromDiscord | <Recruit_main707> that would be nuts |
14:01:33 | FromGitter | <alehander92> hmm nice |
14:01:44 | FromDiscord | <haxscramper> Now I just want to make sure it is not as painful to use as raw c bindings - e.g. porting enum and function names to use nim naming conventions (remove `clang_` prefix from everyhing, drop `CXX` etc) |
14:02:16 | bung | I found that's mysql unimplemented feature. |
14:02:50 | FromDiscord | <haxscramper> I've already done it /partially/ - documentation for cleaned version: https://haxscramper.github.io/hcparse-doc/src/hcparse/libclang.html , but it just needs more work |
14:08:03 | * | myphs joined #nim |
14:08:10 | * | myphs quit (Remote host closed the connection) |
14:08:15 | FromDiscord | <haxscramper> How can I get 'preprocessed' (expand all macros and templates) nim AST from source file |
14:08:19 | PMunch | Crap, just found a weakness in my superQuote macro.. |
14:08:30 | PMunch | It can't do string lookup in tables.. |
14:08:39 | FromDiscord | <Rika> not so super anymore aint it |
14:08:43 | PMunch | And there doesn't seem to be any way of fixing it with how Nim handles ``.. |
14:08:55 | FromDiscord | <haxscramper> There is a `compiler/parser` for parsing string to `PNode` - I want to have something similar |
14:09:21 | FromDiscord | <haxscramper> Some other part in compiler that I missed |
14:10:20 | PMunch | Oh well, I'm off |
14:10:21 | * | PMunch quit (Quit: Leaving) |
14:17:06 | FromDiscord | <haxscramper> Sometimes I wonder what world would we live in if creators of C & C++ didn't try to be too smart with syntax. Things like `<<<template>>>`, ambiguous syntax for `if {} else {}` (probably created just to have something to write chapter in the textbooks on parsing), no keywords for function declarations etc. |
14:28:56 | disruptek | how is this better than treesitter? |
14:29:40 | Yardanico | disruptek: clang is a C/C++ *compiler* |
14:29:48 | Yardanico | it surely knows C/C++ better than treesitter |
14:29:51 | disruptek | gtfo since when? |
14:30:08 | Yardanico | ? |
14:31:06 | FromDiscord | <haxscramper> It has fully type-resolved (AFAIK) ast, can deal with includes, *any* standard-conforming C++ syntax, documentation etc. |
14:32:02 | Araq | <haxscramper> you cannot get a preprocessed Nim file as Nim has no preprocessor |
14:32:15 | Araq | closest would be the "after sem" AST |
14:32:23 | Araq | but it's not exposed |
14:33:40 | FromDiscord | <haxscramper> That's sad. I wanted to make wrapper for sourcetral DB writer and make nim source code explorer. I can just make it on top of parser alone though |
14:36:48 | disruptek | those are features that treesitter cannot handle? |
14:37:10 | Yardanico | disruptek: of course, it's not a C/C++ compiler |
14:37:17 | Yardanico | it's just a parser |
14:37:28 | Yardanico | for different languages |
14:37:38 | shashlick | I've not faced any limitations with tree sitter but I've only worked on c so far |
14:37:40 | Yardanico | "Tree-sitter is a parser generator tool and an incremental parsing library. It can build a concrete syntax tree for a source file and efficiently update the syntax tree as the source file is edited." |
14:37:42 | disruptek | documentation doesn't strike me as exclusive to compilation. |
14:38:12 | shashlick | Of course clang will be better but don't envy haxscramper at all |
14:38:13 | FromGitter | <alehander92> i think it is optimized for incremental usage as editors etc |
14:38:22 | disruptek | so we're really talking about /typed/ ast. |
14:38:48 | * | endragor_ quit (Remote host closed the connection) |
14:39:15 | * | endragor joined #nim |
14:40:04 | shashlick | its light weight and provides enough information for wrapping |
14:40:16 | disruptek | haxscramper: it's easy enough to insert yourself into nim's compilation process, it just might not be what you expect. |
14:40:17 | FromDiscord | <haxscramper> Clang is much better because it is specifically targeted for C++, has several pages worth of documentation already, multiple talks and dozen articles on how to use it to parse c++. It is easier to get started with, better suited for this particular task and provides richer interface. From what I saw treesitter is just generic parse-everything |
14:40:31 | shashlick | i did look at libclang when i started but for my approach, it is not viable |
14:40:55 | FromDiscord | <haxscramper> Why? |
14:41:09 | shashlick | best to read the nimterop readme |
14:43:50 | * | endragor quit (Ping timeout: 265 seconds) |
14:44:07 | FromDiscord | <haxscramper> I'm sorry but there is no mention of clang/libclang on the readme. It talks about advantages of treesitter. Maybe I missed something? I looked in 'why-nimterop' section. |
14:44:49 | FromDiscord | <haxscramper> And I'm actually not really concerned with things like preprocessor, porting macros etc. At least not right now. |
14:45:47 | FromDiscord | <haxscramper> My current objective is to create toolking to writing *fully automatic* wrapped generators for some libraries. Things like qt, cgal etc. that are big enough to have dedicated tool for them. |
14:47:00 | FromDiscord | <haxscramper> And I also want to be able to throw in as many heuristics and logic during translation as I want in order to provide more idiomatic nim API. |
14:47:48 | * | hnOsmium0001 joined #nim |
14:49:18 | FromDiscord | <haxscramper> And I also hope to use libclang to wrap libtooling and *this* use it too. Right now this is in "todo thing that I want to do" |
14:50:49 | Araq | excellent |
14:51:09 | Araq | > My current objective is to create toolking to writing *fully automatic* wrapped generators for some libraries. Things like qt, cgal etc. that are big enough to have dedicated tool for them. |
14:51:12 | Araq | ^ this. |
14:51:57 | Araq | I completely agree with this approach |
14:53:37 | shashlick | > I'm actually not really concerned with things like preprocessor <= that's a big deal in my mind |
14:54:20 | shashlick | hope you read the preprocessing section |
15:00:05 | FromDiscord | <haxscramper> Maybe it is possible to integrate two approaches somehow? Since preprocessor is basically a separate language on top of C++ code it is better to talk about wrapping **preprocessor code** and wrapping **C++ code** as two separate targets. |
15:00:30 | FromDiscord | <Clyybber> what c2nim does is try to translate preprocessor macros into templates |
15:00:38 | FromDiscord | <Clyybber> and preprocessor constants into const |
15:01:00 | FromDiscord | <haxscramper> Valid preprocessor is not valid C++ and vice-versa |
15:01:08 | shashlick | even if u ignore templates, there's still #ifdef blocks which should either be translated into when statements or the resolved output used |
15:01:10 | disruptek | well, if we have typed ast, it becomes a "simple" question of transforms. |
15:01:33 | disruptek | haxscramper: what remains to be implemented? |
15:01:35 | FromDiscord | <Clyybber> disruptek: The issue is that the preprocessor isn't typed at all |
15:01:49 | * | Kaivo quit (Ping timeout: 256 seconds) |
15:01:54 | FromDiscord | <Clyybber> not even untyped |
15:01:56 | disruptek | i know, but i don't write C macros in nim. |
15:02:30 | FromDiscord | <Clyybber> shashlick: They should be translated into when of course |
15:02:49 | FromDiscord | <Clyybber> if hax wants to go the c2nim way |
15:02:49 | disruptek | that's a whooooole 'nother ball of wax. |
15:02:59 | FromDiscord | <haxscramper> If you want to put up with raw c wrappers + some convinience sugar on top everything is already done: https://haxscramper.github.io/hcparse-doc/src/hcparse/libclang_raw/raw_user.html (sugar) and https://haxscramper.github.io/hcparse-doc/src/hcparse/libclang_raw/index.html (raw bindings) |
15:03:21 | disruptek | how do you handle preprocessing now? |
15:03:49 | FromDiscord | <haxscramper> As regular C++ compilation. It is handled internally by libclang |
15:04:12 | * | Kaivo joined #nim |
15:04:21 | FromDiscord | <haxscramper> I put in C++ file + all compilation flags (if any) and get translation unit ast with everything expanded/type resolved whenewher possible |
15:04:25 | FromDiscord | <Pixeye> guys how you manage info visibility in Nim? It's pretty easy with C# with protected/internal stuff to hide guts of library from end user. But what are the options in nim ? |
15:04:36 | Yardanico | you can have private/public fields |
15:04:40 | disruptek | okay, so you currently use the same approach as nimterop. |
15:04:55 | Yardanico | you can have internal and "external" modules and only export the "external" ones |
15:04:58 | Yardanico | from your main module file |
15:04:58 | * | bung quit (Read error: Connection reset by peer) |
15:05:17 | leorize[m] | @Pixeye things in Nim are hidden unless you export them |
15:05:20 | FromDiscord | <haxscramper> The main issue with C++ preprocessor that I see is actually porting libraries that have different API based on defines. |
15:05:44 | * | bung joined #nim |
15:05:54 | disruptek | preprocessor is known to be a huge pita, of course. |
15:05:56 | FromDiscord | <haxscramper> But I think I need to cross this bridge when I come to it instead of trying to do everything at once. |
15:06:21 | disruptek | the nimterop approach is not popular with araq but it does work. |
15:07:01 | FromDiscord | <Pixeye> leorize[Matrix] , I understand this. I've already wrote pretty stuff in nim. I ask about how people handle large scoped projects in nim where there a lot of stuff in one module that is mixed of public/private stuff |
15:07:14 | FromDiscord | <Clyybber> the nimterop approach is guaranteed to work, so thats a plus |
15:07:19 | FromDiscord | <haxscramper> Working with C++ is like eating cardboard anyway - with or without preprocessor. |
15:07:28 | FromDiscord | <Clyybber> the c2nim approach will produce nicer wrappers, but might not work for everything |
15:08:16 | FromDiscord | <haxscramper> But when I started wrapping libclang I used `c2nim` - after tenth 'expected ) but found )' I decided it is easier to write C++ to wrap libclang in nim. |
15:09:04 | FromDiscord | <haxscramper> Right now this package actually looks like matryoshka doll - I used C++ to generate raw bindings, then I use them to generate usable bindings for nim. |
15:09:17 | leorize[m] | I take it that you didn't use c2nim `#def` and `#pp` to selectively expand macros? |
15:09:19 | disruptek | hey, it works. |
15:09:21 | FromDiscord | <dom96> I love shashlick so it pains me to say this, but I strongly oppose nimterop |
15:09:30 | * | endragor joined #nim |
15:09:36 | FromDiscord | <haxscramper> When you use `c2nim` you are expected to manually tweak things. |
15:10:10 | disruptek | what you guys overlook about nimterop is that you expect to be able to cross-compile and your wrappers won't work in that scenario. |
15:11:00 | disruptek | i've had plenty of grief from nimterop, but it /works/ and it frees me from having to think about wrapping. |
15:11:41 | FromDiscord | <haxscramper> Yes, but that's not actually C++ as I already said. In order for this to work you actually need to port *preprocessor*, not C++ |
15:12:00 | disruptek | we agree. |
15:12:10 | disruptek | but it's not done yet. |
15:12:11 | ForumUpdaterBot | New thread by Araq: Blog post about strict funcs, see https://forum.nim-lang.org/t/6733 |
15:12:31 | disruptek | this sounds like a really good step forward, though. |
15:12:38 | Yardanico | btw, seems like after the forum update my forum update bot has been working without issues |
15:12:43 | Yardanico | before it stopped updating after ~2 days |
15:13:28 | FromDiscord | <haxscramper> When I do manageable libclang I will look into merging it with nimterop somehow. |
15:14:54 | * | endragor quit (Ping timeout: 260 seconds) |
15:16:45 | FromDiscord | <haxscramper> Libtooling partially exposes information about macro expansions - https://clang.llvm.org/doxygen/group__CINDEX__LOCATIONS.html which might be used too. |
15:17:57 | FromDiscord | <Clyybber> Yardanico: Huh, I wonder what caused it |
15:18:09 | Yardanico | well if it stops again, then it's a failure in my bot :) |
15:18:14 | FromDiscord | <dom96> I would say that you can get a 90% accurate without caring about macro expansions |
15:18:22 | FromDiscord | <dom96> and for 99.9% of use cases 90% is good enough |
15:18:50 | disruptek | haxscramper: maybe the best solution is to come up with a directory structure for generated wrappers and plan for a platform-agnostic subdirectory that you can check for. this would let you add x-platform support later. |
15:19:41 | FromDiscord | <dom96> as for libclang, before you get an AST out of it, the C/C++ code passes through the preprocessor, so retrieving the preprocessor data is not trivial |
15:20:13 | disruptek | it is known. |
15:20:19 | FromDiscord | <haxscramper> I'm actually more interested in wrapping template C++ code into nim |
15:20:49 | leorize[m] | libclang can keep preprocessor macros in the ast |
15:21:15 | disruptek | holy shit, really? |
15:21:19 | FromDiscord | <dom96> How? |
15:21:20 | FromDiscord | <haxscramper> It can? |
15:21:38 | FromDiscord | <haxscramper> It has expansion extents, yes |
15:22:03 | FromDiscord | <haxscramper> Ah, no, not this one |
15:22:08 | FromDiscord | <Clyybber> wonder how that looks for duffs device |
15:22:50 | FromDiscord | <Clyybber> macros |
15:23:06 | FromDiscord | <Clyybber> or similar macros that rely on the textual representation |
15:23:11 | disruptek | show us show us show us |
15:23:13 | disruptek | leorize |
15:23:40 | FromDiscord | <haxscramper> I don't think keeping macros as part of ast is even possible in theory. You can get some kind of mirrored ast where c++ corresponds to macros. |
15:23:59 | disruptek | that's okay; the syntax isn't the important part. |
15:25:35 | FromGitter | <alehander92> well why not |
15:25:40 | FromGitter | <alehander92> overally keeping expanded forms |
15:25:48 | FromGitter | <alehander92> seem useful for debugging as well |
15:26:13 | FromGitter | <alehander92> we had a thing which mapped nim expansions to lines of code etc for that |
15:27:21 | FromDiscord | <haxscramper> Found this one: http://clang.llvm.org/doxygen/classclang_1_1PPCallbacks.html - it is in libtooling, so no available now |
15:27:45 | disruptek | that would work, definitely. |
15:28:43 | FromDiscord | <dom96> nice, that could work |
15:30:59 | * | synshroud quit (Quit: ZNC 1.7.5 - https://znc.in) |
15:31:18 | * | synshroud joined #nim |
15:32:03 | disruptek | someone else had a problem where they had to define `<=`() and i'd like to hear about it. i had the same problem. |
15:32:19 | disruptek | it's exactly as insane as it sounds. |
15:37:15 | FromDiscord | <Clyybber> what do you mean? |
15:37:33 | FromDiscord | <Clyybber> also staticboundsChecks or staticBoundsChecks? |
15:37:45 | disruptek | no. |
15:37:47 | FromDiscord | <Clyybber> (edit) 'staticboundsChecks' => 'staticboundChecks' |
15:37:52 | * | narimiran quit (Ping timeout: 256 seconds) |
15:37:53 | FromDiscord | <Clyybber> (edit) 'staticBoundsChecks?' => 'staticBoundChecks?' |
15:38:07 | disruptek | <= was false when < or == was true. or vice-versa. |
15:38:19 | FromDiscord | <Clyybber> in Nim? |
15:38:22 | disruptek | yeah. |
15:38:27 | FromDiscord | <Clyybber> for ints? |
15:38:42 | disruptek | well, skiplists. i have a custom comparator. |
15:38:48 | disruptek | but, yes, ints. |
15:38:53 | FromDiscord | <Clyybber> well, then you implemented it wrong |
15:39:05 | disruptek | i didn't implement it at all. |
15:39:07 | disruptek | that's the point. |
15:39:18 | FromDiscord | <Clyybber> do you have something to reproduce? |
15:39:31 | disruptek | of course. |
15:40:45 | FromDiscord | <Clyybber> (tell me staticboundChecks or staticBoundChecks?) |
15:40:57 | disruptek | still no. |
15:41:13 | FromDiscord | <Clyybber> I can't win with you |
15:41:22 | disruptek | what? |
15:41:38 | disruptek | you want me to try enabling that? |
15:41:52 | FromDiscord | <Clyybber> no, tell me which capitalization is better |
15:42:00 | disruptek | staticBound |
15:42:02 | disruptek | obvs |
15:42:16 | * | kinkinkijkin quit (Quit: Leaving) |
15:42:43 | disruptek | it should actually be staticBoundsChecks because bounds are plural. |
15:43:40 | FromDiscord | <Clyybber> yeah but thats a breakign change :) |
15:43:48 | disruptek | not my problem. |
15:44:17 | FromDiscord | <Clyybber> but mine |
15:44:23 | disruptek | indeed. |
15:44:46 | disruptek | dude, it's embarassing how much time i spent on this <= thing. |
15:45:02 | bung | https://github.com/bung87/amysql finally I make all CI passed |
15:45:16 | disruptek | i mean, yesterday was a complete loss because i didn't have any coffee. but, even so, i was losing my fucking mind here. |
15:45:24 | FromDiscord | <Clyybber> disruptek: show me le repro |
15:45:48 | disruptek | i will; it's not in a good state atm. |
15:46:34 | shashlick | disruptek: not sure I got your feedback on nimterop - what's to oppose |
15:46:45 | FromDiscord | <Clyybber> weird, my commit is not appearing on github |
15:46:48 | disruptek | i don't oppose nimterop. |
15:47:08 | Yardanico | shashlick: you probably wanted to ping @dom96 instead? |
15:47:20 | shashlick | The reason I didn't use clang is because it's too fat to get into every user's machine |
15:47:31 | shashlick | And they already have another compiler they want to use |
15:47:39 | disruptek | damn users. |
15:47:45 | shashlick | Whose define values will not be the same |
15:47:54 | * | elijahr joined #nim |
15:48:22 | shashlick | But that's because wrapping preprocessed headers makes the wrapper config specific |
15:49:19 | * | clyybber joined #nim |
15:49:36 | clyybber | hmm, apparently correcting your clock by 4 hours while firefox is running really throws it off |
15:50:28 | shashlick | So if you want to sign onto converting ifdefs to when's and somehow handle all config specific defines typically discovered by cmake and the like, it will produce a better wrapper for sure |
15:50:50 | shashlick | Ah it is dom96 okay, np |
15:51:14 | disruptek | shashlick: 😘 |
15:51:21 | * | endragor joined #nim |
15:51:32 | * | clyybber quit (Client Quit) |
15:51:58 | disruptek | i like being a user of nimterop. it's a little too ambitious a project for my little brain. |
15:52:07 | FromDiscord | <Clyybber> great, looks like I triggered a github bug |
15:52:34 | FromDiscord | <Clyybber> commit appears here: https://github.com/Clyybber/Nim/tree/palexontology, but not here: https://github.com/nim-lang/Nim/pull/14777 |
15:52:35 | disbot | ➥ Cleanup |
15:53:56 | shashlick | I appreciate the pushback on nimterop but the alternative is manual and doesn't scale |
15:53:59 | Yardanico | https://github.com/nim-lang/Nim/pull/14777/commits/0b941d3afcc1ff48486813221753fa1d95b7b920 |
15:54:00 | disbot | ➥ Cleanup |
15:54:03 | Yardanico | hm |
15:54:09 | Araq | don't wrap "preprocessed" headers |
15:54:10 | Yardanico | " This commit does not belong to any branch on this repository." |
15:54:45 | Araq | shashlick: I appreciate all the hard work you're doing but that's your mistake in 2 words, "doesn't scale" |
15:55:02 | * | bung quit (Ping timeout: 260 seconds) |
15:56:38 | shashlick | anyway, the goal is to just share my opinion and i've written it in the readme, if there's a better way to solve this, i'm happy to archive toast |
15:56:39 | Araq | it does scale well enough for Python, Ruby, PHP, Lua, C#, ... |
15:57:34 | disruptek | hooray for bikeshedding software that doesn't exist! |
15:57:34 | Araq | and if we want to be better than the competition I would focus on C++ interop, think of TensorFlow, Qt and Godot |
15:57:42 | leorize[m] | nimterop framework for building library inline with the nim source is pretty useful on its own |
15:58:00 | FromDiscord | <Clyybber> Yardanico: Huh, it appears in front of all the other commits |
15:58:05 | Yardanico | lol |
15:58:06 | FromDiscord | <Clyybber> even though its the last one |
15:58:10 | disruptek | it doesn't matter how flawed the approach is; the output is superior to any currently available alternative. |
15:58:26 | FromDiscord | <Recruit_main707> what araq says makes sense, but i still think we would need the ability to override c++ methods |
15:58:27 | disruptek | Araq: talk is cheap. fix c2nim if it's so superior. |
15:58:43 | FromDiscord | <haxscramper> By the way - I'm right now I'm nostly focues on writing **library**, not a tool for wrapping. |
15:58:51 | Araq | I don't have to. already c2nim supports C++ and nimterop doesn't. |
15:59:05 | FromDiscord | <haxscramper> Of course it can be used like this, but it is possible to make nimterop use it |
15:59:07 | FromDiscord | <mratsim> Someone help me automate that: https://github.com/SciNim/minitorch/issues/1 |
15:59:08 | disruptek | ah, so qt and godot and tensorflow are already wrappable. |
15:59:08 | disbot | ➥ Wrapping |
15:59:09 | disruptek | i forgot. |
15:59:24 | FromDiscord | <mratsim> I can do that manually but upstream merges dozens of commits per day |
15:59:27 | disruptek | !repo nim-qt |
15:59:27 | disbot | https://github.com/filcuc/nimqml -- 9nimqml: 11Qt Qml bindings for the Nim programming language 15 71⭐ 9🍴 7& 1 more... |
15:59:37 | disruptek | where's the rest? |
15:59:42 | disruptek | !repo tensorflow |
15:59:43 | disbot | https://github.com/tensorflow/tensorflow -- 9tensorflow: 11An Open Source Machine Learning Framework for Everyone 15 147854⭐ 82529🍴 7& 29 more... |
15:59:51 | disruptek | hmm. |
15:59:52 | FromDiscord | <haxscramper> I would prefer to avoid makeing yet another 'nice tool' for wrapping C++. |
15:59:59 | leorize[m] | qt is wrappable, you just need to write a `moc` compiler for Nim :P |
16:00:12 | disruptek | so basically, it doesn't exist. |
16:00:19 | disruptek | hooray for bikeshedding software that doesn't exist! |
16:00:25 | FromDiscord | <haxscramper> Or generate C++ code to compile qt |
16:00:30 | * | disruptek 🎉 |
16:00:48 | leorize[m] | you still need to run moc on the generated C++ |
16:00:52 | leorize[m] | it's better to just do it using macros in Nim |
16:00:59 | FromDiscord | <haxscramper> Because qt is just preprocessor-troubles--x2-back-and-forth |
16:01:01 | Araq | disruptek: I can wrap it with c2nim, it's much work. I cannot wrap it at all with nimterop. |
16:01:03 | leorize[m] | crystal cracked the formula |
16:01:23 | Araq | but ok, enough of this |
16:01:27 | FromDiscord | <haxscramper> There is also https://woboq.com/blog/verdigris-qt-without-moc.html |
16:01:32 | disruptek | if the work doesn't get done then it really doesn't matter how hard it is; the result is the same. |
16:01:47 | disruptek | i cannot be bothered to use c2nim to wrap libgit2, but luckily, i don't have to: i have nimterop. |
16:02:24 | FromDiscord | <haxscramper> It requires better handing of macros as opposed to wrapping qt directly (which requires implementing qt moc) |
16:02:49 | * | kenran quit (Ping timeout: 258 seconds) |
16:03:15 | leorize[m] | https://github.com/Papierkorb/bindgen <- this is crystal solution built on libclang, which you might find interesting haxscramper |
16:03:48 | FromDiscord | <mratsim> Btw, Nim is copying exported const arrays in all C files? |
16:04:16 | leorize[m] | no, it generates external symbols that's referenced |
16:04:23 | FromDiscord | <mratsim> if I have const foo = [1, 2, 3, ..., 48] |
16:04:36 | shashlick | there's already a tensorflow c api that's wrapped - https://gist.github.com/genotrance/9214b1c1762c1fc85e62bac1de67725f |
16:06:37 | shashlick | Araq - it's either nimterop or nimble, i only have one brain |
16:07:08 | FromDiscord | <mratsim> @leorize: https://media.discordapp.net/attachments/371759389889003532/748574325942255667/unknown.png |
16:07:22 | Araq | shashlick: well then "nimterop" doesn't scale. |
16:07:42 | shashlick | indeed |
16:08:23 | FromDiscord | <Clyybber> shashlick: How do I handle an error with the download thing? |
16:08:34 | shashlick | which download? |
16:08:41 | leorize[m] | @mratsim: that's weird then, the last time I tried to make those arrays `static` in the compiler I got all sorts of "symbol not found" error :P |
16:08:43 | FromDiscord | <Clyybber> your download header stuff |
16:08:47 | leorize[m] | I guess the compiler changed in the mean time |
16:09:02 | shashlick | what error are you seeing |
16:09:29 | FromDiscord | <Clyybber> shashlick: I'm not seeing any error, I mean what happens if a download ails |
16:09:38 | FromDiscord | <Clyybber> or if the download suceeds but the wrapping fails |
16:10:18 | FromDiscord | <Clyybber> Can I manually download that stuff too and put it in a dir? |
16:10:38 | shashlick | yes, nothing is required - you can call any of the implementation if you prefer |
16:10:48 | shashlick | you can download yourself, you can call c2nim also if preferred |
16:11:09 | leorize[m] | can I have some more opinions on #15212? |
16:11:10 | disbot | https://github.com/nim-lang/Nim/pull/15212 -- 3typetraits: implements `value in type` |
16:11:10 | FromDiscord | <Clyybber> why did you include that download thing into nimterop though? |
16:11:19 | leorize[m] | #15212 |
16:11:19 | disbot | https://github.com/nim-lang/Nim/pull/15212 -- 3typetraits: implements `value in type` |
16:11:33 | shashlick | cause the goal was to make interop easy which also includes obtaining the source/binaries |
16:11:37 | * | endragor quit (Ping timeout: 264 seconds) |
16:11:37 | leorize[m] | ah, it's matrix being laggy again... |
16:11:43 | shashlick | at least i included it in my charter |
16:11:55 | FromDiscord | <Clyybber> isn't it better handled in config.nims ? |
16:11:58 | shashlick | you could just as well use apt or any other way |
16:11:58 | FromDiscord | <Clyybber> or the .nimble ? |
16:12:20 | FromDiscord | <Clyybber> Yeah but the issue is, somebody uses that, I use their library. Now I have to have internet when I'm building |
16:12:39 | shashlick | getheader offers many options that are controlled by the end user |
16:13:00 | shashlick | the library author can offer multiple ways, including letting the user download themselves |
16:13:32 | FromDiscord | <Clyybber> hmm, ok |
16:14:03 | shashlick | like nimgit2, you can set -d:git2Std and just use the locally available libgit2 headers and binaries |
16:14:25 | shashlick | i've been lazy with nimarchive though - it only offers static linking - so depends on the library author |
16:17:55 | disruptek | leorize[m]: i don't get it. |
16:18:16 | disruptek | leorize[m]: `if m notin Month` ... how is this not solved with a slice? |
16:18:19 | FromDiscord | <Clyybber> leorize: Any reason why you are doing <= and >= instead of in A..B |
16:18:35 | FromDiscord | <Clyybber> disruptek: Think about enums with holes |
16:18:48 | disruptek | that's the only one i can come up with. |
16:19:03 | disruptek | why not create a better slice type that works with holy enums. |
16:19:20 | FromDiscord | <Clyybber> Thats not how holes work |
16:19:31 | FromDiscord | <Clyybber> Thats not how slices work |
16:19:33 | Araq | if m notin low(Month)..high(Month) |
16:19:47 | Araq | we need a shortcut for low(T)..high(T) IMHO |
16:19:48 | leorize[m] | @Clyybber: avoids an HSlice creation |
16:19:56 | Araq | but please not more conflations of types with values |
16:20:06 | disruptek | clyybber: that's my point. |
16:20:16 | disruptek | when i do this today, i have to literally iterate. |
16:20:20 | disruptek | cannot use succ, etc. |
16:20:21 | Araq | leorize[m]: the HSlice creation is free when you have a good optimizer |
16:20:23 | FromDiscord | <Clyybber> leorize: I see, super nitpicky, but can you do low <= v and v <= high instead of v => low and v <= high? |
16:20:33 | Araq | and if we haven't, we can special case it in the backend |
16:20:56 | disruptek | and seriously, why can't succ work? |
16:21:07 | FromDiscord | <Clyybber> Araq: We can already do array[SomeEnum, T], so thats a moot point |
16:21:28 | Araq | in fact, pushing the complexity to the backend side is almost always the best design |
16:21:31 | FromDiscord | <Clyybber> disruptek: I don't understand what this has to do with succ |
16:22:25 | disruptek | well, araq's solution doesn't work for holy enums. |
16:23:02 | FromDiscord | <Clyybber> thats what leorize's PR is about |
16:23:20 | disruptek | i know. my point is that holy enums are the only use-case i can think of. |
16:23:43 | disruptek | and i'd like succ to work as a side-effect of this effort. |
16:24:10 | FromDiscord | <haxscramper> In nim enum value can be anything of `string | <ordinal type> | tuple of (<ordinal type>, string) | nothing`, correct? |
16:24:18 | FromDiscord | <mratsim> holy enums? lol |
16:24:33 | disruptek | they are always ordinals. |
16:24:39 | disruptek | you can merely override the str repr. |
16:24:57 | leorize[m] | I do use it for range types too, although I don't mind changing that with a shortcut for `T.low..T.high` |
16:24:58 | FromDiscord | <mratsim> holy enums are not Ordinal |
16:25:04 | disruptek | when you do this while overriding the ordinal, the syntax is tuple-like. |
16:25:16 | Araq | I don't understand what array[SomeEnum, T] has to do with anything I said |
16:25:21 | FromDiscord | <haxscramper> Yes, I mean what can you put on the right side of `enum =` |
16:25:24 | leorize[m] | so `range(T)` that creates a slice of `T.low..T.high`? |
16:25:43 | Araq | yes. better name it fullRange(T) |
16:25:53 | disruptek | haxscramper: yes, your grammar is right. |
16:27:13 | leorize[m] | Araq: there's still the problem that you can only do `T in fullRange(T)` |
16:27:24 | Araq | huh? |
16:27:38 | Araq | my 'in' operator works with values |
16:27:46 | leorize[m] | or should that spit out `Slice[int|float]`? |
16:28:05 | * | bung joined #nim |
16:28:28 | leorize[m] | I mean the value for the `in` check must be already of type `T` |
16:28:47 | leorize[m] | by then you don't need to do the check anymore |
16:28:52 | Araq | proc fullRange(T: typedesc): Slice[T] = low(T)..high(T) |
16:29:04 | Araq | we have an overload for 'in' and Slice |
16:30:07 | FromDiscord | <Clyybber> Araq: My point is that an enum at its core is nothing more than the set of its valid entries (and maybe a relation). |
16:30:19 | FromDiscord | <Clyybber> But arguably then we can ask for 'a in uint8' too |
16:30:23 | leorize[m] | ah okay, what about enums with holes? |
16:30:32 | disruptek | this is my point. |
16:31:10 | * | casaca quit (Ping timeout: 246 seconds) |
16:32:37 | * | bung quit (Ping timeout: 264 seconds) |
16:32:58 | * | kinkinkijkin joined #nim |
16:34:04 | leorize[m] | should the macro for matching enum with holes be spun off into a different proc (`inEnum(T, value)`?) or be dropped? |
16:34:06 | FromDiscord | <Clyybber> small question: why do we have < <= and so on defined on booleans? |
16:34:45 | Araq | what about "enum with holes"? the PR adds an 'in' for typedesc. I want the typedesc->range conversion spelt out in an explicit operation like fullRange |
16:35:07 | disruptek | ah, good. |
16:35:27 | disruptek | so `in` is limited to valid values for the type, yes? |
16:35:40 | Araq | "enum with holes" are like "string", not an ordinal type, cannot construct a range of them because the range might have holes |
16:36:05 | Araq | now if you want to improve holy enums, we can talk about that but I think there is a connection |
16:36:16 | Araq | *I think there is no connection |
16:36:45 | * | kinkinkijkin quit (Remote host closed the connection) |
16:36:56 | disruptek | i think they should be better supported or unsupported. |
16:37:10 | * | kinkinkijkin joined #nim |
16:37:17 | Araq | I fixed the known bugs with them |
16:37:18 | disruptek | they compose so nicely that i would prefer they were supported. |
16:37:24 | FromDiscord | <Clyybber> How about a macro which you give a enum |
16:37:26 | disruptek | succ() doesn't work afaik. |
16:37:35 | FromDiscord | <Clyybber> and they give you back a set with all the values of the enum |
16:37:52 | disruptek | that's what i use these days. |
16:37:57 | Araq | disruptek: yes indeed. I don't mind that |
16:38:07 | disruptek | you don't? |
16:38:09 | FromDiscord | <Clyybber> although it wont work for enums too big for a set |
16:38:37 | FromDiscord | <Clyybber> Should we remove the `<` `<=` overloads for bool? |
16:38:58 | disruptek | seems useful for sorting. |
16:39:07 | Araq | meh, false < true |
16:39:31 | FromDiscord | <--HA--> sent a code paste, see https://play.nim-lang.org/#ix=2vpu |
16:39:56 | Araq | I took it from Delphi and had code like for a in false..true: for b in false..true: ... for doing naive satisfiability checks |
16:40:29 | disruptek | that's kinda cute. |
16:40:56 | disruptek | what's the rational for succ not working, though? |
16:40:59 | disruptek | i don't see it. |
16:41:18 | Araq | disruptek: its implementation is more complex than 'x + 1' |
16:41:31 | Araq | and so far nobody could be bothered to support it |
16:41:35 | disruptek | maybe, but that doesn't strike me as a good excuse. |
16:41:41 | disruptek | i would rather error. |
16:41:45 | * | kinkinkijkin quit (Remote host closed the connection) |
16:41:47 | Araq | it does error |
16:42:00 | Araq | (I hope! tried to fix all these bugs...) |
16:42:21 | * | kinkinkijkin joined #nim |
16:42:21 | disruptek | i doubt it, but someone with fast fingers will let us know. |
16:42:50 | Araq | it used to compile |
16:43:08 | FromDiscord | <Clyybber> IMO it still makes sense to remove holy enums |
16:43:23 | FromDiscord | <Clyybber> and replace them with a distinct ints |
16:44:01 | FromDiscord | <Clyybber> Since those are more flexible anyways |
16:44:12 | FromDiscord | <Clyybber> and enums with holes most often come up in wrappers |
16:44:32 | FromDiscord | <Clyybber> and then we still have to retain the order when declaring, and can't have duplicates |
16:44:34 | leorize[m] | @--HA-- use `macros.getImpl` to get the symbol definition |
16:45:01 | Araq | Clyybber: too late, would break too much infrastructure code |
16:45:01 | disruptek | i don't see how a distinct int achieves the goal. |
16:45:26 | leorize[m] | there's no way to guarantee that the values will be available at compile time, so you're on your own on that |
16:46:58 | Araq | I agree that 'distinct int' is better but that ship is sailed and I'd rather spend the effort on unifying iterator+proc scopes, for example |
16:47:25 | disruptek | okay, succ does fail. it's sad but it's correct. |
16:47:53 | FromDiscord | <Clyybber> Araq: Fair |
16:48:03 | FromDiscord | <Clyybber> disruptek: Oh btw, the typed fix is merged |
16:48:09 | leorize[m] | Araq: what do you think about having `rangeof(T)` over `fullRange(T)`? |
16:48:26 | disruptek | i like that. |
16:48:33 | disruptek | clyybber: today or yesterday? |
16:49:03 | FromDiscord | <Clyybber> today |
16:49:10 | disruptek | nice, thank you dude. |
16:49:27 | disruptek | what did you end up doing with the shadow scopes? |
16:49:41 | * | tane joined #nim |
16:49:54 | disruptek | read: are you in favor of nkScope? |
16:50:05 | FromDiscord | <Clyybber> Not really |
16:50:08 | FromDiscord | <Clyybber> since it can't work here |
16:50:25 | disruptek | maybe not here, no. |
16:50:28 | FromDiscord | <Clyybber> You can't know in advance if you need or don't need a scope there |
16:50:37 | FromDiscord | <Clyybber> so you have to put in this shadowscope |
16:51:30 | FromDiscord | <Clyybber> nkScope seems like unneccessary nesting to me |
16:52:01 | FromDiscord | <Clyybber> but maybe the actual idea is not what I'm thinking of rn |
16:52:05 | FromDiscord | <--HA--> Thanks leorize! |
16:52:23 | disruptek | the only way it's unnecessary is if there is provably no other scenario where you want a new scope. |
16:52:26 | * | jacereda joined #nim |
16:52:35 | disruptek | to me that just sounds like gratuitous limitation. |
16:53:06 | disruptek | i would rather query scope than have to know the language semantics for wherever i am... |
16:53:46 | jacereda | hi... how can I see the commands invoked by `nimble build`? both nim and compiler/linker invocations... |
16:54:34 | Zevv | oy clyybber, you got it merged, sweet stuff |
16:54:49 | Zevv | thanks for all the effort you put in there dude |
16:55:25 | FromDiscord | <Clyybber> np :) |
16:55:28 | Zevv | i was thinking, if we can get our hands on a starwars transporter and slightly modify it so it does not kill the original |
16:55:58 | Zevv | /startrek/ |
16:56:12 | Zevv | ooh that's one *serious* mistake i made there |
16:56:55 | leorize[m] | @jacereda I think --verbose and/or --debug should work |
16:57:37 | FromDiscord | <dom96> Zevv: get out |
16:57:42 | * | Zevv quit (Quit: leaving) |
16:57:46 | jacereda | leorize[m]: it just says something like `CC: parser_cpp`, I'd like to get the full compiler invocation |
16:57:47 | jacereda | |
16:58:08 | Araq | jacereda: --listcmd |
16:58:15 | jacereda | Araq: great, thanks! |
16:58:47 | Araq | dom96: er... what did happen here? |
16:59:07 | * | superbia1 joined #nim |
16:59:15 | leorize[m] | dom96 lol he quit for real |
16:59:43 | FromDiscord | <dom96> lol he'll be back |
17:00:22 | * | a_chou joined #nim |
17:00:42 | * | a_chou quit (Client Quit) |
17:01:11 | * | a_chou joined #nim |
17:01:23 | * | superbia quit (Ping timeout: 256 seconds) |
17:01:48 | * | endragor joined #nim |
17:02:38 | * | shabby joined #nim |
17:03:16 | * | shabby is now known as shaggy |
17:05:56 | leorize[m] | can we have a `Documentation` category in the forum please :) I would like to start some discussions relating to the front page and such, and a category would be useful to keep the topic floating around. |
17:06:03 | * | shaggy quit (Client Quit) |
17:06:14 | * | Zevv joined #nim |
17:06:52 | * | a_chou quit (Quit: a_chou) |
17:07:52 | * | endragor quit (Ping timeout: 265 seconds) |
17:12:54 | FromGitter | <jorjun_twitter> do I need a make file for a nim project with several dependent sources? |
17:13:09 | FromDiscord | <dom96> leorize: suggest a description and a colour and I may add it 🙂 |
17:13:34 | FromDiscord | <dom96> perhaps it shouldn't be `Documentation` but maybe we can make it even more generic: `meta` |
17:13:49 | FromDiscord | <dom96> for all discussions about the nim website, the nim forum, docs, etc. |
17:14:25 | disruptek | jorjun_twitter: no. |
17:17:45 | leorize[m] | Araq: opened #15232 |
17:17:46 | disbot | https://github.com/nim-lang/Nim/pull/15232 -- 3typetraits: add rangeof(T), a shortcut for low(T)..high(T) |
17:18:00 | FromGitter | <jorjun_twitter> @disruptek If I compile A which imports B . Change B, but re-compile A. Nim compiler will re-compile B automagically? |
17:18:13 | Yardanico | of course |
17:18:25 | Yardanico | nim compiles all nim libraries into a single binary |
17:18:51 | disruptek | what yardanico is trying to say is, yes. |
17:18:58 | Yardanico | if you use nimble packages, you would want to use "nimble develop" though |
17:19:17 | leorize[m] | @dom96 I think documentation is important enough that it warrants its own category |
17:20:20 | leorize[m] | "Meta" can be the category to talk about the Nim website and the forum |
17:21:08 | jacereda | if I import a module that has a .passC pragma it seems to be propagated to my module... is that the expected behaviour? |
17:21:31 | leorize[m] | too bad we don't have support for stickies :P |
17:21:40 | leorize[m] | can be useful to pin something to tell people to go to github if they want to report bugs |
17:21:59 | FromDiscord | <dom96> What do others think? |
17:22:08 | FromGitter | <jorjun_twitter> Alright.. my next problem .. so far learning nim has been a descent deeper and darker into the machine… how could it be that libpng.dylib loads ok with "nim c" but not "nim c —r" and also not under a debugger? Starting to think, that like Python dev, you can’t get far without being very adept with debugger… can’t wait to step thru code |
17:22:14 | FromDiscord | <dom96> Implement stickies then 😉 |
17:22:41 | disruptek | i think docs needs its own category. |
17:22:54 | disruptek | it will help people take ownership. |
17:22:55 | FromDiscord | <dom96> The compiler doesn't load libpng.dylib, so unless you run the binary with `-r` it won't actually try to load it |
17:24:38 | FromGitter | <jorjun_twitter> aaha. Thanks @dom96 . Is there something else I need to do after "brew install libpng" for it to be dynamically loaded reliably? |
17:25:55 | FromGitter | <jorjun_twitter> thinking if this works: "pkg-config --libs libpng” , should be OK .. |
17:26:02 | FromDiscord | <dom96> good question, dynamic loading of libraries is a pain in the ass on every OS |
17:26:16 | FromDiscord | <dom96> you need to make sure that brew installed it somewhere that macOS will look for it |
17:26:52 | FromDiscord | <dom96> The way to force macOS is to use `DYLD_LIBRARY_PATH` |
17:27:07 | FromDiscord | <dom96> DYLD_LIBRARY_PATH=/path/where/dylib/is ./yourExecutable |
17:27:25 | FromDiscord | <dom96> Run the executable directly as Nim might not pass the env var correctly |
17:27:41 | leorize[m] | I'd say dynamic loading of libraries is really simple in C land |
17:28:25 | leorize[m] | you just add a requires to your builder (`cmake`, `autohell`, `meson`) and bam it just works |
17:28:54 | leorize[m] | if the library is missing it will even print friendly messages on what you don't have and how to install it |
17:29:08 | leorize[m] | at least on *nix |
17:30:23 | ForumUpdaterBot | New thread by Gabbhack: Problem with template and async, see https://forum.nim-lang.org/t/6734 |
17:32:05 | FromDiscord | <--HA--> leorize, with your advice I got the first version working but when the macro is called from a proc it is always `NilLit`. Do you have an idea? The commented code is the one I'm trying to get to work.↵https://play.nim-lang.org/#ix=2vpM |
17:32:53 | Yardanico | wait, why are you using a macro here |
17:34:38 | FromDiscord | <--HA--> I wan't to be able to define a tuple with the field names coming from an array of strings |
17:37:19 | leorize[m] | it won't work with a proc because `proc` is a runtime thing |
17:38:39 | leorize[m] | use `template` instead if you want compile-time reflection |
17:40:25 | * | ofelas quit (Ping timeout: 240 seconds) |
17:42:12 | FromDiscord | <--HA--> Nice! Thanks again leorize. |
17:44:30 | leorize[m] | @dom96 "Documentations: Discussions relating to [Nim's documentation](https://nim-lang.org/documentation.html): API docs, the Manual, code examples, etc." |
17:44:44 | leorize[m] | as for colors: use light blue/green |
17:46:34 | leorize[m] | "Meta: For everything related to the Nim website, the forum, the playground and the various chatrooms" |
17:47:12 | leorize[m] | use brown or gray for that category |
17:47:40 | leorize[m] | oh, maybe add some bits about learning materials to "Documentations" description |
17:58:23 | jacereda | Shouldn't {.localPassc ...} affect all the {.compile ...} modules? It seems it only affects the module generated by the .nim file |
17:58:26 | ForumUpdaterBot | New thread by Kiakra: How to import a struct (constant)field from C, see https://forum.nim-lang.org/t/6735 |
17:59:20 | * | kenran joined #nim |
18:00:26 | jacereda | I must be missing something, .passC is propagated to other modules, .localPassc doesn't affect the .cpp/.c modules included in this nim... either .localPassc should be modified or there should be a .foreignPassc to set options for .compile modules |
18:04:20 | * | kenran quit (Ping timeout: 258 seconds) |
18:05:04 | FromDiscord | <Clyybber> I think its intended to be this way |
18:05:16 | FromDiscord | <Clyybber> maybe .compile should get extra args |
18:06:06 | * | bung joined #nim |
18:06:56 | jacereda | so, you can't .compile a .c with, say, '-std=c11' and a .cpp without that flag right now? |
18:09:24 | jacereda | and isn't .passC very dangerous? if I import an external module using .passC will it mess my flags? or is it affecting only at project boundaries? |
18:10:18 | FromDiscord | <Clyybber> AFAIK it affects everything |
18:10:51 | * | bung quit (Ping timeout: 258 seconds) |
18:13:00 | jacereda | hmmm... that wouldn't be coherent, since a project built using -passC wouldn't propagate flags but a project using .passC would |
18:13:29 | * | bung joined #nim |
18:13:38 | * | synshroud_ joined #nim |
18:14:26 | FromDiscord | <Clyybber> I think a project build using -passC would too |
18:14:26 | * | kungtotte quit (Read error: Connection reset by peer) |
18:14:34 | * | synshroud quit (Ping timeout: 265 seconds) |
18:17:20 | jacereda | Araq: could you shed some light? I'm willing to work on this issue if needed, do you want me to open a ticket? |
18:18:14 | * | bung quit (Ping timeout: 256 seconds) |
18:18:16 | * | kungtotte joined #nim |
18:19:52 | FromDiscord | <mratsim> use localPassC if you want flags that apply to single files |
18:20:45 | jacereda | mratsim: but I want flags that affect {.compile .} files, not the module generated by the current .nim file |
18:21:40 | FromDiscord | <mratsim> you might be able to hack something with nim.cfg |
18:22:38 | shashlick | request folks interested in nimble to read https://github.com/c-blake/hldiff/issues/1 |
18:22:39 | disbot | ➥ Add `installExt` to `hldiff.nimble` |
18:23:38 | FromDiscord | <mratsim> If you create a nim.cfg and put the name of your C files in there with custom flags it might work, like here: https://github.com/numforge/laser/commit/7b9fd9b32283fa13680ac5f7223fa31283c0d3a4#diff-8294857335429e5df0d207389e22a1d8 |
18:24:28 | FromDiscord | <Clyybber> shashlick: WDYT about removing that structure requirement? |
18:24:37 | * | bung joined #nim |
18:25:56 | jacereda | mratsim: that could work for my current use case, thanks |
18:26:28 | * | superbia1 is now known as superbia |
18:27:17 | * | casaca joined #nim |
18:28:55 | * | bung quit (Ping timeout: 240 seconds) |
18:35:31 | * | bung joined #nim |
18:39:59 | * | bung quit (Ping timeout: 258 seconds) |
18:41:57 | * | arecacea1 quit (Remote host closed the connection) |
18:42:16 | * | bung joined #nim |
18:42:16 | * | arecacea1 joined #nim |
18:45:20 | FromDiscord | <Clyybber> Araq: I've reverted the enum changes in #14777 |
18:45:21 | disbot | https://github.com/nim-lang/Nim/pull/14777 -- 3Cleanup |
18:45:49 | FromDiscord | <Clyybber> I think we need definite assignment analysis only for returning lent/var |
18:48:11 | kinkinkijkin | i found out why my obj loader wasn't working |
18:48:43 | kinkinkijkin | turns out the bug i was talking about was fixed with non-explicit memory management, i just accidentally used readLines instead of lines in one spot |
18:50:43 | * | bung quit (Ping timeout: 258 seconds) |
18:52:03 | * | arecacea1 quit (Remote host closed the connection) |
18:52:35 | * | arecacea1 joined #nim |
18:54:56 | * | bung joined #nim |
18:56:51 | FromDiscord | <Kaynato> Does there exist a neat method of getting the bound type of a generic type without touching macros? |
18:57:05 | leorize[m] | @Clyybber I think currently it already does and will yield a warning |
18:57:41 | leorize[m] | @Kaynato typetraits.genericParams |
18:57:49 | FromDiscord | <Kaynato> Thanks! |
18:59:04 | leorize[m] | @Clyybber if not then probably we just need to enable it? ProveInit analysis has been improved a lot thanks to zah efforts iirc |
18:59:44 | leorize[m] | (ps. please let me have `{.requiresInit.}` attachable to a proc while you're at it) |
19:01:27 | * | bung quit (Ping timeout: 265 seconds) |
19:07:08 | * | bung joined #nim |
19:09:42 | * | qwertfisch joined #nim |
19:13:38 | shashlick | @Clyybber which specific one |
19:14:01 | FromDiscord | <Clyybber> the package structure restriction |
19:15:28 | * | bung quit (Ping timeout: 265 seconds) |
19:18:16 | * | bung joined #nim |
19:26:45 | * | bung quit (Ping timeout: 258 seconds) |
19:31:50 | * | bung joined #nim |
19:36:59 | bung | what's the recommanded struct when implement custom type's `$` |
19:37:16 | shashlick | that's what we are discussing to improve - goal is to just git clone and leave it that way |
19:37:35 | FromDiscord | <Kaynato> wrt. macros, is there a prohibition between mixing undeclared symbols (e.g. for injecting) and declared ones? I'm getting a strange situation where it's ok to have something like `myMacro(unknown1, [known1, known2])` or `myMacro(unknown1, known1)`, but `myMacro(unknown1, known1, known2...)` is prohibited |
19:37:53 | shashlick | there's still a warning if package exports a module that don't match the package name |
19:38:26 | shashlick | • `pname-0.1.0/pname.nim` = OK, `pname-0.1.0/mname.nim` != OKAY |
19:38:38 | shashlick | but that's about it |
19:39:09 | Zevv | kaynato: please be more specific about your error messages |
19:39:30 | * | Vladar quit (Quit: Leaving) |
19:39:41 | FromDiscord | <Kaynato> Just "undeclared identifier: 'unknown1'" and such. |
19:39:52 | Zevv | are your macros typed or untyped? |
19:40:04 | Zevv | you probably want untyped in this case for your argument |
19:40:04 | Zevv | s |
19:40:26 | FromDiscord | <Kaynato> All args are untyped. Would it be that introducing more than one naked typed argument into the untyped macro still makes it treated as typed...? |
19:40:43 | FromDiscord | <Kaynato> The macro itself is `macro withGenericParams*(genericType, unloadAs, body: untyped): untyped` |
19:41:41 | Zevv | try to minimize to a small snippet that shows the behaviour, if you share that here its pretty likely that people will take a look for you |
19:41:55 | FromDiscord | <mratsim> "undeclared identifier: foo" is unfortunately a catchall error message with macros |
19:42:04 | Zevv | exactly |
19:42:07 | Zevv | its a pita |
19:42:15 | Zevv | can't we just deprecate macros |
19:42:46 | * | narimiran joined #nim |
19:42:59 | FromDiscord | <mratsim> when something is wrong and the generated code does not resolve, it just tells you that the identifier doesn't exist (because it was not transformed or created correctly by the macro) |
19:43:14 | FromDiscord | <mratsim> (and so Nim doesn't know what to do with it I guess) |
19:43:55 | FromDiscord | <Kaynato> It... went away and I have no idea what caused it. I lost the undo buffer. |
19:45:48 | FromDiscord | <Kaynato> Fortunately the underlying problem (which was held up by that issue) is still unsolved. I'm trying to get the generic params in a macro, and can't figure out a way to get the macro to pass the typedesc into the helper function (even with passing it as `typed` into the macro, it says it's just another NimNode) |
19:45:52 | FromDiscord | <Yardanico> Apparently Rust people have their own compile the execution with an interpreter |
19:46:06 | FromDiscord | <Yardanico> time* |
19:47:22 | FromDiscord | <Yardanico> https://github.com/rust-lang/rust/pull/72437/ |
19:47:23 | disbot | ➥ Stabilize `#![feature(const_if_match)]` and `#![feature(const_loop)]` |
19:49:29 | FromDiscord | <Yardanico> But it seems to be much more limited than in Nim |
19:51:34 | FromDiscord | <Kaynato> https://play.nim-lang.org/#ix=2vqE causes internal error |
19:52:32 | FromDiscord | <Kaynato> Oh wait, missing a proc, one second >>; |
19:52:50 | FromDiscord | <Kaynato> Ok, here we go: https://play.nim-lang.org/#ix=2vqF |
19:54:04 | * | PMunch joined #nim |
20:00:13 | * | kenran joined #nim |
20:05:05 | * | kenran quit (Ping timeout: 240 seconds) |
20:08:03 | FromDiscord | <Kaynato> Does anyone else have memory leak issues with nimsuggest in vscode? https://media.discordapp.net/attachments/371759389889003532/748634953419325450/unknown.png |
20:08:22 | FromDiscord | <lqdev> yes. |
20:08:33 | FromDiscord | <lqdev> the solution is to use a different extension (which doesn't exist btw) |
20:08:43 | FromDiscord | <lqdev> or fix the existing extension |
20:09:07 | FromDiscord | <Kaynato> Ahh, did someone already identify where the issue is coming from? |
20:09:22 | FromDiscord | <lqdev> wrong usage of nimsuggest |
20:09:24 | FromDiscord | <dom96> the solution is to fix nimsuggest |
20:10:03 | FromDiscord | <dom96> nimsuggest is one of those things I simply don't use, just like concepts |
20:10:09 | FromDiscord | <dom96> and methods |
20:10:11 | FromDiscord | <dom96> and the do notation |
20:10:23 | FromDiscord | <Elegant Beef> you dont use concepts? |
20:10:33 | FromDiscord | <Elegant Beef> Why not? |
20:11:02 | FromDiscord | <dom96> indeed, because they're "experimental" and will very likely be redesigned |
20:11:45 | FromDiscord | <mratsim> Vtables have been coming soon for 3 years ;). Nim time is competing with Valve Time :p |
20:12:09 | shashlick | @dom96 hey was wondering why srcDir exists |
20:12:42 | FromDiscord | <dom96> how else would you allow source files to live in a `src` dir? |
20:13:28 | shashlick | It's not required right |
20:13:41 | FromDiscord | <dom96> nope |
20:14:16 | shashlick | So it's for diligent devs who organize their package |
20:14:26 | shashlick | It could be inferred right |
20:14:30 | * | Kaivo quit (Ping timeout: 260 seconds) |
20:14:32 | FromDiscord | <dom96> yes, it's used for nimble init-ted packages too IIRC |
20:14:55 | FromDiscord | <dom96> I don't think inferring this sort of thing is a good idea |
20:15:40 | shashlick | It's been around for a long time and isn't mandated so no need to remove it |
20:15:47 | shashlick | Just wanted to understand |
20:16:05 | shashlick | I've written up the proposal for all that discussion - where should I post it |
20:16:31 | shashlick | Make a new issue and link/close the ones it fixes? |
20:16:48 | * | Kaivo joined #nim |
20:18:08 | FromDiscord | <Kaynato> https://cdn.discordapp.com/attachments/229317733194530817/748636252906979378/unknown.png This isn't normal, is it? Nothing out of the ordinary as far as I could see in general while using the nim vscode extension, and out of nowhere, simply after a file save, the terminal flashed black, and when I deselected and reselected it, this appeared... |
20:18:37 | FromDiscord | <Elegant Beef> No it's not |
20:18:37 | FromDiscord | <Kaynato> It looks like it might be some sort of dump of something? I hope that it's nothing to do with hardware failing. |
20:19:47 | leorize[m] | shashlick: I've commented on my take on why MVS can't be implemented in Nim as it is currently |
20:20:10 | FromDiscord | <dom96> shashlick: sure, make a new issue in Nimble's repo. Not sure which ones you want to close |
20:20:17 | leorize[m] | and it also details why I think multiple versions of the same thing in a program is a horrible idea |
20:20:49 | FromDiscord | <mratsim> MVS? |
20:21:03 | shashlick | @leorize cool thanks |
20:21:11 | FromDiscord | <dom96> https://research.swtch.com/vgo-mvs |
20:22:20 | FromDiscord | <dom96> leorize: while I understand your concern, I think that multiple versions of the same package in a single program is an important feature |
20:23:01 | FromDiscord | <dom96> In the event that data structures are shared, you can cross that bridge when you come to it and you should get a nice compile-time error when that happens |
20:23:14 | FromDiscord | <dom96> better than getting a package error when that might not even be a problem |
20:28:02 | leorize[m] | IMO this is not something that "you can cross the bridge when you come to it", but YMMV. I'm heavily biased from my experience with packaging for distros, where this sort of mixups happens things silently SIGSEGV without you knowing why. In fact symbol versioning in *nix was invented because of this problem. |
20:28:51 | * | narimiran quit (Ping timeout: 258 seconds) |
20:29:07 | leorize[m] | Go's trick of forcing major version in the name is a pretty clever idea IMO |
20:29:14 | FromDiscord | <dom96> Yes, you're fearful that it will cause runtime errors. If it does then it's definitely bad. |
20:29:37 | FromDiscord | <dom96> I don't think this is important right now, but we should have a plan for how to make it happen in the future. |
20:30:23 | FromDiscord | <dom96> Because once we start running into problems with dependencies wanting two different versions of the same package we will desperately want this feature. |
20:30:35 | Araq | multiple versions of the same package in a single program is horse shit |
20:31:09 | Araq | it's Node.js on the next level |
20:31:12 | FromDiscord | <Elegant Beef> Is there really a compelling reason for wanting to use a deprecated package and a contemporary package at the same time? |
20:31:33 | leorize[m] | perks of having major versions in module name: you know exactly what's compatible and what's not. It will show up in autogenerated docs, in the source code, etc. |
20:31:37 | disruptek | it takes three to tango. |
20:31:48 | FromDiscord | <dom96> also, apparently disruptek already ran into this |
20:32:10 | disruptek | nimph just issues a warning. |
20:32:52 | disruptek | whatever the project is that you're building will trump any clashing requirement. |
20:33:56 | FromDiscord | <haxscramper> I almost finished porting libclang into 'clean' state - documentation is almost done - https://haxscramper.github.io/hcparse-doc/src/hcparse/libclang.html . Tomorrow I will port helper wrappers and probably start writing some tests for this thing |
20:34:32 | FromDiscord | <haxscramper> By almost I mean it is not as good as I want it to be |
20:35:04 | leorize[m] | @haxscramper have you looked at python's clang-index thingy? it abstracts the cursor system using an iterator |
20:35:22 | leorize[m] | having never used libclang, I don't know if that's a good or a bad idea :P |
20:35:45 | FromDiscord | <haxscramper> No, I haven't. And I actually don't think it is necessary |
20:36:08 | FromDiscord | <haxscramper> In this case I'm trying to make interface as similar as possible to `NimNode` |
20:36:43 | FromDiscord | <haxscramper> So things like `[]` to get nth child, `case node.cxKind` to switch over possible scenarions, `for subn in node.children` and so on. |
20:40:08 | * | Trustable quit (Remote host closed the connection) |
20:41:14 | leorize[m] | sounds neat |
20:42:38 | FromDiscord | <haxscramper> I just realized I can hook up `nimtrs` to provide pattern-based rewriting rules for function types. |
20:42:50 | FromDiscord | <haxscramper> Wrapping C-style functions that accept array + size into ones that accept `seq[T]` |
20:43:00 | * | bra-ket quit (Ping timeout: 244 seconds) |
20:43:20 | FromDiscord | <haxscramper> Since function signature is just a list of types I can just find and replace them using pattern |
20:43:32 | * | zyklon joined #nim |
20:45:35 | FromDiscord | <haxscramper> Something like `*(Pointer($a) & %?integer) => seq[$a]`. Although this would require finishing rewriting between different ASTs which means it is a project for some later time. |
20:51:50 | * | elijahr quit (Quit: Textual IRC Client: www.textualapp.com) |
21:02:30 | * | NimBot joined #nim |
21:06:48 | shashlick | dom96 - am going to just use a gist - issues don't have any history for edits to track any changes |
21:10:00 | federico3 | dom96: I keep seeing tiny libraries being added to nimble. Nim will end up with the npm dependency hell if the trend is not reversed :( |
21:10:54 | FromDiscord | <Elegant Beef> I make my small packages nimble usable but dont add to the nimble repository like a good boy 😄 |
21:11:05 | Araq | federico3: there is no alternative. either we become successful and a mess or we are irrelevant |
21:11:41 | Araq | the only way to avoid the dependency hell is to be unsuccessful |
21:11:53 | federico3 | Araq: why not a third option like successful but without tiny libraries? |
21:12:05 | Araq | there is now a generation of programmers who only know JS |
21:12:34 | Araq | it'll take 20 years at least to reverse the trend |
21:12:55 | Araq | but hey, I have no fact to back up my claims so I might as well shut up :-) |
21:12:59 | Araq | *facts |
21:13:36 | FromDiscord | <Elegant Beef> I think the biggest issue with these small libraries is they can just be put into a bigger `topicutils` package |
21:13:52 | FromDiscord | <Elegant Beef> consoledate QOL packages together! |
21:14:42 | federico3 | dumping 20-lines libraries on github (instead of trying to consolidate the code) is a culture thing and culture can be changed |
21:15:11 | disruptek | just abandon the idea of a central list of packages. |
21:15:15 | federico3 | it's also encouraged by having too low friction on creating projects/packages |
21:15:32 | federico3 | disruptek: and then in gets even worse, like go |
21:15:44 | disruptek | that's worse? |
21:16:36 | federico3 | much worse |
21:16:41 | disruptek | why is that? |
21:20:08 | federico3 | it made the ecosystem even more volatile. It's well known to be a nightmare for system engineers and for environments that require traceability and ability to maintain medium/large projects for a long time |
21:20:32 | FromDiscord | <dom96> disruptek: nimble supports more than one package list |
21:20:38 | FromDiscord | <dom96> someone just needs to create an alternative |
21:20:42 | disruptek | this is not a problem that we have, right? |
21:20:56 | disruptek | i mean, what is your proposal? |
21:21:12 | disruptek | dom96: you're going to laugh, but i don't use nimble. 😁 |
21:21:33 | FromDiscord | <dom96> disruptek: did I imply that you did? |
21:21:37 | * | disruptek found someone to create an alternative. |
21:23:03 | bung | nimble lack of grouped deps others parts are good to me |
21:23:47 | * | awe00_ joined #nim |
21:25:05 | * | awe00 quit (Ping timeout: 240 seconds) |
21:25:45 | * | audiofile joined #nim |
21:26:18 | bung | any good example of database connections thread pool ? |
21:27:31 | FromDiscord | <mratsim> it's like any threadpool, memory pool, object pool no? |
21:27:39 | FromDiscord | <dom96> disruptek: wat? |
21:30:21 | FromDiscord | <dom96> shashlick: where is this gist? |
21:31:34 | bung | dont know , some libs implemented defferiently |
21:32:19 | federico3 | bung: I was looking for a good threadpool for postgresql but... no |
21:33:22 | bung | they use lock,atomic lock |
21:34:11 | FromDiscord | <Clyybber> @Kaynato heh, looks a bit like https://www.youtube.com/watch?v=68NvvJClDKI& |
21:34:35 | bung | federico3 I really need that, and I hav'nt write related code to that myself |
21:34:59 | FromDiscord | <Clyybber> Araq: I rebased https://github.com/nim-lang/Nim/pull/14777 and reverted the enum changes |
21:34:59 | disbot | ➥ Cleanup |
21:35:16 | * | PMunch quit (Quit: leaving) |
21:35:17 | FromDiscord | <Clyybber> Do you want me to revert the result = "" changes too? |
21:35:39 | FromDiscord | <Clyybber> I think maybe definite assignment analysis should be restricted to lent/var |
21:35:51 | FromDiscord | <Clyybber> at least there its definitiely needed |
21:36:06 | bung | https://github.com/npgsql/npgsql/blob/dev/src/Npgsql/ConnectorPool.Multiplexing.cs |
21:36:31 | FromDiscord | <Clyybber> leorize: It probably should use the dfa I think |
21:36:38 | bung | how about this one ? dont know its quality |
21:37:57 | * | jwm224 quit (Ping timeout: 260 seconds) |
21:42:58 | * | jwm224 joined #nim |
21:43:06 | Araq | yes. revert the 'result = "" ' changes please |
21:43:36 | * | dv-^_^ joined #nim |
21:44:22 | * | solitudesf quit (Ping timeout: 258 seconds) |
21:48:04 | FromDiscord | <martinium> > it'll take 20 years at least to reverse the trend↵@Araq[IRC]#0000 maybe even longer. Maybe some will learn or know enough CS that they can transition back and forth between high-level dynamic languages to static strict systems languages. Only time will tell. |
21:48:44 | federico3 | bung: set up N connections in a seq, pick an unused one using a lock, run the query, release the lock, handle reconnections? like https://github.com/treeform/pg/blob/master/src/pg.nim but simpler |
21:56:57 | * | tane quit (Quit: Leaving) |
21:57:55 | FromGitter | <bung87> federico3 it's really like this? all I've seen all larger than that |
22:01:03 | * | kenran joined #nim |
22:06:06 | * | kenran quit (Ping timeout: 256 seconds) |
22:06:33 | federico3 | https://www.postgresql.org/docs/11/libpq-threading.html |
22:07:42 | * | noonien joined #nim |
22:12:54 | ForumUpdaterBot | New thread by Leorize: We should make it simpler for authors to have their blog featured on the Nim front page., see https://forum.nim-lang.org/t/6736 |
22:15:11 | * | synshroud_ quit (Quit: ZNC 1.7.5 - https://znc.in) |
22:15:26 | * | synshroud joined #nim |
22:16:16 | * | dv-^_^ quit (Quit: The Lounge - https://thelounge.chat) |
22:18:02 | FromDiscord | <Hearthstone> When Nimph is working and works on Arm, could someone let me know? |
22:19:19 | FromDiscord | <martinium> what is Nimph |
22:19:25 | FromDiscord | <martinium> didn't find it on Nimble |
22:20:02 | FromDiscord | <Elegant Beef> nimph is an alternative package manager |
22:20:04 | FromDiscord | <martinium> found it |
22:20:06 | FromDiscord | <martinium> https://github.com/disruptek/nimph |
22:23:52 | bung | federico3 thanks, the document is very basic theory |
22:31:45 | federico3 | bung: https://nim-lang.org/docs/db_postgres.html uses a wrapper for libpq - if it's already thread safe your work is much easier... |
22:32:56 | * | endragor joined #nim |
22:39:49 | * | endragor quit (Ping timeout: 264 seconds) |
22:54:45 | disruptek | you can't build nimph on arm? |
22:55:09 | shashlick | @dom96 - https://github.com/nim-lang/nimble/wiki/Package-structure-and-Interop |
22:55:34 | FromDiscord | <Hearthstone> > you can't build nimph on arm?↵No idea |
22:55:38 | FromDiscord | <Hearthstone> I'll check though |
22:55:50 | FromDiscord | <Hearthstone> Does the current version build successfully normally? |
22:56:25 | disruptek | sure. |
22:56:33 | shashlick | Does the github wiki not have comments? |
22:56:43 | FromDiscord | <Hearthstone> Okay |
23:00:42 | disruptek | shashlick: i don't think so. |
23:04:59 | FromDiscord | <Hearthstone> disruptek: Got this issue while trying to install nimterop, so i just responded yes https://media.discordapp.net/attachments/371759389889003532/748679482394673163/Screenshot_20200828_000422_com.termux.jpg |
23:05:02 | shashlick | Meh I'll have to use a gist regardless |
23:05:34 | FromDiscord | <Hearthstone> Same for nimgit2 https://media.discordapp.net/attachments/371759389889003532/748679627752472686/Screenshot_20200828_000517_com.termux.jpg |
23:05:56 | FromDiscord | <Hearthstone> They're both repos from genotrace |
23:06:08 | disruptek | that guy's a punk. |
23:06:19 | FromDiscord | <Hearthstone> Oof |
23:06:34 | disruptek | do you know how to get more debugging out of nimble? |
23:06:38 | * | disruptek doesn't. |
23:06:53 | FromDiscord | <Hearthstone> Build failed for nimterop 0.6.8 |
23:06:56 | FromDiscord | <Hearthstone> Nope :P |
23:06:58 | shashlick | If I had enough disk space in my Linux box, I could try an arm docker image |
23:07:22 | FromDiscord | <Hearthstone> I'm just building it on my aarch64 android using Termux- |
23:07:32 | disruptek | try --debug argument to nimble. |
23:07:32 | FromDiscord | <Hearthstone> A mobile programmer just became useful- |
23:07:52 | FromDiscord | <Hearthstone> I'll try if it doesn't work :P |
23:07:58 | disruptek | aight, thanks. |
23:08:17 | FromDiscord | <Hearthstone> Error with one of your repos this time https://media.discordapp.net/attachments/371759389889003532/748680314930331778/Screenshot_20200828_000802_com.termux.jpg |
23:08:18 | disruptek | i don't know if libgit2 works on arm. it probably will. |
23:08:24 | FromDiscord | <Hearthstone> gittyup |
23:09:01 | disruptek | i mean, i kinda need to see the debugging output. |
23:09:37 | shashlick | it should |
23:09:46 | FromDiscord | <Hearthstone> :P |
23:10:01 | disruptek | there's a lot of arm in the cloud now. |
23:10:06 | shashlick | can you just `git clone https://github.com/nimterop/nimterop` |
23:10:24 | shashlick | and then `cd nimterop; nim c nimterop/toast` |
23:10:29 | disruptek | actually, nimph's bootstrap might work better. |
23:10:33 | disruptek | it does all that. |
23:10:45 | shashlick | toast isn't compiling so this isn't nimph |
23:10:55 | disruptek | i know, but it'll produce better messages. |
23:11:01 | FromDiscord | <Hearthstone> Where do i add this? https://media.discordapp.net/attachments/371759389889003532/748680998383779992/Screenshot_20200828_001048_com.termux.jpg |
23:11:10 | FromDiscord | <Hearthstone> I am using bootstrap- |
23:11:32 | FromDiscord | <Hearthstone> I'm trying the nonimble version now |
23:11:41 | disruptek | yeah, that's the one that should produce better output. |
23:12:02 | disruptek | what kinda device is this? |
23:12:11 | FromDiscord | <Hearthstone> An android- |
23:12:16 | FromDiscord | <Hearthstone> Android 10- |
23:12:21 | disruptek | but what's the hardware? |
23:12:24 | disruptek | i'm just curious. |
23:13:01 | FromDiscord | <Hearthstone> It's a Huawei p30 lite with 4gb ram, 128gb internal and an aarch64/arm64 cpu |
23:13:10 | disruptek | wow. |
23:13:48 | * | krux02 quit (Remote host closed the connection) |
23:14:04 | FromDiscord | <Hearthstone> These are the only errors :P https://media.discordapp.net/attachments/371759389889003532/748681766897975316/Screenshot_20200828_001339_com.termux.jpg |
23:15:08 | FromDiscord | <Hearthstone> You can't get gcc on termux |
23:15:23 | FromDiscord | <Hearthstone> It comes with clang by default |
23:15:29 | FromDiscord | <Hearthstone> And they aliased gcc to clang |
23:15:43 | disruptek | ugh. |
23:15:58 | FromDiscord | <Hearthstone> ¯\\_(ツ)\_/¯ |
23:15:59 | disruptek | you have `cc = clang` in your global nim.cfg? |
23:16:16 | * | endragor joined #nim |
23:16:56 | FromDiscord | <Hearthstone> I think so |
23:16:59 | disruptek | hmm, it's running clang. is it not a real clang? |
23:18:01 | disruptek | maybe we're trying to build it with c instead of cpp. |
23:18:13 | FromDiscord | <Hearthstone> Nope, it's using gcc |
23:18:17 | FromDiscord | <Hearthstone> I'll change that |
23:18:37 | FromDiscord | <Hearthstone> Fixed that |
23:18:38 | disruptek | the nonimble calls `c` not `cpp`, right? |
23:18:41 | disruptek | that's what you fixed? |
23:18:55 | FromDiscord | <Hearthstone> No idea, I'll checj |
23:18:59 | FromDiscord | <Hearthstone> I fixed my nim.cfg |
23:19:02 | disruptek | just for the toast line, 2nd to last. |
23:19:07 | FromDiscord | <Hearthstone> It used gcc instead of clang |
23:19:08 | FromDiscord | <Hearthstone> Okay |
23:19:55 | disruptek | i'm surprised this is a problem but probably we should fix it if toast really requires cpp. |
23:20:38 | FromDiscord | <Hearthstone> Trying that now |
23:20:45 | FromDiscord | <Hearthstone> Maybe :p |
23:21:45 | shashlick | toast requires cpp |
23:21:45 | disruptek | we can blame clyybber if it doesn't work. \o/ |
23:21:55 | disruptek | nice, i'll fix that. |
23:21:57 | FromDiscord | <Hearthstone> https://media.discordapp.net/attachments/371759389889003532/748683751948681236/Screenshot_20200828_002139_com.termux.jpg |
23:22:25 | FromDiscord | <Hearthstone> I'm using the fish shell btw |
23:22:32 | FromDiscord | <Hearthstone> Hope that doesn't affect anything |
23:22:47 | disruptek | nah, i use fish, too. |
23:22:51 | FromDiscord | <Hearthstone> Nice |
23:23:49 | disruptek | well, there a couple solutions to this. |
23:24:06 | FromDiscord | <Hearthstone> It says something about not die |
23:24:14 | FromDiscord | <Hearthstone> And it not being able to be called |
23:24:16 | FromDiscord | <Hearthstone> Oh? |
23:24:30 | shashlick | why is it looking for git2_jl.jll - it should be libgit2_jl.jll |
23:24:35 | disruptek | for now i would just edit src/nimph.nim.cfg and change the --define:git2JBB to --define:git2Git |
23:24:37 | shashlick | and is toast even compiled |
23:24:49 | FromDiscord | <Hearthstone> Okay |
23:24:56 | disruptek | looks like toast is compiled. |
23:24:59 | disruptek | one other change. |
23:25:06 | FromDiscord | <Hearthstone> Yes? |
23:25:15 | disruptek | --define:git2SetVer:"1.0.1" use "v1.0.0" -- i think git requires a v. |
23:25:46 | disruptek | that will just build libgit2 from scratch. |
23:25:47 | FromDiscord | <Hearthstone> Okay |
23:26:10 | FromDiscord | <Hearthstone> Nice |
23:26:21 | shashlick | i don't get it d |
23:26:37 | * | Tanger joined #nim |
23:26:37 | * | endragor quit (Ping timeout: 246 seconds) |
23:26:43 | disruptek | i know. |
23:27:25 | shashlick | where do you specify git2JBB |
23:27:36 | disruptek | nimph.nim.cfg under nimph. |
23:27:42 | FromDiscord | <Hearthstone> ^^ |
23:27:44 | disruptek | in master branch, anyway. |
23:28:13 | FromDiscord | <Hearthstone> That's what I'm using! |
23:28:19 | FromDiscord | <Hearthstone> :3 |
23:28:21 | disruptek | but how does that string even get composed without a lib in it? |
23:28:27 | disruptek | yeah, the master branch is stable. |
23:28:40 | FromDiscord | <Hearthstone> Hmm https://media.discordapp.net/attachments/371759389889003532/748685441498087555/Screenshot_20200828_002828_com.termux.jpg |
23:28:57 | disruptek | nice. |
23:29:30 | FromDiscord | <Hearthstone> Maybe something isn't in the path that should be? |
23:29:40 | disruptek | well it's building libgit successfully, looks like. |
23:29:46 | shashlick | what version of nimgit2 are you cloning |
23:29:48 | disruptek | toast can't find itself? |
23:29:52 | disruptek | 1.0.1 |
23:29:56 | disruptek | oh, nimgit2. |
23:30:04 | shashlick | it didn't build it did it |
23:30:12 | disruptek | uh, it's probably head because this is the nonimble script. |
23:30:29 | FromDiscord | <Hearthstone> Yeah |
23:30:29 | disruptek | it did build it, afaict. |
23:30:31 | * | hyiltiz quit (Ping timeout: 260 seconds) |
23:30:35 | * | hyiltiz_ joined #nim |
23:30:56 | disruptek | have you ever used nimterop for anything else? |
23:31:30 | FromDiscord | <Hearthstone> Nope |
23:31:38 | FromDiscord | <Hearthstone> But I've installed it before |
23:31:51 | FromDiscord | <Hearthstone> And the nimterop commands work |
23:32:10 | FromDiscord | <Hearthstone> Also my phone is actually getting affected by compiling in the background- |
23:32:14 | FromDiscord | <Hearthstone> Never normally does- |
23:32:21 | disruptek | oh, just wait. |
23:32:35 | disruptek | nimph in master is like 600k lines of nim. |
23:33:26 | FromDiscord | <Hearthstone> I think i might of uninstalled nimterop at one point |
23:33:31 | FromDiscord | <Hearthstone> Installing again rn- |
23:34:01 | disruptek | shashlick: how is it building libgit without building toast? |
23:34:07 | * | jacereda quit (Remote host closed the connection) |
23:35:22 | FromDiscord | <Hearthstone> Uhoh |
23:35:27 | FromDiscord | <Hearthstone> https://media.discordapp.net/attachments/371759389889003532/748687146420011019/Screenshot_20200828_003518_com.termux.jpg https://media.discordapp.net/attachments/371759389889003532/748687146931716186/Screenshot_20200828_003513_com.termux.jpg |
23:37:05 | disruptek | this nonimble script doesn't work for me. |
23:37:18 | disruptek | but, remember, we had to change it to cpp. |
23:37:24 | FromDiscord | <Hearthstone> Yup |
23:37:35 | disruptek | lemme try the normal bootstrap. |
23:37:42 | FromDiscord | <Hearthstone> Okay |
23:37:52 | shashlick | What version of nimgit2 is being cloned |
23:38:03 | FromDiscord | <Hearthstone> 1.0.1 |
23:38:09 | disruptek | it's head. |
23:38:13 | FromDiscord | <Hearthstone> I think |
23:38:15 | FromDiscord | <Hearthstone> O |
23:38:30 | disruptek | try the normal bootstrap.sh; that one uses the correct versions of everything. |
23:38:50 | disruptek | nimble has its uses. 😉 |
23:39:18 | FromDiscord | <Hearthstone> Okay |
23:39:32 | FromDiscord | <Hearthstone> Oh yeah |
23:39:34 | disruptek | it should crash with "Error: Cannot satisfy the dependency on cligen 1.2.0 and cligen 0.9.45" after installing most stuff. |
23:39:50 | FromDiscord | <Hearthstone> Nimterop doesn't install for me for some version |
23:40:06 | disruptek | oh that's right. |
23:40:07 | FromDiscord | <Hearthstone> When i tried nimble install nimterop |
23:40:17 | FromDiscord | <Hearthstone> :/ |
23:41:21 | disruptek | what does clang --version say? |
23:42:42 | FromGitter | <deech_twitter> If I'm making a compiler PR how backwards compatible does the code need to be? eg. can I use `collect`? |
23:43:02 | disruptek | maybe i should just roll nimterop back until it doesn't conflict with cligen. |
23:43:03 | FromDiscord | <Hearthstone> Let's see |
23:43:35 | FromDiscord | <Hearthstone> sent a code paste, see https://play.nim-lang.org/#ix=2vrG |
23:44:03 | disruptek | looks pretty legit. |
23:44:25 | FromDiscord | <Hearthstone> Mhm |
23:46:42 | disruptek | ahhh, yeah. |
23:46:57 | disruptek | shashlick: nimterop isn't working with clang on linux, either. |
23:47:26 | disruptek | 0.6.8 |
23:47:50 | FromDiscord | <Hearthstone> Oof |
23:48:53 | disruptek | i should be able to find one that works. |
23:50:09 | disruptek | it seems to be a passC added in treesitter/api.nim |
23:50:58 | disruptek | hmm, now i get a nim bug. |
23:53:08 | disruptek | doesn't work in 0.4.4 either. |
23:53:55 | disruptek | or 0.3.3. i think you're probably screwed, unfortunately. |
23:54:12 | * | endragor joined #nim |
23:54:24 | disruptek | araq would say he saw this comin'. |