00:00:02 | * | Jesin joined #nim |
00:00:04 | * | m171273_ quit (Ping timeout: 264 seconds) |
00:01:33 | * | m171273_ joined #nim |
00:05:28 | * | m171273 quit (Ping timeout: 264 seconds) |
00:48:18 | * | m171273 joined #nim |
00:50:57 | * | m171273_ quit (Ping timeout: 250 seconds) |
01:12:36 | * | oalvarez joined #nim |
01:29:02 | * | m171273_ joined #nim |
01:31:41 | * | m171273 quit (Ping timeout: 250 seconds) |
01:45:01 | * | laaron- quit (Remote host closed the connection) |
01:48:55 | * | laaron joined #nim |
01:49:21 | * | m171273 joined #nim |
01:52:29 | * | m171273_ quit (Ping timeout: 250 seconds) |
01:55:32 | * | m171273_ joined #nim |
01:58:59 | * | m171273 quit (Ping timeout: 250 seconds) |
02:03:27 | m171273_ | Thank you, @bevo009. |
02:10:28 | * | theelous3 quit (Ping timeout: 245 seconds) |
02:16:39 | * | m171273 joined #nim |
02:18:34 | * | laaron quit (Remote host closed the connection) |
02:19:47 | * | m171273_ quit (Ping timeout: 250 seconds) |
02:20:58 | * | laaron joined #nim |
02:24:55 | * | m171273_ joined #nim |
02:28:01 | * | m171273 quit (Ping timeout: 250 seconds) |
02:31:18 | * | Kaivo quit (Ping timeout: 245 seconds) |
02:33:22 | * | m171273 joined #nim |
02:36:15 | * | m171273_ quit (Ping timeout: 250 seconds) |
02:36:28 | rayman22201 | stupid question, if you specify the nimcache directory via `--nimcache:/some/path`, should nim create the directory if it does not exist? and if the directory does exist, does nim delete the directory? |
02:36:37 | disruptek | tuples... shouldn't we be able to use `fields` as a default iterator? and shouldn't we have a `contains`? |
02:36:54 | disruptek | rayman22201: if it exists, it adds to the directory. |
02:37:27 | disruptek | (if it doesn't exist, nim creates it) |
02:37:29 | rayman22201 | that's what I thought.... hrmmm |
02:37:54 | disruptek | it overwrites any contents, btw. |
02:38:12 | rayman22201 | it does overwrite any contents |
02:38:19 | rayman22201 | did it not used to? |
02:38:31 | rayman22201 | that is bad english. Did the behavior change? |
02:38:39 | disruptek | i'm new to nim, but i doubt the behavior changed. |
02:39:03 | rayman22201 | lol, then you are new to Nim. Araq has been known to change things like this without telling us :-P |
02:39:12 | rayman22201 | he is better about it these days though |
02:40:10 | disruptek | -d:danger |
02:40:23 | disruptek | but, WORM would be a pretty lousy quality for nimcache. ;-) |
02:40:44 | rayman22201 | I'm trying to pick my nim godbolt work again, and something changed, because the files seem to no longer be able to find any of the files |
02:40:59 | rayman22201 | jeeze. I'm tired |
02:41:09 | rayman22201 | Godbolt can't seem to find any of the files |
02:41:14 | disruptek | the nimcache location did change kinda recently, i think. |
02:41:22 | disruptek | i always specify it. |
02:41:41 | rayman22201 | I'm explicitly setting it in the godbolt config, but the directory ends up empty before godbolt can rean it |
02:41:45 | rayman22201 | *read it |
02:42:22 | disruptek | i think there's something godbolt-specific in that sentence that i don't grok. |
02:43:06 | rayman22201 | lol. no worries |
02:43:10 | rayman22201 | I think I have an idea |
02:43:35 | rayman22201 | I'm also failing to write good English right now. |
02:44:07 | disruptek | noted. :-P |
02:44:43 | disruptek | hey, it's that time of night on a Monday... 😉 |
02:45:00 | rayman22201 | indeed |
02:45:33 | * | laaron quit (Remote host closed the connection) |
02:46:07 | disruptek | if it helps, you can `nimCache="/some/dir"` in a nim.cfg instead of using the command-line. |
02:48:17 | * | laaron joined #nim |
02:56:36 | * | lritter quit (Ping timeout: 272 seconds) |
02:56:55 | * | lritter joined #nim |
03:14:44 | * | m171273_ joined #nim |
03:17:43 | * | fjellfras joined #nim |
03:17:47 | * | m171273_ quit (Remote host closed the connection) |
03:17:51 | * | m171273 quit (Ping timeout: 250 seconds) |
03:18:20 | * | m171273 joined #nim |
03:22:37 | * | m171273 quit (Ping timeout: 250 seconds) |
03:38:27 | * | m171273 joined #nim |
03:43:16 | * | m171273 quit (Ping timeout: 264 seconds) |
03:51:09 | * | dddddd quit (Remote host closed the connection) |
04:23:56 | * | nsf joined #nim |
04:28:36 | * | vlad1777d joined #nim |
04:30:08 | * | rockcavera quit (Remote host closed the connection) |
04:47:52 | FromGitter | <Obround> How do you auto type a variable without defining it? This doesn't work: ⏎ ⏎ ```var foo: auto``` [https://gitter.im/nim-lang/Nim?at=5d5240f71dadc42a115f4f6d] |
04:50:07 | * | endragor joined #nim |
04:53:50 | leorize | you can't |
04:54:10 | * | vlad1777d quit (Ping timeout: 258 seconds) |
04:55:26 | leorize | without knowing the type, the compiler can't allocate the necessary space for the variable |
04:56:00 | leorize | what are you trying to do? |
04:59:15 | FromGitter | <Obround> I am not knowing the variable type but I need to define it. |
05:00:45 | leorize | do you have an example use case? |
05:00:49 | FromDiscord_ | <Shield> use a pointer maybe? |
05:00:57 | leorize | if you don't know the variable type, how can you store stuff in there? |
05:07:56 | FromGitter | <Obround> hmm... |
05:11:09 | * | narimiran joined #nim |
05:13:38 | * | laaron quit (Remote host closed the connection) |
05:15:28 | * | laaron joined #nim |
05:35:53 | Araq | clybber: yes, it's correct |
05:36:04 | Araq | (almost) |
05:36:19 | Araq | but I'll update the spec so you can see the problem |
06:09:47 | * | sagax quit (Remote host closed the connection) |
06:14:01 | * | solitudesf joined #nim |
06:20:56 | * | PMunch joined #nim |
06:37:23 | * | Cthalupa quit (Ping timeout: 244 seconds) |
06:37:59 | * | m171273 joined #nim |
06:39:54 | * | m171273_ joined #nim |
06:43:15 | * | m171273 quit (Ping timeout: 250 seconds) |
06:47:36 | * | Mister_Magister quit (Max SendQ exceeded) |
06:48:48 | * | m171273 joined #nim |
06:49:01 | * | Mister_Magister joined #nim |
06:52:52 | * | m171273_ quit (Ping timeout: 264 seconds) |
06:53:54 | * | m171273_ joined #nim |
06:54:12 | * | Cthalupa joined #nim |
06:58:08 | * | m171273 quit (Ping timeout: 264 seconds) |
06:59:09 | * | Cthalupa quit (Ping timeout: 258 seconds) |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:04:40 | * | gmpreussner joined #nim |
07:06:31 | * | krux02 joined #nim |
07:07:48 | * | Cthalupa joined #nim |
07:12:49 | * | lritter quit (Quit: Leaving) |
07:24:40 | * | Cthalupa quit (Ping timeout: 246 seconds) |
07:25:45 | * | Cthalupa joined #nim |
07:27:41 | * | m171273 joined #nim |
07:31:21 | * | m171273_ quit (Ping timeout: 250 seconds) |
07:32:30 | * | m171273_ joined #nim |
07:36:40 | * | m171273 quit (Ping timeout: 264 seconds) |
07:37:19 | * | Cthalupa quit (Ping timeout: 268 seconds) |
07:39:09 | * | m171273 joined #nim |
07:42:01 | * | Cthalupa joined #nim |
07:42:04 | * | m171273_ quit (Ping timeout: 264 seconds) |
07:44:11 | * | m171273_ joined #nim |
07:47:12 | * | ng0 joined #nim |
07:47:49 | * | m171273 quit (Ping timeout: 250 seconds) |
07:52:02 | * | m171273 joined #nim |
07:55:52 | * | m171273_ quit (Ping timeout: 264 seconds) |
08:01:38 | * | Cthalupa quit (Ping timeout: 258 seconds) |
08:13:05 | * | Cthalupa joined #nim |
08:18:08 | * | Cthalupa quit (Ping timeout: 244 seconds) |
08:29:22 | * | Cthalupa joined #nim |
08:31:37 | * | shomodj joined #nim |
08:36:19 | * | Cthalupa quit (Ping timeout: 248 seconds) |
08:50:04 | Araq | how can I solve this problem: |
08:50:06 | Araq | Access to XMLHttpRequest at 'http://localhost:8001/login' from origin 'http://127.0.0.1:8001' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. |
08:51:59 | PMunch | By setting "Access-Control-Allow-Origin: *" in your server response |
08:52:16 | PMunch | https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS |
08:52:52 | * | solitudesf quit (Ping timeout: 246 seconds) |
08:52:56 | livcd | Araq: btw I dont think Ward can port wNim to other platforms. I guess he would need to wrap libui |
08:53:27 | Araq | PMunch, the server does that yet the problem remains |
08:54:11 | Araq | livcd, the point is to have our own libui :P |
08:55:32 | * | Cthalupa joined #nim |
08:59:43 | livcd | Araq: as in fork libui ? |
09:04:45 | Araq | no, as in "let's have a good UI library that supports all OSes" |
09:04:53 | * | Cthalupa quit (Ping timeout: 268 seconds) |
09:13:18 | * | Cthalupa joined #nim |
09:18:35 | FromGitter | <gogolxdong> +1 we need a GUI library for all OS. |
09:19:37 | * | Cthalupa quit (Ping timeout: 244 seconds) |
09:20:33 | * | solitudesf joined #nim |
09:28:28 | * | Cthalupa joined #nim |
09:30:44 | FromDiscord_ | <Kiloneie> Does anyone know how to retrieve the next iteration in a orderedTable without the for loop jumping to it ? I tried doing it with a while loop but that then doesn't work because i am then working with indexes and i can't insert those into []. |
09:32:58 | FromGitter | <alehander42> @dom96 i played with your nimbox termbox fork yesterday |
09:33:02 | FromGitter | <alehander42> pretty cool |
09:33:19 | FromGitter | <alehander42> made a simple "layouting" dsl |
09:33:20 | FromGitter | <alehander42> lib |
09:33:57 | FromGitter | <alehander42> a bit similar to karax |
09:33:58 | FromGitter | <alehander42> but not sure if termbox already has something like that |
09:43:23 | PMunch | gogolxdong, Araq, yeah I'm still working on that.. |
09:43:27 | PMunch | Or at least my ideas for one |
09:43:40 | PMunch | If I just had infinite amount of time.. |
09:44:32 | * | clyybber joined #nim |
09:48:20 | Araq | clyybber, in a nutshell: you need to ensure that p([x], byVar(x)) doesn't happen, a form of alias analysis |
09:48:52 | Araq | we have AA in the compiler though. Or we change the rule to "f must take a single argument" |
09:48:57 | FromGitter | <alehander42> btw |
09:49:06 | FromGitter | <alehander42> i get fmtRes redeclaration |
09:49:18 | FromGitter | <alehander42> codegen error when trying to `&` string in template |
09:49:25 | FromGitter | <alehander42> what can it be |
09:50:46 | FromGitter | <alehander42> its strange: the compiler generates several NimStringDesc* fmtRes; |
09:50:53 | FromGitter | <alehander42> neareach other in the local section |
09:51:00 | FromGitter | <alehander42> i thought it checks for dups |
09:53:37 | FromGitter | <gogolxdong> nimx introduced an layout aloghrithm like Cassowary |
09:53:39 | * | Cthalupa quit (Ping timeout: 248 seconds) |
09:53:56 | FromGitter | <yglukhov> like a few years ago :P |
09:54:13 | * | stefanos82 joined #nim |
09:54:52 | FromGitter | <gogolxdong> Auto Layout of Apple mobile UI is an implement of Cassowary. |
09:55:35 | FromGitter | <gogolxdong> yes, and layout algorithm doesn't change much for years. |
09:56:45 | * | Cthalupa joined #nim |
09:57:14 | FromGitter | <gogolxdong> If UI library implements some layout algorithm, GUI and Web UI could unify. |
09:57:22 | Araq | wNim does use yuriy's work iirc |
09:58:49 | FromGitter | <gogolxdong> write once , run everywhere. |
10:15:11 | * | Cthalupa quit (Ping timeout: 268 seconds) |
10:31:30 | * | Cthalupa joined #nim |
10:31:58 | * | actuallybatman quit (Ping timeout: 272 seconds) |
10:32:28 | PMunch | gogolxdong, that is the plan. My preliminary experiments target Gtk and Karax |
10:37:58 | * | Cthalupa quit (Ping timeout: 245 seconds) |
10:38:43 | * | Cthalupa joined #nim |
10:42:47 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:43:44 | clyybber | Araq: Or we just remove the special case of treat f([...]) like f(...) for the moment |
10:43:51 | clyybber | Since it isn't neccessary |
10:47:50 | * | arecaceae quit (Remote host closed the connection) |
10:48:16 | * | arecaceae joined #nim |
10:50:21 | Araq | clyybber, come on |
10:50:55 | Araq | you invented partially materialized objects and don't want them? |
10:52:55 | clyybber | Hmm, I'll try to make them work without problems |
10:53:23 | clyybber | Btw, Araq. Unifying pArg and p doesn't make as much sense as I thought it would |
10:53:45 | clyybber | The only real overlap there is the handling of arguments of nkCallKinds |
10:53:54 | clyybber | But that can be extracted into helpers |
10:57:28 | * | shomodj joined #nim |
11:02:01 | Araq | ok |
11:14:07 | * | fjellfras quit (Quit: Leaving) |
11:22:16 | Zevv | I think I asked this before, but can't find it in the irc logs: is there a way to control name mangling inside templates? I now pass dummy arguments to the template just to make sure these names are not suffixed, or I make the whole template .dirty. Are there other methods to do this? |
11:25:51 | * | rockcavera joined #nim |
11:35:53 | leorize | Zevv: {.inject.} |
11:36:12 | leorize | it's in the manual as well, though it might not be that apparant |
11:37:21 | * | dddddd joined #nim |
11:52:44 | * | Vladar joined #nim |
11:53:00 | * | Kaivo joined #nim |
12:08:09 | * | LargeEpsilon_ joined #nim |
12:14:57 | Zevv | hmm let me see if i can fit that in |
12:20:53 | * | floppydh quit (Quit: WeeChat 2.5) |
12:29:44 | * | sagax joined #nim |
12:35:35 | * | floppydh joined #nim |
12:52:38 | disruptek | tuples... shouldn't we be able to use `fields` as a default iterator? and shouldn't we have a `contains`? |
13:05:34 | FromGitter | <bevo009> Hi all, I wrapped C++ fmt::print & fmt::format: ⏎ ⏎ ```var nsg = fmtformat("{}\n", 42) ⏎ print(nsg)``` ⏎ ⏎ Error: expression 'fmtformat("{}\n", 42)' has no type (or is ambiguous) ... [https://gitter.im/nim-lang/Nim?at=5d52b59d9507182477cec7f9] |
13:08:32 | * | leorize quit (Ping timeout: 260 seconds) |
13:10:22 | * | leorize joined #nim |
13:22:41 | * | theelous3 joined #nim |
13:24:47 | Araq | Zevv, .dirty templates are not really "dirty", they are far simpler to understand and maybe we got the default wrong |
13:27:42 | * | fredrik92 joined #nim |
13:30:10 | Zevv | hmm yes I just spent some time figuring out what happens and how, and dirty is indeed less "messy" |
13:30:35 | * | m171273 quit (Remote host closed the connection) |
13:30:52 | * | couven92 quit (Ping timeout: 245 seconds) |
13:31:27 | Zevv | but my setup is pretty complex anyway, 5 calls deep into macro > proc > getasts > template > proc > template |
13:31:45 | Zevv | that's kind of like 6 |
13:32:36 | Zevv | but how are they not really "dirty"? |
13:32:58 | Zevv | because relative to normal templates, they are |
13:38:11 | * | solitudesf quit (Ping timeout: 248 seconds) |
13:39:06 | * | solitudesf joined #nim |
13:40:57 | * | solitudesf- joined #nim |
13:40:59 | * | solitudesf quit (Read error: Connection reset by peer) |
13:46:10 | FromGitter | <bevo009> I'm going through Miran's book and the 1st proc throws an error ⏎ What's wrong with it? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d52bf221dadc42a1162be38] |
13:47:11 | * | nsf quit (Quit: WeeChat 2.4) |
13:47:23 | Zevv | you are calling the function but not using its return value |
13:47:45 | narimiran | bevo009 you need to `echo` the result, or do something with it |
13:47:49 | Zevv | so you eather need to use it, or explicitly "throw it away", using "discard findmax(5, 6)" |
13:48:23 | Zevv | And we all know Mirans books are known to be full of errors |
13:48:44 | Zevv | oh, wait, he's here. I didn't say that |
13:48:48 | narimiran | :P |
13:49:57 | FromGitter | <bevo009> doh! should have tried echo...disregard |
13:50:16 | Araq | Zevv, ok, they are "dirty" but often easier and that's what counts |
13:50:25 | FromGitter | <bevo009> Great book Miran, it's been an excellent refresher |
13:50:50 | narimiran | bevo009 i think it is a valid complaint. maybe there should be a sentence/paragraph/example warning discarded value |
13:51:07 | narimiran | *warning about ... |
13:51:22 | livcd | narimiran: will you write "Nim advanced" ? |
13:51:55 | narimiran | bevo009 thanks! if you find more confusing stuff like this one, please open an issue in the repo, so i can improve it |
13:52:33 | narimiran | livcd: i would like to write it at some point, but currently i don't have enough time for it |
14:02:07 | Zevv | Araq: I have some cases in which --expandMacro is not expanding my macros, but I'm not able to figure out what the conditions exactly are - is this a known issue? |
14:10:00 | * | PMunch quit (Remote host closed the connection) |
14:11:37 | Araq | Zevv, never heard of it before |
14:11:47 | Araq | and it's hard to imagine how it can fail |
14:22:19 | * | abm joined #nim |
14:36:24 | zedeuss | Is there a way to accomplish this? Using a string variable to generate a field access: https://play.nim-lang.org/ |
14:36:33 | zedeuss | oops, https://play.nim-lang.org/#ix=1Rwr |
14:41:14 | * | endragor quit (Remote host closed the connection) |
14:45:57 | FromGitter | <Vindaar> zedeuss: if I understand your intention correctly, then no. The `name` field of `Pref` is only filled at runtime, but in order to access a field, the name must be known at compile time. However, you *can* access object fields in a similar manner from a string. But only if that string is static (i.e. defined at CT). So your `pref` instance must be defined as a `const`. Like so: https://play.nim-lang.org/#ix=1Rww |
14:49:36 | * | m171273 joined #nim |
14:55:23 | * | leorize quit (Remote host closed the connection) |
15:00:06 | * | leorize joined #nim |
15:02:55 | * | m171273 is now known as mebbert |
15:04:04 | * | joshbaptiste quit (Ping timeout: 248 seconds) |
15:08:14 | * | eterps joined #nim |
15:12:22 | * | eterps2 joined #nim |
15:14:52 | * | NimBot joined #nim |
15:18:00 | * | eterps2 quit (Ping timeout: 252 seconds) |
15:25:13 | * | LargeEpsilon_ quit (Ping timeout: 246 seconds) |
15:25:25 | * | eterps quit (Ping timeout: 250 seconds) |
15:31:29 | * | mebbert quit (Ping timeout: 250 seconds) |
15:34:08 | * | eterps joined #nim |
15:37:17 | * | joshbaptiste joined #nim |
15:39:28 | * | BuffBoy joined #nim |
15:40:38 | * | BuffBoy left #nim (#nim) |
15:43:13 | * | eterps quit (Remote host closed the connection) |
15:50:39 | * | joshbaptiste quit (Ping timeout: 268 seconds) |
15:52:05 | * | LargeEpsilon joined #nim |
15:54:43 | * | tiorock joined #nim |
15:54:43 | * | tiorock quit (Changing host) |
15:54:43 | * | tiorock joined #nim |
15:54:44 | * | rockcavera is now known as Guest69737 |
15:54:44 | * | Guest69737 quit (Killed (tolkien.freenode.net (Nickname regained by services))) |
15:54:44 | * | tiorock is now known as rockcavera |
15:55:25 | * | eterps joined #nim |
15:55:54 | * | narimiran quit (Ping timeout: 244 seconds) |
15:58:15 | * | vesper11 quit (Read error: Connection reset by peer) |
15:59:48 | FromGitter | <dawkot> Nim not raising exception when "overflowing" range types is a bug, right? |
15:59:55 | FromGitter | <dawkot> on js |
16:00:09 | * | vesper11 joined #nim |
16:07:51 | * | eterps quit (Ping timeout: 264 seconds) |
16:12:39 | FromGitter | <alehander42> hmm |
16:12:59 | FromGitter | <alehander42> got <proc (e: js){.closure.}> ⏎ but expected one of: ⏎ ⏎ proc (e: js){.closure.} [https://gitter.im/nim-lang/Nim?at=5d52e18bd835f428ec459837] |
16:13:08 | FromGitter | <alehander42> doesnt sound right |
16:13:12 | * | actuallybatman joined #nim |
16:13:23 | FromGitter | <alehander42> i tried to make the compiler accept with |
16:13:30 | FromGitter | <alehander42> tabInfo.monacoEditor.onKeyDown((proc(e: js))proc (e: js) = ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d52e1aa94bbaf4167a76bde] |
16:13:42 | FromGitter | <alehander42> the def is onKeyDown*: proc(e: js) |
16:15:22 | FromGitter | <alehander42> it can be workaround-ed with `.toJs` on strategic places |
16:19:05 | * | joshbaptiste joined #nim |
16:19:55 | * | shomodj_ joined #nim |
16:23:28 | * | shomodj quit (Ping timeout: 272 seconds) |
16:25:21 | * | joshbaptiste quit (Ping timeout: 244 seconds) |
16:52:50 | * | joshbaptiste joined #nim |
16:55:20 | * | Sphearion joined #nim |
16:57:45 | * | Sphearion quit (Client Quit) |
16:59:37 | * | joshbaptiste quit (Ping timeout: 245 seconds) |
17:00:55 | * | floppydh quit (Quit: WeeChat 2.5) |
17:01:04 | disruptek | this is producing a "strutils is imported and unused" warning in devel, though not in the playground: https://play.nim-lang.org/#ix=1RxI |
17:04:42 | * | eterps joined #nim |
17:08:09 | * | Jesin quit (Quit: Leaving) |
17:11:46 | * | CcxWrk quit (Quit: ZNC 1.7.1 - https://znc.in) |
17:12:03 | * | LargeEpsilon quit (Ping timeout: 248 seconds) |
17:12:33 | * | CcxWrk joined #nim |
17:15:32 | * | Jesin joined #nim |
17:21:35 | * | LargeEpsilon joined #nim |
17:26:39 | * | joshbaptiste joined #nim |
17:27:10 | * | couven92 joined #nim |
17:29:00 | * | couven92 quit (Client Quit) |
17:29:18 | * | couven92 joined #nim |
17:32:12 | * | couven92 quit (Read error: Connection reset by peer) |
17:32:55 | * | couven92 joined #nim |
17:33:29 | * | couven92 quit (Client Quit) |
17:36:28 | * | LargeEpsilon quit (Ping timeout: 246 seconds) |
17:39:09 | clyybber | Araq: How can I make testament output the compile time output when compiling the tests? |
17:41:00 | * | eterps quit (Ping timeout: 252 seconds) |
17:43:33 | * | narimiran joined #nim |
17:47:04 | * | theelous3 quit (Ping timeout: 272 seconds) |
17:51:18 | * | eterps joined #nim |
17:58:10 | * | nsf joined #nim |
18:02:55 | * | Trustable joined #nim |
18:26:28 | * | eterps quit (Ping timeout: 252 seconds) |
18:43:57 | * | eterps joined #nim |
18:59:55 | * | couven92 joined #nim |
19:11:39 | * | rockcavera quit (Remote host closed the connection) |
19:14:02 | * | nsf quit (Quit: WeeChat 2.4) |
19:14:31 | * | rockcavera joined #nim |
19:19:16 | * | eterps quit (Ping timeout: 252 seconds) |
19:21:29 | * | eterps joined #nim |
19:31:52 | * | eterps quit (Ping timeout: 264 seconds) |
20:03:02 | * | theelous3 joined #nim |
20:07:34 | rayman22201 | new Nim -> Godbolt question. It turns out, the codegen hash can have `_` characters in it. So I can't just split off everything after the last `_`, as originally suggested. |
20:07:54 | rayman22201 | Any alternate ideas for demangling nim function names? |
20:08:51 | clyybber | Everything after the first _ ? |
20:09:01 | dom96 | rayman22201, reverse engineer the mangling algorithm? |
20:10:01 | rayman22201 | @clybber, it's the last `_`, because `_` can be in the function name (it's not the nep1 standard but it's allowed) |
20:10:34 | clyybber | rayman22201: Have you tested that it wont get style-insensitivized away? |
20:10:36 | rayman22201 | @dom96, It's just the md5 hash appened on the end I believe. But it's not "reversible" in that way |
20:10:49 | rayman22201 | I have tested it. The codegen puts it in how it's written |
20:11:05 | dom96 | md5 allows underscores? |
20:11:11 | clyybber | rayman22201: Doesn't the hash have a consistent length? |
20:11:34 | rayman22201 | It's actually likely that some other crap is also getting appended on the end |
20:11:35 | clyybber | dom96: md5 doesnt know what a underscore is |
20:12:07 | rayman22201 | or md5 is outputing a hash that happens to get ascii stringified into an _ in this case |
20:12:25 | clyybber | rayman22201: What kind of crap? |
20:13:02 | rayman22201 | https://www.irccloud.com/pastebin/hsvgWdV6/ |
20:13:17 | rayman22201 | snippet of some asm for you |
20:13:28 | clyybber | rayman22201: Ah alright |
20:14:19 | rayman22201 | for a proc called "sqaure_c" in case that wasn't obvious. |
20:14:20 | clyybber | Then cut off anything that fits this pseudo regex: _<16chars>_someNumberOrWhatever |
20:15:19 | rayman22201 | I just need to find out what "_someNumberOrWhatever" is |
20:15:22 | rayman22201 | good idea though |
20:16:22 | clyybber | rayman22201: In almost all cases its enough to say cut off _<16chars>_whatevercomesafter |
20:16:30 | clyybber | where it doesnt matter what comes after |
20:16:35 | clyybber | just cut it off I say |
20:18:43 | clyybber | No need to catch the madmans manually suffixing their variable names with md5 hashes, I say |
20:18:50 | rayman22201 | It's a collision resolution detection |
20:18:53 | rayman22201 | I just found the source |
20:18:54 | rayman22201 | yeah |
20:19:29 | rayman22201 | https://github.com/nim-lang/Nim/blob/devel/compiler/sighashes.nim#L379 |
20:20:05 | rayman22201 | lol! I suppose if someone really wants to break the name mangling, the could |
20:33:58 | rayman22201 | I'm extremely confused, because it looks like standard MD5, but it's not output a standard 16 character or 32 character result. It's outputing some variable length string |
20:34:54 | clyybber | Huh |
20:35:04 | clyybber | I say ping @Araq |
20:37:48 | rayman22201 | poke @Araq |
20:40:19 | rayman22201 | He went to bed early tonight I guess :-P |
20:48:25 | * | arecaceae quit (Remote host closed the connection) |
20:48:49 | * | arecaceae joined #nim |
20:57:33 | rayman22201 | This is why: https://github.com/nim-lang/Nim/blob/c94647aecad6ed7fd12152800437a6cda11e06e6/compiler/modulegraphs.nim#L123 |
20:57:44 | rayman22201 | It base64 encodes the hash string |
20:57:51 | rayman22201 | but why? |
20:59:25 | rayman22201 | why base64 encoding instead of the standard md5 ascii algorithm? |
21:01:08 | disruptek | so it can decode it? |
21:01:59 | Araq | probably it's stupid :P |
21:02:26 | Araq | but notice that "md5 ascii" probably wasn't good enough for some theoretical reasons |
21:03:16 | disruptek | i don't see how base64 would help. |
21:03:57 | rayman22201 | The demangler only has access to the final symbol string, which only sees "arbitrary_string_with_underscores". base64 is variable length, so how can the demanger do it's job given that it can't possibly know the length of the base64 portion. |
21:04:36 | rayman22201 | and there may possibly be some extra "hash collision" numbers at the end, which the demangler also can't know. |
21:04:37 | * | Trustable quit (Remote host closed the connection) |
21:05:04 | Araq | disruptek: I don't remember the details but '=' is ascii and yet not valid in C identifiers |
21:05:25 | rayman22201 | the last part is the real problem. I need some way to detect which part to chop off. |
21:05:50 | rayman22201 | the hash collision makes the simple solution not work |
21:05:55 | disruptek | it sounds like you should fix this and see what breaks. is it much code to replace? |
21:06:08 | Araq | I've heard this complaint before but it makes no sense to me |
21:06:32 | clyybber | So the trailing `=` from base64 get cut off too? |
21:06:39 | Araq | the pattern is .*_\[A-Z]+(_\d+)? |
21:06:47 | disruptek | there are, what, 4 wacky characters in md5? |
21:07:18 | disruptek | are you sure it isn't md5'ing base64? |
21:07:40 | Araq | and of course [A-Z] needs to be replaced by the real thing |
21:07:53 | rayman22201 | @Araq: the problem with that pattern is that it also matches valid proc names |
21:08:16 | Araq | what's a "valid" proc name? |
21:09:23 | rayman22201 | the pattern is "proc_name_hash_(maybe collision int)?". I need to match only "_hash_(maybe collision int)?" |
21:09:41 | rayman22201 | but that pattern may also match a valid "proc_name" |
21:10:15 | Araq | nah |
21:10:36 | Araq | you strip the trailing _\d+ (optional) |
21:10:53 | Araq | then you strip the trailing _\$HASH |
21:11:00 | Araq | the end. |
21:11:16 | Araq | proc foo_9 is mangled to 'foo9' |
21:11:25 | rayman22201 | no it's not |
21:11:29 | rayman22201 | I can prove it |
21:11:43 | Araq | of '_': |
21:11:43 | Araq | # we generate names like 'foo_9' for scope disambiguations and so |
21:11:44 | Araq | # disallow this here: |
21:11:45 | Araq | if i > 0 and i < name.len-1 and name[i+1] in Digits: |
21:11:47 | Araq | discard |
21:11:49 | Araq | else: |
21:11:51 | Araq | add(result, c) |
21:11:58 | Araq | ^ that surely was the intention of this code |
21:12:54 | rayman22201 | then it's broken because the asm output shows the original `_` characters |
21:13:27 | rayman22201 | see my snippet : https://www.irccloud.com/pastebin/hsvgWdV6/ |
21:14:34 | disruptek | i think you two are misunderstanding one another. |
21:15:21 | Araq | _ if not followed by a digit is fine |
21:15:26 | Araq | and so it's kept |
21:15:41 | disruptek | but `proc foo_9` in nim code is fine, currently. |
21:15:59 | Araq | square_c_A3OCHz9cVwpTswofedCj6NQ_2 <-- 'c' is not a digit |
21:16:22 | disruptek | but ...Q_ is followed by a digit. |
21:16:30 | clyybber | Btw, Araq: I'm doing pStmt and pExpr now. So far its making the code a lot more digestable/simple |
21:16:49 | Araq | clyybber: slightly wrong but fine with me |
21:16:59 | clyybber | In what sense wrong? |
21:17:45 | Araq | the stmt vs expr distinction is syntactical, you mean 'returns a value' |
21:17:47 | rayman22201 | the fact that 'c' is not a digit and is kept is the problem |
21:17:51 | Araq | but it's ok |
21:18:10 | Araq | btw there is also some *.ndi file generated that contains (orig, mangled) pairs |
21:18:28 | Araq | rayman22201: it's not a problem if you work backwards |
21:18:34 | clyybber | Araq: Yeah, my isExpression helper just does if n.typ != nil or n.kind in nkLiterals + {nkNilLit} |
21:18:59 | * | solitudesf- quit (Ping timeout: 248 seconds) |
21:19:00 | * | leorize quit (Ping timeout: 260 seconds) |
21:19:03 | Araq | huh? if not isEmptyType(n.typ) should be enough |
21:19:31 | clyybber | Ah, alright. Thanks. |
21:20:53 | rayman22201 | Working backwords is fine. I see that, but I don't believe that I can regex match a base64 encoded string that is not a valid proc identifier %100 of the time. |
21:20:56 | rayman22201 | it's guessing. |
21:21:28 | Araq | guessing what? |
21:22:28 | rayman22201 | "AppDef" is valid base64, it's also a reasonable piece of a procname |
21:23:44 | disruptek | but it won't be valid base64 anything, because it doesn't include / and + and =. |
21:23:47 | * | leorize joined #nim |
21:23:51 | disruptek | s/anything/anyway/ |
21:24:15 | rayman22201 | valid in the sense of what the name mangling is doing |
21:24:21 | rayman22201 | which does not include those characters |
21:24:30 | disruptek | yeah, i just mean you cannot decode it. |
21:24:41 | Araq | ah you have a point here. |
21:25:00 | disruptek | is there a reason you cannot replace that mangle with just straight md5? |
21:25:11 | Araq | originally the mangling was easier but people wanted as little mangling as possible |
21:25:22 | disruptek | maybe prefix it with md5_ so that it's a valid identifier and self-documenting to boot? |
21:26:04 | * | aq60 joined #nim |
21:26:05 | Araq | well the prefix is '_' :P |
21:26:13 | disruptek | Araq's response to "less mangling, please!" was to md5->base64->s/[+/=]// -- enjoy! |
21:26:36 | rayman22201 | the problem is that `_` is overloaded. It's allowed in proc names too! |
21:26:41 | disruptek | fair enough; at least md5 looks like md5. 😀 |
21:26:42 | rayman22201 | it's ambiquous |
21:26:57 | rayman22201 | ambiguous* |
21:27:08 | disruptek | well, at least with md5 you can work backwards without regard to _ because it can serve as a delimiter. |
21:27:19 | clyybber | do a double __ |
21:27:33 | disruptek | especially if the trailing digits are limited in length to less than the len of the md5 sum. |
21:27:35 | clyybber | I think thats disallowed as an Nim identifier |
21:27:37 | rayman22201 | I suppose I can assume the last 2 strings in symbol.split("_") are either (base64, int), or (don't care, base64) |
21:27:46 | Araq | it's _<at least 32 chars of crap with a digit in it> |
21:27:54 | Araq | not that hard |
21:28:37 | Araq | yes there are checksums that don't have digits but you ignore them, just like git ignores commit hash collisions :P |
21:28:41 | disruptek | the "no __ in nim identifiers" breaks openapi 1:1 type mapping for me. :-( |
21:28:56 | disruptek | i'm gonna have to make a type wrapper. 😢 |
21:29:09 | rayman22201 | It's much harder than your initial suggestion of "just lop off everything after the `_`" Araq :-P |
21:29:16 | * | narimiran quit (Remote host closed the connection) |
21:29:17 | Araq | 1:1 mapping with bullshit ascii art names was never a design goal |
21:29:34 | disruptek | no blame, just tears. |
21:29:50 | rayman22201 | and I don't like it because I still think it's more ambiguous that it should be. |
21:30:06 | Araq | rayman22201: fix it, PRs welcome |
21:30:10 | disruptek | rayman22201: seems like you're in a great position to fix it. |
21:30:23 | clyybber | Araq: Umm, why does nkStrLit sometimes not have a type? |
21:30:39 | rayman22201 | meh. Araq obviously had reasons for it. I would rather just make Godbolt work |
21:30:49 | rayman22201 | I don't want to go down some other rabbit hole |
21:30:58 | Araq | clyybber: I have no idea. because you iterate over pragmas too? |
21:31:14 | * | Vladar quit (Remote host closed the connection) |
21:31:16 | clyybber | w |
21:31:25 | Araq | rayman22201: we could 'name__hash' rather easily |
21:31:39 | rayman22201 | I may look into the ndi file that maps the names. Do you remember where that is? |
21:31:44 | clyybber | Araq: Hmm, yeah that could be it:w |
21:31:59 | rayman22201 | that seems like a better solution. |
21:32:08 | disruptek | make it name______hash so it's extra-extra safe. |
21:32:09 | rayman22201 | Then it doesn't matter what the mangling scheme is |
21:32:24 | Araq | the ndi files are in nimcache/ but I forget when we emit them |
21:32:42 | clyybber | disruptek: Make the number of _ random, to play with raymans sanity |
21:32:47 | disruptek | name__hash__eman |
21:32:49 | rayman22201 | too late :-P |
21:33:16 | rayman22201 | ok. I will look for the ndi file stuff and get back |
21:33:50 | disruptek | this is gonna break a lot of binaries, isn't it? |
21:34:09 | rayman22201 | what will? |
21:34:23 | disruptek | changing the mangler heuristic. |
21:34:42 | Araq | we have done it a couple of times, nobody ever reported problems |
21:35:05 | disruptek | it's warm and fuzzy here in pre-1.0 land. |
21:35:27 | Araq | we should mangle C++ style but then C++ would mangle or mangled names |
21:35:31 | Araq | producing long names |
21:35:45 | Araq | *would mangle our mangled names |
21:35:51 | rayman22201 | This is why I'm looking into the mapping file solution. I want to sidestep the problem completely |
21:35:57 | aq60 | How to convert ptr byte to int and make substraction so i can find certain interval in array? https://play.nim-lang.org/#ix=1RzF |
21:36:29 | disruptek | i thought i'd be more worried about rayman22201's sanity, but strangely, i'm not bothered by it. |
21:36:57 | rayman22201 | lol. Don't worry. I lost my sanity a long time ago :-P |
21:42:11 | Araq | aq60: you're better off with 'ptr UncheckedArray[T]' |
21:42:21 | Araq | that allows indexing directly |
21:45:44 | rayman22201 | --debuginfo:on produces the file. sweet |
21:47:07 | rayman22201 | Thanks @Araq. I think that is a better solution :+1 |
21:47:21 | rayman22201 | we can leave the "best way to mangle" discussion for another day :-P |
21:50:54 | * | Kaivo quit (Quit: WeeChat 2.5) |
21:51:04 | * | drewr quit (Ping timeout: 264 seconds) |
21:51:12 | rayman22201 | crap. One problem with this. --debuginfo:on forces `gcc -g`. So you won't be able to see optimized gcc assembly this way. |
21:51:45 | Araq | -g doesn't mean O0 |
21:52:14 | Araq | you can debug optimized code too, it's not 1980 anymore |
21:53:02 | * | dddddd quit (Remote host closed the connection) |
21:53:46 | rayman22201 | Well, it forces gcc to leave all the debug strings in the executable |
21:54:27 | clyybber | Just do the __ |
21:54:33 | * | shomodj_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:54:50 | clyybber | Might be so simple you can do it in githubs web interface |
21:55:43 | rayman22201 | No Araq is write, according to the GCC docs, -O3 and -g are compatible flags. |
21:55:50 | rayman22201 | Araq is right even |
21:55:56 | rayman22201 | his write was right X.X |
21:57:30 | rayman22201 | @clyybber The .ndi file that does the mapping already exists, why not use it? It's whole purpose is to be used for this sort of tool. |
21:58:01 | clyybber | Yeah, sure. |
21:58:39 | clyybber | rayman22201: What line adds that _ between name and hash? |
21:59:13 | rayman22201 | https://github.com/nim-lang/Nim/blob/devel/compiler/modulegraphs.nim#L101 |
22:00:47 | rayman22201 | not just used for procs though. It's for all hashed symbols. idk what kind of other consequences changing it may have. |
22:01:19 | clyybber | I don't think it will have any, but the tests will tell us: https://github.com/nim-lang/Nim/pull/11939 |
22:01:55 | rayman22201 | sure 👍 |
22:02:06 | clyybber | I think it's a good idea to use the .ndi file for godbolt as that allows us to also support older nim versions |
22:02:16 | rayman22201 | exactly what I was about to say :-D |
22:02:25 | disruptek | hmm, fair point. |
22:02:34 | clyybber | rayman22201: That unicode char displays as a big fat box for me |
22:02:48 | rayman22201 | it's a thumbs up |
22:03:31 | clyybber | U+1F44D |
22:03:35 | rayman22201 | my irc client tried to "auto convert" +1 to the thumbs up emoji |
22:03:41 | clyybber | lol |
22:04:09 | rayman22201 | too much github influence lol |
22:05:53 | * | drewr joined #nim |
22:05:58 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
22:07:41 | rayman22201 | my next problem is that even with demangling and `gcc -g`, the proc definitions are not correctly matching up with their generated assembly labels. |
22:07:43 | rayman22201 | But I need to break to eat lunch, and do work for my real job, so that will be a problem for another day. |
22:08:00 | clyybber | Oh, nice. Its midnight here haha |
22:08:11 | rayman22201 | 3 in the afternoon my time :-) |
22:08:32 | clyybber | He, have a nice day then :) |
22:08:54 | rayman22201 | lol. Thank you :) #globalcommunity |
22:09:29 | clyybber | have a nice <12 hours> |
22:13:19 | * | shomodj joined #nim |
22:13:36 | * | leorize quit (Ping timeout: 260 seconds) |
22:15:18 | * | leorize joined #nim |
22:19:46 | * | clyybber quit (Quit: WeeChat 2.5) |
22:25:53 | * | LargeEpsilon joined #nim |
22:30:07 | * | LargeEpsilon quit (Ping timeout: 246 seconds) |
22:40:29 | * | lritter joined #nim |
22:41:31 | * | stefanos82 quit (Quit: Quitting for now...) |
22:42:29 | FromGitter | <deech> Anyone know if there are efforts to verify the soundness of the Nim type system ( especially the newruntime move semantics )? |
22:52:24 | * | py0tr joined #nim |
22:53:52 | krux02 | what do you mean with that? |
22:55:32 | krux02 | @deech: There are research papers about the nim type system. This stuff wasn't invented for Nim. |
22:55:58 | py0tr | Hello there! :-D |
22:56:48 | py0tr | Can someone help me with something rare I found in Nim? |
22:58:12 | py0tr | I got this warning: "Warning: use strformat module instead; round is deprecated" |
22:58:57 | FromGitter | <deech> krux02: I realize that, I mean in the same way a subset of Rust semantics have been ( or are in the process of being ) formally verified. |
22:59:07 | py0tr | however The warning comes from a non string environment. I really need to use just floats. |
23:00:06 | py0tr | This is the code: round(float(height) / 2.54, 4) |
23:00:25 | FromGitter | <deech> krux02: I also realize this is a big deal, but since it's being used in the crypto/blockchain space I thought there might be some ongoing efforts ... |
23:02:26 | py0tr | Of course as you can see I am new here |
23:05:16 | py0tr | Ok sorry for the interference I will read the IRC guidelines first. |
23:13:41 | * | krux02_ joined #nim |
23:16:45 | * | py0tr left #nim ("Leaving") |
23:16:51 | * | krux02 quit (Ping timeout: 264 seconds) |
23:34:33 | rayman22201 | Py0tr, don't worry. this is the right place. Do you need exactly 4 decimal places of precision? Why not just use `round(float(height)/2.54)` |
23:39:41 | * | couven92 quit (Quit: Client Disconnecting) |
23:45:24 | * | krux02_ quit (Remote host closed the connection) |
23:51:25 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
23:54:13 | * | aq60 quit (Remote host closed the connection) |