00:00:33 | skrylar[m] | i've been working on mud proxies and servers. not quite as glorious as discord libs. lol |
00:02:29 | FromDiscord | <Technisha Circuit> Lmao |
00:02:51 | FromDiscord | <Technisha Circuit> I was just thinking that it'd be cool if i did something useful |
00:03:08 | Yardanico | well I'm just kinda confused what you're wandering all over the place :P |
00:03:17 | FromDiscord | <SeanOMik> Is there a way I could get a `ref` from a non-ref object? |
00:03:28 | Yardanico | yes |
00:03:40 | FromDiscord | <SeanOMik> Like if a `proc` returns a `Player` but I need a `ref Player` |
00:03:44 | Yardanico | !eval let a = 5; var b: ref int; b[] = a |
00:03:46 | NimBot | Traceback (most recent call last)↵/usercode/in.nim(1) in↵SIGSEGV: Illegal storage access. (Attempt to read from nil?) |
00:03:49 | Yardanico | wait wrong |
00:04:13 | Yardanico | !eval var b = new(int); b[] = 5; echo b |
00:04:15 | NimBot | Compile failed: /usercode/in.nim(1, 33) Error: type mismatch: got <ref int> |
00:04:24 | Yardanico | !eval var b = new(int); b[] = 5; echo b[] |
00:04:26 | NimBot | 5 |
00:04:37 | Yardanico | so yeah, basically you just do something like |
00:04:48 | Yardanico | var mypl = new(Player); mypl[] = mynonrefplayer |
00:05:51 | FromDiscord | <SeanOMik> Uhh |
00:05:51 | FromDiscord | <SeanOMik> Okay |
00:05:59 | FromDiscord | <SeanOMik> Thanks |
00:07:45 | * | couven92 quit (Ping timeout: 272 seconds) |
00:10:26 | * | lritter quit (Ping timeout: 258 seconds) |
00:11:03 | * | lritter joined #nim |
00:12:29 | skrylar[m] | that's just copying the value in to a ref isn't it |
00:14:23 | skrylar[m] | its not quite the same logic as pointers iirc |
00:14:27 | * | adnan338 joined #nim |
00:19:47 | * | couven92 joined #nim |
00:22:01 | FromDiscord | <Technisha Circuit> Is it a good idea to recommend Nim to my friend who can't code but wants to learn? |
00:22:01 | * | couven92 quit (Read error: Connection reset by peer) |
00:22:13 | * | couven92 joined #nim |
00:23:22 | FromDiscord | <SeanOMik> I would think so |
00:23:33 | FromDiscord | <SeanOMik> Its not that complicated |
00:24:47 | FromDiscord | <Technisha Circuit> Nice |
00:26:07 | FromDiscord | <Technisha Circuit> 984 members in the discord- |
00:32:30 | FromDiscord | <impbox> \o/ |
00:34:04 | FromDiscord | <Technisha Circuit> If i had a .so file that had some code written in Nim |
00:35:08 | * | lritter quit (Quit: Leaving) |
00:35:10 | FromDiscord | <Technisha Circuit> And i wanted to get a variable named `a` which was a string, how would i get it? I figured out how to use symAddr (if that's the name), but I can't figure out how to do the same for normal variables |
00:35:25 | FromDiscord | <Technisha Circuit> I need the variables to be fetched at runtime |
00:37:14 | skrylar[m] | @Technisha Circuit depends on the nature of your fren |
00:37:30 | skrylar[m] | if they need a lot of handholding, no. if they are resourceful, maybe. |
00:40:10 | skrylar[m] | i kind of miss the old gamemaker for that purpose... there's gdevelop now i guess. where you can flop around with events and triggers. or a copy of rpgmaker. renpy if you're very brave |
00:44:06 | skrylar[m] | huh. forgot about scratch. never used it |
00:44:38 | FromDiscord | <Technisha Circuit> Oh god i hatw scratch |
00:44:45 | FromDiscord | <Technisha Circuit> (edit) 'hatw' => 'hate' |
00:44:53 | FromDiscord | <Technisha Circuit> Kids say it's proper coding aswell- |
00:45:26 | FromDiscord | <Technisha Circuit> Thankfully my little sister knows that it's not proper coding because she always sees me coding- |
00:45:52 | FromDiscord | <Clyybber> it is coding tho? |
00:46:44 | FromDiscord | <Technisha Circuit> Dragging and dropping blocks is coding? |
00:47:07 | FromDiscord | <Technisha Circuit> I'd say it's more like a simple scripting language if anything |
00:47:25 | FromDiscord | <Clyybber> and *that*'s coding |
00:47:25 | FromDiscord | <Technisha Circuit> But i mostly don't think of it as coding :P |
00:47:36 | FromDiscord | <Technisha Circuit> > if anything |
00:47:37 | FromDiscord | <Technisha Circuit> :p |
00:47:39 | FromDiscord | <Clyybber> well you are creating code |
00:47:52 | FromDiscord | <Clyybber> so I'd say it's coding :p |
00:48:03 | FromDiscord | <Technisha Circuit> Good point ¯\\_(ツ)\_/¯ |
00:48:05 | FromDiscord | <Technisha Circuit> Hmmmmm |
00:48:12 | FromDiscord | <Technisha Circuit> Nvmm |
00:48:16 | FromDiscord | <Technisha Circuit> (edit) 'Nvmm' => 'Nvm' |
00:48:27 | FromDiscord | <Technisha Circuit> What's a good library for making android apps in Nim? |
00:48:34 | FromDiscord | <Clyybber> jnim |
00:48:47 | FromDiscord | <Clyybber> it allows you to interface with java |
00:48:50 | FromDiscord | <Technisha Circuit> Isn't that java and nim interopt? |
00:48:54 | FromDiscord | <Clyybber> yep |
00:49:08 | FromDiscord | <Technisha Circuit> I don't wanna have to learn the pains of Java T^T |
00:50:02 | FromDiscord | <Clyybber> nimx also supporst android afaik |
00:50:16 | FromDiscord | <Technisha Circuit> Nimx? |
00:51:25 | FromDiscord | <Clyybber> ~github nimx |
00:51:26 | disbot | no footnotes for `github`. 🙁 |
00:51:35 | FromDiscord | <Technisha Circuit> I found it |
00:51:40 | FromDiscord | <Clyybber> k |
00:51:45 | FromDiscord | <Technisha Circuit> How do i add a footnote anyway- |
00:51:55 | FromDiscord | <Clyybber> ~footnote is added |
00:51:56 | disbot | footnote: 11added |
00:52:00 | FromDiscord | <Technisha Circuit> O |
00:52:08 | FromDiscord | <Technisha Circuit> ~repo nimx |
00:52:09 | disbot | no footnotes for `repo`. 🙁 |
00:52:13 | FromDiscord | <Technisha Circuit> Oof |
00:52:24 | FromDiscord | <Clyybber> ~repo: nimx |
00:52:25 | disbot | no footnotes for `repo:`. 🙁 |
00:52:25 | FromDiscord | <Technisha Circuit> ~footnote nimx is https://github.com/yglukhov/nimx |
00:52:26 | disbot | no matching footnotes for `footnote` with regexps `nimx, is, https://github.com/yglukhov/nimx`. 🙁 |
00:52:29 | shashlick | disruptek: proc or it didn't happen |
00:52:33 | FromDiscord | <Technisha Circuit> O |
00:52:46 | FromDiscord | <Technisha Circuit> ~nimx |
00:52:47 | disbot | no footnotes for `nimx`. 🙁 |
00:53:17 | FromDiscord | <Zed> ~footnote https://github.com/yglukhov/nimx |
00:53:18 | disbot | no matching footnotes for `footnote` with regexps `https://github.com/yglukhov/nimx`. 🙁 |
00:53:35 | FromDiscord | <Technisha Circuit> I'm confused- |
00:53:35 | FromDiscord | <Zed> ~footnote nimx https://github.com/yglukhov/nimx |
00:53:36 | disbot | no matching footnotes for `footnote` with regexps `nimx, https://github.com/yglukhov/nimx`. 🙁 |
00:53:48 | FromDiscord | <Technisha Circuit> ~footnote is |
00:53:49 | disbot | no matching footnotes for `footnote` with regexps `is`. 🙁 |
00:53:55 | FromDiscord | <Zed> ~footnote |
00:53:56 | disbot | footnote: 11added |
00:54:13 | FromDiscord | <Zed> https://github.com/yglukhov/nimx ~footnote |
00:54:13 | FromDiscord | <Technisha Circuit> ~nimx is https://github.com/yglukhov/nimx |
00:54:14 | disbot | nimx: 11https://github.com/yglukhov/nimx |
00:54:20 | FromDiscord | <Technisha Circuit> Figured it out! |
00:54:23 | FromDiscord | <Technisha Circuit> ~nimx |
00:54:24 | disbot | nimx: 11https://github.com/yglukhov/nimx -- Technisha Circuit |
00:54:27 | FromDiscord | <Technisha Circuit> Finally! |
00:54:29 | FromDiscord | <Zed> yay |
00:54:30 | FromDiscord | <Technisha Circuit> :3 |
00:54:35 | FromDiscord | <Technisha Circuit> :p |
00:54:44 | FromDiscord | <Zed> what a confusing bot |
00:54:48 | FromDiscord | <Zed> :D |
00:55:30 | FromDiscord | <Technisha Circuit> Ikr xD |
00:58:43 | * | oddp quit (Ping timeout: 260 seconds) |
00:58:55 | skrylar[m] | well scratch/logo/early gamemaker were nice at getting you to having little stuff move around the computer and maintain motivation. the classical approach of 5+ years gen.ed. and then maybe someday you start studying the theory of RAM cells so one day you might write a code was a profound failure in comparison |
01:00:00 | skrylar[m] | considering how effective multimedia fusion has been at getting designers engineering best selling games, i'd say abstracting the code until you nderstand the concepts works |
01:01:21 | skrylar[m] | they have their issues but by the time you understand what the problem is in MMF/GDevelop, you're probably ready to graduate to code |
01:02:00 | skrylar[m] | or well, Node-RED if you're doing non-game stuff. |
01:02:11 | FromDiscord | <Technisha Circuit> What's node-red? |
01:02:30 | skrylar[m] | noodle graph runtime in node |
01:03:03 | skrylar[m] | you write little modules and they appear on a graph, so you can visually plop the modules and flow together |
01:03:15 | FromDiscord | <Technisha Circuit> ~~Also, probably not the best idea to attempt to make an android game while coding on an android~~ |
01:03:19 | FromDiscord | <Technisha Circuit> Oh cool |
01:03:38 | skrylar[m] | theres also fungus in unity, and there's another one in unity thats simila rand i forget the name |
01:03:54 | * | Tongir quit (Ping timeout: 240 seconds) |
01:22:53 | * | arecaceae quit (Remote host closed the connection) |
01:23:27 | * | arecaceae joined #nim |
01:26:43 | FromDiscord | <impbox> I think a combination of code + node graphs is ideal, especially if they can both call each other, and if the node graphs can compile down to optimised code |
01:27:38 | FromDiscord | <impbox> most of the time i'd rather code things, but sometimes graphs make more sense and are good for designers to tweak when they can't code but can still do logic and piece together things in interesting ways |
01:40:14 | * | Tlongir joined #nim |
01:50:15 | * | hecanjog joined #nim |
01:53:13 | FromDiscord | <Technisha Circuit> So how would i get a string from .so file in Nim? |
01:53:22 | * | fredrikhr quit (Ping timeout: 246 seconds) |
01:55:52 | * | chemist69 quit (Ping timeout: 244 seconds) |
01:57:58 | * | chemist69 joined #nim |
02:18:23 | FromDiscord | <Elegant Beef> "Hey guys can someone tell me what's wrong?" https://media.discordapp.net/attachments/371759389889003532/722998611880837150/unknown.png |
02:18:43 | FromDiscord | <SeanOMik> How could I check if a string is empty? |
02:19:21 | FromDiscord | <Elegant Beef> strutils |
02:19:35 | FromDiscord | <Elegant Beef> `isEmpty` and `isEmptyOrWhitespace` |
02:19:41 | FromDiscord | <Elegant Beef> Choose which ever you want |
02:21:52 | FromDiscord | <SeanOMik> Awesome, thanks |
02:23:48 | * | Tlongir quit (Read error: Connection reset by peer) |
02:24:03 | * | Tlongir joined #nim |
02:25:30 | * | sacredfrog quit (Quit: ZNC 1.8.1 - https://znc.in) |
02:26:59 | * | sacredfrog joined #nim |
02:28:42 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
02:31:32 | FromDiscord | <SeanOMik> I get this weird error: `template/generic instantiation of 'async' from here` when I try to do this: ```nim↵proc updateUser*(user: User , modify: UserModify): User {.async.} =↵``` |
02:31:42 | FromDiscord | <SeanOMik> (edit) 'UserModify):' => 'UserUpdate):' |
02:32:08 | leorize | to understand it you'll need the full error log |
02:32:27 | leorize | that message is actually a 'hint' and not an error |
02:32:53 | FromDiscord | <SeanOMik> `Expected return type of 'Future' got 'User'` |
02:32:56 | FromDiscord | <SeanOMik> Oh okay |
02:33:02 | FromDiscord | <SeanOMik> So I need to return a future of user then |
02:33:29 | FromDiscord | <SeanOMik> Okay yeah, changing return type to `Future[User]` worked |
02:33:30 | FromDiscord | <SeanOMik> Thanks |
02:39:36 | * | endragor joined #nim |
02:44:46 | * | sagax quit (Read error: Connection reset by peer) |
02:47:11 | * | Tlongir quit (Read error: Connection reset by peer) |
02:47:44 | * | Tlongir joined #nim |
02:50:17 | * | sagax joined #nim |
02:51:33 | * | muffindrake quit (Ping timeout: 260 seconds) |
02:52:32 | * | Tlongir quit (Read error: Connection reset by peer) |
02:52:44 | * | Tlongir joined #nim |
02:53:27 | * | muffindrake joined #nim |
03:38:05 | skrylar[m] | AMP seems okay. haven't used it on the nim side yet but was reading about it |
03:38:17 | skrylar[m] | grpc is probably not bad but the http/2 spec is horrible to read |
03:45:48 | FromDiscord | <impbox> the js dom module seems to be missing a bunch of attributes, I guess the standard changes pretty quick, noticed KeyboardEvent.repeat is missing, is there a way I can extend/add support for this without modifying the system dom module? |
03:46:44 | FromDiscord | <Rika> cant you just make a proc that accepts KeyboardEvent? |
03:47:22 | FromDiscord | <impbox> I do... but I want to check KeyboardEvent.repeat which doesn't exist |
03:48:19 | FromDiscord | <impbox> I'm wondering if there's a way I can extend the type to add `repeat` without changing the system library |
03:50:31 | FromDiscord | <Rika> when not compiles()? |
03:50:47 | FromDiscord | <Rika> or when not defined |
03:52:20 | FromDiscord | <impbox> i can do that, but if it's not defined what can I do? |
03:52:32 | FromDiscord | <Rika> you define it, no? |
03:52:35 | FromDiscord | <impbox> how? |
03:52:41 | FromDiscord | <Rika> by making the proc |
03:52:50 | FromDiscord | <impbox> which does? |
03:52:54 | FromDiscord | <Rika> what you want |
03:53:06 | FromDiscord | <impbox> how do I make my proc read a member on a type which doesn't exist? |
03:53:15 | FromDiscord | <Rika> ah i see what you're thinking now |
03:53:37 | FromDiscord | <Rika> so what i would do is make a new module `xxx_mod` or something |
03:53:48 | FromDiscord | <Rika> in that module you include the original module |
03:53:57 | FromDiscord | <Rika> then you define repeat at the bottom |
03:54:11 | FromDiscord | <Rika> then import `xxx_mod` instead of `xxx` |
03:54:38 | FromDiscord | <Elegant Beef> Well the issue is they want to add a member to an object |
03:54:46 | FromDiscord | <Rika> oh its a MEMBER? |
03:54:50 | FromDiscord | <Rika> not a proc? |
03:55:07 | FromDiscord | <Elegant Beef> I believe it's a member i could be wrong |
03:55:16 | FromDiscord | <Elegant Beef> I only briefly looked at the dom source |
03:55:36 | FromDiscord | <Rika> modify the original source and PR it :PPP |
03:55:46 | FromDiscord | <Elegant Beef> ^ only real solution |
03:57:03 | FromDiscord | <Elegant Beef> yea they want to add a bool to the the KeyboardEvent type that adds a bool called `repeat` |
03:57:34 | FromDiscord | <impbox> yes it's a member |
03:58:05 | FromDiscord | <impbox> obviously that's the ideal solution, but it means waiting for that to be accepted and merged into a new version etc |
03:58:11 | FromDiscord | <impbox> in the meantime, what can one do? |
03:58:18 | FromDiscord | <Elegant Beef> Copy the dom module and append it |
03:58:29 | FromDiscord | <Elegant Beef> Leave it in your project file |
03:58:35 | FromDiscord | <Elegant Beef> (edit) 'file' => 'folder' |
03:59:08 | FromDiscord | <impbox> mm I guess that will work, though suboptimal |
03:59:12 | FromDiscord | <Elegant Beef> Yea |
04:04:33 | * | marnix joined #nim |
04:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
04:06:40 | * | supakeen joined #nim |
04:09:44 | * | B4s1l3 joined #nim |
04:09:50 | * | B4s1l3 is now known as opDispatch |
04:11:27 | * | D_ quit (Ping timeout: 260 seconds) |
04:14:41 | * | D_ joined #nim |
04:34:32 | FromDiscord | <SeanOMik> Is there a tutorial on using VSCode to debug your nim application? |
04:45:50 | * | adnan338 quit (Ping timeout: 260 seconds) |
04:48:06 | * | nsf joined #nim |
05:03:25 | * | adnan338 joined #nim |
05:28:02 | * | solitudesf joined #nim |
05:40:52 | * | aenesidemus quit (Ping timeout: 258 seconds) |
05:57:14 | * | bung_ joined #nim |
06:04:17 | * | kenran joined #nim |
06:09:03 | skrylar[m] | hmm there was a plugin to use that debug visualizer but thats all i know of |
06:14:55 | * | endragor quit (Remote host closed the connection) |
06:15:00 | * | tdc joined #nim |
06:20:42 | * | narimiran joined #nim |
06:24:37 | * | ftsf quit (Ping timeout: 246 seconds) |
06:25:19 | * | nekits0 joined #nim |
06:26:29 | * | nekits quit (Ping timeout: 258 seconds) |
06:26:29 | * | nekits0 is now known as nekits |
06:26:43 | * | adnan338 quit (Ping timeout: 246 seconds) |
06:27:39 | * | endragor joined #nim |
06:27:41 | * | endragor quit (Read error: Connection reset by peer) |
06:27:47 | * | endragor joined #nim |
06:52:00 | * | letto quit (Quit: Konversation terminated!) |
06:52:06 | Araq | guys, if you're looking for a simple, effective task to help us speed up Nim's development |
06:52:39 | Araq | please create PRs that replace 'func' by 'proc' in system.nim and then in other parts of Nim's stdlib |
06:52:46 | Araq | er, no |
06:52:52 | Araq | replace 'proc' by 'func' |
06:53:09 | FromDiscord | <Rika> just ripgrep it 😄 (i kid) |
06:53:12 | Araq | so that we can tinker with https://github.com/nim-lang/RFCs/issues/234 |
06:53:13 | disbot | ➥ Add write-tracking to Nim's func ; snippet at 12https://play.nim-lang.org/#ix=2pg3 |
06:53:35 | Araq | Rika: I prefer nimgrep |
06:53:59 | FromDiscord | <Rika> its a joke T_T |
06:56:29 | * | letto joined #nim |
06:56:39 | * | dddddd quit (Ping timeout: 260 seconds) |
06:56:45 | Araq | I know but nimgrep is the better grep everybody is looking for because it has --confirm and --stdin |
06:57:15 | FromDiscord | <Rika> ill prolly try it some time |
06:57:23 | FromDiscord | <Rika> wonder if ng is taken |
06:57:31 | FromDiscord | <Rika> its not |
06:57:32 | FromDiscord | <Rika> nice |
06:57:39 | FromDiscord | <Rika> ill prolly symlink ng then some time |
06:57:56 | Araq | my alias for it is 'gg' |
06:58:14 | FromDiscord | <Rika> why? |
06:58:26 | Araq | because it's simpler to type |
06:59:01 | FromDiscord | <Rika> makes me think "go to buffer top" because vim so ill prolly just replace rg with nimgrep |
06:59:23 | Araq | you need to play more games, "gg" is obviously for "good game" |
07:03:23 | FromDiscord | <Rika> i dont play games where you play against each other in real time |
07:09:38 | * | PMunch joined #nim |
07:35:55 | * | fredrikhr joined #nim |
07:38:39 | * | dxd joined #nim |
07:38:48 | * | livcd_ quit (Changing host) |
07:38:48 | * | livcd_ joined #nim |
07:40:48 | * | nekits quit (Quit: Ping timeout (120 seconds)) |
07:41:13 | dxd | hi guys! how can i export my nim code to a module for use in lua? i tried with the lua library but this is really poorly documented |
07:41:50 | Araq | dxd, depends on what you mean |
07:42:21 | * | nekits joined #nim |
07:42:23 | dxd | execute my nim procs and get result |
07:42:37 | dxd | transfer to them data from lua code by the way |
07:43:20 | Araq | https://www.lua.org/pil/26.2.html translate the C syntax into Nim's and it will work |
07:43:33 | Araq | but that's "registering a Nim proc to the Lua VM" |
07:43:56 | Araq | maybe what you're asking is "how to call a Lua function from my Nim main program" |
07:44:17 | dxd | no, call from lua |
07:44:44 | dxd | it's for in-game scripting, which is based on lua |
07:44:57 | dxd | k will try |
07:45:30 | Araq | watch out to make your procs .cdecl |
07:47:19 | dxd | so what is analog of |
07:47:24 | dxd | static const struct luaL_reg mylib [] = { {"dir", l_dir}, {NULL, NULL} /* sentinel */ }; |
07:50:01 | Araq | const mylib = [LuaLReg(name: "dir", fn: l_dir), LuaLReg(name: nil, fn: nil)] |
07:50:22 | Araq | but it depends on how LuaLReg was wrapped |
07:50:45 | Araq | it could also be |
07:51:16 | Araq | const mylib = {cstring"dir": l_dir, nil: nil} |
07:51:36 | Araq | which is sugar for |
07:51:56 | Araq | const mylib = {(cstring"dir", l_dir), (nil, nil)] |
07:52:03 | Araq | const mylib = [(cstring"dir", l_dir), (nil, nil)] |
07:52:09 | Araq | (array of tuples) |
07:52:16 | PMunch | dxd, what's the issue with the nimLUA documentation? |
07:52:27 | PMunch | (haven't used it myself, so I really don't know) |
07:52:34 | * | nekits quit (Quit: Ping timeout (120 seconds)) |
07:52:34 | dxd | not nimLUA, lua |
07:52:54 | dxd | https://github.com/nim-lang/lua |
07:53:01 | * | nekits joined #nim |
07:54:28 | PMunch | Oh, didn't know that was even a thing. Why not try nimLUA? |
07:54:35 | PMunch | It seems a bit more complete and documented.. |
07:55:05 | dxd | as I understand it, you can bind only for internal vm lua |
07:55:57 | dxd | but i need to use nim from lua vm |
07:56:45 | dxd | Araq, what is LuaLReg, you mean Preg? |
07:59:11 | Araq | LuaLReg is Nim's spelling of 'struct luaL_reg' |
07:59:30 | Araq | but I don't know how the wrapper wrapped it |
07:59:37 | dxd | undeclared identifier: 'LuaLReg' |
07:59:55 | Araq | which wrapper do you use? please give me a link to it |
08:00:13 | dxd | https://github.com/nim-lang/lua |
08:02:59 | dxd | https://github.com/nim-lang/lua/blob/ed117394cef80e1de48055b238ce251645e2e386/src/lua.nim#L473 |
08:03:54 | dxd | and it also takes an instance, not an array of them |
08:05:38 | Araq | const mylib = [Treg(name: "dir", `func`: l_dir), Treg(name: "", `func`: nil)] |
08:06:10 | Araq | openlib(state, unsafeAddr(mylib[0]), mylib.len-1) |
08:08:46 | * | brainbomb joined #nim |
08:10:17 | dxd | Error: expression has no address |
08:11:59 | dxd | https://pastebin.com/9iYQFJFc |
08:12:42 | solitudesf | const -> let |
08:13:25 | dxd | k it's compiled |
08:15:08 | dxd | and lua says that lua: main.lua:1: module 'test' not found |
08:20:20 | dxd | i compiled incorrectly, i apologize |
08:20:38 | dxd | forgot about --app: lib |
08:21:53 | dxd | something wrong again |
08:21:55 | dxd | https://pastebin.com/0gQw5PbB |
08:23:58 | PMunch | dxd, do you have luaopen_test defined in your Nim file? |
08:24:18 | PMunch | If so it should be visible with `nm -a | grep luaopen_test` |
08:25:12 | * | narimiran quit (Ping timeout: 256 seconds) |
08:25:17 | dxd | yes, i left a link to the code a few posts back |
08:26:15 | dxd | https://pastebin.com/GNNtSeBx |
08:26:36 | PMunch | Ah, well it's not exported and not cdecl |
08:26:54 | PMunch | (not sure if it needs to be exported, but it will at least remove the "unused" warning) |
08:29:58 | dxd | added * and the pragma {.cdecl.} to luaopen_test, nothing has changed at all |
08:30:16 | PMunch | Try this, it should work: http://ix.io/2ptJ/nim |
08:30:37 | PMunch | Not 100% if that Treg(name: "get_hello", `func`: get_hello) thing will work though |
08:31:55 | PMunch | And not sure if get_hello needs the extra pragmas, but it probably won't hurt |
08:31:59 | dxd | cheers, new error! |
08:32:07 | dxd | sigsegv! |
08:32:09 | Araq | this is not how it works... |
08:32:14 | * | Araq sighs |
08:32:39 | Araq | you don't build a DLL for Lua, you embed Lua into a host app |
08:33:40 | Araq | DLLs are a different story, for a start you need to ensure the memory management is compatible |
08:34:21 | dxd | how can i ensure |
08:34:42 | PMunch | Araq, I think he wants to use Nim for a third party program that has lua scripting |
08:34:54 | dxd | yep |
08:35:08 | PMunch | So he wants to call Nim stuff from Lua from a program he doesn't control. |
08:35:32 | dxd | gmod have in-game scripting in lua |
08:35:42 | dxd | so i wanna to make it in nim |
08:36:29 | * | opal quit (Remote host closed the connection) |
08:36:40 | dxd | i can't? |
08:37:40 | dxd | i saw that one guy did it in python |
08:37:51 | * | opal joined #nim |
08:40:24 | Araq | you need something like https://www.lua.org/pil/8.2.html |
08:50:37 | * | couven92 quit (Ping timeout: 264 seconds) |
08:50:49 | * | couven92 joined #nim |
08:57:16 | * | Amun_Ra quit (Quit: Gdyby mi się chciało tak jak mi się nie chce…) |
08:58:58 | dxd | Araq, it works, but still SIGSEGV, just as simple require |
08:59:08 | * | Amun_Ra joined #nim |
08:59:57 | PMunch | dxd, possibly because NimMain isn't being called? |
09:00:10 | PMunch | That means the GC isn't set up and will crash if you try to use it |
09:00:15 | dxd | https://pastebin.com/MFhVG6qy |
09:00:30 | dxd | uhh maybe idk |
09:00:38 | dxd | aaand how call it? |
09:01:21 | PMunch | Ah, NimMain also initialises global variables, so that test variable might be empty if it's not run. |
09:01:36 | FromDiscord | <Recruit_main707> you wrap it and run it in lua iirc |
09:02:14 | dxd | what is iirc |
09:02:22 | PMunch | You compile with --noMain and then in your code do `proc NimMain() {.importc.}` and call it from luaopen_test |
09:02:52 | PMunch | IIRC is an abbreviation for If I Rememeber Correctly |
09:03:12 | FromDiscord | <Recruit_main707> doesnt need to de that i think, just call NimMain should work |
09:03:28 | * | narimiran joined #nim |
09:03:36 | PMunch | Really? |
09:03:45 | FromDiscord | <Recruit_main707> i think so |
09:03:52 | FromDiscord | <Recruit_main707> thats what i do w/ python at least |
09:03:55 | dxd | where should i call? :) |
09:04:33 | dxd | first line of luaopen_test? |
09:04:38 | PMunch | Either as I mentioned in luaopen_test as the first thing you do. Or from lua before luaopen_test is triggered (if you are able to) |
09:06:24 | dxd | like that? https://pastebin.com/5V8mWgrc |
09:06:59 | PMunch | Yes |
09:07:01 | dxd | anyway SIGSEGV |
09:07:07 | PMunch | Line? |
09:07:11 | dxd | 20 |
09:07:18 | FromDiscord | <Recruit_main707> oh, he is calling it from within Nim, then yes, the importc thing is probably needed :P |
09:07:33 | dxd | at state.openlib |
09:07:35 | PMunch | dxd, try to check state.isNil |
09:07:38 | PMunch | Just to make sure |
09:07:53 | dxd | false |
09:08:48 | PMunch | And you are sure that that is the correct signature for luaopen_test? |
09:09:02 | PMunch | Just trying to eliminate errors |
09:09:43 | dxd | same as https://www.lua.org/pil/26.2.html |
09:09:53 | FromDiscord | <Recruit_main707> wrapping nim code in the actual nim side doesnt look very easy, cant lua do something like python does with ctypes? |
09:09:55 | * | couven92 quit (Read error: Connection reset by peer) |
09:10:34 | PMunch | Hmm, that Treg(name: "", `func`: nil) should probably be Treg(name: nil, `func`: nil) |
09:10:39 | PMunch | To properly work as the sentinel |
09:11:17 | * | Trustable joined #nim |
09:11:26 | * | couven92 joined #nim |
09:12:13 | PMunch | That cint(test.len-1) should probably also be a 0 |
09:12:28 | PMunch | I don't think you are using upvalues, although I'm not sure what they are.. |
09:12:41 | dxd | same SIGSEGV |
09:13:14 | PMunch | What does your code look like now? |
09:13:40 | PMunch | Do you have a minimal lua script that will try to load and SIGSEGVS by the way? Would make testing this easier for me |
09:14:31 | dxd | yep |
09:14:43 | dxd | nim code https://pastebin.com/aUMKxmdt |
09:15:26 | dxd | lua code https://pastebin.com/Ee8mJx1b |
09:16:21 | * | NimBot joined #nim |
09:16:36 | FromDiscord | <Clyybber> try with --gc:arc |
09:16:36 | dxd | Nim Compiler Version 1.2.0 [Linux: amd64] and Lua 5.3.3 |
09:16:49 | PMunch | Hmm, I got this: http://ix.io/2ptP |
09:17:39 | PMunch | With Nim 1.2.0 and Lua 5.3.5 |
09:17:53 | dxd | wow |
09:18:03 | PMunch | Compiling with --app:lib and --noMain |
09:18:43 | dxd | maybe f.get_hello()? |
09:19:02 | PMunch | Yup |
09:19:03 | PMunch | That worked |
09:19:20 | dxd | Clyybber, with --gc:arc also SIGSEGV |
09:19:39 | PMunch | http://ix.io/2ptR |
09:19:53 | dxd | uhhh what |
09:26:02 | Araq | https://forum.nim-lang.org/t/6445#39770 there |
09:26:45 | PMunch | dxd, Clyybber, works with --gc:arc as well |
09:27:31 | PMunch | dxd, did you manage to get it to work? |
09:28:14 | * | Tlongir quit (Ping timeout: 240 seconds) |
09:28:15 | dxd | not yet, trying to install 5.3.5, but generally in gmod 5.1 |
09:29:07 | PMunch | Hmm, I doubt that it's a Lua version issue.. |
09:29:23 | dxd | nope, sigsegv :) |
09:29:46 | dxd | oh my god why |
09:30:08 | PMunch | Are you using the exact same code that I'm using? |
09:30:19 | dxd | yes, copied |
09:30:36 | PMunch | Hmm, system architecture? |
09:30:36 | Araq | try with --gc:arc -d:useMalloc |
09:30:47 | PMunch | Araq, the weird thing is that it works for me |
09:31:14 | dxd | i don’t understand why either |
09:32:33 | Araq | well it's DLLs, black magic :P |
09:32:47 | PMunch | Haha, true |
09:32:59 | Araq | is that still allowed? "black" magic? or am I racist now |
09:33:09 | PMunch | Oh shit, good question |
09:33:22 | FromDiscord | <Recruit_main707> answer, dont give a fuck |
09:33:37 | Araq | maybe we should s/black/white on Nim's repository. After all, you cannot be racist if you only care about white. |
09:33:45 | PMunch | I tried to argue that blacklist wasn't racist because black magic wasn't (because neither are actually about skin colour) |
09:34:01 | dxd | Araq, with --gc:arc -d:useMalloc nothing changes |
09:34:21 | PMunch | Araq, haha post that to Reddit/HN and grab some popcorn :P |
09:35:13 | FromDiscord | <Recruit_main707> dxd, you are compiling with the same flags as PMunch? |
09:35:23 | FromDiscord | <Recruit_main707> are you* |
09:35:36 | PMunch | He should if he copied my luatest.nims file |
09:37:07 | * | brainbomb quit (Ping timeout: 272 seconds) |
09:37:26 | FromDiscord | <Recruit_main707> either a .nims file or compile it with:↵`nim c --app:lib --NoMain (--gc:arc optionally) luatest` |
09:38:07 | dxd | https://pastebin.com/FLDJL989 |
09:39:36 | FromDiscord | <Recruit_main707> this is the dumbest question, but are you on windows or linux |
09:39:50 | dxd | linux |
09:40:06 | PMunch | Well they have the Linux Nim compiler, so I would hope Linux :P |
09:40:15 | dxd | it's .so as you see |
09:40:18 | dxd | not .dll |
09:40:34 | PMunch | And I assume that your "local path" thing is actually set to the correct path? :P |
09:40:39 | FromDiscord | <Recruit_main707> thats why it was a dumb question, but just to make sure :P↵i have no more ideas |
09:40:56 | dxd | yes, when the path is wrong it different error |
09:41:14 | FromDiscord | <Recruit_main707> he is getting seg fault, so it should have loaded it at least |
09:41:28 | PMunch | Just making sure you weren't pointing to an old .so you compiled and not the one generated by that Nim code. |
09:41:43 | PMunch | I've done that mistake before.. |
09:41:55 | FromDiscord | <Recruit_main707> happens to the best of use yes... |
09:42:00 | FromDiscord | <Recruit_main707> us* |
09:42:24 | PMunch | Was that an edit, or did you manually type "us*"? |
09:42:34 | PMunch | Just trying to gauge how smart the new bot is :P |
09:42:40 | FromDiscord | <Recruit_main707> manually :P |
09:42:44 | PMunch | Haha, okay |
09:42:57 | FromDiscord | <Recruit_main707> this is what happens when i edot |
09:43:02 | FromDiscord | <Recruit_main707> (edit) 'edot' => 'edit' |
09:43:29 | dxd | copied everything again to be sure, still fucking sigsegv( |
09:43:36 | PMunch | Yeah I know, but we were talking about adding a "simplified" output for that scenario |
09:43:47 | PMunch | dxd, hmmm. |
09:44:02 | dxd | 12falseTraceback (most recent call last)test.nim(21) luaopen_testSIGSEGV: Illegal storage access. (Attempt to read from nil?) |
09:44:15 | dxd | https://pastebin.com/12kN8YVF |
09:44:25 | PMunch | When did you install the lua library? |
09:44:34 | dxd | sudo apt install lua5.3 |
09:44:53 | PMunch | Ah no, the Nim library |
09:45:20 | dxd | nim code in same folder with lua |
09:45:47 | PMunch | Huh? |
09:47:06 | * | waleee-cl joined #nim |
09:47:08 | dxd | ls -main.lua - test.nim - test.nims - test.so |
09:47:12 | PMunch | What is the output of this: find ~/.nimble/pkgs/lua-1.0 -type f \( -exec sha1sum {} \; \) | sha1sum |
09:47:26 | dxd | 4d6fb74718fe6ce54d1ca6ff37ff7a787116fc88 |
09:47:35 | PMunch | Hmm, mine is 68e9fd441b9d43aef87a86738ed054774db5f589 |
09:47:52 | PMunch | Try "nimble install lua" |
09:47:52 | * | oddp joined #nim |
09:48:35 | PMunch | And force overwrite |
09:49:12 | dxd | https://pastebin.com/pAc5mgwb |
09:49:41 | PMunch | What's the output now? |
09:49:49 | dxd | 4d6fb74718fe6ce54d1ca6ff37ff7a787116fc88 |
09:49:57 | dxd | lol what |
09:49:58 | PMunch | Huh, odd |
09:50:18 | * | brainbomb joined #nim |
09:50:40 | PMunch | What about: find ~/.nimble/pkgs/lua-1.0 -type f \( -exec sha1sum {} \; \) |
09:51:55 | dxd | damn |
09:52:03 | dxd | 10 pastes per 24 hour |
09:52:18 | PMunch | Haha, use ix.io or something else :P |
09:52:37 | dxd | https://hastebin.com/rivekekawo.coffeescript |
09:53:07 | dxd | prefer hastebin) |
09:53:39 | PMunch | Ah okay, it's the same |
09:54:03 | PMunch | Only nimblemeta.json and the order is different |
09:54:26 | PMunch | (nimblemeta.json is probably different because the order of files is different) |
09:54:27 | * | chemist69 quit (Ping timeout: 260 seconds) |
09:55:01 | dxd | idk what to do with this strange nim error |
09:55:13 | PMunch | It's weird indeed |
09:55:21 | PMunch | What Nim version are you using again? |
09:55:25 | dxd | 1.2.0 |
09:55:26 | PMunch | 1.2.0 or 1.2.2 |
09:55:29 | PMunch | Hmm |
09:55:30 | * | chemist69 joined #nim |
09:55:43 | PMunch | I tried with both devel and 1.2.0 and both worked |
09:55:57 | * | couven92 quit (Read error: Connection reset by peer) |
09:56:00 | dxd | by the way can you try with lua5.1? |
09:56:31 | PMunch | I did try with 5.2 and got this error: http://ix.io/2pu1 |
09:56:40 | * | couven92 joined #nim |
09:56:49 | alehander92_ | wow |
09:56:53 | alehander92_ | new github is different |
09:56:54 | * | narimiran quit (Ping timeout: 240 seconds) |
09:57:08 | PMunch | alehander92_, you're trying the redesign preview as well? |
09:57:10 | alehander92_ | i enabled some kind of beta |
09:57:12 | alehander92_ | yeah |
09:57:29 | alehander92_ | i still remember the tomsky analysis |
09:57:52 | PMunch | Tomsky analysis? |
09:57:55 | dxd | uh shit |
09:58:20 | alehander92_ | https://tonsky.me/blog/github-redesign/ |
09:58:23 | alehander92_ | tonsky* |
09:58:28 | alehander92_ | i admit it might look a bit too miuch |
09:58:36 | PMunch | The "Design updates" one is fine, not a huge fan of the round avatars but ok. But the "Repository refresh" is not great.. |
09:58:42 | alehander92_ | but i liked how it did put a lot of info in one place |
09:58:51 | alehander92_ | without being too much |
09:58:59 | alehander92_ | but of course probably they want something more minimal |
09:59:07 | alehander92_ | what is the refresh thing |
09:59:10 | alehander92_ | just the new main page? |
09:59:55 | FromGitter | <Vindaar> new repo page is fugly :| |
10:00:16 | dxd | ok gonna try switch at windows |
10:00:23 | * | dxd quit (Remote host closed the connection) |
10:00:25 | Araq | final talk arrived! |
10:00:30 | alehander92_ | ooh |
10:00:33 | alehander92_ | is it moerm |
10:00:35 | Araq | we can now proceed in planning NimConf 2020 |
10:00:55 | alehander92_ | i just want some proof assistants in my signature |
10:01:22 | PMunch | dxd, I'm on Linux as well.. |
10:02:12 | PMunch | alehander92_, if you click you avatar and "Feature previews" you can toggle the different redesigns |
10:02:19 | PMunch | (really neat feature by the way) |
10:02:34 | * | literal_ is now known as literal |
10:03:49 | Araq | no, it's not moerm |
10:04:15 | Araq | I think it's "exelotl"'s talk but tbh |
10:04:28 | Araq | I'm confused with all the nicknames and real names |
10:06:40 | PMunch | Haha, yeah that confused me a lot during my first FOSDEM |
10:07:21 | * | narimiran joined #nim |
10:07:26 | PMunch | Especially since we had a stand so it wasn't really obvious if the people there were Nim users I might know or just interested in Nim |
10:09:22 | livcd_ | why is everyone linking tonsky today :| |
10:12:39 | PMunch | livcd_, because of the new GitHub design? |
10:12:50 | PMunch | alehander92_, I'm with him up to Problem 5 |
10:13:07 | PMunch | And Problem 7 is fine |
10:17:03 | FromGitter | <bung87> new design too bold to me |
10:18:08 | FromGitter | <bung87> maybe the word heavy |
10:18:53 | * | couven92 quit (Read error: Connection reset by peer) |
10:19:11 | * | couven92 joined #nim |
10:19:23 | * | couven92 quit (Read error: Connection reset by peer) |
10:19:46 | * | couven92 joined #nim |
10:20:44 | * | couven92 quit (Read error: Connection reset by peer) |
10:21:19 | * | couven92 joined #nim |
10:21:34 | * | fredrikhr quit (Ping timeout: 246 seconds) |
10:26:25 | * | dxd joined #nim |
10:27:16 | dxd | PMunch wtfff switched to windows and in console just 1, 2 and no errors or something |
10:30:24 | * | fredrikhr joined #nim |
10:32:14 | * | couven92 quit (Ping timeout: 240 seconds) |
10:33:57 | * | dxd quit (Remote host closed the connection) |
10:37:00 | PMunch | dxd, Windows probably hides SIGSEGVs or something |
10:37:11 | PMunch | idk, been ages since I used Windows |
10:37:36 | FromDiscord | <Recruit_main707> dll magic is even more magical on windows |
10:46:20 | narimiran | @exelotl you here? |
10:56:28 | FromDiscord | <Rika> why's `FileStreamObj` an `object of Stream` but `StringStreamObj` is `object of StreamObj`? |
11:28:49 | krux02 | don't ask why. |
11:29:43 | * | Tlongir joined #nim |
11:30:53 | * | federico3_ is now known as federico3 |
11:31:07 | FromDiscord | <exelotl> narimiran: yep, responded in nimconf channel |
11:34:33 | FromDiscord | <impbox> anyone know of an example of a nimble package that has a bootstrap tool that creates a new project, copying example data from the nimble package? |
11:34:59 | FromDiscord | <impbox> for nico I want to make a tool that bootstraps a new nico project and copies and example script and assets from the nimble package |
11:35:06 | Araq | Rika: old code vs new code, it doesn't matter |
11:35:23 | FromDiscord | <Rika> which is the preferred one now tho? |
11:35:26 | Araq | in reality the code always inherits from the object type and never from a 'ref' |
11:35:34 | FromDiscord | <Rika> ah okay |
11:36:13 | Araq | more idiomatic is 'of Stream' without the Obj |
11:36:37 | FromDiscord | <impbox> I guess I just need a way to find out where the nimble package is installed |
11:37:50 | FromDiscord | <impbox> basically copyDir from `$nimblePackageDir/exampleApp` to target dir |
11:38:13 | FromDiscord | <impbox> but i'm not sure how to find programattically where my nimble package is installed |
11:45:27 | * | tane joined #nim |
11:48:45 | FromDiscord | <Zed> anyone on who uses nim + emacs? |
11:49:01 | FromDiscord | <Zed> I cant seem to get nim completion working |
11:49:13 | FromDiscord | <Zed> it's really annoying |
11:57:54 | zedeus | yeah me |
11:58:15 | zedeus | it needs some configuration, one sec |
11:58:32 | FromDiscord | <Zed> im running doom emacs if that changes anything |
11:58:45 | zedeus | i use spacemacs, their nim setup is mostly the same |
11:59:06 | FromDiscord | <Zed> yeah |
11:59:27 | zedeus | http://ix.io/2puz |
11:59:59 | zedeus | you can remove the --threads:on line, only useful if you're working on a project that uses threads |
12:02:29 | FromDiscord | <Zed> Does autocomplete show up as you type? |
12:02:41 | FromDiscord | <Zed> or tab it like in vim? |
12:03:14 | FromDiscord | <Rika> you can make vim show autocomplete as you type tho |
12:03:33 | * | fredrikhr quit (Read error: Connection reset by peer) |
12:03:48 | * | fredrikhr joined #nim |
12:04:15 | zedeus | yeah I get autocomplete while typinf |
12:04:22 | FromDiscord | <Zed> yeah i know, but when using coc the auto complete list fills the screen |
12:04:22 | * | couven92 joined #nim |
12:04:33 | FromDiscord | <Zed> how do you turn that on? |
12:04:40 | FromDiscord | <Zed> im still trying to figure out emacs |
12:05:06 | FromDiscord | <Rika> it doesnt fill the screen for me? i use coc too, dunno what you mean by fill the screen |
12:05:19 | zedeus | idk what coc is, i use company for completion |
12:05:28 | zedeus | oh vim |
12:05:32 | FromDiscord | <Zed> yeah |
12:05:43 | zedeus | well no reason to use vim anyway, its features are a subset of emacs :) |
12:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
12:06:05 | FromDiscord | <Rika> lol |
12:06:15 | FromDiscord | <Rika> i like having a pinky thanks |
12:06:23 | zedeus | me too, that's why i use evil-mode |
12:06:29 | FromDiscord | <Zed> lol same |
12:06:35 | * | supakeen joined #nim |
12:06:38 | zedeus | i don't use ctrl/meta bindings for anything |
12:06:59 | FromDiscord | <Zed> like this @Rika https://media.discordapp.net/attachments/371759389889003532/723146740965965844/Screen_Shot_2020-06-18_at_10.06.16_pm.png |
12:07:09 | FromDiscord | <Rika> ah, i dont mind that |
12:07:13 | FromDiscord | <Rika> i think theres a setting for it |
12:07:21 | FromDiscord | <Zed> I just want 5-10 completions i can scroll through |
12:08:23 | * | fredrikhr quit (Ping timeout: 260 seconds) |
12:09:46 | FromDiscord | <Zed> so i've got company installed |
12:09:56 | FromDiscord | <Zed> but it's still not showing up |
12:10:04 | zedeus | doom should do all that stuff for you |
12:10:50 | FromDiscord | <Zed> that's what i thought but im still getting nothing |
12:11:41 | zedeus | well i dunno, maybe check how spacemacs does it |
12:12:11 | zedeus | http://ix.io/2puE |
12:12:16 | zedeus | here's my company config |
12:12:52 | * | dddddd joined #nim |
12:18:33 | * | clemens3 quit (Quit: rebot) |
12:22:19 | * | brainbomb quit (Ping timeout: 246 seconds) |
12:27:14 | * | brainbomb joined #nim |
12:28:46 | * | couven92 quit (Read error: Connection reset by peer) |
12:28:55 | FromDiscord | <Zed> hmm updating doom now..see if that does anything |
12:29:06 | * | fredrikhr joined #nim |
12:29:42 | * | couven92 joined #nim |
12:31:34 | * | brainbomb quit (Ping timeout: 240 seconds) |
12:31:35 | krux02 | @Zed: I use nim and emacs |
12:36:19 | FromDiscord | <Zed> ok so fly check is working but still no autocompletion while typing |
12:37:36 | * | brainbomb joined #nim |
12:39:00 | krux02 | Zed: how are you using fly check? |
12:40:10 | krux02 | does it use nimsuggest? |
12:40:22 | FromDiscord | <Zed> no idea lol |
12:40:30 | FromDiscord | <Zed> nothing was working before |
12:40:45 | FromDiscord | <Zed> but i just updated doom and now flycheck is working |
12:41:00 | krux02 | I worked on nim-mode and I basically redid all the syntax highlighting of nim-mode. |
12:41:54 | krux02 | And I disabled flycheck by default, because it was unryable (ofting giving wrong errors because it doesn't detect the project root), eats up all system memory, and makes typing unbearably slow. |
12:43:01 | krux02 | Syntax highlighting was also making it impossible to edit files with more than around 1k lines. |
12:43:12 | krux02 | but that part I fixed. |
12:43:29 | krux02 | I could never fix the performance issues of nimsuggest though, because I simly did not understand the code. |
12:43:38 | FromDiscord | <Zed> so i've got nim-mode, flycheck-nim and flycheck-nimsuggest installed |
12:43:46 | zedeus | i turn off flycheck often because nimsuggest is broken, but it can be useful |
12:43:56 | FromDiscord | <Zed> do you think i should remove both the flycheck ones? |
12:44:02 | krux02 | yea |
12:44:28 | krux02 | I recommend to use just the `compile` command from emacs instead. |
12:45:03 | krux02 | There you can compile the project with just `nim c arg1 arg2 ...` like you would do on the terminal |
12:45:20 | zedeus | i have flycheck-nim installed, it works ok in most cases. i mainly get false errors from jester |
12:45:30 | * | team\andinus is now known as notandinus |
12:45:44 | krux02 | but because the compile buffer is linked to your editing buffer, you can jump to the errors with M-n and M-p |
12:45:48 | zedeus | compiling it manually from emacs works but it doesn't serve the same purpose |
12:46:02 | krux02 | and if you bind `recompile` to a key, you can recompile with just a single button press |
12:46:10 | krux02 | super handy, simple to use, |
12:46:19 | krux02 | and 100% accurate. |
12:46:31 | zedeus | and slow if you're working with bigger projects |
12:47:07 | krux02 | well it doesn't slow your editing |
12:47:25 | krux02 | but yes to get feedback you have to wait for a few seconds. |
12:47:32 | krux02 | I worked on the Nim compiler with this. |
12:47:42 | zedeus | the point of flycheck is to show you errors while you're working, if you do a compile to see the errors that can take a few seconds, what's the point? |
12:47:44 | krux02 | feedback was certainly fast enough |
12:48:43 | krux02 | and the compiler usually provides you more than a single error to work on, so you can write your program and afterwards you fix all the problems with it. |
12:48:54 | krux02 | it is not flycheck, that is true, but it is certainly productive. |
12:49:18 | krux02 | And I couldn't handle the constant issues with flycheck anymore. |
12:49:20 | zedeus | i agree, but i'm not sure i would call it a replacement for what flycheck does |
12:49:56 | krux02 | I think nim-mode has also integration with flymake. Maybe that is reliable like compile but with integration like flycheck. |
12:50:01 | zedeus | if you want emacs integration and a quick way to navigate errors, using `compile` is great |
12:50:05 | krux02 | but I am not sure about that. |
12:50:35 | zedeus | nim-mode in general is quite unreliable for me, i often have to restart it |
12:50:37 | krux02 | zedeus, yes |
12:51:00 | krux02 | yea I am sorry about this unreliable part. |
12:51:10 | krux02 | It was really a horrible code base I had to start with. |
12:51:18 | krux02 | And I just could not fix the problems. |
12:51:39 | krux02 | so convoluted complicated and full of feauters that caused more problems that it solved. |
12:52:13 | zedeus | yeah I took a look but quickly gave up |
12:52:16 | krux02 | After all, only syntax highlighting is what I implemented, my knowledge of emacs wasn't high enough at that point in time to also address the other issues. |
12:52:27 | * | mfx joined #nim |
12:52:36 | zedeus | I'm glad I did the org-mode integration though, it's nice |
12:52:45 | krux02 | I think the nimsuggest integration should be thrown away and written from the ground up. |
12:52:56 | krux02 | There is no way to "fix" that mess. |
12:53:20 | krux02 | you did the org-mode integartion? That one is really cool, I use it quite often. |
12:53:31 | krux02 | well, I use it some times. |
12:53:47 | krux02 | I did not have problems with it. |
12:54:58 | krux02 | zedeus, btw the time I started with Nim I also started with emacs. And I spammed the original maintainer of nim-mode with pretty much humiliating issues reports and then he left. |
12:55:03 | krux02 | Not very diplomatic. |
12:55:32 | FromDiscord | <Rika> how rude |
12:55:47 | krux02 | But it was impossible to use. |
12:56:19 | krux02 | opening some files just froze the editor and I had to disable flontlock-mode to be able to do anything. |
12:56:37 | krux02 | But he came up with solutions like more options to control how many features of syntax highlighting should be enabled. |
12:56:46 | krux02 | But the problem was structural. |
12:57:02 | krux02 | Syntax highlighting was implemented in a way that it had to slow down the editor. |
12:57:19 | krux02 | too much lisp code execution at every keystroke. |
12:57:23 | * | mfx quit (Quit: Leaving) |
12:58:04 | krux02 | He probably just opened 10 line example files and tried to make them look as nice as possible, completely ignoring performance. |
12:58:11 | * | mfx joined #nim |
12:58:37 | krux02 | anyway, I am way too emotional right now even though this is years ago. |
13:00:38 | alehander92_ | let go man :D |
13:00:43 | krux02 | I can't |
13:01:24 | FromDiscord | <Zed> *it's been so long, i dont know what a normal code base looks like, i just cant let go* |
13:01:27 | krux02 | feature creep and this "being pround of super complicated fragile almost useless featueres" can really kill projects. |
13:01:30 | alehander92_ | on the other hand i guess you're a good tester of nim stuff |
13:01:41 | krux02 | am I? |
13:01:42 | alehander92_ | yeah, i am very good at adding those |
13:02:19 | * | adnan338 joined #nim |
13:02:27 | alehander92_ | well, if i give you a project and you feel its ok to use i'd probably be happy |
13:02:47 | alehander92_ | btw what do you think of go's generics |
13:02:51 | alehander92_ | they seem closer to reality |
13:02:56 | krux02 | didn't take a look at them |
13:03:05 | krux02 | I only heared about the rumors |
13:03:14 | alehander92_ | they got a tool out which tests the waters |
13:03:18 | krux02 | but never saw an example |
13:03:29 | alehander92_ | https://blog.golang.org/generics-next-step |
13:11:48 | FromDiscord | <willyboar> too late for you GO... 😛 |
13:11:52 | FromDiscord | <Rika> lmao |
13:13:04 | * | vsantana joined #nim |
13:14:09 | * | vsantana quit (Quit: leaving) |
13:14:30 | * | vsantana joined #nim |
13:18:01 | krux02 | It is not too late for go to add generics. |
13:18:09 | krux02 | I just skimmed over the document. |
13:18:17 | krux02 | It looks reasonable at first sight. |
13:18:28 | krux02 | But I am disappointed in the reflection section. |
13:18:30 | shashlick | Looking for feedback on https://github.com/nimterop/nimterop/issues/154#issuecomment-645110953 |
13:18:32 | disbot | ➥ getHeader should install binaries outside nimcache which can go away |
13:20:46 | * | skelett joined #nim |
13:27:38 | * | mfx_ joined #nim |
13:35:14 | * | clemens3 joined #nim |
13:36:32 | * | mfx_ quit (Quit: Leaving) |
13:36:37 | * | mfx quit (Quit: Leaving) |
13:51:58 | * | oddp quit (Read error: Connection reset by peer) |
13:53:20 | * | oddp joined #nim |
13:59:27 | * | oddp quit (Read error: Connection reset by peer) |
14:20:40 | FromDiscord | <impbox> yay managed to make a nico bootstrap app which installs a example code and data in a user specified directory \o/ helped me shorten my talk by about 10 minutes :3 |
14:25:28 | FromDiscord | <Recruit_main707> so unroll is deprecated? :( |
14:26:02 | * | kenran quit (Ping timeout: 258 seconds) |
14:27:54 | FromDiscord | <mratsim> is it? it never worked anyway |
14:28:00 | FromDiscord | <mratsim> it was a placeholder |
14:28:37 | FromDiscord | <Recruit_main707> i know it didnt work, i just though it was a doesnt work *yet* |
14:28:51 | FromDiscord | <mratsim> for 4 years :/ |
14:29:36 | FromDiscord | <Recruit_main707> it would have been useful |
14:32:08 | Araq | I can give you an unroll iterator |
14:32:30 | Araq | unrolling is useful but Nim can do it no less than 2 ways already. |
14:32:41 | Araq | 1. multiple 'yield' statements in an inline iterator |
14:32:46 | Araq | 2. via templates |
14:33:01 | Araq | In fact, Nim's GC uses 2. |
14:33:06 | * | fredrikhr quit (Read error: Connection reset by peer) |
14:33:45 | FromDiscord | <Recruit_main707> id like to have a look at it |
14:33:53 | * | fredrikhr joined #nim |
14:34:05 | FromDiscord | <impbox> need a funroll iterator for more fun |
14:36:08 | * | fredrikhr quit (Read error: Connection reset by peer) |
14:36:57 | * | fredrikhr joined #nim |
14:37:40 | * | fredrikhr quit (Read error: Connection reset by peer) |
14:37:58 | * | fredrikhr joined #nim |
14:38:01 | * | lritter joined #nim |
14:40:25 | * | fredrikhr quit (Read error: Connection reset by peer) |
14:40:36 | * | fredrikhr joined #nim |
14:40:44 | FromDiscord | <Rika> and a sunroll iterator for sun? |
14:41:05 | * | kenran joined #nim |
14:41:14 | zedeus | \[T]/ |
14:42:59 | * | fredrikhr quit (Read error: Connection reset by peer) |
14:43:21 | * | fredrikhr joined #nim |
14:43:25 | * | haxscramper joined #nim |
14:43:46 | haxscramper | How can I skip dependency verification stage in `nimble test` and disable `incorrect structure` warning? |
14:44:31 | * | fredrikhr quit (Disconnected by services) |
14:44:37 | * | couven92 is now known as fredrikhr |
14:44:52 | * | couven92 joined #nim |
14:45:26 | * | kenran quit (Ping timeout: 256 seconds) |
14:50:16 | haxscramper | Or force nimble to always output colored text - there is `--noColor` option but it can only work for disabling color. |
14:50:33 | FromDiscord | <mratsim> @Recruit_main707 this is my unroll template: https://github.com/numforge/laser/blob/7b9fd9b32283fa13680ac5f7223fa31283c0d3a4/benchmarks/vector_math/bench_exp.nim#L113-L125 |
14:50:50 | FromDiscord | <mratsim> And my unroll macro in my code generator: https://github.com/numforge/laser/blob/5213d6a4675d7635856bba02c290935e3d73743d/laser/lux_compiler/backend/legacy/lux_codegen_transfo.nim#L229-L292 |
14:51:10 | FromDiscord | <Recruit_main707> thx |
14:51:14 | Araq | of course, allmighty mratsim does it too |
14:51:16 | Araq | :D |
14:51:28 | FromDiscord | <mratsim> lol |
14:51:48 | FromDiscord | <mratsim> I have to unroll by 4 to put them in SIMD vectors |
14:54:56 | * | aenesidemus joined #nim |
14:57:09 | FromDiscord | <Recruit_main707> now that hot code reloading was mentioned in #nimconf:↵https://play.nim-lang.org/#ix=2pvm↵can code be hot reloaded in this kind of situation? |
14:57:26 | Araq | so my HD is full because of all the NimConf talks |
14:57:39 | Araq | I can now remove from my computer |
14:57:44 | Araq | Java 8 |
14:57:46 | Araq | - or - |
14:57:47 | Araq | Golang |
14:57:54 | zedeus | why not both? |
14:57:55 | FromDiscord | <Rika> hard choice |
14:57:59 | Araq | which one do you think takes up more memory? |
14:58:01 | FromDiscord | <Rika> good point |
14:58:05 | FromDiscord | <Rika> java |
14:58:05 | FromDiscord | <Recruit_main707> zedeus found the solution |
14:58:08 | FromDiscord | <nero> go |
14:58:13 | Araq | Go. |
14:58:18 | FromDiscord | <Rika> stop |
14:58:51 | Araq | perception, that's all there is |
14:58:57 | zedeus | the only lightweight thing about Go is it's feature list |
14:59:04 | FromDiscord | <Rika> oof |
14:59:04 | krux02 | Araq: buy a micro SD card, they you have at lest another 128GB free |
14:59:04 | FromDiscord | <Recruit_main707> lmao |
14:59:33 | FromDiscord | <Rika> at that point why not just buy an ssd |
14:59:50 | krux02 | yea ssd hard drive anything |
14:59:58 | krux02 | stores are still open |
15:00:40 | krux02 | zedeus: I feel that you are not a fan of Go. |
15:00:52 | FromDiscord | <mratsim> "lol no generics" |
15:00:52 | zedeus | how could you tell? |
15:00:54 | krux02 | I like go because of its lightweight feature list. |
15:01:18 | krux02 | mratsim: That one is changing, I just read the proposal that is coming. |
15:01:44 | Araq | I don't see this "lightweight feature list", structs vs pointers, slices, arrays, interfaces, function pointers |
15:01:52 | FromDiscord | <mratsim> yeah more parenthesis, Go will take the best thing of Lisp and leave the cruft behind |
15:02:07 | Araq | it has more features than Java |
15:02:30 | krux02 | But Java sucks. |
15:03:14 | FromDiscord | <nero> but it has a nice eco system |
15:03:31 | krux02 | mratsim: you know that Go doesn't have macros, and that is the best part of lisp. |
15:03:42 | Araq | now, I don't mind having features, but Go is all about perception |
15:04:02 | krux02 | If go gets macros that are as powerfull as Nim macros, I might seriously consider going back to it. But I doubt it is possible. |
15:04:04 | Araq | the illusion of simplicity when you never really look too closely |
15:04:04 | FromDiscord | <mratsim> Lisp has AST manipulation |
15:04:17 | FromDiscord | <mratsim> Go also has AST manipulation but it's ugly |
15:04:38 | krux02 | mratsim: I have to take a look at that, I never knew about that |
15:04:38 | Araq | Go also has pragmas in source code comments |
15:04:56 | Araq | anyhow, it's #nim we can talk about Nim instead |
15:05:03 | * | unknown__ joined #nim |
15:05:11 | FromDiscord | <mratsim> Here you go: https://github.com/ConsenSys/goff/blob/master/internal/templates/element/base.go#L122-L137 |
15:05:19 | FromDiscord | <mratsim> BigInt negation |
15:05:32 | FromDiscord | <mratsim> with static unroll of the for loop |
15:05:51 | FromDiscord | <mratsim> you run the go ast something on that template you get a go file that you can use |
15:06:34 | leorize[m] | reminds me of Araq's pascal preprocessor |
15:06:35 | FromDiscord | <mratsim> generated code: https://github.com/ConsenSys/goff/blob/master/examples/bn256/element.go#L143-L152 |
15:06:49 | FromDiscord | <Rika> looks like c++ templates |
15:07:03 | Araq | leorize[m], how do you know about that one? |
15:07:29 | FromDiscord | <mratsim> Didn't you watch his NimCOnf talk? "Stalking the BDFL of Nim" |
15:08:00 | Araq | Go also has multiple inheritance via "struct embedding", lesson learned: features are only bad if you don't rename them |
15:08:14 | leorize[m] | i read the pascal nim code once while trying to trace a statement in the compiler to its root lol |
15:09:36 | krux02 | Araq: can you elaborate on your sarcasm? |
15:13:51 | Araq | krux02, here is an example. I think we can all agree that Go is strong about "there is one way to do it" |
15:14:39 | Araq | yet in Go I can use 'var x = 0' or 'x := 0' or I can write 'if stmt; cond { ...}' vs 'stmt; if cond { ... }' |
15:15:17 | FromDiscord | <Recruit_main707> x := 0 only works inside a function iirc |
15:15:26 | Araq | how is that not in conflict with this "one way of doing things" design goal? |
15:15:45 | Araq | I tell you how it's not in conflict: nobody wrote a blog post about it. |
15:15:46 | krux02 | yea I agree the := syntax is not best part of the language. |
15:16:16 | krux02 | but the if stmt example, I don't see how that is a problem. |
15:16:23 | Araq | that's all there is to it, perception. it's all in your head and some things are simply not talked about so they don't exist |
15:16:58 | krux02 | well of course it is perception |
15:17:14 | krux02 | programming languages are made for humans to instruct computers. |
15:17:28 | * | abm joined #nim |
15:17:29 | krux02 | So how complex Humans pervieve tha language is very important. |
15:17:53 | krux02 | Big example is GC, it is super complex, but it is percieved as simple. |
15:18:03 | krux02 | not by everyone though. |
15:18:23 | Araq | no, that's just unscientific. a GC is simply to use, but hard to implement |
15:18:29 | krux02 | And those where the illusion of simplicity falls apart might start looking for a new language |
15:18:38 | Araq | (roughly speaking, in fact, implementing a simple GC is well simple) |
15:19:09 | krux02 | No a GC ist nat generally simple to use, because if you start to optimize for a GC you need to start learing about the implementation details of the GC |
15:19:15 | FromDiscord | <Rika> using a closure iterator emits a `RootEffect`? |
15:19:17 | FromDiscord | <Rika> why? |
15:19:18 | krux02 | and that is everything but simple if the implementation isn't simple |
15:19:18 | * | couven92 quit (Read error: Connection reset by peer) |
15:19:59 | Araq | krux02, well but not everybody has to tune the program for the GC |
15:20:13 | krux02 | true |
15:20:21 | krux02 | some some people have to |
15:20:23 | Araq | sometimes it's fast enough and you can care about correctness. |
15:20:49 | krux02 | some people also care about optimal performance |
15:21:06 | Araq | also |
15:21:53 | Araq | it's hard to implement a "stack" that works well for your function calls and value based datatypes |
15:22:22 | Araq | but it works so well that nobody complains about its complexity |
15:22:40 | Araq | it's all delegates to LLVM / Intel engineers ;-) |
15:22:43 | Araq | *delegates |
15:22:45 | FromDiscord | <Rika> (oof) |
15:22:47 | Araq | *delegated |
15:23:55 | shashlick | the quest for performance always takes you into difficult places - cannot expect to get it for free |
15:24:11 | krux02 | Araq: For the use it is important to predect behavior and to have as little surprise as possible. |
15:24:41 | krux02 | It doesn't matter if the implementation is hard or not. It just that usually a simple implementation is simple to predict. |
15:24:59 | FromDiscord | <Clyybber> @Rika Hmm, thats weird |
15:25:55 | krux02 | Anyway, I won't put Go into the list of bad/uncool programming language, just because it has a weird variable declartion syntax |
15:26:06 | krux02 | That is just not enough bad. |
15:26:17 | FromDiscord | <Rika> noticed when i tried using a closure iterator in a stream |
15:26:26 | Araq | that's not what I said |
15:29:14 | krux02 | It is the overall experience during Go development that was just smooth and almost frictionless, compared to the c++ CMake horror and nims .nimble/.nims/.nim.conf mess |
15:29:30 | shashlick | any ideas - https://github.com/nimterop/nimterop/issues/229 - freebsd compilation issue with clang / c++ |
15:29:32 | disbot | ➥ Build failure on FreeBSD ; snippet at 12https://play.nim-lang.org/#ix=2pvr |
15:30:36 | FromDiscord | <Rika> @Clyybber https://play.nim-lang.org/#ix=2pvs |
15:30:52 | FromDiscord | <Rika> or is it something else? |
15:32:54 | Araq | krux02, I hate the config mess myself and it's all my fault |
15:32:57 | FromDiscord | <Rika> i must go now, i am sleepy, ping if i was just stupid or if you know why lol |
15:33:11 | FromDiscord | <Rika> why -> a rooteffect is being emitted |
15:33:53 | FromDiscord | <Recruit_main707> gn |
15:33:55 | * | nikita` joined #nim |
15:34:57 | * | unknown__ quit (Quit: Leaving) |
15:35:23 | FromGitter | <jason_koch_twitter> any help on this error? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5eeb89bbe0e5673398be9027] |
15:35:28 | FromGitter | <jason_koch_twitter> it looks like the sigs match |
15:35:54 | FromGitter | <jason_koch_twitter> trying to pass a callback to a c function |
15:36:27 | Yardanico | can you show libbpf_print_fn_t definition? |
15:36:46 | FromGitter | <jason_koch_twitter> ```libbpf_print_fn_t* = proc(level: libbpf_print_level, a1: cstring): cint {.cdecl, varargs.}``` |
15:36:53 | Yardanico | well yeah they're different |
15:37:30 | FromGitter | <jason_koch_twitter> i'm pulling the varargs wrong i assume |
15:37:46 | FromGitter | <jason_koch_twitter> that seems obvious now i'm looking at it |
15:38:03 | Araq | but PMs and build systems are independent of programming languages |
15:39:06 | krux02 | Not really. |
15:39:45 | Araq | yes, really. you can use C++ without Cmake and Nim without Nimble. |
15:39:50 | * | bung_ quit (Ping timeout: 256 seconds) |
15:39:58 | krux02 | yes you can. |
15:40:12 | krux02 | But you can't use Cmake with Nim or Nimble on C++ |
15:40:27 | * | bung_ joined #nim |
15:41:37 | krux02 | And Go was designed to not require a build system with configuration files for all pure Go projects. |
15:41:38 | Yardanico | @jason_koch_twitter not sure how to go about using C's varargs in nim - probably by using emit or importc? to use va_list |
15:42:56 | krux02 | only when you need to run external tools during the build, for example code generators, The build process becomes more complicated. |
15:43:12 | FromGitter | <jason_koch_twitter> @yardanico i'm trying to call this ⏎ https://github.com/libbpf/libbpf/blob/v0.0.7/src/libbpf.h#L55-L58 |
15:43:22 | krux02 | With c++ you already need CMake or something similar if you want to integrate external libraries. |
15:43:38 | Araq | right. and fortunately Go isn't full of code generators now with its builtin generics and macros... hm |
15:43:39 | FromGitter | <jason_koch_twitter> library should call my fn with va_list, and i need to forward that to logger which takes a varargs[string, `$`] |
15:43:40 | Yardanico | @jason_koch_twitter oh it passes va_list explicitly |
15:43:58 | Yardanico | well you can try to declare va_list type as |
15:44:04 | Yardanico | "type va_list {.importc, header: "<stdarg.h>".} = object" from nimterop |
15:44:20 | krux02 | and nim never needs to run code generators during build, because of macros. So the build system has the potential to be just `nim c main.nim` for everything. |
15:44:24 | krux02 | but it isen't. |
15:44:33 | FromGitter | <jason_koch_twitter> oh that's a good diea, then i can just pass on the va_list as an opaque object right?, don't need to understand it |
15:44:53 | krux02 | or just `nim main.nim && ./main` |
15:44:54 | Yardanico | well you'll need to deconstruct it into nim sequence or something if you want to pass it as nim's sequence or varargs |
15:44:58 | Yardanico | proc myprint(level: libbpf_print_level, data: cstring, args: va_list): cint |
15:45:05 | Yardanico | and then you can also import va_start, va_end from stdarg |
15:46:02 | FromDiscord | <Recruit_main707> i think thats enough go in #nim for now :P |
15:47:03 | krux02 | it is |
15:47:13 | Araq | krux02, now it's turning into a more fruitfull discussion. how can we make this happen |
15:47:26 | euantor | shashlick: I reported the FreeBSD compilation issue, just FYI. If you want anything trying out, just let me know |
15:47:28 | Araq | there is this idea that we only really need 'import <url>' |
15:47:47 | FromDiscord | <Clyybber> it can only happen with nimble |
15:48:01 | FromDiscord | <Clyybber> nimble can have an update that makes us all use submodules |
15:48:02 | FromDiscord | <Recruit_main707> personally i dont like that (i do see it could be useful |
15:48:11 | * | tdc quit (Remote host closed the connection) |
15:48:14 | FromDiscord | <Clyybber> but thats really disruptive |
15:48:27 | krux02 | well first of all I think, Nim should not know about nimble. |
15:48:35 | FromDiscord | <Clyybber> talking about disruptive, once nimph gets rid of its nimble dependency |
15:49:01 | FromDiscord | <Clyybber> we should have something like that |
15:49:04 | krux02 | In other words, if you compile a file with `nim` it should now automatically put stuff from `~/.nimble` in the path |
15:49:17 | Araq | there is an RFC for removing Nim's knowledge of Nimble from it |
15:49:24 | shashlick | Thanks @euantor |
15:49:55 | krux02 | that is a start. |
15:50:30 | krux02 | I think if you want nimble packages on the path automatically, it should be `nimble` or one of its commands. |
15:52:10 | krux02 | Then I don't like that you need to pass the backend to the `nim` command all the time. |
15:52:26 | * | haxscramper quit (Remote host closed the connection) |
15:52:36 | krux02 | The should be a pragman in main.nim that defines the backend. |
15:52:45 | krux02 | something like that. |
15:53:18 | FromDiscord | <Clyybber> eh; we have a backend switch now afaik |
15:53:22 | FromDiscord | <Clyybber> at least for the doc backend |
15:53:30 | krux02 | Nim sees {.target: C.} and it will compile everything with C. |
15:53:46 | FromDiscord | <Clyybber> but I don't like the idea of having `nim somefile.nim` compile it |
15:53:46 | krux02 | libraries should also have something like that. |
15:54:00 | * | tdc joined #nim |
15:54:01 | FromDiscord | <Clyybber> I think theres an RFC by cooldome about that |
15:54:06 | krux02 | so that when you import a js wrapper in a C project, you will get an import error or something like that. |
15:54:41 | krux02 | Clyybber: What is the problem with `nim somefile.nim` compile it? |
15:54:56 | krux02 | that works in C++, too. |
15:55:09 | krux02 | g++ main.cpp && ./a.out |
15:55:19 | krux02 | I like it. |
15:56:10 | * | bung_ quit (Quit: Lost terminal) |
15:56:12 | * | bung quit (Quit: Lost terminal) |
15:59:10 | FromDiscord | <Clyybber> I don't like it because its not clear what it will do; will it compile and run it? evaluate it? docgen it? |
16:00:01 | krux02 | To get dependencies from URLs go has a go get command that fetches all URLs. But a lot of people complained about the dependencies from URLs, because versions |
16:00:20 | krux02 | so I think URL + tag/hash should work sufficiently. |
16:00:27 | FromDiscord | <Recruit_main707> but you cant use libraries without wifi then? |
16:01:01 | krux02 | Recruit_main707: the url is only for fetching the dependency for the first time. |
16:01:08 | krux02 | and to identify it. |
16:01:10 | FromDiscord | <mratsim> I'd like to be able to have specific files compile with specific target, for example CUDA |
16:01:27 | krux02 | mratsim: Yes I do, too. |
16:01:32 | krux02 | That is also what Go does. |
16:01:35 | FromDiscord | <Recruit_main707> krux02, but what happens if the lib gets updated |
16:01:54 | FromDiscord | <mratsim> I can mostly do that with localPassC now I have to check |
16:02:04 | krux02 | Recruit_main707: nothing |
16:02:33 | FromDiscord | <Recruit_main707> then you use the outdated version? or the new one? |
16:03:19 | krux02 | No autoupdating. |
16:03:28 | krux02 | Automatic updates are bad. |
16:03:47 | FromDiscord | <Recruit_main707> how do you update it then? |
16:03:48 | krux02 | We all know, when Java asks for an update, you say: "Not today". |
16:04:17 | * | vicfred quit (Quit: Leaving) |
16:04:17 | krux02 | you just specify the new version on the import |
16:04:32 | krux02 | and rerun the fetch command |
16:04:46 | * | vicfred joined #nim |
16:05:02 | krux02 | The question remains though, where to put all the dependencies. |
16:05:31 | krux02 | There are two options. Option 1 is put everything in a shared `/.nimpackages` directory, similar to nimble |
16:06:09 | krux02 | The other one is to put the dependencies in locally into `dependencies/` subfolder that will be ignored by git. |
16:06:22 | krux02 | I like the local dependencies subfolder. |
16:06:39 | krux02 | But it means that you need internet to start a new project. |
16:06:54 | krux02 | or add new dependencies |
16:08:01 | FromGitter | <bung87> if not a enterprise project,no need local package |
16:08:38 | krux02 | There can be a local package cache as well. |
16:09:20 | krux02 | Then the question is, what do you usually pass to the nim compiler if you need to do it? |
16:09:35 | krux02 | These compiler flags should be removed one by one. |
16:09:53 | FromGitter | <bung87> for a company theu may need local version packages in case package author delete it from internet |
16:10:18 | krux02 | bung87: good point |
16:10:36 | * | marnix quit (Remote host closed the connection) |
16:10:48 | FromGitter | <bung87> it just happens. |
16:11:01 | krux02 | I mean Nim could also start to provide its own server infrastructure for packages. |
16:11:09 | krux02 | for backup |
16:11:22 | krux02 | something like maven maybe. |
16:12:29 | krux02 | The last part is, look through project that can't be build with bare bone `nim c/cpp/js` and then try to figure out if there is a way to work around the additional required flags. |
16:12:42 | FromGitter | <bung87> yeah , other registry do so, they make package deleting more steps than publish |
16:12:47 | krux02 | Last part is tests. |
16:13:11 | krux02 | One thing that comes just to my mind are tests. |
16:13:37 | krux02 | It is a very common pattern to declare `whenIsMainModule: test1(); tes2(); ...` |
16:13:45 | krux02 | that is cool |
16:13:56 | FromDiscord | <Rika> I am still awake |
16:14:14 | krux02 | but it requires to write a tool that scans through your project and runs all modules. |
16:14:18 | * | rokups joined #nim |
16:14:19 | FromDiscord | <Rika> I'm not a fan of links as imports |
16:14:42 | krux02 | Rika: what is the problem? |
16:14:45 | krux02 | too verbose? |
16:14:50 | krux02 | too much information? |
16:15:07 | FromDiscord | <Rika> I don't exactly know how to say it |
16:15:31 | FromDiscord | <Rika> But I don't like the lack of separation between the package manager and the code |
16:15:53 | FromGitter | <bung87> not as i know ,is there language pack information including external dependencies? |
16:15:55 | krux02 | I am also not the biggest fan of it, but it is certainly cool in Go. At loast to my personal experience. But maybe it is possible to extract the coolness without actually putting links as imports. |
16:15:58 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
16:16:57 | krux02 | An idea would be a dependencies section at the beginning of your project that declares package names and associates them with links where they can be found. |
16:17:30 | krux02 | but after that initial declaration, the packages can be imported projectwide with their package name. |
16:17:51 | Araq | well we can always fix Nimble instead of re-inventing it |
16:18:05 | krux02 | well, I really want to make nimble obsolete. |
16:18:22 | krux02 | that is my goal. |
16:18:48 | krux02 | at least for the most part |
16:19:44 | FromGitter | <bung87> yeah , they can strictlly define what shoule be including in package info file and write in what format, but I Know most of them just describe it in readme |
16:22:38 | krux02 | Araq: to make `nim main.nim` work with everything, nimble needs to be made obsolete. |
16:23:00 | alehander92_ | why do people take inspiration from go and not from cargo |
16:23:16 | krux02 | And that means to see what parts of nimble are actually usfull and reinvent them in the Nim compiler. |
16:23:40 | FromDiscord | <Clyybber> eh? |
16:23:51 | krux02 | alehander92_: because Go in the language that I used for a long enough time to have a qualified opinion about it. |
16:23:54 | alehander92_ | it seems to me that rust got its package manager story right sooner and go kept experimenting and the url things were weird (but i am absolutely a noob at package mans / cargo tho) |
16:24:03 | FromDiscord | <Rika> I don't like this |
16:24:14 | alehander92_ | and people love cargo so much that many of them see it as one of the top rust's +s |
16:24:23 | Araq | alehander92_, it depends on the phase of the moon. we'll copy cargo again in 2 weeks. |
16:24:39 | krux02 | I would even go so far to make `nim` work for all project, without specifying a main. Then nim compiler has to figure out on its own what the main file is. |
16:25:12 | krux02 | By putting the right constrains on the project struture to make the main/entry point of the program always unique by construction. |
16:25:22 | alehander92_ | Araq havent copied nix yet |
16:25:36 | alehander92_ | (i know more cool words about tech i barely tried :( ) |
16:26:25 | alehander92_ | krux02 but how without specifying a special filename |
16:26:32 | alehander92_ | like __init__.py style |
16:26:43 | alehander92_ | there can be a nim.cfg main? |
16:26:56 | FromGitter | <bung87> dont like init file |
16:27:12 | krux02 | alehander92_, for examples by specifying a special filename, like: The entry point shall always be main.nim |
16:27:14 | FromGitter | <bung87> py doesnot need it nowadays |
16:27:24 | alehander92_ | krux02 but configurable , right? |
16:27:34 | alehander92_ | bung87 huh how do they run folders |
16:27:38 | alehander92_ | import* |
16:27:52 | krux02 | alehander92_, the point is to eleminate the cfg file |
16:28:07 | alehander92_ | but .. where would you put your flags |
16:28:11 | krux02 | alehander92_, nope not configurable |
16:28:13 | krux02 | fix |
16:28:31 | krux02 | alehander92_, that is the point, you don't put flags |
16:28:34 | FromGitter | <bung87> dont need a dir contains a init.py , most of them just empty file |
16:28:37 | FromDiscord | <Rika> What's so bad about a configuration file |
16:28:38 | krux02 | you just compile and it works |
16:28:40 | FromDiscord | <Rika> I don't get it |
16:28:41 | FromGitter | <bung87> looks silly |
16:28:52 | alehander92_ | but its useful to be able to put flags somewhere |
16:29:06 | alehander92_ | i know that i can run a bash file but .. then this doesnt work for windows etc |
16:29:21 | krux02 | no bash |
16:29:28 | krux02 | just `nim` |
16:29:34 | alehander92_ | i mean, if i dont want to type all the options |
16:29:40 | FromDiscord | <Rika> And if they want to force a flag? |
16:29:45 | krux02 | I said there are no options |
16:29:47 | alehander92_ | do i have any other way to pass the flags |
16:29:51 | krux02 | you just compile it. |
16:30:00 | krux02 | no |
16:30:04 | FromDiscord | <Rika> This sounds incredibly limiting |
16:30:08 | alehander92_ | yes, what i mean is do i have to always type `nim --myoptions etc` |
16:30:10 | alehander92_ | well, that sucks man |
16:30:15 | alehander92_ | i mean, it sounds good on theory |
16:30:28 | alehander92_ | but cfg pays off imho for some scenarios |
16:30:29 | krux02 | well you will still be able to pass flags, I don't want to remove that thing because so much already depends on it. |
16:30:53 | FromGitter | <bung87> I image that will be` when define install: requires ...` |
16:31:45 | alehander92_ | and i am not sure why does package management need to be done by the compiler: separation of those two does seem sensible |
16:31:54 | alehander92_ | it's more *minimalist* imo |
16:31:55 | krux02 | But I want to make "passing flags to the compiler" superflous and deprecated |
16:32:16 | alehander92_ | ah ok hm, but then how would you configure how it compiles your program |
16:32:20 | krux02 | because if you "need" to pass a flag to nim, you need to look up that flag in the README to build it. |
16:33:00 | krux02 | alehander92_, everything needs to be set in source |
16:33:02 | alehander92_ | and if you use software, sometimes you need to read a bit of help |
16:33:17 | alehander92_ | i mean, almost all cli software uses flags |
16:33:25 | alehander92_ | people learned how to do this |
16:33:41 | alehander92_ | krux02 but i might want to use all kinds of flags |
16:33:43 | alehander92_ | with the same program |
16:33:45 | FromGitter | <bung87> maybe first step just make package structure constrain,then other pm follows |
16:33:48 | alehander92_ | i did it before |
16:33:55 | krux02 | and if it can't be set in source, it needs to be specified globally (true meaning of glbally, one value for the entire world) |
16:33:57 | alehander92_ | i compile the same file with different flags |
16:34:01 | alehander92_ | how can i set it in source |
16:34:26 | alehander92_ | so, env variables? |
16:34:31 | krux02 | alehander92_, no |
16:34:35 | krux02 | maybe |
16:34:45 | krux02 | I need to see the source file to give you an answer. |
16:34:51 | alehander92_ | this doesnt make sense to me: the compiler is a function, it takes sources and it produces e.g. a binary, |
16:34:57 | alehander92_ | i want to be able to pass args to it |
16:35:09 | krux02 | But generally I want to take away the "pass flags to the compiler" tool. |
16:35:16 | alehander92_ | instead of immitating that with some kind of i dont know what |
16:35:29 | alehander92_ | krux02 ok imagine i compile the same file ui.nim |
16:35:36 | alehander92_ | once to karax-based js file |
16:35:45 | alehander92_ | and once to tui-cbackend-based binary |
16:35:53 | alehander92_ | how do i do it in source |
16:36:02 | krux02 | two projects |
16:36:13 | FromDiscord | <Rika> What |
16:36:17 | krux02 | one karax-based project, one cbacked based project |
16:36:31 | FromGitter | <bung87> oh,that's weird |
16:36:33 | krux02 | they can share the same tui |
16:36:47 | alehander92_ | ah this makes sense |
16:36:51 | alehander92_ | two files , right |
16:37:12 | alehander92_ | and then if someone uses my program and needs to experiment, he plays with a third file |
16:37:16 | Araq | and never share a single file between them because then when you open this file in your editor it cannot determine the "project" anymore |
16:37:19 | alehander92_ | i mean .. ok |
16:37:24 | alehander92_ | but i wouldn't really use it |
16:37:53 | krux02 | The current approach is, one project per folder. |
16:38:04 | alehander92_ | ok, this is just burocracy |
16:38:05 | krux02 | So the idea would alwas recursively search for the `main.nim` |
16:38:08 | Araq | but we can blame Nim/Nimble about this problem and pretend it's not an intrinsic property of a hierarchical file system |
16:38:41 | alehander92_ | krux02 sorry i just dont feel this is good |
16:38:46 | krux02 | so another project means another folder. I am not saying this is the ultimate solution, but it would work reliable and never confuse any editor. |
16:38:49 | alehander92_ | its very useful to tweak args etc on command line |
16:38:55 | alehander92_ | instead of changing all in source |
16:39:09 | krux02 | alehander92_, I disagree |
16:39:12 | alehander92_ | but copying the same files in the other folder would be very hard |
16:39:19 | alehander92_ | i mean, i dont want to copy them |
16:39:20 | Araq | it wouldn't work and it takes 1 minute to destroy the design |
16:39:22 | alehander92_ | i want to reuse them |
16:39:26 | krux02 | I prefear to tweak in source, because then you can commit it to VCS |
16:39:38 | alehander92_ | krux02 but .. you have cfg files for that .. |
16:39:40 | krux02 | you can't commit your command line flags |
16:39:41 | alehander92_ | you can have both |
16:39:50 | krux02 | nope no config files |
16:40:00 | alehander92_ | so you take my option |
16:40:02 | alehander92_ | just because |
16:40:08 | Araq | but whatever man, keep believing in ideas that don't work if it keeps you happy |
16:40:19 | alehander92_ | i mean, i am all for radical designs but i cant see how it helps me |
16:40:23 | FromDiscord | <Rika> What the heck |
16:40:50 | FromDiscord | <Rika> So the idea is to mould the config files into the source and remove flags, I don't understand what this solves |
16:40:50 | alehander92_ | i understand having a separate config might seem undesirable |
16:40:53 | alehander92_ | but it is useful |
16:41:02 | FromGitter | <bung87> whats the bad part of config file? |
16:41:20 | krux02 | alehander92_, it is not just undesirable. It fucks up IDE support |
16:41:36 | alehander92_ | well come on its much easier to somhow teach IDE-s to pick up my config |
16:41:48 | krux02 | no |
16:41:50 | krux02 | it's not |
16:41:52 | alehander92_ | than to limit users so much |
16:42:02 | krux02 | because you have to do it over and over and over and over again |
16:42:02 | alehander92_ | well, all other compilers i think of take args |
16:42:15 | krux02 | not all compilers |
16:42:21 | alehander92_ | which one doesn't |
16:43:41 | FromGitter | <bung87> oh , sounds like a rollup.config.js file |
16:43:46 | alehander92_ | i mean, its too much to need to copy your files in different folders |
16:44:02 | alehander92_ | when i make a change, i need to always copy it again? |
16:44:05 | alehander92_ | how does this work |
16:44:33 | krux02 | Araq: I am sure it would work. It just breaks stuff. |
16:44:48 | krux02 | maybe it can be made with just deprecation instead of breaking stuff |
16:45:03 | krux02 | but I am 100% sure it would work. |
16:45:14 | krux02 | It would fix all editor support |
16:45:19 | krux02 | well not all |
16:45:25 | alehander92_ | but how do all normal languages have ide support |
16:45:32 | FromGitter | <ynfle> Why is `nnkDotExpr` not in `nnkCallKinds`? |
16:45:38 | krux02 | but it is always a big pain for editors to know your compilation flags. |
16:45:59 | FromGitter | <bung87> yeah thats true |
16:45:59 | FromDiscord | <Rika> I assume because not all dot expressions call a function |
16:46:03 | alehander92_ | that's true, but there must be some middle ground |
16:46:14 | krux02 | ynfle: because it isn't yet a call, it will be converted ito a call |
16:46:30 | alehander92_ | ynfle yeah, and it might not be a call at all iirc |
16:46:34 | alehander92_ | e.g. `a.field` |
16:46:35 | FromGitter | <ynfle> Thanks |
16:47:07 | krux02 | but the compiler will convert it into a call |
16:47:48 | krux02 | so when you have a typed macro argument, it will become a call if it actually is a function symbol. |
16:47:55 | FromGitter | <bung87> krux if it just works ,shoud it be in part of compiler ,not a build system? |
16:48:30 | FromGitter | <ynfle> Thanks |
16:48:43 | krux02 | I think it should be part of the compiler |
16:49:04 | krux02 | because onthere there it can reach enough people to make a differce. |
16:49:43 | krux02 | alehander92_, Have you ever tried to have IDE support for languages like C++? |
16:50:28 | FromGitter | <bung87> if its just a package then user can easy give a try without breaking anything |
16:51:04 | krux02 | if its just a package then it can easyly never make a difference |
16:51:32 | alehander92_ | krux02 but this is ide's problem |
16:51:33 | FromGitter | <bung87> yeah, maybe people just dont try... |
16:51:58 | alehander92_ | why should the user of a language be super-limited because ide-s are not perfect at config detection |
16:52:18 | krux02 | alehander92_, no its a language problem when it is hard to provide ide support. |
16:52:27 | alehander92_ | and it seems people still get by with most language like c#/java/typescript etc |
16:52:32 | alehander92_ | ruby/python |
16:53:18 | krux02 | Java and C# have very good IDE support. |
16:53:23 | krux02 | Much better than Nim |
16:53:26 | alehander92_ | but it *is* an ide problem |
16:53:28 | FromGitter | <bung87> no thats not same |
16:53:31 | alehander92_ | if i could just easily tell the ide |
16:53:37 | alehander92_ | now just use *this* config file |
16:53:39 | FromGitter | <bung87> nim is multi targets |
16:53:45 | alehander92_ | or switch between all 3 in my project |
16:53:45 | krux02 | In terms of IDE support I would even say that Java puts Nim to shame |
16:53:48 | alehander92_ | it would be all fine |
16:54:04 | alehander92_ | and i dont see how is this hard |
16:54:26 | alehander92_ | its probably even an extension problem, ide-s provide the primitives probably |
16:54:29 | krux02 | alehander92_, then go and fix for all Nim IDEs if it isn't hard. |
16:54:48 | alehander92_ | well, what kind of argument is this |
16:55:08 | alehander92_ | better than removing config + cli args all together just because of a theory |
16:55:15 | FromGitter | <bung87> well actually you can provide a status bar switch in Ide for that |
16:55:15 | krux02 | Did you work on any Nim IDE support? |
16:55:27 | alehander92_ | krux02 i work on an ide-like thing which supports nim |
16:55:28 | krux02 | I can tell you, that I did work on nim-mode (emacs). |
16:55:38 | krux02 | And I tell you, it is hard to solve generally. |
16:55:59 | krux02 | If you would implement the constraints that I talked about, it wuold be trivial to support in IDEs |
16:56:03 | alehander92_ | and i admit i havent experimented with the config stuff (because the focus was elsewhere mostly) |
16:56:12 | alehander92_ | but i dont see whats the problem in |
16:56:15 | krux02 | but you want to keep the problem hard. |
16:56:32 | alehander92_ | but your solution make 5 other more important things impossible for me as an user |
16:56:39 | alehander92_ | i genuinely want to like it but huh |
16:56:41 | krux02 | so that every IDE implements a slightly different solution for it and it all becomes a big mess? |
16:56:51 | alehander92_ | so again |
16:57:01 | krux02 | what is impossileb? |
16:57:31 | alehander92_ | sorry, harder, |
16:57:35 | alehander92_ | i have my tui_project and browser_project |
16:57:41 | krux02 | you need to adjust to new constraints that you didn't have befor. That isn't easy, true. But not impossle. |
16:57:44 | alehander92_ | and they import the same 20 files |
16:57:50 | krux02 | no it is not harder. |
16:57:52 | alehander92_ | can i reuse those 20 files |
16:57:54 | krux02 | It is just different. |
16:58:27 | krux02 | yes of course you can |
16:58:36 | alehander92_ | or, i write a lib which can be used with 20 combinations of flags |
16:58:54 | alehander92_ | and i need to open a different project in my ide |
16:58:58 | alehander92_ | for each test file |
16:59:16 | alehander92_ | krux02 so how does the ide know how which config to use |
16:59:23 | alehander92_ | when i edit a_imported.nim |
16:59:28 | alehander92_ | the tui one or the browser one |
16:59:43 | krux02 | it doesn't need to know |
16:59:43 | alehander92_ | if i usually target both when writing changges |
17:00:21 | alehander92_ | but it does, so it can e.g. check with the correct options |
17:01:54 | FromDiscord | <Shucks> Did anyone figured out how to debug a dll loaded by a process? |
17:01:58 | krux02 | I said it already in the beginning, there is some detail working to be done. |
17:02:04 | Yardanico | @Shucks wdym? |
17:02:09 | alehander92_ | but what's the whole point then |
17:02:09 | krux02 | Some problems need to be solved differently |
17:02:29 | krux02 | but the idea here is, everything is more autark. |
17:03:25 | krux02 | alehander92_, I told you, get rid of the configuration messe. |
17:03:32 | krux02 | mess |
17:03:39 | alehander92_ | but you still need to solve the same problem |
17:03:41 | alehander92_ | i write my ide |
17:03:51 | alehander92_ | i want to semantically check a_imported.nim |
17:03:52 | FromGitter | <bung87> if it simpler and works i just wait and see |
17:03:54 | alehander92_ | what do i do |
17:04:00 | FromDiscord | <Shucks> I got a program which loads my nim dll which currently causes a crash and I have no idea why. I can't get any error messages from the main program itself so I need to debug the dll itself |
17:04:29 | FromDiscord | <Shucks> if that makes sense |
17:04:33 | Yardanico | well you can compile with --debugger:native |
17:04:37 | Yardanico | and then use gdb to get a backtrace |
17:04:40 | alehander92_ | like, you just move the cfg thing to "make a separate folder with a nim file instead of new cfg" |
17:05:26 | alehander92_ | but an extension should be able to understand a simple option which says "use this cfg file / flags" |
17:05:42 | alehander92_ | why is this so hard? probably i am missing something |
17:05:48 | FromDiscord | <Shucks> any other flags? Theres that much stuff like `--debuginfo` `--lineDir:on` |
17:06:01 | krux02 | a_imported doesn't need to be imported to work |
17:06:09 | FromDiscord | <Shucks> and gdb just needs to be attached to the main program? |
17:06:19 | krux02 | a_imported doesn't need to be imported to be checked for the compiler. You can compiler the library independently. |
17:06:26 | alehander92_ | ok, but there is code inside defines there which only makes sense with some flags |
17:07:20 | alehander92_ | it might even depend on having some of them e.g. when they pass consts |
17:07:24 | krux02 | Shucks: Those flags are just for debugging, they would still remain compiler flags. You would never need them for IDE support or building a project for the end user. |
17:08:19 | FromDiscord | <Shucks> Um yea, I was asking how I can debug my dll |
17:08:20 | krux02 | alehander92_, I would need to see the file to know. |
17:08:20 | alehander92_ | and another problem is build systems might apply many env-based flags e.g. optimization etc based on external configs or CI-s |
17:08:43 | alehander92_ | like : a huge thing would be to test my lib under a matrix of 5 different flag combos |
17:08:50 | alehander92_ | i dont want to manually write down 25 files |
17:09:13 | Yardanico | @Shucks you just need --debugger:native |
17:09:17 | krux02 | But for libraries that work for C and JS I thought about declaring that somewhere like: ``{.backends: [C, JS].}`` |
17:09:20 | Yardanico | and yes, then attach gdb to the main program |
17:09:22 | alehander92_ | krux02 well, all files which do stuff like `when defined(stuff): var other = .. else: template other: etc` |
17:09:25 | Yardanico | and what do you mean by the "crash"? |
17:09:31 | Yardanico | does it actually fail with SIGSEGV or something like that |
17:09:36 | Yardanico | or just finishes with some exit code |
17:09:52 | FromDiscord | <Shucks> well yea getting sigsegv from some thread and thats it |
17:09:58 | alehander92_ | krux02 but the backend command is just one example of all: e.g. `gc`, `defines` etc |
17:10:10 | krux02 | that means you instantly get a compilation error for modlues that can't be compiled for that backend instead of failing somewhere else. And the module knows that it needs to be checked for errors in both C and JS. |
17:10:19 | FromDiscord | <Shucks> Cant actually browse between lines. Cant set any breakpoints on vscode aswell |
17:10:39 | alehander92_ | krux02 but i want this module checked with some of my cfg options |
17:10:46 | alehander92_ | because those are what i usually need anyway |
17:10:50 | alehander92_ | not with some default ones |
17:10:51 | krux02 | So you can get error reports on both branches of a `when` statement at the same time |
17:11:06 | Yardanico | @Shucks you can set breakpoints with gdb itself |
17:11:12 | Yardanico | if you compile with --debugger:native |
17:11:32 | Yardanico | and you can actually debug with gdb from vscode too :) |
17:11:39 | Yardanico | just need a correct vscode debug task |
17:11:57 | krux02 | Shucks: what is with the breakpoints on vscode? |
17:12:06 | krux02 | Sorry gdb integration in vscode really sucks. |
17:12:18 | alehander92_ | it kinda works, it just needs the correct setup iirc |
17:12:24 | krux02 | I could not get that to work when I implemented it. |
17:12:34 | alehander92_ | it does work well once one sets it up |
17:12:51 | FromDiscord | <Shucks> It works pretty good for me aswell if im compiling a binary |
17:12:52 | alehander92_ | what people usually get confused is that top level variables in simple files |
17:12:56 | FromDiscord | <Shucks> but didnt got it working with a library yet |
17:13:02 | alehander92_ | are not recognized as they are mangled iirc |
17:13:16 | alehander92_ | but otherwise they maybe were pretty printed iirc |
17:13:19 | krux02 | There are two problems, Generated Lineinfo for the nim files aren't that good. The second problem is, gdb integration into vscode isn't really good. |
17:13:27 | alehander92_ | krux02 it is: it works |
17:14:06 | alehander92_ | the lineinfo needs fixes tho yeah |
17:14:22 | FromGitter | <bung87> the config task can be easy as copy paste? |
17:15:11 | FromGitter | <bung87> i may copy to my extension |
17:15:15 | krux02 | and if you use gc:arc, pretty printing functionality becomes worse in gdb. |
17:18:06 | krux02 | my recommendation for gdb is, use the rbreak command when you want to break on function entry. |
17:18:32 | krux02 | rbreak <funcname> will break on any function that has <funcname> in it. |
17:18:54 | krux02 | In other words it doesn't care if there is name mangling involved. |
17:19:12 | krux02 | it also works on generic functions as it will break on all generic implementations. |
17:19:47 | krux02 | But I could not find any gdb terminal in vscode gdb integration. |
17:20:29 | krux02 | I always use the emacs gdb integration. That integration as gdb as you can get. |
17:20:44 | krux02 | it is like command line gdb, but everything is put into emacs buffers. |
17:21:00 | FromDiscord | <SeanOMik> Is there any way I could debug my Nim application? |
17:21:08 | krux02 | yes |
17:21:10 | krux02 | nim-gdb |
17:21:10 | FromDiscord | <Generic> echo 😛 |
17:21:27 | krux02 | nim c -g myprogram |
17:21:42 | krux02 | nim-gdb --args ./myprogram |
17:21:54 | FromDiscord | <SeanOMik> Is there a way I could do it with VSCode? |
17:21:55 | krux02 | rbreak myfunction |
17:22:02 | krux02 | print arg1 |
17:22:24 | krux02 | SeanOMik: well there is some gdb VSCode integration. People say it kind of works |
17:22:38 | krux02 | it is far from perfect though, maybe better than nothing. |
17:22:38 | * | endragor quit (Remote host closed the connection) |
17:22:57 | FromDiscord | <SeanOMik> Yeah I see that but I get an error when it tries to launch the `.exe` |
17:23:05 | * | endragor joined #nim |
17:23:15 | FromDiscord | <SeanOMik> Something like the `.exe` doesn't exist or is invalid |
17:23:30 | krux02 | but last time I used vscode I could not find a gdb command line interface, I think that currently that is essential in debugging Nim. |
17:23:55 | FromDiscord | <SeanOMik> Theres a debug console |
17:24:05 | FromDiscord | <SeanOMik> But I cant type in it because I have to start a debugging session |
17:24:18 | krux02 | does it allow you to write gdb commands such as `run` or `rbreak`? |
17:24:24 | FromDiscord | <SeanOMik> No |
17:24:35 | FromDiscord | <SeanOMik> I cant type in it because I cant start a debugging session |
17:25:01 | alehander92_ | but otherwise it does |
17:25:13 | alehander92_ | seanOMik maybe you dont pass the right path |
17:25:22 | FromDiscord | <SeanOMik> The path is correct |
17:25:39 | FromDiscord | <Shucks> you don't got gdb in path. Either setup nim/dist/mingw/bin/ to your path or edit the nim-gdb.bat in nim/bin/nim-gdb.bat |
17:25:54 | * | vikfret joined #nim |
17:25:57 | FromDiscord | <SeanOMik> I entered the path into explorer and it launches the `.exe` |
17:26:00 | krux02 | SeanOMik: nim-gdb is a shell script, there is also a .bat substitution, but I did not write it, I can't guarantee that it would work. |
17:26:13 | FromDiscord | <SeanOMik> Oh I wasn't pointing to the one in the nim directory |
17:26:13 | krux02 | But maybe you start with bare bone `gdb` to get started. |
17:26:34 | krux02 | nim-gdb just tells gdb to load the nim pretty printers |
17:26:40 | alehander92_ | hm i didnt realize nim-gdb works like that |
17:26:41 | alehander92_ | cool |
17:26:46 | alehander92_ | otherwise |
17:26:47 | alehander92_ | http://ix.io/2pvY |
17:26:52 | alehander92_ | is my vscode config |
17:26:58 | FromDiscord | <Shucks> me either. Nim-gdb makes variables and stuff more readable? |
17:27:12 | krux02 | he is on windows |
17:27:20 | krux02 | nim-gdb is a shell script |
17:27:30 | krux02 | Shucks: yes |
17:27:39 | alehander92_ | ahh |
17:27:41 | krux02 | it shows seq string and enums. |
17:27:47 | krux02 | But enums don't work all the time |
17:27:49 | * | endragor quit (Ping timeout: 264 seconds) |
17:27:51 | FromDiscord | <Shucks> good to know |
17:27:53 | * | dxd joined #nim |
17:27:56 | krux02 | it also prints set[enum] |
17:28:14 | alehander92_ | so i guess a combo of gdb path and nim-gdb in `.gdbinit` works? |
17:28:20 | alehander92_ | krux02 i want to fix the case object stuff |
17:28:24 | alehander92_ | for my job |
17:28:48 | alehander92_ | once i tried to add some new runtime type info for branch<=>fields mapping |
17:28:49 | krux02 | I wrote a test for nim-gdb but it isn't integrated into CI, so anybody could break the pretty printer at any time and no test would catch it. |
17:29:11 | alehander92_ | but it never really got inside |
17:29:19 | Yardanico | well RTTI is not the way to go anyway, maybe nim could generate some more native debugging info somehow? |
17:29:22 | Yardanico | how C/C++ do that? |
17:29:28 | FromDiscord | <Shucks> still can't figure out how I could debug my dll. `gdb -p MainProcessPid` just tells me that no symbols are load |
17:29:35 | krux02 | I didn't find `.gdbinit` useful for anything. |
17:29:38 | alehander92_ | well probably dwarf, but the case<=>field stuff seems pretty nim specific |
17:29:42 | dxd | hi! can i translate this headers to nim? c2nim is throwing errors |
17:29:42 | dxd | https://github.com/Facepunch/gmod-module-base/tree/development/include/GarrysMod/Lua |
17:29:55 | krux02 | it is constantly disabled for "security" rendering it completely useless |
17:30:16 | FromDiscord | <Recruit_main707> dxd, c2nim will require you to modify the headers |
17:30:17 | alehander92_ | but we can look at e.g. rust enum gdb support |
17:30:25 | Yardanico | dxd: c2nim supports C++ but you need some manual work |
17:30:27 | alehander92_ | they might be kinda similar |
17:30:31 | krux02 | I don't know how to fix the case object stuff. currently it prints everything as far as I can tell. |
17:30:40 | alehander92_ | yeah, i wanted to be able to just |
17:30:46 | alehander92_ | detect the active branch fields |
17:30:47 | dxd | Recruit_main707, Yardanico, and what should i do? |
17:30:51 | * | oddp joined #nim |
17:31:10 | alehander92_ | yardanico i am not sure whats the problem with purely debug-only rtti |
17:31:16 | Yardanico | dxd: either manually wrap it or you can just use C++'s backend to use these headers with importc/importcpp |
17:31:18 | krux02 | alehander92_, that is something that only the Nim compiler knows. |
17:31:30 | alehander92_ | exactly, so it needs to produce that info somewhere |
17:31:38 | krux02 | yes |
17:31:43 | alehander92_ | i had a PR |
17:31:45 | alehander92_ | to the compiler |
17:31:59 | FromDiscord | <Recruit_main707> dxd, this is for c, maybe you can extrapolate some things https://blog.johnnovak.net/2018/07/07/creating-a-nim-wrapper-for-the-fmod/ |
17:32:02 | alehander92_ | that did that, but i am not sure what state i left it in |
17:33:14 | alehander92_ | https://github.com/nim-lang/Nim/pull/9949 |
17:33:15 | disbot | ➥ Add data about variants in debug mode |
17:34:33 | alehander92_ | it seems i forgot about it |
17:37:07 | FromDiscord | <Shucks> nim-gdb just seems to work for linux |
17:37:10 | FromDiscord | <Recruit_main707> dxd. you should check https://github.com/genotrance/nimgen↵aswell |
17:39:23 | dxd | i will try |
17:42:25 | dxd | i don’t think it is very different from c2nim, the same errors |
17:45:15 | shashlick | @euantor: you here? |
17:46:10 | euantor | shashlick: yeah, just about to eat dinner though |
17:46:57 | shashlick | did you set gcc.linkerexe = "clang++" or clang.linkerexe = "clang++" |
17:47:15 | shashlick | i should probably just remove that when/else |
17:48:04 | euantor | Ah, I did the latter. I’ll try that change once I finish eating |
17:48:16 | * | vsantana_ joined #nim |
17:48:41 | euantor | I just changed the g++ in the quotes and that’s it |
17:49:34 | * | vsantana quit (Ping timeout: 246 seconds) |
17:50:04 | * | dxd quit (Ping timeout: 245 seconds) |
17:50:36 | shashlick | ya need to change both since you are using clang as your default compiler |
17:51:06 | shashlick | best to just say - switch("gcc.linkerexe", "g++"); switch("clang.linkerexe", "clang++") without any when/else |
17:51:11 | euantor | Yeah, will try it and let you know |
17:51:29 | shashlick | cool thanks |
17:57:24 | Araq | controversial RFC incoming, https://github.com/nim-lang/RFCs/issues/236 |
17:57:26 | disbot | ➥ Deprecate the 'defer' statement from Nim ; snippet at 12https://play.nim-lang.org/#ix=2pwd |
17:59:25 | * | casaca quit (Remote host closed the connection) |
18:00:55 | FromDiscord | <mratsim> so we can't have a go syntax skin anymore? |
18:01:05 | FromDiscord | <mratsim> are you removing interface from the keywords as well? |
18:01:49 | * | vsantana_ quit (Quit: leaving) |
18:02:24 | livcd_ | oh no so forward declarations and defer are going away? |
18:02:34 | Araq | huh? |
18:02:44 | livcd_ | you mentioned earlier |
18:03:06 | Araq | no, on the contrary, the need for forward decls should be removed |
18:03:17 | livcd_ | ahh |
18:03:40 | * | waleee-cl joined #nim |
18:03:47 | Araq | mratsim: "inferface" is a keyword without an implementation. |
18:04:08 | Araq | it doesn't cost us development effort, I fail to see the connection. |
18:04:08 | FromDiscord | <mratsim> yeah I know 😉 |
18:04:18 | FromDiscord | <mratsim> it was a joke |
18:04:30 | Araq | no, I'm not gonna remove everything from Nim that I personally don't like |
18:04:32 | FromDiscord | <mratsim> it's go day today |
18:04:59 | Araq | but some things have a bad benefit/cost ratio |
18:05:24 | oddp | What are some other pain points on your list? |
18:06:13 | oddp | What else needs to go further down the line? |
18:06:23 | FromDiscord | <mratsim> enums with holes? |
18:06:27 | Araq | 'defer', "implicit items/pairs iterators", "different scopes for iterators and procs", 2 config systems |
18:06:31 | euantor | shashlick: hooray, we have liftoff! |
18:06:41 | euantor | Will open a PR with the change |
18:07:15 | Araq | enums with holes can stay. |
18:08:02 | FromDiscord | <mratsim> party in da house! |
18:08:34 | Araq | oh and methods and converters could see some patches too. |
18:09:24 | Araq | I have an alternative for 'static T' that would make the bugs much easier to fix but @zah doesn't agree |
18:09:25 | FromDiscord | <mratsim> (vtable) |
18:09:49 | Araq | maybe I should write the RFC anyway |
18:09:57 | FromDiscord | <Clyybber> what is the alternative? |
18:09:58 | FromDiscord | <mratsim> didn't timotheecour already propose 3 or 5 fixes to that? |
18:10:54 | shashlick | @euantor awesome! Thanks for persisting |
18:10:55 | FromDiscord | <Clyybber> you mean the aliasSym thing? |
18:11:50 | * | alehander92_ wow so many results |
18:11:55 | Araq | Clyybber: in a nutshell it's "simply allow values to be passed to generic parameters" |
18:11:56 | alehander92_ | huh how did i do that |
18:12:27 | FromDiscord | <Clyybber> Araq: Ah. |
18:12:28 | euantor | Just got to hope the CI doesn't complain |
18:16:57 | FromDiscord | <Shucks> What exactly does `nim-gdb` do? It seems like its joining my executable path incorrect on windows. |
18:16:59 | FromDiscord | <Shucks> `"G:\Coding\Nim\Tests/gdbtest.exe": not in executable format: File format not recognized` |
18:17:45 | * | endragor joined #nim |
18:19:23 | Yardanico | By the way, I wonder if there's any reason not to use --opt:speed even by default in debug builds? |
18:19:38 | Yardanico | Because all nim stacktraces and stuff will still be enabled, so are there any drawbacks? |
18:20:35 | FromDiscord | <mratsim> some bugs only happen when you don't compile with -O3 |
18:20:43 | Yardanico | oh, maybe also longer compile times |
18:20:47 | Yardanico | forgout about that |
18:20:51 | Yardanico | *forgot |
18:20:54 | FromDiscord | <willyboar> alehander92 we should organize the talk after the conf |
18:21:02 | alehander92_ | ok |
18:21:22 | Yardanico | it's just from https://forum.nim-lang.org/t/6444 again |
18:21:23 | FromDiscord | <mratsim> I'm not too worried about the compile-time on the C side |
18:21:23 | alehander92_ | just setup a time guys, i am usually ok if its not on sunday |
18:21:33 | Yardanico | that person got hit by https://github.com/nim-lang/Nim/issues/14272 :P |
18:21:34 | disbot | ➥ -d:release -d:danger don't work as expected in user configs ; snippet at 12https://play.nim-lang.org/#ix=2leZ |
18:21:39 | FromDiscord | <willyboar> until now i really totally agree w/ PMunch approach |
18:22:49 | * | endragor quit (Ping timeout: 246 seconds) |
18:23:26 | * | solitudesf- joined #nim |
18:26:37 | * | solitudesf quit (Ping timeout: 264 seconds) |
18:30:55 | * | solitudesf- quit (Remote host closed the connection) |
18:31:17 | * | solitudesf- joined #nim |
18:32:09 | * | NimBot joined #nim |
18:35:06 | * | natrys joined #nim |
18:38:45 | * | kenran joined #nim |
18:40:40 | shashlick | why is marshal not supported with --gc:arc |
18:40:56 | FromDiscord | <Recruit_main707> smh |
18:41:11 | Yardanico | shashlick: because it uses typeinfo |
18:41:25 | Yardanico | which is module to work with nim's RTTI |
18:42:09 | shashlick | okay what's the alternative |
18:42:23 | Yardanico | https://github.com/status-im/nim-json-serialization/tree/master/json_serialization ? |
18:42:26 | Yardanico | https://github.com/status-im/nim-json-serialization |
18:43:24 | shashlick | great - more dependencies |
18:43:30 | Yardanico | you can try json.to |
18:43:42 | Yardanico | and % |
18:43:58 | * | rokups quit (Quit: Connection closed for inactivity) |
18:44:09 | shashlick | just when i thought I was done - ugh |
18:44:33 | Araq | sorry |
18:44:48 | FromDiscord | <Shucks> hallelujah https://media.discordapp.net/attachments/371759389889003532/723246844037300264/gdb.png |
18:44:54 | shashlick | I need to add some --gc:arc tests to nimterop |
18:45:10 | FromDiscord | <mratsim> what, how? @Shucks I've given up |
18:45:17 | FromDiscord | <mratsim> it worked for me once, 3 years ago |
18:45:24 | Yardanico | @mratsim it's easy to set up |
18:45:28 | Yardanico | well not hard |
18:45:32 | shashlick | please document! |
18:45:34 | Yardanico | I think we talked in the chat here too |
18:45:38 | Yardanico | and alehander helped me |
18:45:41 | FromDiscord | <mratsim> please make a blog post |
18:46:48 | FromDiscord | <Shucks> I guess I did nothing fancy. Mostly just used the standard launch.json. Let me paste it |
18:47:02 | FromDiscord | <Shucks> https://paste.sh/IFvIbHyD#c7SA9BO2H4cmZtwbO8Ypra7U |
18:47:30 | Yardanico | you can paste right in discord too :) |
18:47:48 | FromDiscord | <Shucks> dont wanna flood that chat ;D |
18:47:49 | FromDiscord | <Shucks> brb |
18:50:46 | * | vikfret quit (Quit: Leaving) |
18:51:53 | * | clemens3 quit (Read error: Connection reset by peer) |
18:53:05 | * | casaca joined #nim |
18:53:06 | * | casaca quit (Excess Flood) |
18:54:05 | * | casaca joined #nim |
18:54:06 | * | casaca quit (Excess Flood) |
18:55:05 | * | casaca joined #nim |
18:55:06 | shashlick | peace - marshal => json was seamless |
18:55:06 | * | casaca quit (Excess Flood) |
19:03:12 | shashlick | Marshal could handle nested which is why I ditched json |
19:03:30 | shashlick | But I had removed nesting so it worked |
19:03:34 | Yardanico | well % handles nested just fine |
19:05:37 | * | fredrikhr quit (Ping timeout: 264 seconds) |
19:05:44 | shashlick | Not nested sorry, cyclic |
19:05:48 | Yardanico | oh |
19:06:27 | disruptek | i think the problem with defer is composition and reasoning, legibility. |
19:13:09 | FromDiscord | <Recruit_main707> now that the chat is more calmed, https://play.nim-lang.org/#ix=2pwD↵can hot code reaload work in a situation like this? ^ |
19:13:55 | Yardanico | @Recruit_main707 yeah sure why not |
19:14:00 | Yardanico | why did you use noreturn btw? :P |
19:14:07 | Yardanico | I mean it's okay but I'm just curious |
19:14:14 | FromDiscord | <Shucks> Wait? Nim can hot code reload? |
19:14:21 | Yardanico | https://nim-lang.org/docs/hcr.html |
19:14:35 | Yardanico | @Recruit_main707 you'll have to split into modules though |
19:15:09 | FromDiscord | <Recruit_main707> thats the thing, the main module calls the loop that would need to check wether to hot reload or not |
19:15:50 | * | kenran quit (Ping timeout: 258 seconds) |
19:16:12 | FromDiscord | <Recruit_main707> ...unlike the example in that web |
19:18:54 | FromDiscord | <Clyybber> @Recruit_main707 you mean you want to reload the body of the loop? |
19:19:08 | FromDiscord | <Clyybber> you can just extract out the contents into a proc |
19:19:09 | FromDiscord | <Clyybber> ¯\_(ツ)_/¯ |
19:19:55 | FromDiscord | <Recruit_main707> not sure what you mean, i want to reload the code of the main module, but from within my library |
19:20:06 | Yardanico | so put the while loop in the main module |
19:20:19 | Yardanico | and make it call a proc in that loop |
19:20:31 | Yardanico | so you can reload the other module from the main module |
19:20:38 | Yardanico | anyway I've never used nim's hcr myself :P |
19:21:00 | FromDiscord | <Recruit_main707> no, i reload the main module from the other module |
19:21:05 | Yardanico | wat |
19:22:49 | FromDiscord | <Recruit_main707> check the code again, Nimbot.nim is the main module, that calls receive-and_respond() from the other module (RLNIM.nim), which should hot reload the code in the main module (Nimbot.nim). |
19:24:00 | FromDiscord | <Recruit_main707> (get_output is declared in the main module) |
19:24:00 | FromDiscord | <Recruit_main707> https://play.nim-lang.org/#ix=2pw |
19:24:14 | shashlick | why not deprecate marshal and point users to json instead |
19:29:27 | shashlick | https://github.com/disruptek/gittyup/pull/8 |
19:29:29 | disbot | ➥ Fix static test |
19:29:43 | * | Jesin quit (Quit: Leaving) |
19:36:38 | * | Jesin joined #nim |
19:38:53 | planetis[m] | do you guys want random numbers from gauss distribution in std / random? |
19:39:09 | FromDiscord | <mratsim> wasn't there a commit already that added that 2 weeks ago? |
19:39:24 | FromDiscord | <mratsim> 2 months* |
19:40:38 | Yardanico | https://github.com/nim-lang/nim/search?q=gauss&unscoped_q=gauss 0 results hmm |
19:41:01 | FromDiscord | <mratsim> I may misremember, it may have been in a repo i watch |
19:41:11 | Yardanico | yeah I vaguely remember something like that too |
19:41:37 | FromDiscord | <mratsim> I think <@723185752128618619> has a gaussian based on the Ziggurat method which should be the fastest |
19:41:44 | FromDiscord | <mratsim> I have one using circles |
19:42:55 | shashlick | still need to use marshal on Nim < 1.2.0 but there's no arc so its okay |
19:43:07 | Yardanico | 986 members on the discord server btw |
19:43:19 | FromDiscord | <Recruit_main707> hype |
19:43:23 | shashlick | https://travis-ci.org/github/nimterop/nimterop/jobs/699839409 |
19:43:36 | Yardanico | will need to put a post in #announcement s about nimconf again |
19:43:40 | shashlick | Unable to create constructor for: nnkRefTy |
19:43:44 | * | haxscramper joined #nim |
19:43:45 | Yardanico | when the schedule will be out |
19:44:32 | Yardanico | so uhh |
19:44:34 | haxscramper | How to iterate over proc parameters? Similar to `fieldPairs` but for `proc(...)` |
19:44:38 | planetis[m] | i benchmarked ratio method from gsl and python and also polar from alea |
19:44:39 | * | drewr quit (Quit: ERC (IRC client for Emacs 26.3)) |
19:44:54 | Yardanico | haxscramper: you'd need a macro for that I think |
19:45:06 | Yardanico | also - we agree that we'll ping everyone on discord when nimconf will be about go start? :P |
19:45:14 | Yardanico | last time I did that some people were upset :P |
19:45:24 | Yardanico | and I did it with @ here (only people who are online), not @ everyone |
19:45:42 | Yardanico | well anyway I guess if they don't want nim-related announcements they can leave the server :P |
19:46:14 | planetis[m] | frankly I saw no difference, I even counted the loops and it was the same |
19:47:41 | haxscramper | And second question: is there any way to get return type of the callback proc? I have callback in form of `cb: (proc(a: T): T) | (proc(a: T): Option[T])` and need to select return type of the main proc based on return type of the callback. |
19:48:14 | planetis[m] | can you try this: https://gist.github.com/b3liever/23505f9b47124bc9cc40e60d7279b067 |
19:50:02 | * | drewr joined #nim |
19:51:50 | FromDiscord | <Generic> haxscramper: you can try when type(cb(T()) is Option[T]: or something like that |
19:52:02 | shashlick | g d |
19:55:05 | planetis[m] | krux02 has written it https://github.com/krux02/arnelib/blob/master/src/ziggurat_normal_dist.nim |
19:55:18 | planetis[m] | who is 723185752128618619 ? |
19:58:49 | planetis[m] | i think 3 * 128 * 8 bytes for precomputed tables is pretty bad for the stdlib |
20:00:05 | planetis[m] | if only can give me some numbers bc in my system there is alot of noice, can't get a meaningful result |
20:00:20 | planetis[m] | *can someone |
20:08:00 | * | haxscramper quit (Remote host closed the connection) |
20:10:17 | * | Jesin quit (Quit: Leaving) |
20:12:38 | FromDiscord | <mratsim> will run |
20:12:52 | FromDiscord | <mratsim> that's a lot of bytes |
20:13:49 | planetis[m] | ok bits :) |
20:14:19 | FromDiscord | <mratsim> https://gist.github.com/b3liever/23505f9b47124bc9cc40e60d7279b067#gistcomment-3346707 |
20:14:33 | FromDiscord | <mratsim> 7ms is a bit low |
20:14:34 | * | Jesin joined #nim |
20:14:48 | FromDiscord | <mratsim> I'll try doing more iteration to reduce the noise |
20:16:06 | FromDiscord | <mratsim> seems like there is almost no diff |
20:16:11 | planetis[m] | thank you |
20:17:33 | FromDiscord | <willyboar> I was thinking that will have to revive awesome-nim. Curated packages are cool but difficult to find them. |
20:17:56 | FromDiscord | <mratsim> THe maintainer was looking for a new maintainer |
20:19:27 | FromDiscord | <willyboar> i think it would be best to move it into nim-lang and add some extra people to maintain it. |
20:21:20 | * | endragor joined #nim |
20:24:49 | shashlick | anyone know how to get mingw + cmake to cooperate with a visual studio lib file - https://travis-ci.org/github/genotrance/travister/jobs/699799263#L678 |
20:27:10 | * | nsf quit (Quit: WeeChat 2.8) |
20:27:13 | * | endragor quit (Ping timeout: 264 seconds) |
20:30:35 | FromDiscord | <Luk> What are my benefits of nim over other languages like V or Go? |
20:32:37 | disruptek | shashlick: i merged your gittyup pr but it still doesn't work for me. |
20:32:56 | disruptek | i guess i need static-everything-else, huh? |
20:33:43 | FromDiscord | <Generic> @Luk it depends on what you're working on |
20:33:59 | FromDiscord | <Generic> for me is the portability a huge argument |
20:34:16 | FromDiscord | <Luk> Webserver, and CLI software |
20:34:58 | FromDiscord | <Generic> I'm honestly not too familiar with those stuff, so someone else might be better at arguing this |
20:35:24 | FromGitter | <Knaque> Out of sheer curiosity, is it possible to make a custom "assignment" operator? So you could have something like `var x is "Hello"`. I'm not actually gonna *use* this of course, just curious if it's possible. |
20:35:46 | FromDiscord | <Generic> but I've seen some pretty cool CLI DSL's for argument parsing |
20:36:20 | FromDiscord | <willyboar> @Luk for web there is huge potential. |
20:36:44 | FromDiscord | <Generic> yeah, the potential for DSL's doesn't stop there |
20:36:47 | FromDiscord | <Luk> I mean simple stuff too , compilation speed binary sie etc |
20:37:05 | FromDiscord | <Luk> *size |
20:37:45 | FromDiscord | <Generic> Nim binaries can be pretty small |
20:37:57 | FromDiscord | <Generic> I don't know if Go has improved in this regard |
20:38:17 | FromDiscord | <Generic> but atleast when I was using it Nim was easily beating it |
20:38:25 | FromDiscord | <Generic> that was few years ago |
20:38:28 | disruptek | i guess the thing to do now is compression and stuff. |
20:38:30 | FromDiscord | <Luk> Vlang just created a 181byte hello world |
20:38:42 | disruptek | like, there's a whole ecosystem of tools to shrink go binaries. |
20:38:46 | FromDiscord | <Luk> Nim was some kbyte |
20:38:54 | FromDiscord | <Shucks> Is Vlang even open source now? |
20:39:02 | FromDiscord | <Luk> ? |
20:39:10 | FromDiscord | <Generic> I think it is, but it's still a bit dubious |
20:39:13 | FromDiscord | <Luk> Was it closed source? |
20:39:22 | FromDiscord | <willyboar> IMHO opinion you should try use nim to build something simple and you would never go away |
20:39:45 | disruptek | willyboar: whaddya mean? |
20:39:49 | FromDiscord | <willyboar> (edit) removed 'opinion' |
20:40:28 | FromDiscord | <willyboar> 😛 |
20:41:00 | shashlick | disruptek: what do you mean? |
20:41:10 | FromDiscord | <willyboar> build something w/ nim == fall in love with nim |
20:41:12 | shashlick | the libdir fix is still not released |
20:41:16 | FromDiscord | <Luk> I just want to know why nim exists still, am i missing some feature ? |
20:41:43 | FromDiscord | <Luk> I mean compared to vlang its ... Slow and big |
20:41:53 | FromDiscord | <Generic> slow? |
20:41:54 | disruptek | shashlick: i know, but i cannot statically link libgit2 on linux due to ssh2 iirc. |
20:42:01 | FromDiscord | <Generic> do you mean compile time slow? |
20:42:09 | FromDiscord | <Generic> or producing slow executables? |
20:42:14 | FromDiscord | <Luk> Compile- runtime slow |
20:42:26 | shashlick | disruptek: that's on windows i think |
20:42:26 | FromDiscord | <Recruit_main707> lel |
20:42:33 | FromDiscord | <Generic> because both Go and V are significantly less complex afaik |
20:42:34 | shashlick | but with the new nimgit2 it should be better |
20:42:35 | disruptek | shashlick: i'm using linux right now. |
20:42:40 | FromDiscord | <Generic> in terms of what they can do with generics |
20:42:41 | shashlick | precompiled binaries |
20:42:48 | FromDiscord | <Generic> and macros |
20:42:50 | shashlick | problem is that conan and jbb have old versions of nimgit2 |
20:42:53 | shashlick | 0.28.3 is latest |
20:43:04 | shashlick | so your 1.0+ stuff is not possible yet |
20:43:06 | FromDiscord | <Recruit_main707> Luk: first of all, Nim has macros, which means that some code is run at compile time |
20:43:15 | disruptek | you want to distribute libgit2 binaries? |
20:43:32 | FromDiscord | <Recruit_main707> (which are already a feature that makes it better than go and v by itself imo) |
20:43:57 | FromDiscord | <Luk> Hm, noted |
20:44:04 | shashlick | static link is also possible |
20:44:27 | FromDiscord | <Recruit_main707> second, nim is (except a few situtations) almost as fast as c |
20:44:31 | disruptek | nimterop 0.5.9 produces: Unknown short option: "f" |
20:44:49 | FromDiscord | <Recruit_main707> you probably are not compiling it with -d:release or -d:danger |
20:44:51 | shashlick | ehmm |
20:45:16 | FromDiscord | <Luk> Well, Vs New Backend makes it almost faster than c |
20:45:18 | * | natrys quit (Quit: natrys) |
20:45:30 | shashlick | disruptek: snippet? |
20:46:01 | FromDiscord | <Luk> GCC and LLVM are bloat so v made its own Backend, compiling to smaller and faster bins |
20:46:13 | FromDiscord | <Generic> they totally aren't |
20:46:30 | FromDiscord | <Generic> they are decades of optimisations put into them |
20:46:32 | disruptek | shashlick: http://ix.io/2pxn/nim |
20:46:38 | disruptek | shashlick: cannot run `nimble test` |
20:46:51 | FromDiscord | <Luk> And still slower than nim ? |
20:47:00 | FromDiscord | <Recruit_main707> personally, i dont know v, so i cant talk about it, but as a third oint, i would say its clean and super flexible syntax is also really good |
20:47:03 | FromDiscord | <Luk> Or V |
20:47:35 | FromDiscord | <Recruit_main707> can we see those benchmarks btw? |
20:47:41 | disruptek | has anyone written any significant software in v that anyone can evaluate? |
20:47:52 | FromDiscord | <Luk> Volt |
20:47:59 | disruptek | where's the source? |
20:48:05 | FromDiscord | <Luk> Github |
20:48:07 | * | bung joined #nim |
20:48:17 | disruptek | where? |
20:48:27 | disruptek | is this the only existant application? |
20:48:37 | disruptek | have you ever spoken to a v programmer? |
20:48:37 | * | endragor joined #nim |
20:48:54 | FromDiscord | <Luk> But even hello world is smaller and faster |
20:48:54 | disruptek | because, y'know, most of us have written 10s of thousands of lines of nim. |
20:48:56 | FromDiscord | <Recruit_main707> bro disruptek, its not about attacking V |
20:49:07 | disruptek | i'm just curious about it. |
20:49:16 | disruptek | i'm surprised anyone would think it's comparable to nim. |
20:49:26 | FromDiscord | <willyboar> by the way to the web part here : https://github.com/the-benchmarker/web-frameworks |
20:49:28 | FromDiscord | <Luk> I have talked to the main Dev Alex |
20:49:29 | FromDiscord | <Recruit_main707> (ok, its just that in plain text it can sound a bit agressive :P ) |
20:50:00 | disruptek | i still cannot find the source to volt. is it not under /vlang? |
20:50:03 | disruptek | !repo volt |
20:50:04 | disbot | https://github.com/voltrb/volt -- 9volt: 11A Ruby web framework where your Ruby runs on both server and client 15 3272⭐ 205🍴 7& 29 more... |
20:50:12 | disruptek | !search volt language:vlang |
20:50:13 | disbot | https://github.com/vlang/v/issues/4059 -- 3Comparison with zig 7& 8 more... |
20:50:19 | disruptek | !search volt language:v |
20:50:20 | disbot | https://github.com/vlang/v/issues/4059 -- 3Comparison with zig 7& 8 more... |
20:50:26 | FromDiscord | <Shucks> Dont we had that Vlang vs Nim already here: https://forum.nim-lang.org/t/4758 ;p |
20:50:50 | disruptek | i have more nim repositories than v has vlang repositories. |
20:51:38 | solitudesf- | there was a volt repo, but it was too much of a vaporware to exist |
20:51:42 | FromDiscord | <Generic> apparently they removed the comparison with Nim from their website |
20:51:45 | FromDiscord | <willyboar> Volt is closed source |
20:51:47 | * | solitudesf- is now known as solitudesf |
20:51:53 | FromDiscord | <Shucks> still? |
20:52:09 | FromDiscord | <willyboar> https://github.com/voltapp/volt |
20:52:31 | FromDiscord | <willyboar> it would be opened in 2021 |
20:52:44 | FromDiscord | <Luk> Oh lel |
20:52:51 | FromDiscord | <Luk> Sorry |
20:53:31 | shashlick | V is young, comparing with Nim is like comparing Nim with Python |
20:53:46 | shashlick | Decades of time difference |
20:53:54 | FromDiscord | <Generic> well it's not like they aren't provocating the comparison |
20:54:02 | FromDiscord | <Luk> I think nim should make a v back end |
20:54:14 | * | endragor quit (Ping timeout: 240 seconds) |
20:54:18 | FromDiscord | <Generic> for what reason? |
20:54:20 | FromDiscord | <Recruit_main707> thats a lot of work :P |
20:54:21 | * | bung quit (Ping timeout: 258 seconds) |
20:54:21 | FromDiscord | <Luk> Maybe the bins would be better |
20:54:26 | FromDiscord | <Luk> Smaller |
20:54:27 | FromDiscord | <Generic> it's an uncessary extra step |
20:54:37 | disruptek | do you need a smaller binary? |
20:54:41 | FromDiscord | <Luk> Extra step? |
20:54:52 | FromDiscord | <Generic> as long as it compiles via C |
20:55:00 | FromDiscord | <Generic> which will be the dominant way of doing it |
20:55:03 | FromDiscord | <Luk> It doesnt |
20:55:22 | FromDiscord | <Luk> It has its own compiler |
20:55:28 | FromDiscord | <Generic> https://github.com/vlang/v#key-features-of-v |
20:55:35 | FromDiscord | <Generic> it says so right in this feature list |
20:55:37 | FromDiscord | <mratsim> Why compile to V when V compiles to C and Nim compiles to C? |
20:56:00 | FromDiscord | <Generic> and I doubt the assembler their self made compiler spits out |
20:56:03 | FromDiscord | <Luk> V does not compile to c |
20:56:20 | FromDiscord | <mratsim> so what is it using for codegen? |
20:56:20 | FromDiscord | <Luk> Its optional |
20:56:34 | FromDiscord | <Luk> It uses its own thing |
20:57:05 | FromDiscord | <Luk> Write a vlang helloworld and compile it with v hello.v -x64 |
20:57:21 | FromDiscord | <Generic> their own thing will never match GCC or LLVM in terms of quality of generated code |
20:57:23 | FromDiscord | <Clyybber> gcc is miles better |
20:57:29 | FromDiscord | <Luk> Hah |
20:57:36 | FromDiscord | <Luk> Not in size |
20:57:37 | FromDiscord | <Clyybber> with miles I mean 50 times around the world |
20:57:38 | FromDiscord | <mratsim> Ah it uses GCC: https://github.com/vlang/v/blob/1d28d45c5cb662443af57f27fb41de8ee673922f/vlib/v/builder/cc.v#L185 |
20:57:50 | FromDiscord | <mratsim> mystery solved |
20:58:00 | FromDiscord | <Shucks> well that was fast |
20:58:01 | FromDiscord | <Shucks> ;p |
20:58:14 | FromDiscord | <willyboar> 🍿 |
20:58:21 | FromDiscord | <Luk> Bad joke |
20:58:41 | FromDiscord | <mratsim> show me the assembly code generator then |
20:58:57 | FromDiscord | <Generic> https://github.com/vlang/v/blob/master/vlib/v/gen/x64/gen.v |
20:59:02 | FromDiscord | <Generic> it seems to be WIP |
20:59:06 | FromDiscord | <mratsim> I see planly written in the source code "arguments for the C compiler": https://github.com/vlang/v/blob/1d28d45c5cb662443af57f27fb41de8ee673922f/vlib/v/builder/cc.v#L104 |
20:59:11 | FromDiscord | <mratsim> plainly* |
20:59:31 | FromDiscord | <Luk> https://github.com/vlang/v/blob/1d28d45c5cb662443af57f27fb41de8ee673922f/vlib/v/builder/x64.v |
20:59:48 | FromDiscord | <Luk> It uses clang, GCC as an option |
20:59:54 | FromDiscord | <Generic> that's still super immature |
20:59:56 | * | tdc quit (Ping timeout: 256 seconds) |
20:59:59 | FromDiscord | <Generic> the backend I mean |
21:00:08 | FromDiscord | <Luk> Its faster tho |
21:00:17 | FromDiscord | <Luk> Sure its young |
21:00:18 | FromDiscord | <Generic> yes, because it doesn't optimise |
21:00:41 | FromDiscord | <Clyybber> theres simply no reason for nim to compile to V |
21:00:41 | FromDiscord | <Luk> It optimizes the size |
21:00:41 | FromDiscord | <mratsim> anyway, feel free to contribute a v backend to Nim, people added Zig a month ago |
21:00:52 | FromDiscord | <Recruit_main707> did they actually? |
21:00:55 | FromDiscord | <Generic> writing your own assembler generating compiler is a backend in 2020 |
21:00:56 | FromDiscord | <mratsim> well yes |
21:01:02 | FromDiscord | <Generic> *deadend |
21:01:16 | FromDiscord | <Clyybber> well, not really. They simply used the clang zig bundles |
21:01:18 | FromDiscord | <mratsim> many are writing JIT in 2020 |
21:01:24 | FromDiscord | <Generic> JIT is another story |
21:01:48 | FromDiscord | <Generic> it's a lot more domain specific |
21:02:01 | FromDiscord | <mratsim> anyway for general purposes I agree, domain specific compiler (graphics/machine learning/cryptography) are another story |
21:02:11 | FromDiscord | <mratsim> I can't believe how bad GCC is at generating bigint code |
21:02:20 | FromDiscord | <Recruit_main707> didnt we actually have some kind of nim direct compiler? but that it was not released because c++ templates wouldnt be able to be wrapped or something like that?↵i think Araq mentioned it |
21:03:01 | FromDiscord | <Recruit_main707> id need to scroll up a lot to find that conversation though :P |
21:03:06 | FromDiscord | <Clyybber> @Luk You can use tcc tho |
21:03:15 | FromDiscord | <Clyybber> its really fast |
21:03:32 | FromDiscord | <mratsim> you can serach @Recruit_main707 |
21:03:35 | FromDiscord | <mratsim> search |
21:03:44 | FromDiscord | <Recruit_main707> im on it, im on it |
21:06:02 | FromDiscord | <Recruit_main707> i think i got it |
21:06:27 | * | narimiran quit (Ping timeout: 260 seconds) |
21:06:58 | * | xet7 quit (Quit: Leaving) |
21:07:55 | FromDiscord | <Recruit_main707> https://discordapp.com/channels/371759389889003530/371759389889003532/692093748670234634↵this was the conversation, not exactly mentioning the existance of a nim compiler as such, i just interpreted that as there is some kind of thing being done |
21:10:46 | * | unknown__ joined #nim |
21:11:14 | disruptek | shashlick: 0.5.6 probably needs to be de-tagged, right? |
21:14:16 | disruptek | i don't even know what i'm supposed to do to fix this. |
21:15:56 | disruptek | something something on devel and something something else on stable? |
21:17:58 | FromDiscord | <mratsim> That's some digging you did @Recruit_main707 |
21:20:15 | shashlick | need to check this later, will get back to you |
21:20:25 | FromDiscord | <Recruit_main707> i tend to remember some things for some reason, and i do it *forever* |
21:20:58 | FromDiscord | <mratsim> I tend to remember small technical details as well |
21:21:05 | FromDiscord | <mratsim> but don't ask me what I ate 3 days ago |
21:21:21 | FromDiscord | <Recruit_main707> exactly :) |
21:21:50 | FromDiscord | <mratsim> okay, time to try Nim 1.2.2 |
21:22:47 | * | aenesidemus_ joined #nim |
21:23:10 | * | endragor joined #nim |
21:24:51 | * | willyboar joined #nim |
21:25:34 | * | aenesidemus quit (Ping timeout: 240 seconds) |
21:28:05 | * | endragor quit (Ping timeout: 258 seconds) |
21:31:44 | * | moerm joined #nim |
21:31:52 | moerm | Hello, everyone ;) |
21:32:20 | * | Jjp137_ quit (Quit: Leaving) |
21:32:32 | * | Jjp137 joined #nim |
21:33:30 | FromDiscord | <willyboar> Hello |
21:33:49 | FromDiscord | <willyboar> disruptek: i am ready |
21:34:01 | disruptek | are you? |
21:34:22 | FromDiscord | <willyboar> I have joined your irc channel 🙂 |
21:34:48 | disruptek | i had no idea i had a channel. |
21:35:08 | * | solitudesf quit (Ping timeout: 256 seconds) |
21:35:21 | disruptek | shashlick: btw, gitnim seems to work fine on a random aws node. |
21:35:24 | willyboar | I think i saw it in a stream |
21:39:43 | moerm | I once saw some ducks in a stream |
21:44:03 | Zevv | Is saturday's program up somewhere already? |
21:44:53 | disruptek | what? |
21:45:01 | Zevv | Is saturday's program up somewhere already? |
21:45:16 | alehander92_ | moerm ducks just know streams well |
21:45:18 | disruptek | that's what i thought you said. |
21:45:24 | alehander92_ | duck typed streams |
21:45:24 | Zevv | if the time table has been published |
21:45:56 | willyboar | not yet |
21:46:46 | moerm | alehander92_, yet they are swimming *against* the stream sometimes |
21:48:24 | alehander92_ | brave birds |
21:49:18 | alehander92_ | good thing they keep themselves out from internet streaming then |
21:51:32 | moerm | alehander92_, Do they really? Just look at duck typed streams in some "programming languages" ... |
21:51:34 | disruptek | Zevv: should we meet up at nimconf? you're going, right? |
21:52:33 | FromDiscord | <exelotl> shit where is it? I lost my map |
21:52:39 | FromDiscord | <djazz> localhost |
21:52:52 | alehander92_ | i knew the cool kids stay somewhere |
21:54:26 | moerm | Cu all ... ;) |
21:54:31 | * | moerm quit (Quit: Leaving) |
21:54:58 | alehander92_ | moerm i just like ducks :P |
21:55:01 | alehander92_ | see ya |
22:01:03 | * | PMunch quit (Quit: leaving) |
22:02:03 | * | tane quit (Quit: Leaving) |
22:03:30 | * | willyboar quit (Remote host closed the connection) |
22:04:01 | * | willyboar joined #nim |
22:05:43 | * | nikita` quit (Quit: leaving) |
22:05:44 | * | willyboar quit (Client Quit) |
22:10:20 | FromGitter | <ynfle> Where can I get nimconf updates? |
22:10:53 | FromDiscord | <Recruit_main707> there is no gitter channel afaik |
22:11:19 | FromDiscord | <Recruit_main707> no news yet, its this sunday, that if for now :) |
22:11:23 | * | Jjp137 quit (Read error: Connection reset by peer) |
22:11:23 | FromDiscord | <Recruit_main707> saturday*** |
22:11:50 | * | disrupteq joined #nim |
22:12:01 | * | Jjp137 joined #nim |
22:12:10 | FromDiscord | <Recruit_main707> man, i make a lot of misspellings when i type standing up |
22:14:55 | FromDiscord | <willyboar> @ynfle we will spam once they post the schedule |
22:21:55 | FromGitter | <ynfle> @Willyboar, so kind of you |
22:22:42 | * | disruptek_ joined #nim |
22:23:17 | * | disruptek quit (Quit: Bye) |
22:23:17 | * | disrupteq is now known as disruptek |
22:23:45 | * | disruptek_ quit (Client Quit) |
22:31:38 | FromDiscord | <SeanOMik> What is the bitwise operator `&` (from C++) in Nim? |
22:31:44 | disruptek | and |
22:31:55 | * | willyboar joined #nim |
22:32:18 | FromDiscord | <SeanOMik> Oh |
22:33:49 | FromDiscord | <SeanOMik> Okay and if you do this: ```nim↵if (value != nil and value.num == 20)```↵and the first condition in the if statement is false it wont go to the second condition right? |
22:33:56 | disruptek | shashlick: it's kinda awesome how well git nim works. |
22:34:24 | FromDiscord | <SeanOMik> Actually, nvm |
22:34:25 | disruptek | only thing is, i don't even have static libs on some servers. so i guess we should default to shared builds. |
22:34:51 | disruptek | ie. i'll remove -static from gitnim.nim.cfg. |
22:35:05 | FromDiscord | <SeanOMik> disruptek that doesn't work |
22:35:10 | FromDiscord | <SeanOMik> I mean the bitwise operator |
22:35:16 | FromDiscord | <SeanOMik> Not the conditional operator |
22:35:37 | disruptek | you're blowing my mind right now. |
22:35:41 | FromDiscord | <SeanOMik> In C++ the `&` bitwise operator is the `bitwise AND` |
22:35:42 | disruptek | ~playground |
22:35:43 | disbot | playground: 11an online in-the-browser IDE for simple Nim experiments at http://argentina-ni.ml/ -- disruptek |
22:35:43 | disbot | playground: 11https://play.nim-lang.org the official Nim playground, can run Nim in the browser and share snippets |
22:36:03 | Yardanico | @SeanOMik in nim it's "and" for both bolls and bitwise |
22:36:06 | Yardanico | bools* |
22:36:10 | disruptek | show me it failing, please. |
22:37:09 | FromDiscord | <SeanOMik> Oh it is |
22:37:17 | FromDiscord | <SeanOMik> I had to convert my enum to uint |
22:37:29 | FromDiscord | <SeanOMik> In C++ you don't have to do that so thats why it wasn't working |
22:37:31 | FromDiscord | <SeanOMik> Thanks disruptek |
22:37:37 | FromDiscord | <SeanOMik> And Yardanico |
22:39:36 | * | xet7 joined #nim |
22:42:33 | disruptek | i don't even have ops on my own channel. |
22:42:38 | disruptek | what a fucking loser. |
23:07:01 | * | abm quit (Read error: Connection reset by peer) |
23:24:47 | skrylar[m] | hoi |
23:29:14 | FromGitter | <hugosenari> Ola! | Hi! |
23:31:28 | FromGitter | <hugosenari> anyone knows if nim uses return type to define what proc call if another proc has same name/signature but other return type? |
23:31:38 | Yardanico | nim doesn't have return type overloading |
23:31:49 | Yardanico | I don't know of any language which does :P |
23:31:55 | FromGitter | <hugosenari> thanks :) |
23:32:30 | Prestige | Does anyone see a potential issue with this small template? https://play.nim-lang.org/#ix=2pyc |
23:33:04 | Prestige | I'm getting an error with it, Error: unhandled exception: Can't obtain a value from a `none` [UnpackError] |
23:33:43 | Yardanico | works for me, can you show the code? |
23:34:57 | Prestige | It's this line: https://github.com/avahe-kellenberger/nimdow/blob/master/src/nimdowpkg/windowmanager.nim#L665 |
23:35:40 | Prestige | not a very small example though. It usually works, idk why it's failing for this one application |
23:35:46 | Yardanico | well maybe it comes from somewhere else, not from here? |
23:35:52 | Yardanico | or it's somehow getting modified, idk |
23:35:55 | Yardanico | I mean not from withSome code |
23:36:19 | Prestige | that's where the execution stops, idk |
23:37:17 | Yardanico | what does this.display.getWindowName(client.window) return? |
23:37:50 | Prestige | hm I extraced the first argument from withSome into its own variable and it no longer crashes |
23:38:33 | Prestige | oh templates evaluate the args more than once so that makes sense |
23:38:46 | Yardanico | oh right I missed it |
23:38:48 | Yardanico | yeah lol |
23:41:49 | * | fredrikhr joined #nim |