<< 17-07-2023 >>

00:19:27NimEventerNew thread by Pixeye: PODS: Easy to read and type text format for serialization and config files. , see https://forum.nim-lang.org/t/10340
00:22:06FromDiscord<ravinder387> proc add2n(x,y: int): int = return x + y
00:22:30FromDiscord<ravinder387> var y = add2n 2, 3 # gives error
00:26:04FromDiscord<Elegantbeef> Command syntax is limited to a single value if it's inside another expression
00:26:26FromDiscord<michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4ALW
00:27:59FromDiscord<Elegantbeef> I swear they're just trolling
00:28:12FromDiscord<Elegantbeef> They've asked about command syntax many times
00:28:47FromDiscord<ravinder387> In reply to @Elegantbeef "Command syntax is limited": then why he write f a,b same as f(a,b) https://media.discordapp.net/attachments/371759389889003532/1130294997397291108/Screenshot_2023-07-17_055603.png
00:28:49FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1130295006175973406/image.png
00:28:59FromDiscord<Elegantbeef> We already went through this
00:29:04FromDiscord<Elegantbeef> Multiple times
00:29:14FromDiscord<Elegantbeef> Command syntax inside an expression is limited to 1 parameter
00:30:26FromDiscord<ravinder387> In reply to @Elegantbeef "image.png": I agree I asked 3rd time this
00:31:42FromDiscord<Elegantbeef> Right and every time the answer is the same
00:32:05FromDiscord<Elegantbeef> Command syntax inside an expression can only have 1 parameter unless it's UFCS'd then it can have two
00:32:22FromDiscord<ravinder387> UFCS mean
00:33:36FromDiscord<Elegantbeef> method call syntax
00:33:48FromDiscord<Elegantbeef> `echo 1.doThing 2, 3` is `echo(doThing(1, 2), 3)`
00:33:57FromDiscord<Elegantbeef> but `echo doThing 2, 3` is `echo (doThing(2), 3)`
00:34:04FromDiscord<Elegantbeef> Whoops bad parenthesis
00:36:14FromDiscord<ravinder387> so echo is a function which have only one input .. echo "hello", "world" convert into echo "helloworld"
00:36:29FromDiscord<ravinder387> under the hood
00:36:52FromDiscord<Elegantbeef> Nope that's not what anyone said
00:42:49FromDiscord<ravinder387> Command syntax inside an expression can only have 1 parameter?
00:43:11FromDiscord<ravinder387> what is reason behind this? what's benefit we get from this ?
00:43:37FromDiscord<Elegantbeef> It's an established rule to resolve ambiguity
00:43:38FromDiscord<ravinder387> any idea?
00:43:43FromDiscord<Elegantbeef> `echo doThing 2, 3`
00:43:48FromDiscord<Elegantbeef> What is the 'proper' way of handling that
00:44:00FromDiscord<Elegantbeef> Either doThing consumes all or it consumes 1
00:44:09FromDiscord<Elegantbeef> There is no correct. Welcome to language design
00:54:32FromDiscord<ravinder387> what does it mean by comma? in nim lang how he intepret
00:55:19FromDiscord<ravinder387> multi-args OR comma means end of instruction
00:55:56FromDiscord<ravinder387> best practice to use () for parameter
00:56:17*MightyJoe quit (Ping timeout: 246 seconds)
00:57:56*cyraxjoe joined #nim
00:58:39FromDiscord<graveflo> so then use `()` for clarity. Coma is not an eos
00:58:46FromDiscord<bostonboston> `doThing(a,b)` and `doThing a,b` are equal
01:00:42FromDiscord<bostonboston> (and `a.doThing(b)` for completeness)
01:06:07FromDiscord<ravinder387> Got it. whenever nim see comma(,) it means multiargs
01:06:29FromDiscord<ravinder387> sent a code paste, see https://play.nim-lang.org/#ix=
01:07:12FromDiscord<ravinder387> when nim see this he thought echo has 2 parameter so echo(dothing 2, 3)
01:07:22FromDiscord<graveflo> yea usually. You should think of comma as a delimiter if that helps... that is its usual function anyways. in the above `echo` is taking two args not `doThing`
01:14:42FromDiscord<ravinder387> and var y = add2n 2, 3
01:15:06FromDiscord<ravinder387> means = has 2 parameter add2n 2 , 3
01:15:21FromDiscord<ravinder387> i got it
01:15:50FromDiscord<ravinder387> = has 2 param y and add2n 2
01:25:13nisstyreNim can do arbitrary AST macros right? So is it possible to have custom infix operators in Nim with a macro, or would it be too janky? Purely theoretical question, not planning on doing this in real code
01:25:34NimEventerNew Nimble package! caster - casting macro for procedure parameters, see https://github.com/hamidb80/caster/
01:25:34NimEventerNew Nimble package! voicepeaky - Voicepeak Server, see https://github.com/solaoi/voicepeaky
01:25:37FromDiscord<Elegantbeef> You don't need macros for that
01:25:44nisstyreoh, how do I do it without?
01:25:48FromDiscord<Elegantbeef> `a $! b` is valid nim
01:25:52FromDiscord<Elegantbeef> You just define an operator
01:25:54nisstyreah ok nice
01:25:59nisstyreI somehow didn't even realize that
01:26:19FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/rkKZx
01:26:25nisstyrewhat about associativity/precedence ?
01:26:36FromDiscord<Elegantbeef> Based off first symbol
01:26:42nisstyreok cool
01:26:49FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#syntax-associativity
01:27:11nisstyreSo it would assume it's the lowest precedence given standard math operators in the same expression?
01:27:38FromDiscord<Elegantbeef> `` has the same precedence as `$!`
01:27:50nisstyreoh first character right I get it now
01:27:59nisstyrethat's an interesting choice
01:28:37nisstyreso $? and ^? are the same precedence wise
01:28:37FromDiscord<Elegantbeef> It's pretty smart as it allows you to define the precedence of all operators
01:28:41nisstyreyeah
01:28:51nisstyrein Haskell you have some other syntax to tell it
01:29:22nisstyrehttps://www.haskell.org/onlinereport/decls.html#fixity
01:29:27nisstyreI guess this would have been more verbose
01:29:38FromDiscord<Elegantbeef> Yea they are, but `^?` is right associative
01:29:49nisstyregot it
01:30:08FromDiscord<Elegantbeef> It's more verbose and more unpredictable
01:30:25nisstyreyes and requires the backticks for most things
01:30:35NimEventerNew Nimble package! sokol - sokol is a minimal cross-platform standalone graphics library, see https://github.com/floooh/sokol-nim
01:30:42FromDiscord<Elegantbeef> If you look at an expression in Nim, given the precedence table you can reason how it's evaluated, if you look at haskell you also need the operator definition
01:30:50nisstyreyep
01:30:54nisstyreso it can't even be known until parsed
01:30:58FromDiscord<Elegantbeef> Not that I generally say "use user defined operators"
01:31:00nisstyreI made a parser like this before
01:31:11nisstyreand it had to adapt the parser dynamically basically
01:31:15nisstyredepending on what it had seen
01:31:45nisstyreit let you mix infix and prefix operators
01:31:51nisstyrekinda a bad idea in hindsight
01:35:36NimEventerNew Nimble package! musicSort - A tool to sort your mp3 music files based on id3 metadata, see https://github.com/CarkWilkinson/musicSort
01:35:43FromDiscord<ravinder387> i want to see any production grade software written in nim?
01:36:26nisstyreI am trying to accomplish just that
01:36:33nisstyreJester seems pretty battle tested
01:36:39nisstyreplanning on using that
01:37:00FromDiscord<Elegantbeef> https://github.com/orgs/status-im/repositories?q=&type=all&language=nim&sort=
01:37:32nisstyreoh yeah I forgot about the Nimbus people
01:37:42nisstyrealso Nitter is pretty widely used no?
01:37:52nisstyrenot anymore tho :(
01:38:09FromDiscord<Elegantbeef> Nitter is back alive
01:38:20nisstyreawesome
01:38:26nisstyreI guess they found a way to still make it work
02:22:21*cnx quit (Remote host closed the connection)
02:23:14*cnx joined #nim
03:19:14FromDiscord<shad.ow> how can i check if an `arraymancer` tensor contains a value?
03:29:28FromDiscord<Elegantbeef> Seems there is no `find` or `contains` so write your own using the iterators
03:47:30FromDiscord<shad.ow> In reply to @Elegantbeef "Seems there is no": i see
03:47:35FromDiscord<shad.ow> for some reason `.values` and `.items` don't work
03:47:39FromDiscord<shad.ow> even though the tutorial mentions the,
03:47:41FromDiscord<shad.ow> (edit) "the," => "them"
03:47:49FromDiscord<Elegantbeef> They're insidie the `accessors` module
03:48:04FromDiscord<shad.ow> ah
03:48:40FromDiscord<shad.ow> how do i import that?
03:49:18FromDiscord<shad.ow> nvm got it
03:49:18FromDiscord<Elegantbeef> https://mratsim.github.io/Arraymancer/accessors.html
03:49:18FromDiscord<Elegantbeef> `arraymancer/tensor/accessors` i asssume
03:50:47FromDiscord<shad.ow> yeah i found that too
03:50:51FromDiscord<shad.ow> turns out
03:50:56FromDiscord<shad.ow> i had typed `tensors` instead of `tensor` lol
03:51:01FromDiscord<shad.ow> `import arraymancer.tensor.accessors` works
03:51:10FromDiscord<shad.ow> ah that's deprecated
03:51:16FromDiscord<shad.ow> In reply to @Elegantbeef "`arraymancer/tensor/accessors` i asssume": yep ty
03:55:01FromDiscord<shad.ow> is there a clean way to do big boolean expressions?
03:55:09FromDiscord<shad.ow> like if i have `... or ... or ...`
03:55:11FromDiscord<shad.ow> where each part is quite large
03:55:16FromDiscord<shad.ow> i can't seem to find a nice way to write it
03:56:20FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4AMn
03:56:44FromDiscord<shad.ow> ah so that's how you have to break up the lines
03:56:45FromDiscord<shad.ow> thank you
03:56:57FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/XSyhV
03:57:19FromDiscord<shad.ow> ah smart
04:07:47FromDiscord<punchcake> In reply to @pmunch "As long as you": Bet
04:09:06*lucasta quit (Remote host closed the connection)
04:54:48NimEventerNew thread by xanim: Wrapping Tkinter GUI in Nim?, see https://forum.nim-lang.org/t/10341
05:04:01FromDiscord<punchcake> How do i use c2nim to convert an entire C project to nim?
05:05:30FromDiscord<Elegantbeef> Araq would say to use Nim as the entry and call the underlying C from Nim's main
05:06:02FromDiscord<Elegantbeef> Slowly translating/replacing where you need
05:06:14FromDiscord<punchcake> I mean its quite a huge project
05:06:23FromDiscord<punchcake> Im trying to port lvgl to nim
05:07:37FromDiscord<Elegantbeef> Right you wouldnt use c2nim to port it
05:07:44FromDiscord<Elegantbeef> You'd use c2nim to import the exposed API
05:07:56FromDiscord<Elegantbeef> then just include the project as a submodule
05:09:45FromDiscord<punchcake> Hm so i guess i just wrap the lvgl.h
05:09:58FromDiscord<punchcake> Lvgl is the framework to rule them all
05:10:11FromDiscord<punchcake> It can run anywhere you can have a screen and a framebuffer
05:11:23FromDiscord<Elegantbeef> Right, there is no point in machine translating C to Nim, as they have different semantics and idioms so you'd just get C-like Nim, which defeats the purpose of having it in Nim 😄
05:11:59FromDiscord<punchcake> XD
05:31:10FromDiscord<punchcake> nvm lvgl is buggy af on windows
05:45:17FromDiscord<pmunch> I would highly recommend using Futhark instead of c2nim thought
05:45:26FromDiscord<pmunch> (edit) "thought" => "though"
05:46:22FromDiscord<ravinder387> which programming language is best C interop?
05:46:42FromDiscord<ravinder387> which programming language has best C interop?
05:46:50FromDiscord<Elegantbeef> C
05:47:19FromDiscord<Elegantbeef> Zig can include C directly then compile it along side the zig program
05:47:31FromDiscord<Elegantbeef> Pmunch wrote futhark to do the same
05:49:48FromDiscord<ravinder387> if i compile any app in window. can i run on .exe file on other windows labtop. how much comptiable nim lang is?
05:50:19FromDiscord<Elegantbeef> Of course if you ship any dependencies or statically link them
05:55:04FromDiscord<ravinder387> @elegantbeef r u chatgpt bot or human
05:55:20FromDiscord<Elegantbeef> Well given you pinged a discord user you do the math
05:58:50FromDiscord<ravinder387> @elegantbeef what you do for living?
05:58:57FromDiscord<ravinder387> r u software engineer
06:03:07FromDiscord<Elegantbeef> I pass the butter
06:15:42*ntat joined #nim
06:20:06*azimut joined #nim
06:23:31FromDiscord<punchcake> In reply to @pmunch "I would highly recommend": completely unbiased opinion
06:28:48FromDiscord<pmunch> Of course 😛
06:29:05FromDiscord<punchcake> xd
06:29:25FromDiscord<punchcake> @pmunch bro do you know how i can bind nim -> js?
06:29:33FromDiscord<punchcake> i want to make nim work with electron
06:29:57FromDiscord<punchcake> one way is to just host a rest api server and send http request to it from electron
06:30:57*PMunch joined #nim
06:31:39FromDiscord<pmunch> That is kinda what I did in my example isn't it?
06:31:54FromDiscord<pmunch> But you probably still want some JS stuff just for doing Electron specific stuff
06:32:23FromDiscord<pmunch> Wrapping JS is basically the same process as wrapping C, but slightly less complicated, and without any nice helper tools that I'm aware of
06:32:51FromDiscord<punchcake> In reply to @pmunch "But you probably still": doesnt electron use ipc with node?
06:33:06FromDiscord<punchcake> so effectively i can just swap out node with nim
06:33:53FromDiscord<pmunch> No idea, as I said the other day I'm not a huge Electron fan so I haven't really looked into it. I just followed the quick start guide and did it in Nim to see if it would be feasible.
06:34:06FromDiscord<punchcake> hm i see
06:34:10FromDiscord<ajusa> does `nimble install` build with `-d:release` by default? Or do I need to set that in config.nims or elsewhere?
06:34:12FromDiscord<pmunch> But yeah, if it has an IPC layer then I guess it should be possible
06:34:22FromDiscord<Elegantbeef> install makes a release
06:34:25FromDiscord<punchcake> In reply to @pmunch "But yeah, if it": or just host a rest api XD
06:35:00FromDiscord<punchcake> https://github.com/mikke89/RmlUi
06:35:15FromDiscord<punchcake> i'd argue if i find a way to port this to nim it would truly be the gui that rules them all
06:36:38FromDiscord<punchcake> ngl if someone finds a way to bind rmlui to nim im paying them 30 usd next month
06:36:57FromDiscord<pmunch> Well there you have two options. Manually wrap the C++ headers, or teach Futhark how to wrap C++
06:37:01FromDiscord<Elegantbeef> A whole $30 for multiple hours of work 😄
06:37:10FromDiscord<punchcake> In reply to @Elegantbeef "A whole $30 for": better than 0
06:37:27PMunchWe really should teach Futhark to wrap C++...
06:37:30FromDiscord<Elegantbeef> I'd rather be a chimney sweep in the 1800s, atleast I'd get some charcoal
06:37:57FromDiscord<punchcake> In reply to @PMunch "We really should teach": yeah he needs a mentor tbh
06:38:46FromDiscord<Elegantbeef> Doesnt rmlui have a C api?
06:39:11PMunchWell in that case you're already done :P
06:39:18FromDiscord<punchcake> In reply to @Elegantbeef "Doesnt rmlui have a": probably not
06:39:30FromDiscord<Elegantbeef> https://github.com/mikke89/RmlUi/tree/master/Include/RmlUi
06:39:32FromDiscord<Elegantbeef> I mean
06:39:48FromDiscord<Elegantbeef> Ah those are C++ header files
06:39:55FromDiscord<punchcake> yup
06:40:02FromDiscord<punchcake> nobody seems to use .hpp
06:40:05FromDiscord<Elegantbeef> Do i ever wish people used hpp for C++ headerfiles
06:40:06PMunchYeah, for some reason without the .hpp extension..
06:40:19FromDiscord<punchcake> although you can name C and cpp header files whatever you want
06:40:30FromDiscord<punchcake> you can name it `header.porn` and it would work
06:40:30FromDiscord<Elegantbeef> Sure but conventions are nice
06:41:24FromDiscord<Elegantbeef> Nah gotta localise the header files so it's `header.hi-ach`
06:41:30FromDiscord<Elegantbeef> For the brits
06:41:48FromDiscord<Elegantbeef> That's not how you phonetically write how brits say 'H' but alas
06:42:16FromDiscord<punchcake> anyways my offer still stands
06:44:16FromDiscord<Elegantbeef> Easier to just expose a C-api for the C++ code you need, it's a shit ton of code to wrap
06:46:31*azimut quit (Remote host closed the connection)
06:47:00*azimut joined #nim
06:48:06PMunchOr just teach Futhark to wrap C++
06:48:10PMunchIt can't be that hard
06:48:28FromDiscord<Elegantbeef> Famous last words
06:48:36PMunchMost of the ground work is already there, we're just missing some C++ built-in types and namespaces stuff
06:48:43FromDiscord<punchcake> bro
06:48:57FromDiscord<punchcake> i literally dont know jack shit in C++ build systems
06:49:03FromDiscord<punchcake> nor am i gonna learn that mess
06:49:08FromDiscord<punchcake> i just use xmake + vcpkg
06:51:01FromDiscord<Elegantbeef> You don't need to know anything about build systems to teach futhark C++
06:53:15FromDiscord<punchcake> sent a code paste, see https://play.nim-lang.org/#ix=4AMC
06:53:15FromDiscord<punchcake> i taught futhark
06:58:11PMunchIt might be easy, but unfortunately it's not quite that easy
07:02:47FromDiscord<4zv4l> is there a library in Nim close to Thor in Ruby ?
07:03:43Amun-Rahttps://github.com/c-blake/cligen ?
07:03:51madpropshttps://www.red-lang.org/p/about.html
07:04:04Amun-Ra4zv4l: look at cligen
07:10:43FromDiscord<jmgomez> In reply to @Elegantbeef "Easier to just expose": more easy: expose a C++ api with the code that you need. Even easier: directly bind the code that you need
07:11:54*stallman_big_fan joined #nim
07:13:17*stallman_big_fan left #nim (#nim)
07:14:21*stallman_big_fan joined #nim
07:15:11*stallman_big_fan quit (Client Quit)
07:17:03FromDiscord<bung8954> anyone same as me that on m1 mac `nimlsp` get 100% cpu usage?
07:17:44FromDiscord<punchcake> In reply to @jmgomez "more easy: expose a": more easier: user C++
07:17:48FromDiscord<punchcake> which is what im doing rn
07:18:54PMunchbung8954, which Nim version did you build your nimlsp with?
07:20:41FromDiscord<bung8954> In reply to @PMunch "<@714152700920594493>, which Nim version": Nim Compiler Version 1.6.12 [MacOSX: arm64]
07:22:01FromDiscord<demotomohiro> If C++ API has template functions/classes, you cannot wrap it with C API.↔You might wrap std::vector and expose stdVectorInt, stdVectorFloat, etc, but you cannot expose stdVector[T].
07:30:44PMunchbung8954, that's a known bug on 1.6.12: https://github.com/PMunch/nimlsp/issues/154#issuecomment-1609312307
07:31:06PMunchIt was fixed in 1.6.14 (technically in a commit five commits after the release, but we had to wait for a new release)
07:39:58FromDiscord<punchcake> ngl C++ with qml is actually a very pleasant experience
07:41:41FromDiscord<punchcake> call me mcdonalds cause im loving it https://media.discordapp.net/attachments/371759389889003532/1130403941537022053/image.png
07:58:10FromDiscord<requiresupport> In reply to @madprops "https://www.red-lang.org/p/about.html": interesting
08:04:21FromDiscord<ieltan> In reply to @punchcake "call me mcdonalds cause": missed opportunity to say mclovin
08:10:44*om3ga quit (Ping timeout: 252 seconds)
08:26:10NimEventerNew Nimble package! broly - High Performance Stub Server, see https://github.com/solaoi/broly
08:26:10NimEventerNew Nimble package! nimf - Search for files in a directory hierarchy., see https://github.com/Gruruya/nimf
08:47:50FromDiscord<punchcake> In reply to @NimEventer "New Nimble package! broly": what even is a stub server
09:03:02FromDiscord<intellij_gamer> Think to act in place of a real server?↔Looking at the repo it looks like you define how the server should respond to certain requests↔So handy for like running tests when you don't control the server that you connect ti
09:03:07FromDiscord<intellij_gamer> (edit) "ti" => "to"
09:19:10FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4AN2
09:23:06FromDiscord<demotomohiro> What that do in Ruby?
09:23:25FromDiscord<4zv4l> execute a shell command and return the output of it in a variable
09:23:59FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4AN3
09:24:27FromDiscord<4zv4l> I found `execProcess` but I need to add the right options I think
09:24:31FromDiscord<demotomohiro> osproc module has procs that runs shell command at runtime.
09:27:36FromDiscord<punchcake> In reply to @4zv4l "execute a shell command": you can make a macro like that
09:27:46FromDiscord<punchcake> in nim macros can manipulate the AST
09:27:56FromDiscord<punchcake> so you can do anything you want with no limits
09:31:34FromDiscord<demotomohiro> You dont even need to write a macro to run a shell command and get a output.↔osproc module can do.
09:33:05FromDiscord<4zv4l> well I can't get it to work
09:33:08FromDiscord<demotomohiro> If you want to run commands at compile time:↔https://nim-lang.org/docs/system.html#staticExec%2Cstring%2Cstring%2Cstring
09:33:10FromDiscord<4zv4l> I wanna execute an interactive commande
09:34:07FromDiscord<michaelb.eth> In reply to @4zv4l "I wanna execute an": maybe port the venerable expect library to Nim?
09:34:44FromDiscord<4zv4l> all I need is `execShellCmd` but that returns the output
09:35:29FromDiscord<vindaar> Fun DSL to execute shell commands I can provide https://github.com/vindaar/shell 😁 but having an interactive command like calling `fzf` isn't supported at the moment (well, we just don't see the `fzf`, it "works" thuogh)
09:36:39FromDiscord<demotomohiro> https://nim-lang.org/docs/osproc.html#ProcessOption↔poParentStreams allows to use stdin and out in your process to child process.↔But you cannot read stdout and store it to a variable.
09:37:17FromDiscord<vindaar> sent a code paste, see https://play.nim-lang.org/#ix=4AN5
09:37:28FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4AN6
09:37:53FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4AN7
09:38:09FromDiscord<vindaar> Pfff, you don't know your filesystem by heart?
09:38:13FromDiscord<4zv4l> looool
09:43:20FromDiscord<demotomohiro> If fzf write texts to stdout or stderr? And fzf write the path of picked file in stdout or stderr?
09:43:33FromDiscord<spotlightkid> Maybe just call "zenity"?
09:44:28FromDiscord<spotlightkid> fzf pobably needs acess to a (pseudo) terminal or at least readline support?
09:45:17FromDiscord<demotomohiro> Anyway, osproc cannot do connect stdout of parent to child's stdout while use pipe to childs stderr.
09:49:45FromDiscord<punchcake> In reply to @vindaar "Pfff, you don't know": lmao this guy didnt even write his own kernel yet
09:50:00FromDiscord<punchcake> are you even a programmer if you didnt write your kernal in asm??
09:55:20FromDiscord<4zv4l> đŸ„ș
09:55:22FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4ANc
09:59:36FromDiscord<demotomohiro> In reply to @4zv4l "so nothing like this": I dont know what you actually needs. That command needs to use parent process's stdin but stdout need to be pipe?
09:59:52FromDiscord<4zv4l> need to be returned yeah↔I don't know how ruby handle that
10:00:11FromDiscord<4zv4l> In reply to @4zv4l "all I need is": really like this
10:00:19FromDiscord<4zv4l> the command works with `execShellCmd`
10:00:24FromDiscord<4zv4l> but I don't get the return value I want
10:01:23FromDiscord<4zv4l> its exactly like `$()` in bash
10:01:26FromDiscord<4zv4l> I would need the same
10:02:54FromDiscord<demotomohiro> `execCmdEx` doesn't work?
10:03:02FromDiscord<4zv4l> it doesn't
10:03:09FromDiscord<4zv4l> I don't see the interface of the program
10:03:13FromDiscord<4zv4l> it executes in background
10:03:35FromDiscord<4zv4l> actually
10:03:42FromDiscord<4zv4l> I see the interface but when I type something
10:03:45FromDiscord<4zv4l> it crashes
10:03:59FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4ANe
10:06:15FromDiscord<demotomohiro> I guess your child process need to use stdin in parent process but stdout need to be piped but osproc module seems doesn't support it.
10:06:21FromDiscord<4zv4l> I guess to do a workaround I could `> tmp` and read from it to get the output from the command
10:06:32FromDiscord<4zv4l> but that's not the best xD
10:11:20FromDiscord<4zv4l> the redirection doesn't work
10:11:21FromDiscord<4zv4l> xD
10:13:19FromDiscord<4zv4l> okay it works
10:14:10*om3ga joined #nim
10:14:48FromDiscord<4zv4l> is there an execve equivalent that would replace the current process by the new one ?
10:16:15FromDiscord<demotomohiro> Maybe this is what you needs:https://github.com/cheatfate/asynctools/blob/master/asynctools/asyncproc.nim#L139↔You can specify how each of stdin/out/err are handled.
10:18:22FromDiscord<spotlightkid> Like I said, fzf needs a terminal (tty).
10:19:05FromDiscord<4zv4l> In reply to @4zv4l "is there an execve": anything for this one ?
10:20:17FromDiscord<spotlightkid> See the os stdlib module
10:23:57FromDiscord<spotlightkid> No, sorry, it's also in `osproc`\: `startProcess`
10:24:35*unwoker joined #nim
10:26:34FromDiscord<spotlightkid> A direct binding for the `exec`libc functions is defined in the `posix` module.
10:26:55*unwoker quit (Quit: Client closed)
10:38:13FromDiscord<michaelb.eth> In reply to @demotomohiro "Maybe this is what": note that the author of asynctools is also one of the maintainers of nim-chronos, and if I'm remebering correctly, it's generally recommended to the os proc facilities offered by chronos instead of asynctools
10:38:24FromDiscord<michaelb.eth> (edit) "In reply to @demotomohiro "Maybe this is what": note that the author of asynctools is also one of the maintainers of nim-chronos, and if I'm remebering correctly, it's generally recommended to ... the" added "use"
10:48:36FromDiscord<4zv4l> how can I do a http get request at compile time in Nim ?
10:49:02FromDiscord<ambient3332> Do it in a build script?
10:49:09FromDiscord<4zv4l> because I get↔`/home/azz/.choosenim/toolchains/nim-1.6.14/lib/pure/httpclient.nim(335, 12) Error: cannot evaluate at compile time: defaultSslContext`
10:49:14FromDiscord<4zv4l> In reply to @ambient3332 "Do it in a": in a program
10:49:17FromDiscord<4zv4l> to get a file at comptime
10:49:35FromDiscord<ambient3332> comptime is the build time, which makes sense to have it in a build script
10:49:55FromDiscord<4zv4l> basically I wanna download a file at compile time and put it in a variable
10:51:46FromDiscord<4zv4l> In reply to @ambient3332 "comptime is the build": how can I put the value in a variable afterward ?
10:52:11FromDiscord<ambient3332> either read it statically into the executable or just read file normally
10:52:28FromDiscord<4zv4l> do you mind showing me a quick example ?
10:53:19FromDiscord<ambient3332> https://nim-lang.org/docs/system.html#staticRead%2Cstring
11:02:14FromDiscord<demotomohiro> In reply to @michaelb.eth "note that the author": https://status-im.github.io/nim-chronos/docs/chronos/asyncproc.html↔But I cannot find `startProcess` or other procs that I can specify how each of stdin/out/err of child process are handled separetly.↔Maybe it is not yet implement?
11:18:04FromDiscord<bung8954> is there short way get this `template nilId(): ID = cast[ID](nil)`?
11:28:04FromDiscord<michaelb.eth> In reply to @demotomohiro "https://status-im.github.io/nim-chronos/docs/chrono": the tests have some demos of working with stdin/out/err and piping↔https://github.com/status-im/nim-chronos/blob/master/tests/testproc.nim
11:35:51FromDiscord<4zv4l> In reply to @ambient3332 "https://nim-lang.org/docs/system.html#staticRead%2C": I used readFile because somehow readFileStatic didn’t work (didn’t find the file ?) and seems to achieve what I want so perfect
11:39:21PMunchbung8954, `default(ID)` should work
11:40:08PMunchEverything is nulled out by default in Nim, so `default` of a ref or pointer type will be a nil pointer
11:43:39FromDiscord<intellij_gamer> `ID(nil)` should also work iirc
12:00:01FromDiscord<bung8954> thanks, I choose `nil.ID`
13:40:19*lucasta joined #nim
14:08:27*PMunch quit (Quit: Leaving)
14:18:59FromDiscord<demotomohiro> In reply to @michaelb.eth "the tests have some": https://github.com/status-im/nim-chronos/blob/master/chronos/asyncproc.nim#L774
14:19:45FromDiscord<demotomohiro> I found `startProcess` is defined in asyncproc module but it is not documented in https://status-im.github.io/nim-chronos/docs/chronos/asyncproc.html
14:30:14FromDiscord<michaelb.eth> pffft, documentation, who needs it 😉
14:50:42*xet7 quit (Ping timeout: 272 seconds)
15:41:48NimEventerNew Nimble package! sun_moon - Astro functions for calcuation of sun and moon position, rise and set time as well as civil, nautical and astronomical dawn and dusk as a function of latitude and longitude., see https://github.com/dschaadt/sun_moon
15:53:31*oddish_ quit (Remote host closed the connection)
15:53:40*oddish joined #nim
16:32:09*lucasta quit (Quit: Leaving)
18:34:16*disso-peach joined #nim
18:46:11FromDiscord<System64 ~ Flandre Scarlet> Why do I have this error? https://media.discordapp.net/attachments/371759389889003532/1130571163630841866/image.png
18:49:22FromDiscord<nnsee> because Positive is an int, not a float64
18:49:57FromDiscord<nnsee> https://nim-lang.org/docs/system.html#Positive
18:50:36FromDiscord<System64 ~ Flandre Scarlet> Oh alright↔So I'll have to go with a while loop then
18:50:43FromDiscord<nnsee> seems so
19:09:09FromDiscord<ambient3332> sent a code paste, see https://play.nim-lang.org/#ix=4APL
19:09:17FromDiscord<ambient3332> Does || degrade to .. ?
19:37:11FromDiscord<ambient3332> It does seem to exactly do that, at least it doesn't complain
20:11:11*ntat quit (Quit: leaving)
20:19:06FromDiscord<graveflo> this is weird but how does one do something like this:
20:19:20FromDiscord<graveflo> sent a code paste, see https://paste.rs/mu70Q
20:20:29FromDiscord<graveflo> It's hard to make the generic object work with static values and allow for the generic to instantiate the correct object. The above does not work because once `initSimPl` is instantiated once it doesn't happen again
20:56:55FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4AQa
20:57:00FromDiscord<Elegantbeef> Static parameters in result are often quite odd
21:08:17*disso-peach quit (Quit: Leaving)
21:24:24FromDiscord<thesherwood> What is currently the preferred way to define a c array in nim?
21:26:57FromDiscord<thesherwood> I see nimline and cinterop have support for this. I'd prefer to not bring in another dependency if I there's a simple way to do this without one.
21:26:58FromDiscord<Elegantbeef> \`var a = [1, 2, 3, 4]
21:27:53FromDiscord<thesherwood> A nim array is just a c array?
21:28:20FromDiscord<Elegantbeef> They're static sized arrays yes
21:29:16FromDiscord<thesherwood> I didn't realize they'd be byte-for-byte the same. Cheers
21:29:48FromDiscord<Elegantbeef> Well arrays are one of the things that really on has one sane way of doing
21:29:58FromDiscord<Elegantbeef> Sequences on the otherhand have a multitude of ways of doing
21:31:02FromDiscord<thesherwood> That's convenient. Thanks ElegantBeef
22:10:11FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#ix=4AQh
22:10:31FromDiscord<user2m> (edit) "https://play.nim-lang.org/#ix=4AQh" => "https://play.nim-lang.org/#ix=4AQi"
22:10:40FromDiscord<Elegantbeef> Cause you have not handled `"hello"`
22:12:00FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4AQj
22:19:50FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#ix=4AQk
22:38:38*azimut quit (Ping timeout: 240 seconds)
22:42:28FromDiscord<PingusMcDuck> Anyone have ant idea if Ive got Orx bindings for Nim, which is a C game engine, is it possible to avoid pointers and references, and just do GC?
22:43:18FromDiscord<Elegantbeef> If you wrap the C code then make a high level api, yes
22:59:55FromDiscord<PingusMcDuck> I think that might be what the binding are, thank you
23:26:52*rez joined #nim
23:29:39*rez quit (Client Quit)
23:57:04*xet7 joined #nim