00:05:06 | FromDiscord | <auxym> @sOkam! this too: https://nim-lang.org/docs/system.html#currentSourcePath.t |
00:07:27 | FromDiscord | <sOkam!> Solution to this one unique problem exists, as mentioned. Ty↵Still, my point still stands in that working nimscript feels extremely limited↵Does someone know if that is meant to be improved over time, or is that something not desirable for w/e reason i'm unaware of? |
00:15:48 | FromDiscord | <demotomohiro> I guess people use nim script only for simple program and doesn't need to use all stdlib most of time. |
00:17:04 | FromDiscord | <demotomohiro> If you need to use all Nim features, you can create executable file with `nim c` or `nim cpp`. |
00:19:25 | * | wallabra quit (Ping timeout: 252 seconds) |
00:19:35 | * | wallabra joined #nim |
00:24:35 | * | sagax quit (Ping timeout: 244 seconds) |
00:27:06 | FromDiscord | <exelotl> nimscript could really benefit from being able to get the modification date of a file tbh |
00:28:20 | FromDiscord | <exelotl> one of it's best use cases is for build tasks but there's no way to skip work if a file didn't change |
00:40:02 | * | genpaku quit (Remote host closed the connection) |
00:40:42 | * | genpaku joined #nim |
01:00:37 | * | sagax joined #nim |
01:12:22 | * | derpydoo joined #nim |
01:44:17 | * | wallabra_ joined #nim |
01:45:15 | * | wallabra quit (Ping timeout: 265 seconds) |
01:49:59 | * | wallabra_ quit (Ping timeout: 252 seconds) |
01:50:01 | * | wallabra joined #nim |
02:01:00 | FromDiscord | <wiga> any way to get shell command output? |
02:01:12 | FromDiscord | <wiga> i know i asked or some else asked here |
02:01:26 | FromDiscord | <wiga> but i dont remember where lol |
02:01:37 | FromDiscord | <wiga> (edit) "some" => "someone" |
02:15:34 | * | derpydoo quit (Ping timeout: 268 seconds) |
02:19:38 | * | arkurious quit (Quit: Leaving) |
03:10:24 | * | wallabra_ joined #nim |
03:11:23 | * | wallabra quit (Ping timeout: 252 seconds) |
03:12:43 | * | wallabra_ is now known as wallabra |
03:37:30 | * | rockcavera quit (Remote host closed the connection) |
04:24:01 | * | wallabra_ joined #nim |
04:24:19 | * | wallabra quit (Ping timeout: 244 seconds) |
04:26:15 | * | wallabra_ is now known as wallabra |
04:51:19 | FromDiscord | <that_dude> Are you looking for something like echo? |
05:17:33 | FromDiscord | <demotomohiro> In reply to @wiga "any way to get": https://nim-lang.org/docs/osproc.html |
05:35:30 | * | wallabra_ joined #nim |
05:35:48 | * | wallabra quit (Ping timeout: 264 seconds) |
05:37:17 | * | wallabra_ is now known as wallabra |
05:39:50 | * | xilo joined #nim |
05:43:27 | * | dnh joined #nim |
06:26:59 | FromDiscord | <Horizon [She/Her]> Wonder how difficult it'd be to compile JVM bytecode to Nim code |
06:27:11 | FromDiscord | <Horizon [She/Her]> Since it can be done, someone did it with Python a long time ago |
06:27:17 | FromDiscord | <Horizon [She/Her]> They used Python bytecode tho |
06:28:31 | FromDiscord | <Horizon [She/Her]> (JVM bytecode to Python bytecode) |
06:29:46 | FromDiscord | <Rika> It can be done but it isn’t practical |
06:29:52 | FromDiscord | <Rika> I don’t think it is, at least |
06:35:09 | FromDiscord | <Horizon [She/Her]> I don't see how it could be practical at all either haha |
06:35:28 | FromDiscord | <Horizon [She/Her]> Just would be a very interesting project for the future |
06:39:11 | FromDiscord | <Prestige> In reply to @Event Horizon "Wonder how difficult it'd": would there be a use? |
06:39:48 | * | dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
06:44:32 | FromDiscord | <Horizon [She/Her]> Using Java libraries natively in Nim |
06:44:46 | FromDiscord | <Horizon [She/Her]> Wouldn't exactly have a use though I'd imagine |
06:47:43 | * | wallabra quit (Ping timeout: 252 seconds) |
06:48:04 | * | wallabra joined #nim |
06:50:18 | FromDiscord | <Rika> In reply to @Event Horizon "Using Java libraries natively": You’d still have to make it friendly to use |
06:58:54 | * | dnh joined #nim |
07:22:03 | FromDiscord | <Horizon [She/Her]> Yup exactly |
07:22:13 | FromDiscord | <Horizon [She/Her]> It'd be a massive pain but interesting |
07:22:25 | FromDiscord | <Horizon [She/Her]> Also need to reimplement Java standard libraries too which won't be fun |
07:51:21 | FromDiscord | <Horizon [She/Her]> Is it safe to assume that `initObjectName` and `newObjectName` are likely the constructors for creating a new Nim object? |
07:51:26 | FromDiscord | <Horizon [She/Her]> For user defined types |
07:51:35 | FromDiscord | <Horizon [She/Her]> And if they don't conform, that's their own fault? |
07:51:55 | FromDiscord | <Elegantbeef> Even saner to look for `proc init(_: typedesc[T])` |
07:52:11 | FromDiscord | <Elegantbeef> The stdlib doesnt use it but it's just better |
07:52:41 | FromDiscord | <Horizon [She/Her]> In reply to @Elegantbeef "Even saner to look": I liked that too but i thought it was bad practice |
07:52:49 | FromDiscord | <Elegantbeef> It's not |
07:53:02 | FromDiscord | <Elegantbeef> `newT` is bad practice |
07:53:06 | FromDiscord | <Elegantbeef> Due to the fact it's not generic supporting |
07:53:29 | FromDiscord | <Elegantbeef> You cannot make a proc that operates on `newT` without macros, you can make a proc that works on `T.new` |
07:53:52 | FromDiscord | <Horizon [She/Her]> Wdym by that? |
07:53:57 | FromDiscord | <Horizon [She/Her]> Don't think i understand completely |
07:54:42 | FromDiscord | <Horizon [She/Her]> Would `MyObjectChild.new` work when `proc init(_: typedesc[MyObject])` is defined? |
07:54:52 | FromDiscord | <Rika> You can’t make a function that takes a generic T use a function called newT |
07:55:02 | FromDiscord | <Horizon [She/Her]> (edit) "init(_:" => "new(_:" |
07:55:10 | FromDiscord | <Rika> Because that needs name substitution or whatever it’s called |
07:55:20 | FromDiscord | <Horizon [She/Her]> Ah |
07:55:43 | FromDiscord | <Rika> If you use new(…: typedesc[T]) then your function could just pass the generic T in |
07:56:35 | FromDiscord | <Horizon [She/Her]> Ah that makes sense |
07:57:32 | * | kenran joined #nim |
08:11:21 | * | wallabra quit (Ping timeout: 268 seconds) |
08:12:20 | * | wallabra joined #nim |
08:16:00 | * | dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
08:20:22 | NimEventer | New thread by konradmb: How to chain anonymous proc with UFCS?, see https://forum.nim-lang.org/t/9500 |
08:30:19 | * | dnh joined #nim |
08:34:54 | * | kenran quit (Remote host closed the connection) |
08:35:27 | * | kenran joined #nim |
08:57:05 | * | dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:02:20 | * | dnh joined #nim |
09:06:30 | NimEventer | New thread by drkameleon: Getting pointer to a seq, see https://forum.nim-lang.org/t/9501 |
09:21:24 | * | wallabra quit (Ping timeout: 264 seconds) |
09:22:06 | * | xilo left #nim (#nim) |
09:22:30 | * | wallabra joined #nim |
09:31:50 | * | dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:32:00 | * | Vladar joined #nim |
09:59:25 | * | dnh joined #nim |
10:27:45 | * | ggsx joined #nim |
10:44:41 | * | wallabra quit (Ping timeout: 250 seconds) |
10:45:59 | * | wallabra joined #nim |
10:47:00 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4bTv |
10:47:06 | FromDiscord | <4zv4l> is this because of the slice ? |
10:47:29 | FromDiscord | <4zv4l> if yes how can I do to not use allocation ? |
10:47:36 | FromDiscord | <Rika> what does the echo show you |
10:47:45 | FromDiscord | <4zv4l> `@['S', 'a', 'l', 'u', 't', '\n']` |
10:51:14 | FromDiscord | <Rika> toopenarray perhaps would help |
10:51:45 | FromDiscord | <Rika> prolly needs experimental views enabled |
10:51:55 | FromDiscord | <Rika> im not familiar with it so i cant help much past that |
10:52:24 | FromDiscord | <4zv4l> I did this |
10:52:30 | FromDiscord | <4zv4l> xD look like C too in that way |
10:52:31 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4bTy |
10:52:38 | FromDiscord | <4zv4l> In reply to @Rika "toopenarray perhaps would help": I'll try that |
10:53:34 | FromDiscord | <4zv4l> In reply to @Rika "toopenarray perhaps would help": indeed that works ! |
10:53:36 | FromDiscord | <4zv4l> thanks ^^ |
10:58:53 | * | wallabra quit (Ping timeout: 252 seconds) |
11:01:03 | FromDiscord | <ShalokShalom> whats the formatting meaning? https://media.discordapp.net/attachments/371759389889003532/1025361629786943498/unknown.png |
11:01:21 | FromDiscord | <ShalokShalom> Why is there command: string; and workingDir: string = ""; |
11:01:49 | FromDiscord | <ShalokShalom> Whats the difference, why does workingDir actually put = "" |
11:02:13 | FromDiscord | <ShalokShalom> And command only shows the type, isnt it expected for both to provide a string |
11:02:19 | FromDiscord | <Yardanico> because "" is the default value for the argument, so you don't need to put it, then it'll default to this value |
11:02:28 | FromDiscord | <Yardanico> command only shows the type because it's a required argument, there's no default value |
11:02:35 | FromDiscord | <Yardanico> https://nim-lang.org/docs/tut1.html#procedures-default-values |
11:05:44 | FromDiscord | <4zv4l> `Error: invalid type: 'openArray[char]' for let` what does it mean ? |
11:05:55 | FromDiscord | <4zv4l> ` let data = buff.toOpenArray(0, n-1)` |
11:07:37 | FromDiscord | <ChocolettePalette> Try making it var |
11:08:32 | FromDiscord | <4zv4l> I tried and it showed the same |
11:09:10 | FromDiscord | <4zv4l> `Error: invalid type: 'openArray[char]' for var` |
11:09:17 | FromDiscord | <Rika> `{.experimental: "views".}` |
11:09:23 | FromDiscord | <Rika> top of file |
11:09:37 | FromDiscord | <Rika> ofc, know that this is experimental |
11:09:51 | FromDiscord | <Rika> https://nim-lang.github.io/Nim/manual_experimental.html#view-types |
11:10:43 | FromDiscord | <4zv4l> why is it experimental ? I thought openarray were immutable ? so could be a safe pointer to an array (part of an array) that you cannot modify |
11:11:36 | FromDiscord | <Rika> wdym why lol it is because it is |
11:11:39 | FromDiscord | <Rika> its a new feature |
11:11:49 | FromDiscord | <Rika> openarrays are not "immutable" unless you make them |
11:12:01 | FromDiscord | <Rika> even if they were, lifetime considerations are needed |
11:12:44 | FromDiscord | <Yardanico> In reply to @4zv4l "why is it experimental": in stable nim `openArray` is just a "meta" type that can only be used in normal routine (func/proc/maybe method) arguments, you can't store it or return it |
11:13:06 | FromDiscord | <4zv4l> I thought openArray were immutable |
11:13:31 | FromDiscord | <Yardanico> unless you prepend `var` they are, but how does this relate to your question? |
11:13:56 | FromDiscord | <Yardanico> ah right, you can use them as a return type, I forgot, but then you have to immediately use the return value, and not store it |
11:14:19 | FromDiscord | <Horizon [She/Her]> Wonder if it's feasible to just fork CPython and replacing bits of it with Nim over time |
11:14:26 | FromDiscord | <4zv4l> I'm just trying random stuff↵it's just from a 'challenge' I did online, when I got an openArray from a function I couldn't modify it |
11:14:27 | FromDiscord | <Yardanico> In reply to @Event Horizon "Wonder if it's feasible": ofc possible, but what for? |
11:14:35 | FromDiscord | <Yardanico> you'll end up with C code that's written in Nim syntax style |
11:15:02 | FromDiscord | <Yardanico> since you plan on replacing modules one-by-one, you'll have to write everything with the C types and C stdlib in mind |
11:15:11 | FromDiscord | <Horizon [She/Her]> Aah true |
11:15:29 | FromDiscord | <Horizon [She/Her]> Hm, too big to replace everything at once though lol |
11:15:36 | FromDiscord | <Yardanico> and not much reason for ;) |
11:15:48 | FromDiscord | <Horizon [She/Her]> Yeah true too lmao |
11:16:06 | FromDiscord | <Horizon [She/Her]> I keep forgetting that I'm working on a pure Nim implementation of Lua |
11:16:12 | FromDiscord | <Rika> why |
11:16:13 | FromDiscord | <Horizon [She/Her]> I just hate parsers :p |
11:16:19 | FromDiscord | <Horizon [She/Her]> In reply to @Rika "why": This is for fun |
11:16:30 | FromDiscord | <Rika> ok |
11:16:32 | FromDiscord | <Horizon [She/Her]> I've wanted to make an interpreter all this time but kept getting stuck on parsers |
11:16:39 | FromDiscord | <Rika> then thats that lmao have fun ig? |
11:16:51 | FromDiscord | <Horizon [She/Her]> Yeah ofc |
11:16:52 | FromDiscord | <Rika> In reply to @Event Horizon "I've wanted to make": why |
11:16:59 | FromDiscord | <Rika> why i mean to the stuck |
11:17:01 | FromDiscord | <Horizon [She/Her]> ~~when I'm done with a parser~~ |
11:17:35 | FromDiscord | <Horizon [She/Her]> In reply to @Rika "why i mean to": I just don't understand how it works in general, the examples i read have things like `expr()` with no arguments and it confuses me |
11:17:50 | FromDiscord | <Horizon [She/Her]> Like in the scala example I've been following or crafting interpreters (which i used previously) |
11:17:57 | FromDiscord | <Horizon [She/Her]> https://www.toptal.com/scala/writing-an-interpreter |
11:18:07 | FromDiscord | <Yardanico> why not follow the normal book version? |
11:18:12 | FromDiscord | <Yardanico> which has Java and C versions |
11:18:19 | FromDiscord | <Rika> the html version is free |
11:18:30 | FromDiscord | <Rika> oorc |
11:18:33 | FromDiscord | <Rika> (edit) "oorc" => "iirc" |
11:18:33 | FromDiscord | <Yardanico> yep |
11:18:46 | FromDiscord | <Horizon [She/Her]> In reply to @Yardanico "why not follow the": I did (from the html page which is free), just didn't understand how the parser worked |
11:18:48 | FromDiscord | <Horizon [She/Her]> I could write it sure |
11:18:51 | FromDiscord | <Yardanico> https://craftinginterpreters.com/contents.html |
11:18:52 | FromDiscord | <Horizon [She/Her]> But i wanna understand it |
11:19:04 | FromDiscord | <Rika> what was unclear |
11:19:05 | FromDiscord | <Yardanico> In reply to @Event Horizon "But i wanna understand": i mean, parser is just parsing things |
11:19:12 | FromDiscord | <Yardanico> you go by your language's |
11:19:24 | FromDiscord | <Yardanico> you have tokens, and then you go through them and form your AST |
11:19:41 | FromDiscord | <Yardanico> like if you see 2 + 2 you get plus operation with left node being 2, and right being 2 (simplified) |
11:20:30 | FromDiscord | <Rika> maybe a good analogy is that lexing is like identifying what are words and punctuation, then parsing is understanding the context between the words and punctuation |
11:20:39 | FromDiscord | <Rika> though again idk what you dont understand |
11:20:43 | FromDiscord | <Horizon [She/Her]> In reply to @Yardanico "like if you see": Hm okay |
11:21:02 | FromDiscord | <ShalokShalom> @Yardanico Perfectly explained |
11:21:05 | FromDiscord | <ShalokShalom> Thanks a lot |
11:21:05 | FromDiscord | <Horizon [She/Her]> In reply to @Rika "though again idk what": Was struggling to grasp how it built the AST just from the tokens |
11:21:11 | FromDiscord | <Yardanico> In reply to @Rika "maybe a good analogy": yes |
11:21:13 | FromDiscord | <Horizon [She/Her]> Yardanico's explanation helps tho |
11:21:23 | FromDiscord | <ShalokShalom> Is this anywhere disclosed, like in documentation? |
11:21:26 | FromDiscord | <Yardanico> In reply to @Event Horizon "Was struggling to grasp": you don't just have the tokens, you have your language's grammar - how you expect it to be written |
11:21:28 | FromDiscord | <Yardanico> In reply to @ShalokShalom "Is this anywhere disclosed,": which part? |
11:21:55 | FromDiscord | <ShalokShalom> About the formatting |
11:21:55 | FromDiscord | <Horizon [She/Her]> In reply to @Yardanico "you don't just have": Is the grammar defined in the parser? |
11:22:13 | FromDiscord | <ShalokShalom> That = "" is about the default value |
11:22:17 | FromDiscord | <Yardanico> In reply to @ShalokShalom "That = "" is": ah |
11:22:33 | FromDiscord | <Yardanico> there's always the manual, which is very big, but it covers almost all nim features, |
11:22:35 | FromDiscord | <Yardanico> https://nim-lang.org/docs/manual.html#procedures |
11:22:38 | FromDiscord | <ShalokShalom> or maybe even provide some means of linking such explaination to the examples |
11:22:39 | FromDiscord | <Rika> https://nim-lang.org/docs/manual.html#procedures |
11:22:41 | FromDiscord | <Rika> fuck |
11:22:42 | FromDiscord | <Rika> slow |
11:22:42 | FromDiscord | <ShalokShalom> like with a button |
11:22:47 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/1025367097620045875/unknown.png |
11:23:04 | FromDiscord | <ShalokShalom> well, about the formatting of the documentation itself |
11:23:05 | FromDiscord | <Yardanico> In reply to @ShalokShalom "like with a button": this would be really too verbose, because as I said before, it's even covered in the first tutorial |
11:23:16 | FromDiscord | <Yardanico> In reply to @ShalokShalom "well, about the formatting": well, documentation doesn't have specific formatting for signatures |
11:23:18 | FromDiscord | <ShalokShalom> then thats fine |
11:23:21 | FromDiscord | <Yardanico> it just shows you the actual signature of the proc |
11:23:24 | FromDiscord | <ShalokShalom> well, it seems like? |
11:23:26 | FromDiscord | <ShalokShalom> Ah, ok |
11:23:36 | FromDiscord | <ShalokShalom> that there is a default value for one, but not the other |
11:23:44 | FromDiscord | <Yardanico> yes |
11:23:48 | FromDiscord | <ShalokShalom> that is explained in the tut |
11:23:49 | FromDiscord | <ShalokShalom> ok |
11:23:51 | FromDiscord | <Yardanico> the first argument has no default value, hence it only has `:` |
11:23:51 | FromDiscord | <ShalokShalom> thanks |
11:24:07 | FromDiscord | <Yardanico> the other arguments have the default value, and actually specifying the type when you have a default value is optional |
11:24:14 | FromDiscord | <ShalokShalom> In reply to @Yardanico "the first argument has": the question is, where is this documented? |
11:24:19 | FromDiscord | <ShalokShalom> that this is the case |
11:24:20 | FromDiscord | <ShalokShalom> this way |
11:24:24 | FromDiscord | <Yardanico> ? |
11:24:28 | FromDiscord | <Yardanico> it's just documented in the manual |
11:24:31 | FromDiscord | <Yardanico> that arguments go by `name: type` |
11:24:34 | FromDiscord | <ShalokShalom> how are we supposed to know this |
11:24:39 | FromDiscord | <Yardanico> by reading the tutorials or the manual |
11:24:48 | FromDiscord | <ShalokShalom> and that = "" is the default value? |
11:24:56 | FromDiscord | <ShalokShalom> since that made no sense to me |
11:25:00 | FromDiscord | <Yardanico> again, in the manual, it doesn't have to tell specifically about `= ""` |
11:25:12 | FromDiscord | <Yardanico> it just talks about default values in general, since in Nim a lot of rules apply to a lot of things, they're not exclusive to something |
11:26:05 | FromDiscord | <4zv4l> what happen if `execProcess` return value is too big ? |
11:26:22 | FromDiscord | <Yardanico> In reply to @4zv4l "what happen if `execProcess`": as in? |
11:27:03 | FromDiscord | <Yardanico> if you mean if the output is really huge (like we're talking hundreds of MBs of text), then you can use `startProcess` and read from the output stream so the whole output doesn't have to be stored in the memory at the same time |
11:28:40 | FromDiscord | <4zv4l> alright, that's what I'm trying to do with an iterator↵how can I give it the `ENV` like `PATH` ? |
11:28:52 | FromDiscord | <4zv4l> I don't know well ENV things |
11:29:01 | FromDiscord | <Yardanico> there's an `env` argument |
11:29:28 | FromDiscord | <Yardanico> so you just pass a stringtable (std/strtabs) with a mapping of environment variable names to their values |
11:31:01 | FromDiscord | <4zv4l> yeah there is the env argument but I don't know how I can simply give the same env I have in my shell ? |
11:31:35 | FromDiscord | <Yardanico> In reply to @4zv4l "yeah there is the": then you probably want to execute the command through the shell |
11:31:38 | FromDiscord | <Yardanico> there's an `poEvalCommand` option for that |
11:31:42 | FromDiscord | <Yardanico> for `options` argument |
11:32:07 | FromDiscord | <Yardanico> or actually if you are launching the nim program that'll launch your program from the same shell, you don't need that |
11:32:15 | FromDiscord | <Yardanico> since the nim program will inherit the environment, and pass it to the program it started |
11:33:02 | FromDiscord | <4zv4l> wait I didn't get all xD |
11:33:07 | FromDiscord | <4zv4l> what do I need to do ? |
11:33:34 | FromDiscord | <Yardanico> if you're launching your Nim program from the same shell where you have your environment variables, just use `startProcess` as-is without specifying extra options or the environment |
11:34:23 | FromDiscord | <4zv4l> because when I try `ls`↵I get↵`Additional info: Could not find command: 'ls'. OS error: No such file or directory` |
11:34:59 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4bTH |
11:35:27 | FromDiscord | <Yardanico> `ls` is a shell command, not an actual program |
11:35:35 | FromDiscord | <Yardanico> so to use it you actually need to use `poEvalCommand` |
11:35:38 | FromDiscord | <4zv4l> there is `/bin/ls` |
11:35:47 | FromDiscord | <Yardanico> or, if you need `ls` specifically, why not use walkDir from std/os ? |
11:36:19 | FromDiscord | <Rika> In reply to @Yardanico "`ls` is a shell": ls has always been a program hasnt it |
11:36:19 | FromDiscord | <4zv4l> oh not especially |
11:36:21 | FromDiscord | <Rika> cd is the shell command |
11:36:30 | FromDiscord | <4zv4l> any commands |
11:36:34 | FromDiscord | <4zv4l> not just ls |
11:36:45 | FromDiscord | <4zv4l> remote shell basically |
11:36:59 | FromDiscord | <4zv4l> that's what I have for now |
11:37:00 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4bTI |
11:37:10 | FromDiscord | <4zv4l> the buff is low to test the loop I made |
11:37:14 | FromDiscord | <Rika> remote shell, sus |
11:37:33 | FromDiscord | <4zv4l> I made one in C but the algo was bad since I was using a 4kb buffer |
11:37:42 | FromDiscord | <4zv4l> I want it to be able to handle any command output |
11:38:40 | FromDiscord | <4zv4l> https://media.discordapp.net/attachments/371759389889003532/1025371097937498122/unknown.png |
11:38:43 | FromDiscord | <4zv4l> that's weird |
11:38:51 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4bTJ |
11:39:07 | FromDiscord | <4zv4l> yeah right I could for the command input |
11:41:12 | * | Vladar quit (Ping timeout: 265 seconds) |
11:41:30 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4bTK |
11:41:31 | FromDiscord | <Yardanico> you probably missed the main proc or something |
11:41:34 | FromDiscord | <Yardanico> in the paste |
11:42:15 | FromDiscord | <4zv4l> this is the main proc |
11:42:17 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4bTL |
11:44:58 | FromDiscord | <Yardanico> well this works fine: |
11:45:06 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4bTN |
11:45:08 | FromDiscord | <Yardanico> I really hope you're not going to create some ransomware or a trojan with this |
11:45:11 | FromDiscord | <Yardanico> surely not :) |
11:45:46 | FromDiscord | <Yardanico> and yeah, I kind of don't like `defer` and it's half-deprecated, so I used `finally` instead in the `exec` |
11:46:02 | FromDiscord | <Yardanico> and since you want it to handle all shell commands as well, you just pass the whole command as-is |
11:47:47 | FromDiscord | <Yardanico> also your code doesn't work with `nc` for me reliably, since `nc` doesn't seem to always send everything at once |
11:48:55 | FromDiscord | <4zv4l> this was the one I made in C↵but yeah since I used a buffer I wanted something that could work with any output length https://media.discordapp.net/attachments/371759389889003532/1025373674624274432/server.c |
11:49:05 | FromDiscord | <4zv4l> In reply to @Yardanico "and yeah, I kind": it's half deprecated ? |
11:49:09 | * | arkurious joined #nim |
11:49:15 | FromDiscord | <Yardanico> it's not officially deprecated, but its use has been kind of discouraged |
11:49:34 | FromDiscord | <Yardanico> using try: finally: is more preferred, at least to my knowledge |
11:50:41 | FromDiscord | <4zv4l> I'll try to remember that, thanks ^^ |
11:51:12 | FromDiscord | <4zv4l> In reply to @Yardanico "I really hope you're": already did actually, but that was for school and harmless |
11:59:49 | * | ggsx quit (Quit: Client closed) |
12:15:48 | FromDiscord | <Horizon [She/Her]> Question, what usecase could transpiling Nim to Python or Nim to Lua, fill? |
12:16:36 | FromDiscord | <ShalokShalom> I honestly think this depends on how readable the code becomes |
12:16:40 | FromDiscord | <Horizon [She/Her]> (It's my goal after Nim to JVM) |
12:17:02 | FromDiscord | <ShalokShalom> F# just released / releases their transpiler to Python with Fable 4 |
12:17:08 | FromDiscord | <ShalokShalom> It looks ok readable |
12:17:15 | FromDiscord | <Horizon [She/Her]> In reply to @ShalokShalom "I honestly think this": I mean, how readable could it be when I'm trying to make code nearly a 1:1 |
12:17:23 | FromDiscord | <ShalokShalom> Lua is an interesting and popular target |
12:17:32 | FromDiscord | <Horizon [She/Her]> (It still requires a custom stdlib too) |
12:17:36 | FromDiscord | <Horizon [She/Her]> In reply to @ShalokShalom "Lua is an interesting": Oh? |
12:17:41 | FromDiscord | <ShalokShalom> You would be surprised, how many 'to-lua' languages exist |
12:17:55 | FromDiscord | <ShalokShalom> And Terra, which uses Lua as meta language |
12:18:08 | FromDiscord | <Horizon [She/Her]> In reply to @ShalokShalom "You would be surprised,": Oh yeah, i dislike them tbh |
12:18:13 | FromDiscord | <Horizon [She/Her]> Don't feel as clean as Nim |
12:18:24 | FromDiscord | <Horizon [She/Her]> Plus, i need to target Lua's 5.1 interpreter |
12:18:52 | FromDiscord | <Horizon [She/Her]> Since ComputerCraft and other games use Lua 5.1 for scripting |
12:47:34 | FromDiscord | <Horizon [She/Her]> Would Nim to Typescript be interesting? :P |
12:50:20 | FromDiscord | <Rika> In reply to @Event Horizon "Would Nim to Typescript": Not really no |
12:50:30 | FromDiscord | <Rika> Might be to some propel |
12:50:30 | FromDiscord | <Rika> People |
12:51:51 | FromDiscord | <Horizon [She/Her]> Hm |
12:55:59 | FromDiscord | <ShalokShalom> Everything is interesting |
12:56:33 | FromDiscord | <ShalokShalom> I still see the most value in a Nim to F# and Nim to Haxe |
12:56:58 | FromDiscord | <ShalokShalom> This targets the most languages |
12:57:19 | FromDiscord | <ShalokShalom> Since these languages compile to various other interesting languages |
12:58:03 | FromDiscord | <ShalokShalom> With these two targets, basically every language that is know to most programmers is available via Nim↵↵Including Rust |
13:10:21 | * | derpydoo joined #nim |
13:13:33 | FromDiscord | <Horizon [She/Her]> In reply to @ShalokShalom "I still see the": Oh? |
13:13:52 | FromDiscord | <Horizon [She/Her]> In reply to @ShalokShalom "With these two targets,": Haxe wouldn't allow near seamless interop tho |
13:13:56 | FromDiscord | <Horizon [She/Her]> Idk about F# |
13:14:05 | NimEventer | New Nimble package! QRterm - A simple QR generator in your terminal., see https://github.com/aruZeta/QRterm |
13:14:11 | FromDiscord | <Horizon [She/Her]> Goal is to try and make it so interop is as clean as possible |
13:15:43 | FromDiscord | <k2> anybody who has used haxe knows how badly "compile to multiple languages with different semantics and type systems" works |
13:16:28 | FromDiscord | <auxym> In reply to @ShalokShalom "I still see the": why not nim directly to CLR bytecode, instead of f#? |
13:17:07 | FromDiscord | <k2> there are very few people in the haxe community who actually compile to different languages. most people generally have a preferred target and only make sure that everything works for them for that platform. |
13:17:15 | FromDiscord | <Horizon [She/Her]> In reply to @k2 "anybody who has used": Never used it tbh and i don't plan to |
13:17:53 | FromDiscord | <Horizon [She/Her]> I just want as much pure Nim code to work on another language, like the JVM (my main goal too) |
13:18:14 | FromDiscord | <Horizon [She/Her]> Would mean Nim truely runs everywhere lol |
13:18:41 | FromDiscord | <Horizon [She/Her]> One major obstacle for me though is wrapping Java code, that'll be hell |
13:18:44 | FromDiscord | <Rika> In reply to @k2 "there are very few": Guess what the situation is for Nim 😛 |
13:18:56 | FromDiscord | <k2> also one big problem if you want to make nim work with different targets - there is lots of code which actually depends on c/c++ and even js target misses out on that stuff |
13:19:37 | FromDiscord | <jan Apisu> nim |
13:20:18 | FromDiscord | <k2> if there was less dependence on c/c++ libs, a wasm backend could be nicely done. but right now it is better to depend on llvm/emscripten/... like things to be able to compile such stuff with ease |
13:20:48 | FromDiscord | <jan Apisu> what code formatter you guys use for Nim?↵i need something like Black ( for python ) |
13:20:50 | FromDiscord | <k2> same is the situation witch jvm/anything else |
13:21:08 | FromDiscord | <k2> no code formatter available for nim which works properly |
13:21:31 | FromDiscord | <jan Apisu> saddons |
13:21:44 | FromDiscord | <jan Apisu> or i can take that as a project idea |
13:21:49 | FromDiscord | <k2> (edit) "if there was less dependence on c/c++ libs, a wasm backend could be nicely done. but right now it is better to depend on llvm/emscripten/... like things to be able to compile such stuff with ease ... " added "(also they decided to use dwarf for wasm debuginfo so thats another reason to not have custom backend for wasm)" |
13:22:20 | FromDiscord | <k2> there is nimpretty (developed together in the nim repo) which you can work on if you want |
13:22:41 | FromDiscord | <k2> (edit) "witch" => "with" |
13:27:13 | FromDiscord | <jan Apisu> how can i run nimpretty in vscode |
13:28:02 | FromDiscord | <Rika> It’s a CLI program |
13:29:14 | FromDiscord | <hotdog> In reply to @jan Apisu "how can i run": You can probably set it up to run under a vscode task, so you can launch it from within the editor |
13:30:23 | FromDiscord | <Horizon [She/Her]> In reply to @k2 "also one big problem": Sadly yup |
13:31:22 | FromDiscord | <Horizon [She/Her]> In reply to @k2 "same is the situation": Yeah that's an issue but honestly, if pure Nim code works on X language, and i can interop with it (i consider that a big thing with Nim), that's fine |
13:31:26 | FromDiscord | <auxym> I think saem's extension is supposed to be able to run nimpretty, but I never got it to work |
13:47:45 | * | wallabra joined #nim |
13:49:13 | FromDiscord | <Yardanico> In reply to @auxym "I think saem's extension": nimpretty is broken in a lot of cases really, I don't think it's that useful in the current state |
13:50:14 | FromDiscord | <auxym> yeah, that's why I haven't invested too much effort in trying to get it to work |
13:57:56 | FromDiscord | <ShalokShalom> In reply to @Event Horizon "Yeah that's an issue": Do you translate from the AST, the source language or something else? |
13:58:07 | FromDiscord | <ShalokShalom> If there is even some intermediate languages in Nim |
13:58:24 | FromDiscord | <ShalokShalom> The jvm port |
13:59:37 | FromDiscord | <Horizon [She/Her]> In reply to @ShalokShalom "Do you translate from": I'm translating from the Nim AST and generating JVM bytecode (with Jasmin, a bytecode assembler for Java) |
13:59:48 | FromDiscord | <ShalokShalom> In reply to @k2 "if there was less": Well, there is the custom, direct llvm backend |
14:00:14 | FromDiscord | <Horizon [She/Her]> If you look at https://github.com/Mythical-Forest-Collective/Nimpiler, the addition test works, except it doesn't actually do addition since semPass makes it a string lmao |
14:00:34 | FromDiscord | <Horizon [She/Her]> It's just emitting hello world statements and works perfectly fine, i just really need to rework the code to be a lot better |
14:01:31 | FromDiscord | <ShalokShalom> sent a long message, see https://paste.rs/Xy7 |
14:02:02 | FromDiscord | <ShalokShalom> I personally care only about F# and Fable works on F# ↵↵So PHP, Rust, Dart and Python are covered by that |
14:02:05 | FromDiscord | <Horizon [She/Her]> It's definitely possible to make a CLR bytecode backend but I don't use CLR so I'm not focusing on that at all |
14:02:09 | FromDiscord | <ShalokShalom> And JavaScript, obviously |
14:02:26 | FromDiscord | <Horizon [She/Her]> (C# or any other .NET language) |
14:02:26 | FromDiscord | <ShalokShalom> In reply to @Event Horizon "It's definitely possible to": CLR and Java Bytecode is very similar |
14:02:39 | FromDiscord | <ShalokShalom> CIL/Java Bytecode |
14:02:45 | FromDiscord | <Horizon [She/Her]> In reply to @ShalokShalom "CLR and Java Bytecode": I'm using an assembler, not the direct bytecode |
14:03:03 | FromDiscord | <Horizon [She/Her]> Unless you want to port Jasmin (the JVM bytecode assembler) to C# lmao |
14:08:35 | FromDiscord | <ravinder387> In reply to @Event Horizon "I'm using an assembler,": I will pay. if u teach me how nim ast translate into other lang |
14:09:28 | FromDiscord | <Horizon [She/Her]> In reply to @ravinder387 "I will pay. if": Lmao it's a uh, lot of work and ngl i don't even understand a lot of it |
14:10:18 | FromDiscord | <ravinder387> you are not expert |
14:11:03 | FromDiscord | <Horizon [She/Her]> In reply to @Event Horizon "If you look at": You can look at my repo here in the https://github.com/Mythical-Forest-Collective/Nimpiler/blob/master/src/backends/jvm/jasmin/compile.nim file? Note that I'm using a fork of Nim that makes the compiler easier to work with and it's adding more improvements too still |
14:11:33 | FromDiscord | <Horizon [She/Her]> In reply to @ravinder387 "you are not expert": Yeah I'm just hacking together code with my own stuff and filing down things that are unneeded or that could be neater |
14:12:58 | FromDiscord | <Yardanico> In reply to @Event Horizon "I'm translating from the": but isn't jasmin basically abandoned? |
14:13:04 | FromDiscord | <Yardanico> there seems to be no development at all for multiple years |
14:14:03 | FromDiscord | <Horizon [She/Her]> In reply to @Yardanico "but isn't jasmin basically": It is, but it's the easiest thing for me to use |
14:14:26 | FromDiscord | <Yardanico> it's just that I think it's highly probable that jasmin itself has bugs |
14:14:29 | FromDiscord | <Yardanico> and it's not updated for recent jvm |
14:14:43 | FromDiscord | <Horizon [She/Her]> If i ever can get the energy to do it, i may work on my own assembler or bytecode generation library for Nim |
14:14:55 | FromDiscord | <Horizon [She/Her]> In reply to @Yardanico "and it's not updated": The JVM is backwards compatible which in this case, works for me |
14:15:11 | FromDiscord | <Horizon [She/Her]> In reply to @Yardanico "it's just that I": It probably does but doesn't impact me currently so |
14:17:53 | FromDiscord | <Horizon [She/Her]> Also, there's no alternative that i know of that i could use |
14:18:09 | FromDiscord | <Yardanico> you can just emit jvm bytecode directly? |
14:18:12 | FromDiscord | <Yardanico> since it's backwards compatible |
14:18:55 | FromDiscord | <Horizon [She/Her]> In reply to @Yardanico "you can just emit": I can yeah, but I don't understand it at all and it's easier to debug a human readable format than the bytes, even with javap |
14:19:51 | FromDiscord | <Horizon [She/Her]> I'm not intending on Jasmin being the final implementation for the JVM backend, but this definitely will help me get a bit more familiar with how the bytecode works at a lower level and help me make valid code easier |
14:22:41 | * | derpydoo quit (Ping timeout: 260 seconds) |
14:24:50 | FromDiscord | <ShalokShalom> In reply to @Event Horizon "You can look at": You mean Cyo? |
14:24:58 | FromDiscord | <Horizon [She/Her]> Yup |
14:25:04 | FromDiscord | <ShalokShalom> I didn't thought it's already doing some difference |
14:25:14 | FromDiscord | <ShalokShalom> Where do you notice it the most? |
14:26:30 | FromDiscord | <Horizon [She/Her]> They've reorganised the packages, they've implemented a VM backend for Nimscript which my code is mostly based off of, they're also made the compiler quite a bit faster |
14:26:32 | FromDiscord | <ShalokShalom> So, translating bytecode doesn't necessarily translate into readable source code |
14:27:05 | FromDiscord | <ShalokShalom> Wasnt there a VM for Nimscript already? |
14:27:35 | FromDiscord | <Horizon [She/Her]> Wdym? I'm not using Nimskull VM's bytecode and Jasmin is an assembler which while isn't readable, is easy to understand with some poking |
14:27:50 | FromDiscord | <Horizon [She/Her]> In reply to @ShalokShalom "Wasnt there a VM": Yeah, that's the vm I'm talking about |
14:28:03 | FromDiscord | <Horizon [She/Her]> I'm using vmgen.nim as the base for my backend |
14:30:05 | * | derpydoo joined #nim |
14:46:28 | * | kenran quit (Remote host closed the connection) |
14:49:31 | FromDiscord | <auxym> what's up with nimbase.h? Is it distributed with (binary) nim installations? Or only used when building the nim compiler? Search on my pc doesn't turn up |
14:52:00 | FromDiscord | <Rika> Distributed with installations, you need it to build any Nim application |
14:53:44 | FromDiscord | <auxym> oh. didn't turn up in my searches because ".choosenim" is considered hidden |
15:02:13 | * | vicecea quit (Remote host closed the connection) |
15:02:44 | * | vicecea joined #nim |
15:10:20 | FromDiscord | <ShalokShalom> In reply to @Event Horizon "Yeah, that's the vm": I mean, is there not a Nimscript VM done by Nim |
15:10:36 | FromDiscord | <ShalokShalom> I thought that's how Nimscript gets executed |
15:15:52 | FromDiscord | <auxym> yes? when you run `nim e`. it's also embedded in the compiler and used to evaluate macros/templates and compile-time expressions (const etc) |
15:23:27 | FromDiscord | <ShalokShalom> In reply to @Event Horizon "They've reorganised the packages,": So how is the Nimskull implementation better? |
15:53:12 | * | kenran joined #nim |
16:02:50 | FromDiscord | <konradmb> Is there a safe seq/array accessor that produces default type value on out of bounds access? |
16:03:04 | FromDiscord | <konradmb> like with options.get |
16:12:15 | FromDiscord | <jan Apisu> can we generate css files using nim? |
16:12:50 | FromDiscord | <enthus1ast> there is an scss wrapper |
16:13:09 | FromDiscord | <jan Apisu> can we make a gnome app in nim? |
16:13:28 | FromDiscord | <jan Apisu> with libadwaita and stuff |
16:13:32 | FromDiscord | <enthus1ast> gnome idk, but gtk |
16:13:43 | FromDiscord | <jan Apisu> gtk3? |
16:15:21 | FromDiscord | <enthus1ast> https://github.com/StefanSalewski/gintro |
16:17:43 | FromDiscord | <Prestige> In reply to @konradmb "Is there a safe": Not that I'm aware of but you could write a proc to do that I suppose |
16:50:38 | FromDiscord | <Horizon [She/Her]> In reply to @ShalokShalom "So how is the": I haven't looked into the internals too much by myself so you're better off asking them, but iirc they have a graph of all the changes they've made, and just reading the code and comparing it with Nim will show many differences |
16:51:21 | FromDiscord | <Horizon [She/Her]> In reply to @ShalokShalom "I mean, is there": Nimskull's Nimscript has it's own bytecode format and has better integration with things like the `os` module iirc, i haven't touched it though since i haven't needed to |
16:55:10 | FromDiscord | <Recruit_main707> In reply to @konradmb "Is there a safe": You could create your own `SafeArray` type and then create a `[]` function to do what you want |
17:02:51 | FromDiscord | <jan Apisu> is there a parsing library? |
17:04:19 | FromDiscord | <Bung> parse what |
17:04:22 | FromDiscord | <Recruit_main707> yeah but i dont know the name |
17:08:12 | * | pro joined #nim |
17:13:19 | FromDiscord | <ShalokShalom> In reply to @Event Horizon "Nimskull's Nimscript has it's": And what part of the fork does actually effect you positively? |
17:14:03 | FromDiscord | <Horizon [She/Her]> The support i get there, the structure of the packages is clearer when searching the docs (for example, ast types are in their own file) |
17:15:03 | FromDiscord | <Horizon [She/Her]> And it's more readable than the Nim compiler code in mainstream Nim, which means if i want to look at how a backend works, it's so much easier for me (because i struggle a lot when it comes to reading messy code), and Nim itself says that the compiler code isn't a poster child of good code |
17:15:41 | FromDiscord | <Horizon [She/Her]> @ShalokShalom here |
17:16:01 | FromDiscord | <Horizon [She/Her]> Also, you're genuinely better off asking them for everything they've done, they can give a much better and more in-depth explanation |
17:16:03 | FromDiscord | <ShalokShalom> I see |
17:16:35 | FromDiscord | <ShalokShalom> Sounds good |
17:20:46 | FromDiscord | <Mrcool> Will nim get anonymous struct support in the future, it something that I enjoy a lot in typescript it feels very natural to use instead of having to name each type, zig also seems to have it <https://ziglang.org/documentation/0.9.1/#Anonymous-Struct-Literals> (never used zig though) |
17:23:06 | FromDiscord | <alehander42> there are tuples |
17:23:30 | FromDiscord | <alehander42> they wouldn't match with named types with the same fields tho, so maybe that's different(?) |
17:24:03 | FromDiscord | <alehander42> there are tuples with named fields, not only the `(a,b)` ones |
17:24:45 | * | kenran quit (Remote host closed the connection) |
17:43:11 | FromDiscord | <Mrcool> Yeah the most important part is that they match, I think it's called structural typing |
17:52:20 | FromDiscord | <Mrcool> This issue <https://github.com/nim-lang/Nim/issues/20440> is annoying me since I can't use the lsp when targeting js backend, can I get some hints on where I need to look to fix this |
18:07:18 | FromDiscord | <hotdog> @Mrcool try asking in #internals too |
18:07:51 | FromDiscord | <hotdog> I'm also interested in what's going on but I've not got experience with the compiler internals/nimsuggest impl |
18:19:23 | FromDiscord | <ShalokShalom> sent a long message, see http://ix.io/4bVy |
18:19:41 | FromDiscord | <ShalokShalom> So because it has a type, its not optional anymore?↵↵https://nim-lang.org/docs/osproc.html#startProcess,string,string,openArray[string],StringTableRef,set[ProcessOption] |
18:20:33 | FromDiscord | <ShalokShalom> (edit) "long message," => "code paste," | "http://ix.io/4bVy" => "https://play.nim-lang.org/#ix=4bVA" |
18:21:07 | FromDiscord | <ShalokShalom> (edit) "anymore?↵↵https://nim-lang.org/docs/osproc.html#startProcess,string,string,openArray[string],StringTableRef,set[ProcessOption]" => "anymore?↵https://nim-lang.org/docs/osproc.html#startProcess,string,string,openArray[string],StringTableRef,set[ProcessOption]" |
18:27:35 | FromDiscord | <Rika> In reply to @ShalokShalom "I am a little": the error is that you are not using the return value |
18:27:45 | FromDiscord | <Rika> i do not know what you mean by "because it has a type, its not optional anymore?" |
18:27:59 | FromDiscord | <ShalokShalom> Its what the error suggested me |
18:28:06 | FromDiscord | <ShalokShalom> "{poStdErrToStdOut})' is of type 'Process' and has to be used (or discarded)" |
18:28:11 | FromDiscord | <Rika> no |
18:28:16 | FromDiscord | <Rika> "expression 'startProcess("bash nspawn --init garuda/garuda/raw", "", [], nil,↵ {poStdErrToStdOut})' is of type 'Process' and has to be used (or discarded)" |
18:28:27 | FromDiscord | <Rika> "expression 'startProcess(...)' is of type 'Process' and has to be used (or discarded)" |
18:28:35 | FromDiscord | <ShalokShalom> aha |
18:28:45 | FromDiscord | <Rika> strange line break |
18:28:50 | FromDiscord | <Rika> dont ask me why thats there lol |
18:28:50 | FromDiscord | <ShalokShalom> yeah |
18:29:07 | FromDiscord | <ShalokShalom> errors are not the strongest suit of Nim 😛 |
18:29:16 | FromDiscord | <Rika> eh you get used to it |
18:29:20 | FromDiscord | <Rika> not great but whatever |
18:29:47 | FromDiscord | <ShalokShalom> So startProcess forces me to handle the return value |
18:30:04 | FromDiscord | <ShalokShalom> Since its meant to interact, not just send a simple command |
18:36:09 | FromDiscord | <ShalokShalom> So, what I am doing wrong now? |
18:36:17 | FromDiscord | <ShalokShalom> https://media.discordapp.net/attachments/371759389889003532/1025476191009914911/Screenshot_18.png |
18:38:21 | FromDiscord | <ShalokShalom> I am expecting to see "true" echoed in the Terminal. Is the code wrong? |
18:44:06 | FromDiscord | <Mrcool> ~ doesn't get expanded magically |
18:51:53 | * | pro quit (Quit: pro) |
18:52:08 | FromDiscord | <Rika> In reply to @ShalokShalom "So startProcess forces me": Nim in general does that |
18:52:44 | FromDiscord | <Rika> In reply to @Mrcool "~ doesn't get expanded": This is likely the issue yeah |
18:56:32 | FromDiscord | <ShalokShalom> I dont understand |
18:56:36 | FromDiscord | <ShalokShalom> What can I do? |
18:56:41 | FromDiscord | <ShalokShalom> In any of the two issues 😦 |
19:09:46 | FromDiscord | <enthus1ast> in nim you must capture the return value, or explicitly discard it |
19:10:13 | FromDiscord | <enthus1ast> and the second issue |
19:10:24 | FromDiscord | <enthus1ast> is that the path is not expanded |
19:11:09 | FromDiscord | <enthus1ast> try this\: https://nim-lang.org/docs/os.html#expandTilde%2Cstring |
19:12:36 | * | CyberTailor joined #nim |
19:17:08 | FromDiscord | <ShalokShalom> sent a code paste, see https://play.nim-lang.org/#ix=4bVN |
19:17:20 | FromDiscord | <ShalokShalom> (edit) |
19:17:26 | FromDiscord | <ShalokShalom> this doesnt work :/ |
19:17:50 | FromDiscord | <ShalokShalom> In reply to @enthus1ast "in nim you must": I plan to capture it, and I miss any info about how to do that |
19:18:02 | FromDiscord | <ShalokShalom> There is nothing about that in the startProcess documentation |
19:18:02 | FromDiscord | <juan_carlos> Nim supports NUMA arch? |
19:18:10 | FromDiscord | <ShalokShalom> Like, no example or anything |
19:18:33 | FromDiscord | <ShalokShalom> In reply to @juan_carlos "Nim supports NUMA arch?": Nim supports each platform that its targets do, I assume |
19:18:41 | FromDiscord | <ShalokShalom> Does C, C++ support NUMA? |
19:18:53 | FromDiscord | <ShalokShalom> If that is a CPU architecture, you are asking for |
19:24:32 | FromDiscord | <enthus1ast> @ShalokShalom\: for me it works (also on windows) |
19:24:47 | FromDiscord | <enthus1ast> let pr = startProcess(........) |
19:25:00 | FromDiscord | <ShalokShalom> oh, thanks a lot |
19:25:05 | FromDiscord | <ShalokShalom> so its just me ^^ |
19:25:08 | FromDiscord | <ShalokShalom> Linux |
19:26:20 | FromDiscord | <ShalokShalom> Ah, you mean just putting startProcess into a binding |
19:27:01 | FromDiscord | <enthus1ast> startProcess returns something, just assign it to a variable or use discard |
19:27:01 | FromDiscord | <enthus1ast> discard startProcess |
19:31:15 | * | krux02 joined #nim |
19:38:27 | FromDiscord | <ShalokShalom> How would I then interact with an appearing yes/no question, that happens within the process? |
19:39:03 | FromDiscord | <enthus1ast> you could try to get handles to the stdout and parse this |
19:39:32 | FromDiscord | <enthus1ast> but i'm unshure if you can peek on the output stream, so this might become tricky |
19:40:07 | FromDiscord | <ShalokShalom> Is there no standardized way to do this? |
19:41:44 | * | CyberTailor left #nim (Konversation terminated!) |
19:45:13 | FromDiscord | <enthus1ast> this works\: |
19:45:28 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4bVR |
19:45:36 | FromDiscord | <enthus1ast> host.nim |
19:45:46 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4bVS |
19:54:47 | FromDiscord | <ShalokShalom> thanks a lot |
20:10:59 | FromDiscord | <Horizon [She/Her]> If i wanted to be able to make it so a proc takes a type (so int, string, etc) what would i do for it?↵I need to map primitive Nim types to their Java counterpart but i want it to be in a simple way if possible? |
20:11:11 | FromDiscord | <Horizon [She/Her]> Or am i better off just using separate methods? |
20:11:59 | * | oprypin quit (Quit: No Ping reply in 180 seconds.) |
20:12:45 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4bVZ |
20:13:05 | FromDiscord | <Horizon [She/Her]> Oh neat, didn't know that |
20:13:28 | FromDiscord | <enthus1ast> idk, maybe yes. Think it depends on the usescase↵(@Horizon [She/Her]) |
20:13:56 | FromDiscord | <Horizon [She/Her]> In reply to @enthus1ast "idk, maybe yes. Think": My case is above xD |
20:15:03 | * | oprypin joined #nim |
20:15:09 | FromDiscord | <Patitotective> sent a code paste, see https://paste.rs/6Qs |
20:15:22 | FromDiscord | <Patitotective> (edit) "https://play.nim-lang.org/#ix=4bW2" => "https://play.nim-lang.org/#ix=4bW1" |
20:16:00 | FromDiscord | <enthus1ast> afaik you cannot exportc such generic procs and call them from eg c or java ffi? |
20:16:23 | FromDiscord | <Patitotective> In reply to @enthus1ast "afaik you cannot exportc": dont know |
20:17:07 | FromDiscord | <enthus1ast> then @Horizon [She/Her] needs to make multiple procs |
20:17:07 | FromDiscord | <Horizon [She/Her]> In reply to @enthus1ast "afaik you cannot exportc": Not using FFI, i'm making a code generator for assembly :p |
20:17:16 | FromDiscord | <enthus1ast> ah ok |
20:17:30 | * | kenran joined #nim |
20:18:43 | FromDiscord | <Horizon [She/Her]> Not assembly, but a bytecode assembler |
20:18:47 | FromDiscord | <enthus1ast> sounds interesting btw↵(@Horizon [She/Her]) |
20:19:15 | FromDiscord | <enthus1ast> so you wanna directly output opcodes? |
20:19:28 | * | kenran quit (Remote host closed the connection) |
20:19:39 | FromDiscord | <Horizon [She/Her]> In reply to @enthus1ast "so you wanna directly": I'm gonna work my way up to that haha, currently i'm using Jasmin |
20:19:48 | FromDiscord | <Horizon [She/Her]> old, probably fragile, but works fine |
20:19:53 | FromDiscord | <enthus1ast> jasmin? |
20:20:13 | FromDiscord | <enthus1ast> ahh jvm opcodes |
20:20:19 | FromDiscord | <Horizon [She/Her]> yeah hold on |
20:20:20 | FromDiscord | <Horizon [She/Her]> https://jasmin.sourceforge.net/guide.html |
20:21:27 | FromDiscord | <Horizon [She/Her]> It's for my impl of a JVM Nim backend |
20:22:58 | FromDiscord | <enthus1ast> i dont know much about java and jvm, but would it not be better if you would generate java sourcecode? |
20:22:59 | FromDiscord | <enthus1ast> So that one could importc and exportc stuff |
20:23:27 | FromDiscord | <enthus1ast> (but still nice hacky project \:) ) |
20:24:18 | FromDiscord | <Horizon [She/Her]> In reply to @enthus1ast "i dont know much": I've had people tell me that i should use bytecode when i was working on source code creating, and then source code when i am using bytecode now lmao |
20:24:37 | FromDiscord | <Horizon [She/Her]> But in general, lower level code generation should theoretically be easier |
20:24:52 | FromDiscord | <enthus1ast> do not listen to me, i have no clue \:P |
20:26:15 | FromDiscord | <Horizon [She/Her]> Fair lmao it's totally fresh |
20:26:19 | FromDiscord | <Horizon [She/Her]> Uh ignore that |
20:26:51 | * | kenran joined #nim |
20:28:47 | * | kenran quit (Read error: Connection reset by peer) |
20:30:05 | * | kenran joined #nim |
20:30:15 | FromDiscord | <Horizon [She/Her]> In reply to @Event Horizon "Fair lmao it's totally": Turns out juggling a convo when impersonating the early 80/90s(?) isn't a good idea when doing dev work |
20:51:13 | FromDiscord | <Phil> Is it possible to basically pass on a seq of types? |
20:51:38 | * | fallback quit (Ping timeout: 268 seconds) |
20:51:46 | * | rwb quit (Ping timeout: 260 seconds) |
20:53:32 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4bWb |
20:53:56 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4bWb" => "https://play.nim-lang.org/#ix=4bWd" |
20:54:57 | FromDiscord | <Patitotective> i dont think you can, youll have to use an object variant but youd have to make a variant for each typedesc and that doesnt make sense to me :/ |
20:56:37 | FromDiscord | <Phil> What I basically want, is I want the user to define their norm models for whatever they want, and then I want them to pass me all their norm-model-types.↵I generate a crapton of CRUD endpoints for them and add them to their application, which I can because I'll be assuming the web project and ORM they use |
20:57:16 | * | rwb joined #nim |
20:57:54 | FromDiscord | <Phil> So object variants are out because I can not know all the model types. My code will be able to grab them at compile time, but I do not specifically know them since they can be anything the user of the lib defines |
21:00:58 | * | fallback joined #nim |
21:04:54 | FromDiscord | <hotdog> In reply to @Isofruit "So object variants are": Can't think of a way to do this without macros as I guess you need access to all the object fields to generate the crud code |
21:06:43 | * | qwr quit (Ping timeout: 246 seconds) |
21:07:04 | FromDiscord | <Phil> For now I'll just write a proc that does this for a single type, can figure out how to call that for n types later |
21:08:16 | FromDiscord | <hotdog> In reply to @Isofruit "For now I'll just": Good plan. It shouldn't be a difficult macro to write |
21:13:32 | * | qwr joined #nim |
21:24:44 | * | rwb is now known as rb |
21:32:41 | * | kenran quit (Remote host closed the connection) |
21:46:38 | FromDiscord | <Elegantbeef> `proc doThing[T: A](val: T)`↵(@Phil) |
21:58:19 | * | krux02 quit (Remote host closed the connection) |
22:29:05 | * | derpydoo quit (Quit: derpydoo) |
22:40:33 | FromDiscord | <ngangngong> hi there, anyhow I can inject rawhtml in https://nim-lang.github.io/Nim/htmlgen.html#examples ? |
22:52:13 | * | oprypin quit (Quit: Bye) |
22:52:23 | * | oprypin joined #nim |
23:21:15 | * | dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |