00:08:52 | FromDiscord | <Zectbumo> Which to install VSCode Nim: Konstantin Zaitsev (60k installs, last updated 2.5 years ago) or nimsaem (7k installs, last updated 3 months ago)? |
00:11:43 | FromDiscord | <Elegantbeef> the latter |
00:12:45 | FromDiscord | <Zectbumo> thx |
00:59:23 | NimEventer | New Nimble package! mersal - Send SMS and Otp in nim, a wrapper for TextBelt's public API, see https://github.com/foxoman/mersal |
01:00:16 | FromDiscord | <Rainbow Asteroids> TOTP > sms otp |
01:22:32 | NimEventer | New thread by Polarian: Native compile option?, see https://forum.nim-lang.org/t/9366 |
01:40:37 | FromDiscord | <ajusa> I remember seeing a library for auth/perms somewhere that I can't find now. I checked nimble.directory and can't find it either |
01:41:01 | FromDiscord | <ajusa> I recall that you could create a user/entity, and give it specific permissions |
01:41:37 | FromDiscord | <flywind> In reply to @ajusa "I remember seeing a": This one? https://github.com/FedericoCeratto/nim-httpauth |
01:41:47 | FromDiscord | <ajusa> In reply to @flywind "This one? https://github.com/FedericoCeratto/nim-ht": Nope |
01:42:18 | FromDiscord | <ajusa> It had a few interesting concepts, and no persistence iirc |
01:46:28 | FromDiscord | <ajusa> Found it: https://github.com/ba0f3/rbac.nim |
01:46:41 | FromDiscord | <ajusa> Keyword was "role based access control" |
01:48:16 | FromDiscord | <flywind> I saw it before, guess I need to add it to my list. |
02:23:15 | * | wallabra_ joined #nim |
02:25:35 | * | wallabra quit (Ping timeout: 252 seconds) |
02:25:35 | * | wallabra_ is now known as wallabra |
02:55:26 | FromDiscord | <MagPhi> Is nim faster or haxe? |
02:57:28 | FromDiscord | <Elegantbeef> Nim can be fast |
02:58:06 | FromDiscord | <Elegantbeef> It's a language that gives a ton of control, you can be as fast as your favourite high level system language, be it C/C++/Pascal/Rust/Zig/Ada/... |
02:58:27 | FromDiscord | <Elegantbeef> Nim's speed is down to the programmer just like most languages |
03:03:49 | FromDiscord | <Prestige> Nim |
03:04:26 | FromDiscord | <huantian> yes this i nim |
03:04:35 | FromDiscord | <huantian> (edit) "i" => "is" |
03:09:54 | FromDiscord | <MagPhi> Yeah didnt expect anything else |
03:09:57 | FromDiscord | <MagPhi> Should I use haxe or nim |
03:10:05 | FromDiscord | <Elegantbeef> Nim |
03:10:12 | FromDiscord | <Elegantbeef> If you ask a haxe community they'll say haxe |
03:10:30 | FromDiscord | <MagPhi> Haxe has an advantage of C# bc that allows me to access the ecosystem of .NET |
03:10:37 | FromDiscord | <Elegantbeef> If you want an expressive language with pascal heritage use Nim. If you want a C#/Java replacement use Haxe |
03:10:39 | FromDiscord | <MagPhi> In reply to @Elegantbeef "If you ask a": Yes I have asked there too |
03:10:51 | FromDiscord | <MagPhi> In reply to @Elegantbeef "If you want an": Pascal heritage? |
03:11:04 | FromDiscord | <Elegantbeef> Nim is heavily inspired by pascal/Modula/Oberon |
03:13:01 | FromDiscord | <Elegantbeef> I've personally never used Haxe but it very much seems like a better C#/Java, if you want that then there you go |
03:18:47 | FromDiscord | <flywind> In reply to @MagPhi "Haxe has an advantage": You can use https://khchen.github.io/winim/clr.html to interact with Windows .NET frameworks |
03:19:10 | FromDiscord | <Prestige> That's awesome |
03:19:30 | FromDiscord | <Prestige> But yeah I agree with Beef, you should use Nim |
03:19:55 | FromDiscord | <MagPhi> In reply to @flywind "You can use https://khchen.github.io/winim/clr.html": Perfection |
03:19:57 | FromDiscord | <flywind> In reply to @flywind "You can use https://khchen.github.io/winim/clr.html": see also https://forum.nim-lang.org/t/7265 |
03:21:15 | FromDiscord | <MagPhi> In reply to @flywind "You can use https://khchen.github.io/winim/clr.html": Is this interop better or js interop? |
03:21:48 | FromDiscord | <flywind> js interop is official and should be better. |
03:22:12 | FromDiscord | <MagPhi> alright |
03:24:05 | * | rockcavera quit (Remote host closed the connection) |
03:25:53 | FromDiscord | <MagPhi> Was the csources repo handwritten? |
03:26:39 | FromDiscord | <huantian> don't think so |
03:26:48 | FromDiscord | <MagPhi> Then how was it produced? |
03:27:05 | FromDiscord | <Elegantbeef> Nim was bootstrapped years ago using pas2nim |
03:27:25 | FromDiscord | <flywind> https://github.com/nim-lang/csources_v1/blob/561b417c65791cd8356b5f73620914ceff845d10/build.sh#L4 |
03:27:45 | FromDiscord | <flywind> `koch csource` |
03:31:55 | * | arkurious quit (Quit: Leaving) |
03:32:00 | FromDiscord | <MagPhi> I cant read bash scripts but this is just compiling the generated object files |
03:32:13 | FromDiscord | <Elegantbeef> Nim outputs C code |
03:32:15 | FromDiscord | <MagPhi> are the object files generated by the nim compiler? |
03:32:17 | FromDiscord | <MagPhi> Oh |
03:33:04 | FromDiscord | <Elegantbeef> There is NLVM which uses LLVM instead, but Nim outputs C/C++/Js |
03:33:28 | FromDiscord | <flywind> What's your use case? for game development? Or system programing? |
03:33:45 | FromDiscord | <MagPhi> Systems programming and JS interop |
03:34:02 | FromDiscord | <flywind> (edit) "programing?" => "programming?" |
03:35:17 | FromDiscord | <flywind> haxe doesn't seem to be a system programming language and it uses immix gc for hashlink, |
03:36:10 | FromDiscord | <Elegantbeef> Yea like i said it's pretty much a nicer C#/Java |
03:37:42 | FromDiscord | <flywind> Nim supports deterministic memory management (ARC), which is designed for system programming. |
03:38:04 | FromDiscord | <Elegantbeef> It also has RAII and high control which haxe doesnt have |
03:39:34 | FromDiscord | <Elegantbeef> I guess their C++ backend might be usable |
03:39:41 | FromDiscord | <Elegantbeef> But going to be a pain |
03:43:52 | FromDiscord | <MagPhi> In reply to @Elegantbeef "But going to be": Nim's generated code isnt really readable |
03:44:00 | FromDiscord | <Elegantbeef> Cool you dont need to read it |
03:48:56 | FromDiscord | <Prestige> Yeah, just compile and run |
03:49:23 | FromDiscord | <Elegantbeef> `-d:danger` makes it a bit more readable |
03:49:27 | FromDiscord | <Elegantbeef> But yea you dont really need to read it much |
03:58:28 | FromDiscord | <MagPhi> nim cc, nim compileToC generate a binary |
03:58:36 | FromDiscord | <MagPhi> How do I get to the C file |
03:58:51 | FromDiscord | <Elegantbeef> You look at your `nimcache` which is by default `.nim/cache` |
03:59:04 | FromDiscord | <Elegantbeef> you an do `--nimcache:cacheHere` |
04:01:05 | FromDiscord | <huantian> wait isn't it `.cache/nim` |
04:01:24 | FromDiscord | <Elegantbeef> It is |
04:01:24 | FromDiscord | <Elegantbeef> I'm dumb |
04:09:05 | FromDiscord | <Bubblie> hello! what would be the equivalent of const char in nim? |
04:09:24 | FromDiscord | <Bubblie> would it be cchar or just char |
04:09:39 | FromDiscord | <flywind> No, you have to importc by yourself. |
04:10:12 | FromDiscord | <Bubblie> oh, I kinda meant like, if there was anything in nim that would be just the general equivalent to it |
04:10:51 | FromDiscord | <flywind> cchar/char should work, see also https://github.com/nim-lang/Nim/issues/19588 |
04:10:58 | FromDiscord | <MagPhi> should I use nimlsp or nim/langserver |
04:11:03 | FromDiscord | <Bubblie> In reply to @flywind "cchar/char should work, see": thank you :) |
04:12:26 | FromDiscord | <flywind> In reply to @MagPhi "should I use nimlsp": nim/langserver should work well with big projects and it supports nimsuggest v3 option. |
04:12:44 | FromDiscord | <flywind> It is used in production by status.im |
04:13:38 | FromDiscord | <flywind> (edit) "well" => "better" |
04:18:13 | FromDiscord | <Prestige> I should try getting that working again with neovim |
04:18:48 | FromDiscord | <Elegantbeef> The downside is you need a compiler built with a specific commit since it hasnt been in a release yet↵(@flywind) |
04:20:09 | FromDiscord | <flywind> In reply to @Elegantbeef "The downside is you": I see. I will try it with the nim compiler after disabling nimsuggest for a long while. |
04:21:19 | FromDiscord | <MagPhi> In reply to @Avahe "I should try getting": I am seeing if I can get nimlangserver working with neovim |
04:25:15 | FromDiscord | <MagPhi> I installed nimlangserver but what is the command? |
04:25:37 | FromDiscord | <Elegantbeef> should be nimlangserver, but like mentioned if you dont have a compiler with the commit it requires it will not work |
04:25:56 | FromDiscord | <MagPhi> but its building |
04:26:48 | FromDiscord | <MagPhi> (edit) "its building" => "it installed" |
04:26:55 | FromDiscord | <MagPhi> Hmm the command doesnt work |
04:26:59 | FromDiscord | <MagPhi> Which commit? |
04:28:49 | FromDiscord | <Prestige> Can you just use choosenim devel? |
04:29:29 | FromDiscord | <Elegantbeef> It's mentioned on nimlangserver's github |
04:29:34 | FromDiscord | <Elegantbeef> You can |
04:29:40 | FromDiscord | <Elegantbeef> Or `choosenim #thecommit` |
04:40:02 | FromDiscord | <Hamid_Bluri> does other nim tools nimble/nimpretty,... update when I hit `choosenim update ...` ? or just Nim compiler itself? |
04:40:15 | FromDiscord | <Elegantbeef> They do update all the tooling shipped with nim |
04:40:21 | FromDiscord | <Elegantbeef> nimble isnt a nim tool technically |
04:40:34 | FromDiscord | <Hamid_Bluri> thanks |
04:42:38 | FromDiscord | <flywind> Yeah, nimble will be installed by sepcified commit in the Nim compiler |
04:42:53 | FromDiscord | <Elegantbeef> Oh right it does |
04:47:15 | FromDiscord | <flywind> Discord editing doesn't seem to show on matrix 😕 |
04:47:25 | FromDiscord | <Elegantbeef> Yep it's a shame |
04:47:29 | FromDiscord | <Elegantbeef> The bridge is really meh |
04:48:19 | FromDiscord | <Rainbow Asteroids> write a better bridge when |
04:53:48 | FromDiscord | <MagPhi> I installed choosenim through nible |
04:53:52 | FromDiscord | <MagPhi> (edit) "nible" => "nimble" |
04:53:57 | FromDiscord | <MagPhi> but the command is not working |
04:55:08 | FromDiscord | <huantian> What is the error? |
04:55:58 | FromDiscord | <MagPhi> choosenim: command not found |
04:59:07 | FromDiscord | <huantian> Oh you installed it via nimble, not sure then |
05:04:20 | FromDiscord | <huantian> I would probably install it via the script |
05:07:26 | FromDiscord | <Bubblie> just a quick question, im making some bindings but for all C integers should I use cint and ciunt? when should I use each respectively since nim also has the difffeten integers like uint64 and int64 |
05:08:06 | FromDiscord | <Generic> you can bind explicitly sized integers like uint8_t as uint8 in Nim |
05:08:21 | FromDiscord | <Generic> in fact I don't even think there is something like cuint8 or so in Nim |
05:09:11 | FromDiscord | <Bubblie> ah okay |
05:09:33 | FromDiscord | <Bubblie> and for int32_t cant I just make that int in nim |
05:09:36 | FromDiscord | <Bubblie> rather than specifically saying |
05:09:39 | FromDiscord | <Bubblie> int32 |
05:09:44 | FromDiscord | <Generic> no |
05:09:46 | FromDiscord | <MagPhi> In reply to @huantian "I would probably install": `choosenim-init: Downloading choosenim-0.8.4_linux_amd64↵main: line 77: /tmp/choosenim-0.8.4_linux_amd64: No such file or directory` |
05:09:55 | FromDiscord | <Generic> int32_t -> int32 |
05:09:55 | FromDiscord | <Bubblie> In reply to @Generic "no": so I should specify int32 |
05:10:00 | FromDiscord | <Generic> yes |
05:10:02 | FromDiscord | <Bubblie> alright thank you :) |
05:10:58 | FromDiscord | <flywind> In reply to @MagPhi "`choosenim-init: Downloading choosenim-0.8.4_linux_": There are pre-built releases for linux https://github.com/dom96/choosenim/releases |
05:11:03 | FromDiscord | <MagPhi> but what is it ? |
05:11:06 | FromDiscord | <MagPhi> an executable? |
05:11:19 | FromDiscord | <flywind> Yeah |
05:11:25 | FromDiscord | <MagPhi> but it doesnt work |
05:11:37 | FromDiscord | <flywind> What's your OS? |
05:11:46 | FromDiscord | <MagPhi> `exec: Failed to execute process '/tmp/choosenim-0.8.4_linux_amd64': The file exists and is executable. Check the interpreter or linker?` |
05:11:53 | FromDiscord | <MagPhi> In reply to @flywind "What's your OS?": NixOS |
05:12:09 | FromDiscord | <huantian> you can't just execute executables on nixos |
05:12:28 | FromDiscord | <huantian> because NixOS is ✨ special ✨ |
05:12:43 | FromDiscord | <MagPhi> Makes sense |
05:14:06 | FromDiscord | <flywind> You can download latest prebuilt nim compiler from nightlies => https://github.com/nim-lang/nightlies/releases/tag/2022-08-13-devel-713f39083ee37085ba24345af741e5b448fdcc05 |
05:14:45 | FromDiscord | <huantian> hmm I'm not sure if anyone has made a nightly overlay for nim |
05:15:42 | FromDiscord | <MagPhi> so I used nimble to build langserver |
05:15:45 | FromDiscord | <MagPhi> it produces a binary |
05:16:09 | FromDiscord | <MagPhi> but when I run the binary it doesnt give any output |
05:18:08 | FromDiscord | <huantian> you'd probably just have better luck if you use `nimlsp` which is already packaged for nix |
05:18:44 | FromDiscord | <MagPhi> I didnt try installing it through nix but |
05:19:07 | FromDiscord | <MagPhi> when I try to install it using nimble it says nimsuggest folder not found |
05:19:28 | FromDiscord | <huantian> yes because nixos won't install nim nor nimsuggest where it normally is |
05:19:34 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=47sd |
05:19:55 | FromDiscord | <huantian> note <https://github.com/NixOS/nixpkgs/blob/3a11db5f408095b8f08b098ec2066947f4b72ce2/pkgs/development/tools/misc/nimlsp/default.nix#L19> |
05:20:29 | FromDiscord | <MagPhi> so if I install nimlsp |
05:20:38 | FromDiscord | <MagPhi> should I use nightlies or the latest stable version? |
05:20:39 | FromDiscord | <Bubblie> also what would the equivalent of va_list in nim |
05:20:45 | FromDiscord | <huantian> In reply to @MagPhi "should I use nightlies": latest stable |
05:20:49 | FromDiscord | <MagPhi> alright |
05:21:13 | FromDiscord | <huantian> the `nim` package you probably have already should be fine |
05:21:19 | FromDiscord | <huantian> the wonders of NixOS |
05:22:38 | FromDiscord | <MagPhi> the nim package I have cannot build nimlsp |
05:23:17 | FromDiscord | <huantian> are you installing <https://search.nixos.org/packages?channel=unstable&show=nimlsp&from=0&size=50&sort=relevance&type=packages&query=nim> |
05:23:41 | FromDiscord | <MagPhi> no i tried installing it using neovim |
05:23:51 | FromDiscord | <MagPhi> which installs it using nimble install nimlsp |
05:23:54 | FromDiscord | <MagPhi> (edit) "nimlsp" => "nimls" |
05:24:14 | FromDiscord | <huantian> hm sorry I can't really help with neovim stuff |
05:24:32 | FromDiscord | <huantian> but can't you have nvim use a specific path |
05:24:46 | FromDiscord | <MagPhi> nvm I did install it |
05:25:13 | FromDiscord | <MagPhi> but running nimlsp doesnt do anything |
05:25:42 | FromDiscord | <huantian> well I don' think it should? |
05:25:51 | FromDiscord | <huantian> like running the lsp binary directly |
05:25:57 | FromDiscord | <huantian> idk how lsp works |
05:41:05 | FromDiscord | <Rainbow Asteroids> sent a code paste, see https://paste.rs/D1h |
05:41:26 | FromDiscord | <Elegantbeef> `readData(addr buffer[0], amount)` |
05:41:45 | FromDiscord | <Rainbow Asteroids> that makes a lot of sense, thank you |
05:58:58 | FromDiscord | <Elegantbeef> @Rainbow Asteroids\: worth noting there is `readStr` |
05:59:21 | FromDiscord | <Elegantbeef> Ah nvm you're reading to a byteseq |
06:26:55 | FromDiscord | <!&luke> How can I get the directory that the binary of the program is |
06:27:11 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/os.html#getAppDir |
06:27:18 | FromDiscord | <!&luke> Oh |
06:29:15 | FromDiscord | <!&luke> Also is there a way I can tell if a user is connected to the internet without sending a request to a website |
06:29:32 | FromDiscord | <Elegantbeef> Probably os depended |
06:29:52 | FromDiscord | <!&luke> Meh I'll just send a request |
06:34:44 | FromDiscord | <MagPhi> after installation where will the files in nim/config go? |
06:34:50 | FromDiscord | <MagPhi> and nimble? |
06:36:54 | FromDiscord | <Elegantbeef> Depends how you installed it, for choosenim it's `.choosenim/yournimversion/` |
06:37:32 | FromDiscord | <MagPhi> i used the install script in nim-nightly and installed it into a folder |
06:37:48 | FromDiscord | <Elegantbeef> Perhaps `.nim` no clue i've only ever used choosenim |
06:39:52 | FromDiscord | <MagPhi> hmm files in the nimble folder goes in .nimble |
06:40:03 | FromDiscord | <MagPhi> but nim/config? |
06:46:37 | FromDiscord | <!&luke> Making an update feature is kinda hard |
06:46:46 | FromDiscord | <!&luke> Because I have to make sure it's cross platform |
07:05:22 | * | derpydoo joined #nim |
07:10:43 | FromDiscord | <Phil> sent a long message, see http://ix.io/47sD |
07:10:59 | FromDiscord | <Elegantbeef> Think it's `#branch` |
07:12:23 | FromDiscord | <Phil> where? After the general repo, like↵`nimble install https://github.com/PhilippMDoerner/norm#branchfeature/%133-add-public-fromRow`? |
07:13:15 | FromDiscord | <Phil> I'm mostly getting a lot of ` Error: 'hg' not in PATH.` errors |
07:13:59 | FromDiscord | <Elegantbeef> Rename your branch to something sane |
07:14:20 | FromDiscord | <Phil> sad branch naming noises |
07:16:35 | FromDiscord | <Phil> Damn you git and your temptation to have issue-references in branch names |
07:16:48 | FromDiscord | <Phil> (edit) "git" => "github" |
07:22:04 | FromDiscord | <Phil> just naming the branch 133-add-public-fromRow without the `feature/#` still doesn't get many further:↵.... wait, nimble reacts to tags! |
07:22:09 | FromDiscord | <Phil> Maybe I can just tag the branch |
07:33:14 | FromDiscord | <Phil> Nope.↵I can't just use <my repo>#<tag-name> as that always causes the "hg" error the second a hash is involved, <my repo>@<tag-name> is only for versioning tags (which also compares with the nimble version) so I'm either manually adding stuff to nimble or waiting |
07:33:54 | FromDiscord | <Phil> (edit) "repo>#<tag-name>" => "repo>#<branch or tag-name>" |
07:38:27 | * | kenran joined #nim |
07:41:04 | * | CyberTailor quit (Remote host closed the connection) |
07:43:01 | * | CyberTailor joined #nim |
08:00:28 | NimEventer | New post on r/nim by qFoxoman: Send Sms/Otp in nim - Mersal, see https://reddit.com/r/nim/comments/wn8xv6/send_smsotp_in_nim_mersal/ |
08:05:09 | * | kenran quit (Quit: WeeChat info:version) |
08:09:33 | FromDiscord | <4zv4l> is there a function or a set of functions in the stdlib to interact with the pcap.h lib ? to scan packets from an interface ? |
08:10:59 | FromDiscord | <enthus1ast> no, either search for a nimble module thats wraps it (not aware of any) or wrap it yourself |
08:12:28 | FromDiscord | <4zv4l> alright, gonna try |
08:13:26 | FromDiscord | <enthus1ast> maybe c2nim, Nimterop or futhark can help you with this |
08:16:38 | FromDiscord | <4zv4l> do you have a small example of how to wrap a small c function in nim ? then I can start doing it from 'scratch' |
08:17:28 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#foreign-function-interface-importc-pragma |
08:18:19 | FromDiscord | <4zv4l> thanks ! |
08:18:28 | FromDiscord | <Elegantbeef> Can also refer to things like https://github.com/nim-lang/Nim/blob/version-1-6/lib/posix/posix_other.nim |
08:24:22 | FromDiscord | <4zv4l> alright I still don't totally get it |
08:25:11 | FromDiscord | <4zv4l> like, what if I wanna make my own printf in nim that use printf to print "hello, world" how do I do that ? |
08:25:20 | FromDiscord | <enthus1ast> what i often do is, i copy small snippets in c2nim |
08:25:37 | FromDiscord | <Elegantbeef> That is importing C's printf |
08:26:00 | FromDiscord | <enthus1ast> @4zv4l\: also have a look how the stdlib does it |
08:26:12 | FromDiscord | <4zv4l> wait so, am I supposed to translate the pcap lib or interact with it ? |
08:26:48 | FromDiscord | <Elegantbeef> you need to import the libraries into nim |
08:27:54 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=47sS |
08:28:45 | FromDiscord | <enthus1ast> ah |
08:28:46 | FromDiscord | <enthus1ast> https://github.com/PMunch/nim-pcap |
08:29:30 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=47sT |
08:29:45 | FromDiscord | <Elegantbeef> That's not for the library enthus |
08:29:55 | FromDiscord | <enthus1ast> yes i know |
08:30:00 | FromDiscord | <4zv4l> wait so I do have to translate it |
08:30:03 | FromDiscord | <4zv4l> why |
08:30:09 | FromDiscord | <Elegantbeef> You dont have to translate it |
08:30:12 | FromDiscord | <Elegantbeef> You have to import it |
08:30:22 | FromDiscord | <4zv4l> why can't I just import the library and use the functions directly ? like if I was importing a nim lib ? |
08:30:24 | FromDiscord | <Elegantbeef> Cause Nim and C use different type systems |
08:30:39 | FromDiscord | <4zv4l> sent a code paste, see https://paste.rs/LMF |
08:30:40 | FromDiscord | <Elegantbeef> That's not rewritten |
08:30:44 | FromDiscord | <Elegantbeef> That's an imported struct |
08:30:54 | FromDiscord | <Elegantbeef> Consider `char` in C what is it in Nim? |
08:30:58 | FromDiscord | <Elegantbeef> This is impossible to tell |
08:31:07 | FromDiscord | <Elegantbeef> If you want a zig like import look at futhark |
08:31:59 | FromDiscord | <Elegantbeef> Nim and C are not the same language nor do they share most semantics |
08:32:18 | FromDiscord | <Elegantbeef> Hell even a `int` is ambiguous in C |
08:32:53 | FromDiscord | <Elegantbeef> Does it expect a heap allocated int, a reference, a partridge in a pair tree? |
08:34:13 | FromDiscord | <Elegantbeef> C's type system is very lax which makes it hard to import into a language that cares about types |
08:34:20 | FromDiscord | <Elegantbeef> Well hard to automatically |
08:35:24 | FromDiscord | <Elegantbeef> Though futhark does it's job well and you can write like 3 lines of import and get a library to work |
08:35:24 | FromDiscord | <Phil> In reply to @Elegantbeef "Does it expect a": Your mortal soul, it expects your mortal soul to be poured into the variable to function |
08:35:35 | FromDiscord | <Elegantbeef> Probably phil |
08:35:39 | FromDiscord | <Elegantbeef> It's a joke of a type system |
08:35:46 | FromDiscord | <4zv4l> if I use futhark, will nim be able to include the functions I use inside the binary for no library dependencies ? |
08:36:05 | FromDiscord | <Elegantbeef> If you statically link yes |
08:36:08 | FromDiscord | <Elegantbeef> Otherwise no |
08:36:12 | FromDiscord | <Elegantbeef> Just like if you used it from C |
08:37:34 | FromDiscord | <Elegantbeef> On debian libpcap does ship a static library |
08:37:39 | FromDiscord | <Elegantbeef> So you can statically link it easily |
08:38:19 | FromDiscord | <Elegantbeef> No clue if your distro does, but i just had to check |
08:46:47 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=47sX |
08:46:47 | FromDiscord | <4zv4l> what is the use of varargs also ? |
08:47:13 | FromDiscord | <Elegantbeef> varargs was only for `printf` cause in C it uses varargs |
08:47:19 | FromDiscord | <Elegantbeef> you have a `:` after the procedure |
08:47:43 | FromDiscord | <Elegantbeef> it's `proc getAdd(x, y: cint): cint {. header:"math.c", importC: "add".}` |
08:48:11 | FromDiscord | <4zv4l> alright, I start to get it I thikn |
08:48:14 | FromDiscord | <4zv4l> (edit) "thikn" => "think" |
08:55:10 | FromDiscord | <tandy> leorize\: can i use union with std/options? |
08:55:23 | FromDiscord | <Elegantbeef> Only if you ask nicely |
08:55:24 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=47sY |
08:55:34 | FromDiscord | <4zv4l> what did I do wrong ? |
08:55:36 | FromDiscord | <tandy> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1007935332160897024): leorize\: can i use union with std/options?↵like `Option[union(string | int)]` |
08:55:56 | FromDiscord | <4zv4l> or it's because I didn't typedef the struct ? |
08:56:01 | NimEventer | New thread by N8: What's the use case for a "block" statement?, see https://forum.nim-lang.org/t/9367 |
08:56:28 | FromDiscord | <4zv4l> yes |
08:56:31 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/w6O |
08:56:31 | FromDiscord | <4zv4l> that was the typedef |
08:56:40 | FromDiscord | <Elegantbeef> you'd have to do `struct humans` otherwise |
08:56:46 | FromDiscord | <4zv4l> alright, thank you so much |
08:56:55 | FromDiscord | <4zv4l> damn I think I really start to get it |
08:56:56 | FromDiscord | <4zv4l> xD |
08:57:08 | FromDiscord | <4zv4l> but yeah Zig and Nim way to do that is way different I think |
08:57:44 | FromDiscord | <Elegantbeef> Yea Nim compiles to C so just makes you import the types verbatim |
09:00:27 | FromDiscord | <Prestige> Is there a plan to allow same-name properties for object variants? |
09:00:46 | FromDiscord | <4zv4l> if I make my lib, is there a way I can share it and someone use it without having the pcap.h on its system ? |
09:00:59 | FromDiscord | <Yardanico> In reply to @Avahe "Is there a plan": only if they have the same type, but yeah, the RFC is kinda semi-accepted |
09:01:00 | FromDiscord | <4zv4l> without compiling the lib in .so or .dll ofc |
09:01:16 | FromDiscord | <Yardanico> In reply to @4zv4l "without compiling the lib": if they have the pcap lib installed, then yes, they won't need pcap.h if your bindings don't use that header |
09:01:17 | FromDiscord | <Prestige> In reply to @Yardanico "only if they have": Neat, thanks |
09:01:42 | FromDiscord | <Yardanico> otherwise you'll have to ship the binary with statically linked pcap or something like that (if you don't want users to install it themselves) |
09:01:56 | FromDiscord | <Yardanico> and again, pcap.h is only needed for compilation, of course it won't be needed for actually running the binary |
09:02:11 | FromDiscord | <4zv4l> yeah right, if I compile it in static right ? |
09:02:42 | FromDiscord | <4zv4l> because I had that trouble using Goland using the pcap lib and even when compiling (supposed to be static) I got error when not having the pcap lib |
09:03:22 | FromDiscord | <Elegantbeef> Well you have to statically link it properly(just like you would with C) with Nim |
09:06:50 | FromDiscord | <tandy> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1007935332160897024): leorize\: can i use union with std/options?↵like `Option[union(string | int)]`↵EDIT\: Yes \:) |
09:07:38 | FromDiscord | <Rika> In reply to @Avahe "Is there a plan": I’d assume only if the types are the same as well |
09:08:37 | FromDiscord | <4zv4l> Don't kill me for what I'm gonna say but would it be possible for Nim to add support for Zig ? Would it be worth it ? Like zig doesn't depend on libc or anything and does really fast and small binaries |
09:08:49 | FromDiscord | <Elegantbeef> You can use zig cc |
09:08:54 | FromDiscord | <Elegantbeef> There isnt much benefit |
09:09:13 | FromDiscord | <Elegantbeef> Zig has similar issues to C for importing C code |
09:09:20 | FromDiscord | <Yardanico> In reply to @4zv4l "Don't kill me for": you can make it so that Nim won't depend on libc either, it's just a matter of writing another stdlib |
09:09:24 | FromDiscord | <Yardanico> or you can just statically link it |
09:09:30 | FromDiscord | <Yardanico> and nim does "really fast and small binaries" too fwiw |
09:11:10 | FromDiscord | <4zv4l> In reply to @Elegantbeef "There isnt much benefit": From what I have used zig cc does better optimisation than gcc or others c compiler I used |
09:11:34 | FromDiscord | <Rika> ? |
09:11:34 | FromDiscord | <Yardanico> In reply to @4zv4l "From what I have": `zig cc` is literally just `clang`, so your statement is kinda weird |
09:11:36 | FromDiscord | <Rika> In what sense |
09:11:46 | FromDiscord | <4zv4l> Like even with all the flag for size optimisation I get to 14k with gcc maybe 12k with tcc and with zig I easily get to 7k with the same code |
09:11:50 | FromDiscord | <Elegantbeef> Clang + linker!↵(@Yardanico) |
09:11:59 | FromDiscord | <Elegantbeef> TCC isnt good for file size |
09:12:15 | FromDiscord | <Elegantbeef> It's literally the laziest compiler with the single goal of "get code out" |
09:12:30 | FromDiscord | <Rika> TCC is for compilation speed yes |
09:12:43 | FromDiscord | <4zv4l> In reply to @Yardanico "you can make it": Yeah but why rewrite the stdlib when zig got one |
09:12:49 | FromDiscord | <Rika> In reply to @4zv4l "Yeah but why rewrite": What? |
09:12:53 | FromDiscord | <Elegantbeef> Cause Nim isnt Zig? |
09:12:56 | FromDiscord | <Yardanico> In reply to @4zv4l "Yeah but why rewrite": nim also got one already |
09:13:10 | FromDiscord | <Rika> I don’t know what you mean |
09:13:14 | FromDiscord | <Yardanico> and about file size, as I said - you compared tcc and gcc, but `zig cc` uses clang |
09:13:15 | FromDiscord | <Rika> Or rather imply with that statement |
09:13:25 | FromDiscord | <Elegantbeef> Why write a Rust stdlib when C has one |
09:13:42 | FromDiscord | <Yardanico> I kinda can't follow the dialogue anymore 🤔 |
09:13:47 | FromDiscord | <Yardanico> what are we trying to argue about |
09:13:50 | FromDiscord | <4zv4l> Im not saying Nim is bad or anything I really like it just since it's up from C and C++,... why not add Zig to the list since Zig had lot of advantages over C |
09:13:51 | FromDiscord | <Rika> Yeah I don’t get it |
09:13:54 | FromDiscord | <4zv4l> Not arguing |
09:14:08 | FromDiscord | <Elegantbeef> Cause when you use C as an IR zig doesnt add much |
09:14:10 | FromDiscord | <Yardanico> In reply to @4zv4l "Im not saying Nim": but how does that matter for Nim? |
09:14:11 | FromDiscord | <Elegantbeef> Aside from portabillity |
09:14:16 | FromDiscord | <4zv4l> Just got a thought about Nim and Zig |
09:14:18 | FromDiscord | <Yardanico> Nim only uses C as a compilation target, Zig won't change anything |
09:14:33 | FromDiscord | <4zv4l> Well if Nim use Zig as target the binary could be faster and smaller |
09:14:36 | FromDiscord | <Elegantbeef> The only benefit Zig adds is a cross platform compiler and linker |
09:14:38 | FromDiscord | <Yardanico> In reply to @4zv4l "Well if Nim use": no |
09:14:46 | FromDiscord | <enthus1ast> maybe better cross compilation |
09:14:52 | FromDiscord | <Yardanico> yes, but you can already do that with zig cc |
09:14:56 | FromDiscord | <4zv4l> In reply to @Yardanico "no": No ? |
09:14:59 | FromDiscord | <Yardanico> In reply to @4zv4l "No ?": no. |
09:15:00 | FromDiscord | <Rika> In reply to @4zv4l "Well if Nim use": Why would it be? |
09:15:00 | FromDiscord | <Elegantbeef> No |
09:15:22 | FromDiscord | <enthus1ast> ah yeah↵(@Yardanico) |
09:15:29 | FromDiscord | <Elegantbeef> Unless Zig is significantly faster than the equivlent C it's not any faster |
09:15:53 | FromDiscord | <4zv4l> In reply to @Rika "Why would it be?": Because it has been proven that zig makes smaller and faster binaries |
09:16:03 | FromDiscord | <Rika> In reply to @4zv4l "Because it has been": what |
09:16:15 | FromDiscord | <Yardanico> In reply to @4zv4l "Because it has been": at this point you are starting to seem like a troll honestly, sorry if that sounds a bit hostile |
09:16:19 | FromDiscord | <Rika> What does that even mean |
09:16:20 | FromDiscord | <Yardanico> there are no proofs for that |
09:16:56 | FromDiscord | <4zv4l> https://youtu.be/Z4oYSByyRak |
09:16:58 | FromDiscord | <4zv4l> 22:00 |
09:17:04 | FromDiscord | <4zv4l> He's showing that the zig binary is faster |
09:17:13 | FromDiscord | <4zv4l> Im not trolling im trying to talk |
09:17:40 | FromDiscord | <Elegantbeef> Language benchmarks a fucking joke |
09:17:41 | FromDiscord | <Yardanico> in one specific case, and the difference was negligible compared to C |
09:17:44 | FromDiscord | <Elegantbeef> Dont buy into the koolaid |
09:18:00 | FromDiscord | <4zv4l> Im maybe the only one here thinking Zig is a better language that C and that's why you think I'm a troll |
09:18:08 | FromDiscord | <Elegantbeef> I think zig is better than C |
09:18:15 | FromDiscord | <Yardanico> In reply to @4zv4l "Im maybe the only": we're not arguing about that |
09:18:23 | FromDiscord | <Yardanico> but we're talking about Nim, not C |
09:18:38 | FromDiscord | <Rika> Zig is better than C but not for the reasons you state |
09:18:42 | FromDiscord | <Elegantbeef> Yard it's worse |
09:18:43 | FromDiscord | <4zv4l> Yeah Nim which is a language that wrap another language isn't it ? |
09:18:55 | FromDiscord | <Elegantbeef> I believe he uses comptime to achieve the speedup |
09:19:01 | FromDiscord | <Elegantbeef> So something Nim can do |
09:19:07 | FromDiscord | <Elegantbeef> No Nim doesnt wrap another |
09:19:09 | FromDiscord | <Rika> In reply to @4zv4l "Yeah Nim which is": Just how Zig wraps the LLVM IR and C does for assembly? |
09:19:14 | FromDiscord | <Yardanico> In reply to @4zv4l "Yeah Nim which is": That's not much different, there's even an unofficial LLVM backend for Nim. |
09:19:16 | FromDiscord | <Rika> (edit) "In reply to @4zv4l "Yeah Nim which is": Just ... how" added "like" |
09:19:17 | FromDiscord | <Elegantbeef> It uses C as a very portable IR to reach many platforms |
09:19:24 | FromDiscord | <Elegantbeef> Nim does not wrap any language |
09:19:25 | FromDiscord | <enthus1ast> haha trigger comments \:) |
09:19:35 | FromDiscord | <enthus1ast> the transpiler nim is |
09:19:40 | FromDiscord | <Yardanico> bingo card |
09:19:43 | FromDiscord | <Rika> Enthusiast!!! |
09:19:54 | FromDiscord | <Elegantbeef> Style sensitivity sucks! |
09:20:08 | FromDiscord | <Rika> Beefs got the spirit at least |
09:20:13 | FromDiscord | <enthus1ast> e\_ch\_O "foo" |
09:20:19 | FromDiscord | <Elegantbeef> Lol |
09:20:20 | FromDiscord | <Rika> Achoo |
09:20:23 | FromDiscord | <Elegantbeef> 3am is my excuse rika |
09:20:34 | FromDiscord | <Rika> Bad excuse |
09:21:03 | FromDiscord | <Elegantbeef> In summary the benefits from speed got from Zig's implementation in that case were from the compiler having a rich compile time |
09:21:10 | FromDiscord | <Elegantbeef> Which it just so happens Nim has aswell |
09:21:26 | FromDiscord | <Elegantbeef> So switching to zig for anything but portability is pretty much a joke |
09:21:30 | FromDiscord | <4zv4l> Alright |
09:21:37 | FromDiscord | <4zv4l> And I wasn't talking about switching |
09:21:38 | FromDiscord | <flywind> In reply to @4zv4l "Don't kill me for": Feel free to write a Zig backend in library form like nlvm, the Nim team doesn't have much manpower to maintain one officially. |
09:21:40 | FromDiscord | <4zv4l> Just adding target |
09:22:00 | FromDiscord | <Elegantbeef> Is it really better than using `zig cc`? |
09:22:10 | FromDiscord | <Elegantbeef> Like we can already use zig's compiler to compile C and link it across platforms |
09:22:14 | FromDiscord | <Rika> I wouldn’t think so |
09:22:24 | FromDiscord | <4zv4l> Well I don't know much about zig xx |
09:22:26 | FromDiscord | <4zv4l> Cc |
09:22:38 | FromDiscord | <Yardanico> In reply to @4zv4l "Just adding target": yes, but as we told you, it doesn't make sense to do that |
09:22:53 | FromDiscord | <Yardanico> we already have the C target and an unofficial LLVM backend, and Zig also uses LLVM to create native binaries |
09:22:53 | FromDiscord | <4zv4l> Just from what I used it and I used it a lot it tends to make smaller binaries with zero dependencies and the stdlib is usable even on freestanding |
09:22:56 | FromDiscord | <Elegantbeef> Zig cc calls the C compiler shipped with zig that it uses for `include` it allows you to compile and link binaries across platforms |
09:23:03 | FromDiscord | <Yardanico> so adding Zig as yet another backend wouldn't result in any benefits |
09:23:13 | FromDiscord | <Elegantbeef> I mean we can get without many flags 22kb hello world |
09:23:16 | FromDiscord | <Elegantbeef> 5kb with static musl |
09:23:27 | FromDiscord | <Rika> Insert 100ish byte hello world here |
09:23:31 | FromDiscord | <4zv4l> 5k is still too much for an hello world program |
09:23:35 | FromDiscord | <Rika> Forgot if it was 100 bytes or something |
09:23:41 | FromDiscord | <Elegantbeef> It was 100 bytes i think |
09:23:56 | FromDiscord | <4zv4l> Hand crafted elf can do that in like 100 bytes yeah I think |
09:23:56 | FromDiscord | <Elegantbeef> Think it was like 149 bytes |
09:24:13 | FromDiscord | <Yardanico> In reply to @4zv4l "Hand crafted elf can": but no one does that for real apps |
09:24:19 | FromDiscord | <4zv4l> Yeah ofc xD |
09:24:54 | FromDiscord | <Rika> I don’t know, what’s wrong with the lib c dependency( |
09:24:57 | FromDiscord | <Rika> (edit) "dependency(" => "dependency?" |
09:25:05 | FromDiscord | <Elegantbeef> oh shit apparently the char says 41 bytes |
09:25:11 | FromDiscord | <4zv4l> Alright you can teach me something it's just I still don't get how come years ago they could make operating system that could fit in 5k and now a simple hello world is easily 14k |
09:25:31 | FromDiscord | <Yardanico> because of money and time |
09:25:31 | FromDiscord | <Elegantbeef> https://cr.yp.to/bib/1995/wirth.pdf↵(@4zv4l) |
09:25:41 | FromDiscord | <Rika> Because no one would write the operating system like that nowadays? |
09:25:46 | FromDiscord | <enthus1ast> and bigger drives |
09:25:50 | FromDiscord | <Yardanico> development costs money, development takes time, with abstractions (that consume memory and processing power) you can get the job done faster |
09:26:14 | FromDiscord | <Yardanico> so that's what (almost) everyone does nowadays |
09:26:33 | FromDiscord | <4zv4l> So that's just about abstraction and coding faster ? |
09:26:47 | FromDiscord | <Yardanico> it's about getting the product done faster and costing less money to create, yes |
09:26:55 | FromDiscord | <Yardanico> that's why Electron has become popular for cross-platform apps |
09:27:06 | FromDiscord | <Elegantbeef> When you have more resources you dont have to spend as much time optimising it to make it run as fast as prior so you get shittier code |
09:27:08 | FromDiscord | <Rika> I mean don’t you know about the saying that “time is money” |
09:27:11 | FromDiscord | <Elegantbeef> As time goes on you get blloat |
09:27:44 | FromDiscord | <Elegantbeef> Wirth's plea i linked explains it quite well for even 1995 |
09:27:59 | FromDiscord | <enthus1ast> also i think nim is already pretty good in terms of executable size |
09:28:03 | FromDiscord | <enthus1ast> compared to eg go |
09:28:15 | FromDiscord | <Elegantbeef> I mean it used to advertise 41byte size hello world on the website |
09:28:23 | FromDiscord | <Rika> Well go is statically linked so |
09:28:27 | FromDiscord | <Rika> It’s not exactly fair |
09:28:48 | * | derpydoo quit (Ping timeout: 268 seconds) |
09:30:36 | FromDiscord | <Elegantbeef> I think really most people dont need to care about executable size, it's just accepted programs have size |
09:30:47 | FromDiscord | <Phil> sent a long message, see http://ix.io/47t7 |
09:30:53 | FromDiscord | <Elegantbeef> Unless you're in a constrained environment it's not important anymore |
09:31:20 | FromDiscord | <Rika> Most of the time it’s more expensive to spend dev time than to spend run time |
09:31:22 | FromDiscord | <Elegantbeef> Just give them pizza and coffee they'll work for free!↵(@Phil) |
09:32:02 | FromDiscord | <enthus1ast> its not THAT important anymore; just look at eg how older notebooks struggle to use the discord app |
09:32:14 | FromDiscord | <Rika> If beef was my employer I feel like I’d be fired immediately because I don’t eat pizza (so the bribe doesn’t work) |
09:32:18 | FromDiscord | <enthus1ast> if bloat accumulates you got a problem |
09:32:31 | FromDiscord | <Elegantbeef> Dont worry rika it'd be the greatest canadian pizza |
09:32:33 | FromDiscord | <Elegantbeef> Hawaiian |
09:32:37 | FromDiscord | <Elegantbeef> most people wouldnt eat it |
09:32:42 | FromDiscord | <Phil> I agree with your point enthus1ast, but who will pay the money for it? |
09:32:49 | FromDiscord | <Rika> I don’t eat pizza at all, but when I did I liked Hawaiian |
09:33:04 | FromDiscord | <Elegantbeef> Fuck yea Canada for the win! |
09:33:54 | FromDiscord | <Rika> In reply to @Isofruit "I agree with your": People will complain and maybe sooner or later a competitor would win out and you’ll lose your company xd but it’s doubtful for discord |
09:34:03 | FromDiscord | <Phil> I'd love for discord to be native, take only like 5Mb of RAM and be thrice as fast (afaik native chat clients manage to go that low?), but at one point one must acknowledge that you get discord while "only" paying with your data |
09:34:03 | FromDiscord | <Elegantbeef> Canadian cuisine is so bland we're best known for just adding ingredients to existing things and calling id different |
09:34:23 | FromDiscord | <Elegantbeef> Well you also have to acknowledge people dont really care that much |
09:34:51 | FromDiscord | <Elegantbeef> A good example of this is that games are in the 100s of GBs now |
09:34:59 | FromDiscord | <Rika> Why is it called Hawaiian if it’s from Canada last time I checked Hawaii isn’t Canadian |
09:35:10 | FromDiscord | <Elegantbeef> Pineapples are tropical |
09:35:10 | FromDiscord | <Phil> In reply to @Rika "Why is it called": yet |
09:35:13 | FromDiscord | <Phil> Beef has plans |
09:35:33 | FromDiscord | <Rika> :monkaChrist: |
09:36:51 | FromDiscord | <Phil> In reply to @Elegantbeef "A good example of": Aye, here though I feel like one has actual reason to be miffed because you're paying money and they're still hogging your drive like it's free real estate |
09:37:52 | FromDiscord | <Phil> Given that not that many games in the "massive file size" department actually do anything that interesting gameplay wise |
09:38:14 | FromDiscord | <Phil> (edit) "wise" => "wise, I'm very happy that the industry has a seemingly solid "indie" core nowadays" |
09:51:27 | FromDiscord | <MagPhi> sent a code paste, see https://paste.rs/5kk |
09:51:29 | FromDiscord | <MagPhi> Why is this happening |
09:55:02 | FromDiscord | <Prestige> Would need to see your code |
09:55:15 | FromDiscord | <Prestige> if you do -d:debug instead of release, you should get a stack trace |
09:55:32 | FromDiscord | <MagPhi> My file is just a hello world |
09:56:04 | FromDiscord | <Prestige> just 1 line, `echo "Hello, world"`? |
09:56:12 | FromDiscord | <MagPhi> Yes |
09:56:45 | FromDiscord | <enthus1ast> --parallelBuild\:0 maybe? |
09:56:55 | FromDiscord | <Prestige> It's working for me (on linux) |
09:57:15 | FromDiscord | <enthus1ast> ah its --o |
09:57:29 | FromDiscord | <enthus1ast> (not tested \:) ) |
09:57:40 | FromDiscord | <MagPhi> wdym? |
09:58:38 | FromDiscord | <enthus1ast> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1007950954424975430): ~~ah its --o~~ |
09:58:46 | FromDiscord | <enthus1ast> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1007951014588076112): ~~(not tested \:) )~~ |
10:00:43 | FromDiscord | <enthus1ast> no, i cannot reproduce it (on windows) |
10:03:09 | FromDiscord | <enthus1ast> i think, i had this one before, back then it was a mismatch between compiler and stdlib, if i remember correctly |
10:03:58 | FromDiscord | <enthus1ast> can you try to add "-f" ? |
10:22:55 | FromDiscord | <Phil> ... I need to use ndb/sqlite more, damn is it nice to get proper Rows instead of seq[string] as Rows for sql records |
10:23:47 | FromDiscord | <enthus1ast> imho we should patch all the database modules in the stdlib |
10:24:20 | FromDiscord | <enthus1ast> all db's should support this |
10:24:47 | FromDiscord | <Phil> ndb is only missing mysql really and the generic version of the _sqlite libs |
10:37:33 | FromDiscord | <xzntrc> is it possible to force text into the user input? |
10:37:43 | FromDiscord | <Phil> Well, one thing after another, first get norm the ability to deal with arbitrary object types and Signal system, then let's see about improving Std SQL libs |
10:39:05 | FromDiscord | <xzntrc> sent a code paste, see https://play.nim-lang.org/#ix=47tf |
10:39:19 | FromDiscord | <xzntrc> i dont know if I'm even making sense. |
10:41:41 | FromDiscord | <xzntrc> or can I use readLineFromStdin() |
10:42:01 | FromDiscord | <Rika> I don’t know what you’re trying to mean |
10:42:11 | FromDiscord | <xzntrc> ok what I mean is like |
10:42:21 | FromDiscord | <xzntrc> fuck I dont know how to explain |
10:42:24 | FromDiscord | <Rika> To have text that’s there to edit beforehand? |
10:42:31 | FromDiscord | <xzntrc> I think thats what i mean? |
10:43:04 | FromDiscord | <Rika> Yes but I assume it implies some cursed incantation of POSIX (or was it ANSI) terminal manipulation or something |
10:43:26 | FromDiscord | <xzntrc> what i mean is like |
10:43:45 | FromDiscord | <xzntrc> having user input, but already having some basic input there, which the user can press enter to, or backspace and replace |
10:43:56 | FromDiscord | <Rika> I know I get it |
10:44:24 | FromDiscord | <Rika> But as I’ve said it probably implies some sort of terminal manipulation and manual reimplementation of input or so |
10:45:08 | FromDiscord | <Phil> I think your best bet is every keystroke , manipulate input if necessary, ask for input again and try to hide your earlier asking for input, if that's even possible |
10:45:24 | FromDiscord | <Phil> (edit) "I think your best bet is every keystroke ... ," added "counts as input" |
10:45:27 | FromDiscord | <xzntrc> fuck |
10:45:47 | FromDiscord | <Phil> Though as stated, only if the first bit is even possible |
10:46:18 | FromDiscord | <xzntrc> I've saved all input into a text file called history, and I want to allow the user to call back to it using the up arrow and be able to manipulate it |
10:46:53 | FromDiscord | <Phil> Wait, you were the guy making his own shell right? |
10:47:02 | FromDiscord | <Phil> Hmm |
10:47:15 | FromDiscord | <xzntrc> In reply to @Isofruit "Wait, you were the": yesh |
10:47:15 | * | pro joined #nim |
10:47:15 | FromDiscord | <xzntrc> :3 |
10:48:11 | FromDiscord | <Phil> How the heck does zsh do it with their ctrl r previews? |
10:48:51 | FromDiscord | <Phil> Maybe they have their own input implementation? |
10:48:51 | FromDiscord | <xzntrc> that's what im thinking |
10:49:02 | FromDiscord | <Rika> They do |
10:49:07 | FromDiscord | <Rika> They manipulate the terminal |
10:49:13 | FromDiscord | <xzntrc> fock |
10:49:19 | FromDiscord | <xzntrc> so i dont pressume this would be an easy task |
10:49:24 | FromDiscord | <Rika> You can just use line noise |
10:49:27 | FromDiscord | <Rika> Library |
10:51:28 | FromDiscord | <xzntrc> will check |
10:56:06 | FromDiscord | <xzntrc> https://media.discordapp.net/attachments/371759389889003532/1007965762570432512/unknown.png |
10:56:20 | FromDiscord | <xzntrc> https://media.discordapp.net/attachments/371759389889003532/1007965824692256818/unknown.png |
10:56:31 | FromDiscord | <xzntrc> this was probably the sketchiest way possible to write out histroy |
10:56:36 | FromDiscord | <xzntrc> sent a code paste, see https://play.nim-lang.org/#ix= |
10:56:55 | FromDiscord | <xzntrc> I didn't know if it were possible to write only to the end of the file, so i'm taking whats there and dumping it back |
10:59:50 | FromDiscord | <Rika> You’re not gonna have fun with multi line commands then |
11:00:00 | FromDiscord | <xzntrc> oh fuck |
11:00:03 | FromDiscord | <xzntrc> ill figure something out |
11:00:19 | FromDiscord | <xzntrc> i still dont even have binary execution done :troll: |
11:00:38 | FromDiscord | <xzntrc> I'll have my own user defined pathb |
11:00:39 | FromDiscord | <xzntrc> (edit) "pathb" => "path" |
11:09:01 | FromDiscord | <ShalokShalom> https://blog.nindalf.com/posts/stop-citing-tiobe/ |
11:37:13 | FromDiscord | <dom96> Here is my favourite PL popularity ranking: Wikipedia page view stats. https://pageviews.wmcloud.org/?project=en.wikipedia.org&platform=all-access&agent=all-agents&redirects=0&start=2015-07&end=2022-07&pages=Nim_(programming_language)|D_(programming_language)|Zig_(programming_language)|Rust_(programming_language) |
11:38:20 | FromDiscord | <dom96> Nothing is perfect though, that Zig spike is interesting |
11:39:30 | * | jmdaemon quit (Ping timeout: 268 seconds) |
11:40:03 | FromDiscord | <dom96> but also, that tiobe article is wrong |
11:40:23 | FromDiscord | <dom96> It actually would use `+"xkcd programming"` as a search term which gives 1.5k results |
11:42:46 | FromDiscord | <EyeCon> In reply to @flywind "Discord editing doesn't seem": You can do a `s/old/new` to replace something in the next message though, something (bots? bridges themselves?) edits your message on both sides |
11:44:24 | FromDiscord | <EyeCon> In reply to @4zv4l "do you have a": As a newcomer, I recently wrapped two easy libraries, maybe you can take a look: https://github.com/EyeCon/smaznim and https://github.com/EyeCon/shoconim (if I understood you right) |
11:47:51 | FromDiscord | <EyeCon> In reply to @xzntrc "What I mean is,": I think some shells are using https://tiswww.case.edu/php/chet/readline/rltop.html for this |
11:49:04 | FromDiscord | <tandy> this a thought in the far future for nimskull↵(@4zv4l) |
11:50:13 | FromDiscord | <haxscramper> support for zig as a compiler\ |
11:50:36 | FromDiscord | <haxscramper> not support for zig as a separate target backend, although this is a possibility |
11:53:39 | FromDiscord | <tandy> ah mb |
11:54:29 | FromDiscord | <tandy> i think thats what 4zv4l wants anyway |
11:56:32 | FromDiscord | <Rainbow Asteroids> In reply to @EyeCon "You can do a": s/thatisdone/clientside |
11:57:11 | FromDiscord | <dom96> I don't get the people that keep asking for Zig/Rust/etc backends |
11:57:20 | FromDiscord | <dom96> like what's the point, just use Zig/Rust if you really want |
11:58:42 | FromDiscord | <tandy> cos no one wants to write rust lol |
11:59:03 | FromDiscord | <Rainbow Asteroids> lol |
11:59:04 | FromDiscord | <tandy> dom do you have time to review my nimble pr resurrection \:)? |
11:59:08 | FromDiscord | <dom96> and what will a Rust backend get you? |
11:59:20 | FromDiscord | <dom96> you'll just get Nim, it will just happen to call the Rust compiler |
11:59:24 | FromDiscord | <dom96> the language will be the same |
11:59:28 | FromDiscord | <tandy> you could rewrite nim in rust↵(@dom96) |
11:59:38 | FromDiscord | <dom96> maybe what you're really asking for is lifetimes |
12:00:11 | FromDiscord | <Rainbow Asteroids> In reply to @dom96 "and what will a": longer compile times |
12:00:14 | FromDiscord | <dom96> a Rust backend won't magically make Nim have the same compile-time memory safety as Rust |
12:00:29 | FromDiscord | <dom96> In reply to @tandy "dom do you have": about to head out for McDonalds so no :D |
12:14:53 | FromDiscord | <domosokrat> That is simple logic for them\: 'c backed == easy integration with c code' =\@dom96) |
12:30:29 | * | pro quit (Quit: pro) |
12:46:18 | FromDiscord | <exelotl> Hey, if someone is getting this error when trying to install my Nimble package: https://hastebin.com/raw/ibelezizof |
12:46:28 | FromDiscord | <exelotl> is there a command they can run to get more information? |
12:54:23 | FromDiscord | <noiryuh> welp, i just Nim supports Zig as C compiler |
12:54:25 | FromDiscord | <leorize> you might want to make your own option type with union \:p |
12:55:16 | FromDiscord | <noiryuh> In reply to @noiryuh "welp, i just Nim": since you have to write a `zig cc` wrapper (which is different on linux and windows) |
12:55:54 | FromDiscord | <Rainbow Asteroids> just write in nim then? |
12:57:04 | FromDiscord | <noiryuh> how? |
12:57:27 | FromDiscord | <noiryuh> `--cc:clang --clang.exe:zig-cc --clang.linkerexe:zig-cc` |
12:58:08 | FromDiscord | <noiryuh> it's like triple the length instead of simple `--cc:zig` |
12:59:16 | FromDiscord | <ShalokShalom> In reply to @dom96 "It actually would use": I think they changed thaz6 |
12:59:22 | FromDiscord | <ShalokShalom> That article is quite old |
13:01:03 | FromDiscord | <ShalokShalom> (edit) "thaz6" => "that" |
13:05:05 | FromDiscord | <Phil> In reply to @Rainbow Asteroids "longer compile times": Nim makes me too productive and is too fun to write, got to slow it down! |
13:09:13 | FromDiscord | <Phil> In reply to @noiryuh "it's like triple the": Actually you raise a good point in that zig support might be a bit difficult to figure out ( from what I understood from your post).↵I'll make an SO question about this later I thing for easier googling |
13:09:31 | FromDiscord | <Phil> zig compiler support |
13:09:45 | FromDiscord | <Phil> (edit) "thing" => "think" |
13:10:43 | FromDiscord | <Phil> Though the main benefit I've seen from using the zig compiler so far is being able to define what version of glibc to link against |
13:10:49 | FromDiscord | <noiryuh> could be this↵or waiting for `zig toolchain` command (there is issue about it) to generate a wrapper |
13:12:02 | FromDiscord | <noiryuh> welp, i have cross-compiled from linux to windows using this |
13:12:09 | FromDiscord | <Phil> Honestly I'd rather manpower goes to Bugfixes given that zig compiler support functionally exists, albeit not in the most convenient way (aka needs 3 flags instead of 1) |
13:12:32 | FromDiscord | <noiryuh> sent a code paste, see https://play.nim-lang.org/#ix=47tP |
13:15:11 | FromDiscord | <noiryuh> welp, just by changing the triple and `--os`↵i could compile for linux musl and macos too |
13:16:06 | FromDiscord | <noiryuh> but if Nim supports Zig as C compiler |
13:16:15 | FromDiscord | <noiryuh> you could reduce the compiler and linker flags |
13:16:33 | FromDiscord | <noiryuh> Nim will automatically add it via `--os` |
13:17:14 | FromDiscord | <Rainbow Asteroids> can't you pass flags conditionally using `config.nims` for the time being? |
13:18:05 | FromDiscord | <noiryuh> welp, mostly the problem is writing wrapper |
13:18:41 | FromDiscord | <noiryuh> since Nim will find a program called `zig\ cc` (literally escaped space in the middle) |
13:18:54 | FromDiscord | <noiryuh> and i have no idea how to write a wrapper in windows |
13:18:57 | FromDiscord | <noiryuh> 😅 |
13:19:40 | FromDiscord | <noiryuh> and you also have `bat` and `ps1` on windows too |
13:19:49 | FromDiscord | <noiryuh> different syntax iirc |
13:20:15 | * | dnh joined #nim |
13:23:21 | * | dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:40:41 | * | pro joined #nim |
13:42:41 | FromDiscord | <noiryuh> idk how hard to add another C compiler in Nim |
13:43:00 | FromDiscord | <noiryuh> since Zig uses Clang so it should be easy |
13:44:10 | FromDiscord | <dom96> In reply to @ShalokShalom "That article is quite": It’s less than a month old? |
13:45:11 | FromDiscord | <noiryuh> Nim has supported multiple C compilers which i have no idea are there any people using it currently↵like lcc, watcomc, borlandc, pocc, dmc, sunproc, etc. |
13:45:24 | FromDiscord | <noiryuh> (edit) "currently↵like" => "now↵like" |
13:45:48 | FromDiscord | <dom96> Pretty sure others have been able to compile Nim using ‘zig cc’ |
13:46:13 | FromDiscord | <dom96> @Yardanico possibly |
13:46:18 | FromDiscord | <Phil> In reply to @noiryuh "but if Nim supports": Wait, why do you say it doesn't? |
13:46:29 | FromDiscord | <Yardanico> it does |
13:46:31 | FromDiscord | <Phil> Dom remember my prologue guide? |
13:46:45 | FromDiscord | <noiryuh> sent a code paste, see https://play.nim-lang.org/#ix=47tV |
13:46:46 | FromDiscord | <Phil> It describes how to use zig in there |
13:46:49 | FromDiscord | <Yardanico> sent a code paste, see https://paste.rs/baX |
13:46:51 | FromDiscord | <Yardanico> create a script like that, name it with something without spaces and add it to PATH |
13:46:59 | FromDiscord | <Yardanico> then just do `--cc:clang --clang.exe:"myzigname"` |
13:47:09 | FromDiscord | <noiryuh> i mean |
13:47:11 | FromDiscord | <Yardanico> and pass other args |
13:47:13 | FromDiscord | <noiryuh> support natively |
13:47:37 | FromDiscord | <noiryuh> https://github.com/nim-lang/Nim/pull/13757 |
13:47:44 | FromDiscord | <noiryuh> no idea why it's removed |
13:48:29 | FromDiscord | <Yardanico> In reply to @noiryuh "no idea why it's": because honestly there's no need |
13:48:42 | FromDiscord | <Yardanico> it's just clang with cross-compilation, why would it need a separate compiler entry |
13:57:17 | * | derpydoo joined #nim |
13:57:26 | * | pro quit (Quit: pro) |
13:58:22 | * | dnh joined #nim |
14:01:10 | * | tinystoat quit (Quit: the rare reboot....) |
14:01:38 | FromDiscord | <krisppurg> Is there a way to determine the duration of an audio file? |
14:02:21 | FromDiscord | <krisppurg> (edit) "Is there a way to determine the duration of an audio file? ... " added "either by using nim's stdlib." |
14:03:07 | FromDiscord | <Rika> not with the stdlib iirc |
14:03:21 | FromDiscord | <Rika> stdlib has no video/audio codec processing |
14:04:14 | * | tinystoat joined #nim |
14:05:23 | FromDiscord | <krisppurg> what about the nimble packages? |
14:07:36 | FromDiscord | <Rika> i dont know of any, you can easily search them in nimble.directory no? |
14:12:09 | FromDiscord | <Ras> hello!↵maybe a dumb question, but I'm new to nim. How would I go about sending a 32-bit integer (in native byte order) via a socket? |
14:12:55 | FromDiscord | <noiryuh> In reply to @Yardanico "it's just clang with": just my 2 cents↵it would simplify the cmd-line |
14:12:55 | FromDiscord | <Ras> as in, if I want to send `4`, the following would be sent over the wire:↵`04 00 00 00` |
14:13:17 | FromDiscord | <noiryuh> In reply to @Yardanico "then just do `--cc:clang": also you need to pass `--clang.linkerexe=zig-cc` |
14:13:21 | * | arkurious joined #nim |
14:13:32 | FromDiscord | <Rika> In reply to @noiryuh "also you need to": you can put that in your nim configuration |
14:13:49 | FromDiscord | <noiryuh> and since Zig is not v1.0 yet |
14:13:51 | FromDiscord | <Rika> then you dont need to put it all the time |
14:13:56 | FromDiscord | <noiryuh> some weird shit is not done↵https://github.com/ziglang/zig/issues/4911 |
14:13:58 | FromDiscord | <Phil> In reply to @noiryuh "just my 2 cents": Personally I think any hope of having the command line clean is futile given how many options you may want to use |
14:14:25 | FromDiscord | <Phil> Therefore as rika stated, the thing to use are nim config or nimble tasks |
14:15:19 | FromDiscord | <Ras> (wow, this server could probably use a #help channel, conversations about nim in general and technical questions in the same channel is rather messy) |
14:15:44 | FromDiscord | <Rika> a help channel would not help |
14:16:05 | FromDiscord | <Rika> if we get multiple help conversations at the same time then its the same problem |
14:16:07 | FromDiscord | <Phil> Traffic is manageable either way so we're fine having it in one channel |
14:16:52 | FromDiscord | <Phil> If the channel were bustling with 5 folks typing at once all the time I would be more inclined to agree, but for now we're good |
14:16:57 | FromDiscord | <Ras> In reply to @Rika "if we get multiple": doesn't seem to be a problem in other programming servers, /shrug |
14:17:15 | FromDiscord | <noiryuh> In reply to @Ras "doesn't seem to be": i have seen people asking in general and off topic |
14:17:17 | FromDiscord | <Ras> In reply to @Isofruit "If the channel were": fair, i'm just afraid of my single question getting lost in traffic and not getting any responses |
14:17:21 | FromDiscord | <Phil> Keep in mind that this channel is bridged to hell and back with other chat technologies |
14:17:25 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=47ua |
14:17:35 | FromDiscord | <Ras> thank you |
14:17:38 | FromDiscord | <Ras> sent a code paste, see https://play.nim-lang.org/#ix=47ub |
14:17:40 | FromDiscord | <enthus1ast> but this is sync |
14:17:41 | FromDiscord | <noiryuh> In reply to @noiryuh "i have seen people": in other server |
14:17:44 | FromDiscord | <Ras> sync is fine |
14:17:46 | FromDiscord | <Ras> for now |
14:17:54 | FromDiscord | <Ras> i'll burn that async bridge when i get to it 🙂 |
14:17:59 | FromDiscord | <Rika> In reply to @Ras "doesn't seem to be": you're mistaken |
14:18:33 | FromDiscord | <Ras> i was a moderator in pydis, which had... the most traffic a programming discord server had at that time, and i speak from experience :p |
14:19:35 | FromDiscord | <Rika> okay |
14:19:38 | FromDiscord | <Rika> sure |
14:19:45 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=47uc |
14:20:16 | FromDiscord | <Ras> thank you! |
14:21:47 | FromDiscord | <enthus1ast> aaand a bug in 8 soc \:) |
14:21:54 | FromDiscord | <enthus1ast> it should be int32 |
14:22:11 | FromDiscord | <Ras> i'm doing .uint32 explicitly anyways |
14:22:16 | FromDiscord | <enthus1ast> kk |
14:37:08 | * | dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:01:41 | * | kenran joined #nim |
15:07:02 | FromDiscord | <Ras> another dumb question - as `sock.recv(4)` seems to return a `string`, how do i convert the string `33110000` to the int 4403? |
15:07:11 | FromDiscord | <Ras> ie 0x00001133 |
15:10:24 | FromDiscord | <dom96> you should be treating `string` as a `seq[byte]` |
15:11:05 | FromDiscord | <dom96> there should be a package in nimble that helps you transform a byte sequence to an int |
15:11:53 | FromDiscord | <dom96> maybe this one? https://clonkk.github.io/bytesequtils/bytesequtils.html |
15:11:57 | FromDiscord | <Ras> iirc when i did that PR for pixie, i recall one of treeform's packages doing magic with bytes |
15:11:59 | FromDiscord | <Ras> ah thanks |
15:12:01 | FromDiscord | <Ras> i'll have a look |
15:13:05 | FromDiscord | <dom96> this can also come in handy https://nim-lang.org/docs/endians.html |
15:14:15 | FromDiscord | <Ras> i think i was thinking about `flatty/binny` |
15:14:18 | FromDiscord | <Ras> https://media.discordapp.net/attachments/371759389889003532/1008030743894696076/unknown.png |
15:15:00 | FromDiscord | <dom96> nice yeah, that's what you want |
15:15:23 | FromDiscord | <enthus1ast> @Ras\: there also is this\: https://nim-lang.org/docs/net.html#recv%2CSocket%2Cpointer%2Cint |
15:15:31 | FromDiscord | <enthus1ast> proc recv(socket\: Socket; data\: pointer; size\: int)\: int |
15:15:38 | FromDiscord | <Phil> In reply to @Ras "iirc when i did": Treeform does a lot of magic everywhere |
15:15:58 | FromDiscord | <dom96> use the non-pointer variant if you don't mind some perf downside |
15:16:13 | FromDiscord | <dom96> it's better to go for the safe variants than the unsafe (`pointer` etc) |
15:16:18 | FromDiscord | <enthus1ast> yeah |
15:16:31 | FromDiscord | <enthus1ast> at least validate your stuff \:) |
15:16:42 | FromDiscord | <enthus1ast> parse is better than cast in this case |
15:17:02 | FromDiscord | <dom96> the Nim doc gen should IMO put any unsafe procs in their own "Unsafe" section |
15:19:48 | FromDiscord | <enthus1ast> @dom96\: btw the forum has no user overview etc for mods and admins right? |
15:20:14 | FromDiscord | <Ras> In reply to @enthus1ast "parse is better than": welll... |
15:20:17 | FromDiscord | <Ras> https://media.discordapp.net/attachments/371759389889003532/1008032247225524334/unknown.png |
15:20:37 | FromDiscord | <enthus1ast> \:) |
15:20:59 | FromDiscord | <dom96> In reply to @enthus1ast "<@132595483838251008>\: btw the forum": what do you mean? |
15:21:20 | FromDiscord | <enthus1ast> to see what users exits with their status etc |
15:21:52 | FromDiscord | <dom96> I still don't understand what you mean 😅 |
15:22:20 | FromDiscord | <enthus1ast> i was quite surprised that there is no real admin view or admin tools |
15:22:34 | FromDiscord | <enthus1ast> to see all registered/active users for exampe |
15:22:44 | FromDiscord | <dom96> oh yeah, there isn't |
15:23:13 | FromDiscord | <dom96> It's not something that is necessary |
15:25:05 | FromDiscord | <Ras> should i be worried about this warning |
15:25:08 | FromDiscord | <Ras> https://media.discordapp.net/attachments/371759389889003532/1008033470578184293/unknown.png |
15:25:56 | FromDiscord | <lantos> sent a code paste, see https://play.nim-lang.org/#ix=47ux |
15:27:17 | FromDiscord | <lantos> (edit) "https://play.nim-lang.org/#ix=47ux" => "https://play.nim-lang.org/#ix=47uy" |
15:27:54 | FromDiscord | <enthus1ast> @Ras\: it would be better if you do a case |
15:29:00 | FromDiscord | <Ras> i don't expect to ever receive an int that isn't defined in the enum though... it's always reflected |
15:29:05 | * | kenran quit (Quit: WeeChat info:version) |
15:29:13 | FromDiscord | <Ras> and i don't send anything that isn't defined |
15:29:13 | FromDiscord | <dom96> In reply to @lantos "I thought this would/should": I guess the expression you're trying to pass into the template doesn't work? |
15:30:07 | FromDiscord | <enthus1ast> something is off with one of the bridges |
15:30:23 | FromDiscord | <enthus1ast> "Could not display this event" |
15:30:45 | FromDiscord | <retkid> neqSeq() is 1 index right? |
15:30:55 | FromDiscord | <retkid> (edit) "index" => "indexed" |
15:33:45 | * | dnh joined #nim |
15:36:10 | FromDiscord | <lantos> sent a code paste, see https://play.nim-lang.org/#ix=47uB |
15:36:43 | FromDiscord | <Rika> `var i {.inject.}` |
15:37:03 | FromDiscord | <dom96> check how the `It` templates are implemented |
15:40:09 | FromDiscord | <Ras> let's say i've got a LOT of different types defined https://media.discordapp.net/attachments/371759389889003532/1008037248907878511/unknown.png |
15:40:13 | FromDiscord | <Ras> how would i go about exporting everything? |
15:40:22 | FromDiscord | <Ras> do i really just have to append `` to every single one? |
15:41:22 | FromDiscord | <Rika> yes |
15:41:29 | FromDiscord | <Ras> oh dear |
15:41:58 | FromDiscord | <enthus1ast> or you get fancy and build a macro for it |
15:43:02 | FromDiscord | <enthus1ast> but its also quickly done with vim macros, vscode or multi cursor |
15:43:02 | FromDiscord | <enthus1ast> but its also quickly done with vim macros, vscode multi cursor |
15:43:10 | FromDiscord | <Ras> yeah i'm just doing it with vim macros |
15:45:22 | FromDiscord | <Phil> Pre-emptive warning for the incoming SO Question, that was the self-answered one that contains how to use zig's compiler in nim.↵No need to answer.↵Though I do appreciate if anyone could tell me where window's equivalent to `/usr/local/bin` on Linux is (the place where you put binaries that you want to be able to call in the shell without having to specify their filepath) |
15:45:58 | FromDiscord | <enthus1ast> system32 |
15:46:00 | FromDiscord | <Rika> yes |
15:46:02 | FromDiscord | <Rika> was going to say |
15:46:05 | NimEventer | New question by Philipp Doerner: How to use the zig compiler in order to compile nim code?, see https://stackoverflow.com/questions/73345643/how-to-use-the-zig-compiler-in-order-to-compile-nim-code |
15:46:05 | FromDiscord | <enthus1ast> but you should put in on the path |
15:46:22 | FromDiscord | <Ras> sent a code paste, see https://play.nim-lang.org/#ix=47uG |
15:46:25 | FromDiscord | <Phil> Then I could add that to the answer since it kinda relies on you writing a shell-script that contains `zig cc $@` |
15:46:25 | FromDiscord | <Ras> in powerhell |
15:48:38 | FromDiscord | <Phil> So for my somewhat tired brain the correct thing to write in there is ↵> Move zigcc to somewhere on your shell's path, e.g. `/usr/local/bin` on Linux or somewhere on your powershell path on Windows. This is required since the nim compiler does not tolerate spaces in commands that call compilers.↵↵Or should I write "somewhere on $Env:Path" on windows? |
15:49:18 | FromDiscord | <Ras> "some directory listed in the PATH environment variable" |
15:49:32 | FromDiscord | <enthus1ast> you could also write something like\: "make sure zigcc is on your path" |
15:49:36 | FromDiscord | <Ras> in powerhell, you'd do `$Env:Path`, but for cmd.exe IIRC it's `echo %PATH%` |
15:50:24 | FromDiscord | <enthus1ast> mhh |
15:50:26 | FromDiscord | <Ras> In reply to @Isofruit "So for my somewhat": powershell doesn't really have its own path variable, it inherits it from the system-wide or user environment settings |
15:50:31 | FromDiscord | <Ras> i.. think |
15:50:36 | FromDiscord | <enthus1ast> the nimble bin dir is on the path already |
15:50:39 | FromDiscord | <Ras> i haven't used windows in years.. |
15:50:42 | FromDiscord | <Phil> So↵> 3. Move zigcc into a directory that is on your PATH environment variable, e.g. `/usr/local/bin` on Linux or somewhere in System32. This is required since the nim compiler does not tolerate spaces in commands that call compilers.↵? |
15:50:45 | FromDiscord | <enthus1ast> maybe we could do a small package that just does it |
15:50:55 | FromDiscord | <Phil> (edit) "System32." => "System32 on windows." |
15:51:26 | FromDiscord | <Ras> In reply to @Isofruit "So > 3.": i don't think you should be dropping anything in system32, i think the recommendation should be to simply update the PATH variable to point to where zigcc is located |
15:51:39 | FromDiscord | <enthus1ast> @Phil\: i personally would not put such stuff in system32, but would rather add another directory to the path var |
15:52:21 | FromDiscord | <Ras> mind you the way you add entries to PATH is really painful in windows |
15:52:26 | FromDiscord | <Phil> > 3. Move `zigcc` into a directory that is on your PATH environment variable, e.g. `/usr/local/bin` on Linux. Alternatively add the path of the directory that contains your `zigcc` script to the PATH variable. This is required since the nim compiler does not tolerate spaces in commands that call compilers.↵There you go |
15:52:26 | FromDiscord | <Ras> you have to go through the gui |
15:54:19 | FromDiscord | <enthus1ast> @Phil\: the only thing this does is to be a command without whitespace and forwards all to "zig cc ..." right? |
15:55:11 | FromDiscord | <Phil> In reply to @enthus1ast "<@180601887916163073>\: the only thing": Pretty much |
15:55:36 | FromDiscord | <noiryuh> does converting from `string` to `cstring` need to free memory? |
15:55:56 | FromDiscord | <noiryuh> on arc/orc |
15:56:16 | FromDiscord | <Phil> I think string to cstring just takes the memory of the string that's already there and cuts of the piece of memory storing the length I'd assume |
15:56:58 | FromDiscord | <Phil> I'm not a highly qualified source for this, that's the impression I got after talking to more knowledgeable folks on here about strings and cstrings out of curiosity |
15:57:20 | FromDiscord | <noiryuh> humm |
15:57:30 | FromDiscord | <noiryuh> i will take a look at generated c |
15:58:18 | FromDiscord | <ajusa> Thanks for writing that up @Phil, I see that question come up a lot |
15:58:50 | FromDiscord | <Phil> In reply to @ajusa "Thanks for writing that": Funnily enough, it wasn't that much work since I already did that particular write up for how to deploy prologue in an alpine or bitnami/minideb docker container 😄 |
15:59:16 | FromDiscord | <Phil> Thankfully I do not intend to go after myself for this egregious display of theft of intellectual property or sth |
16:00:04 | FromDiscord | <Phil> ~~I may have also annoyed Yard , demotomohiro and a couple others back when I ran into this issue~~ |
16:00:30 | * | pro joined #nim |
16:01:01 | FromDiscord | <retkid> how do i check for compiler flags lol |
16:01:16 | FromDiscord | <retkid> ie -d:debug |
16:01:31 | FromDiscord | <enthus1ast> @Phil\: https://github.com/enthus1ast/zigcc |
16:01:48 | FromDiscord | <enthus1ast> if your nimble bin is on your path, you can just install this |
16:01:50 | FromDiscord | <enthus1ast> via nimble |
16:03:07 | FromDiscord | <Phil> So I install this via nimble and can I then just pass that file as a flag to the compilation command and it'll know how to execute it or will it just magically work when compiling or what's going on? |
16:03:21 | FromDiscord | <retkid> defined(x) |
16:03:25 | FromDiscord | <retkid> thanks guys for the help |
16:03:26 | FromDiscord | <noiryuh> In reply to @noiryuh "i will take a": it returns the pointer to the internal data |
16:03:31 | FromDiscord | <enthus1ast> and it prolly is |
16:03:31 | FromDiscord | <enthus1ast> would be glad if someone could test it haha |
16:03:32 | FromDiscord | <enthus1ast> @retkid\: defined(debug) |
16:04:02 | FromDiscord | <enthus1ast> after installation, can you start it via "zigcc" in your terminal? |
16:04:16 | FromDiscord | <Phil> Err let me check, I need to throw out the shell script first |
16:04:40 | FromDiscord | <retkid> half of this code is debug |
16:04:41 | FromDiscord | <retkid> 😭 |
16:04:55 | FromDiscord | <Phil> In reply to @retkid "half of this code": My condolences, that's how I feel staring at some of my own code |
16:04:59 | FromDiscord | <Phil> So many compiletime checks |
16:05:28 | FromDiscord | <retkid> well |
16:05:36 | FromDiscord | <noiryuh> In reply to @enthus1ast "after installation, can you": it does |
16:05:37 | FromDiscord | <retkid> basically half the code is just graphs |
16:05:44 | FromDiscord | <retkid> lol |
16:05:44 | FromDiscord | <enthus1ast> @retkid\: for debug output i've used this quite some time https://github.com/enthus1ast/nimDbg |
16:05:47 | FromDiscord | <Phil> In reply to @enthus1ast "after installation, can you": zigcc exists in my terminal, fascinatingly enough |
16:06:20 | FromDiscord | <enthus1ast> @Phil\: @noiryuh yeah, then could you try to compile nim code with zig? (have nothing installed) |
16:06:26 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/1008043861463011399/unknown.png |
16:06:27 | FromDiscord | <Phil> One sec |
16:06:35 | FromDiscord | <retkid> its more like me making a pager to figure it out |
16:07:10 | FromDiscord | <retkid> should i include this stuff in release |
16:07:52 | FromDiscord | <Phil> In reply to @enthus1ast "<@180601887916163073>\: <@998188037026627696> yeah,": Yep, compiles like a charm |
16:07:59 | FromDiscord | <enthus1ast> then nice |
16:08:00 | FromDiscord | <Phil> I'll add it to the answer |
16:08:05 | FromDiscord | <Phil> On linux, no idea on windows |
16:08:13 | FromDiscord | <enthus1ast> imho its easier than to fiddle with shell scripts etc |
16:09:10 | FromDiscord | <Phil> In reply to @enthus1ast "imho its easier than": Watch this become your most popular package of all time |
16:09:21 | FromDiscord | <enthus1ast> ;\_; |
16:09:51 | FromDiscord | <enthus1ast> maybe i should do stuff like "nimIsEven" or so |
16:12:59 | FromDiscord | <noiryuh> In reply to @enthus1ast "<@180601887916163073>\: <@998188037026627696> yeah,": welp, if `zigcc` works then it should be fine |
16:13:09 | FromDiscord | <noiryuh> ~~`zigc++` when~~ |
16:13:33 | FromDiscord | <Phil> Anyway, I added it to the SO answer |
16:13:39 | FromDiscord | <enthus1ast> zigc++ is a thing? |
16:13:51 | FromDiscord | <enthus1ast> or zig c++ |
16:13:53 | * | pro quit (Ping timeout: 268 seconds) |
16:13:54 | FromDiscord | <enthus1ast> ? |
16:13:57 | FromDiscord | <noiryuh> yes i does |
16:14:01 | FromDiscord | <noiryuh> it's `clang++` |
16:14:10 | FromDiscord | <noiryuh> (edit) "i" => "it" |
16:14:23 | FromDiscord | <enthus1ast> mhhh can i actually have 2 apps in a nimble module? |
16:14:47 | FromDiscord | <noiryuh> https://media.discordapp.net/attachments/371759389889003532/1008045967444021258/unknown.png |
16:15:21 | FromDiscord | <noiryuh> iirc, there is proposal about `objdump` or `readelf` |
16:17:34 | FromDiscord | <enthus1ast> "Error\: invalid module name\: zigc++" |
16:17:51 | FromDiscord | <enthus1ast> is zigcpp good? |
16:18:12 | FromDiscord | <noiryuh> welp, i mostly see people using C compiler |
16:18:28 | FromDiscord | <enthus1ast> i mean, when i'm on it, could do them all |
16:19:44 | FromDiscord | <enthus1ast> but imho only releant ones for nim are zigcc and zigcpp |
16:19:51 | FromDiscord | <noiryuh> is `eqdestroysystem(NimStringV2)` destroy the internal `NimStrPayload`? |
16:19:55 | FromDiscord | <noiryuh> (edit) "is" => "does" |
16:20:02 | FromDiscord | <noiryuh> (edit) "`eqdestroysystem(NimStringV2)`" => "`eqdestroysystem(NimStringV2)`" |
16:20:20 | FromDiscord | <noiryuh> i can't even find the function definition |
16:20:23 | FromDiscord | <Phil> In reply to @enthus1ast "but imho only releant": I think if anybody wants to go into the even fringer edgecase than this particular edgecase of using this compiler, they can figure it out from the SO question |
16:31:38 | FromDiscord | <noiryuh> In reply to @noiryuh "does `eqdestroy__system(NimStringV2*)` destroy the": https://github.com/nim-lang/Nim/blob/version-1-6/lib/system/strs_v2.nim |
16:31:39 | FromDiscord | <noiryuh> damn |
16:32:10 | FromDiscord | <enthus1ast> strs\_v2 is used when you compile with arc/orc |
16:32:55 | FromDiscord | <Rainbow Asteroids> so I can't cast a string to a seq[char] anymore? 😢 |
16:33:08 | FromDiscord | <Rainbow Asteroids> how could they do this |
16:33:23 | FromDiscord | <Phil> In reply to @Rainbow Asteroids "how could they do": Inhumane cruelty, that's how! |
16:34:57 | FromDiscord | <Rainbow Asteroids> !eval echo cast[seq[char]]("Hello, world!") |
16:35:00 | NimBot | @['H', 'e', 'l', 'l', 'o', ',', ' ', 'w', 'o', 'r', 'l', 'd', '!'] |
16:35:02 | FromDiscord | <Rainbow Asteroids> damn |
16:35:07 | FromDiscord | <Rainbow Asteroids> yes |
16:35:17 | FromDiscord | <Rainbow Asteroids> idiomatic nim code |
16:36:41 | FromDiscord | <Phil> In reply to @Rainbow Asteroids "idiomatic nim code": ... but "Hello, world!".toSeq exists! |
16:36:56 | FromDiscord | <Rainbow Asteroids> which is faster? |
16:37:09 | FromDiscord | <Rainbow Asteroids> ;) |
16:37:11 | FromDiscord | <Phil> That is a really good question |
16:37:18 | FromDiscord | <Phil> `nimble install benchy` |
16:37:24 | FromDiscord | <Phil> There you go |
16:37:28 | FromDiscord | <Phil> 😛 |
16:37:51 | FromDiscord | <Rainbow Asteroids> well, the cast is a reinterpretation of the bytes in memory, so in theory, its O(1) |
16:39:26 | FromDiscord | <Rainbow Asteroids> `sequtils.toSeq` uses a for loop, so its O(n) |
16:45:21 | FromDiscord | <spoon> any up-to-date bgfx bindings? |
16:47:00 | FromDiscord | <!Patitotective> In reply to @Rainbow Asteroids "well, the cast is": casts are unsafe ¯\_(ツ)_/¯ |
16:47:41 | FromDiscord | <enthus1ast> and imho do not work with js? |
16:47:56 | FromDiscord | <Phil> Was rainbow working with js? |
16:48:36 | FromDiscord | <Rainbow Asteroids> In reply to @Patitotective "casts are unsafe ¯\_(ツ)_/¯": I am unsafe 🥊 |
16:48:54 | FromDiscord | <enthus1ast> no it works with js |
17:10:20 | FromDiscord | <treeform> sent a code paste, see https://play.nim-lang.org/#ix=47ve |
17:11:43 | FromDiscord | <enthus1ast> the winapi often let the caller allocate mem, and informs the caller if it needs more mem to complete the task |
17:12:31 | FromDiscord | <enthus1ast> or just alloc, and let the caller free it |
17:17:12 | FromDiscord | <noiryuh> sent a long message, see http://ix.io/47vh |
17:26:15 | FromDiscord | <noiryuh> sent a code paste, see https://play.nim-lang.org/#ix=47vj |
17:26:34 | FromDiscord | <ieltan> sent a long message, see http://ix.io/47vk |
17:30:43 | FromDiscord | <Rika> I’d say it’s ultimately useless because programming paradigm also affects performance (functional vs object oriented vs etc) |
17:31:01 | FromDiscord | <dom96> There is too many variables to control and too many fights to have to be consistent |
17:31:36 | FromDiscord | <ieltan> In reply to @Rika "I’d say it’s ultimately": Then it can also be part of the model that tries to make programming paradigm consistent |
17:31:47 | FromDiscord | <Rika> In reply to @ieltan "Then it can also": Then it’s not idiomatic to the languages |
17:32:00 | FromDiscord | <Rika> Languages generally have an idiomatic paradigm |
17:32:16 | FromDiscord | <Rika> Haskell for example doesn’t do OOP |
17:32:38 | FromDiscord | <dom96> Every language is slow at something and fast at something |
17:32:49 | FromDiscord | <SaAnd> and either way, people disagree on what is idiomatic, on what is silly compiler optimization and exactly how to do the other optimizations |
17:32:51 | FromDiscord | <dom96> General purpose benchmarks don't work and are a waste of time in my eyes |
17:33:03 | FromDiscord | <Rika> Pretty much |
17:33:13 | FromDiscord | <Rika> I believe a lot of us hold the same sentiment as Dom here |
17:33:31 | FromDiscord | <Rika> By the way this doesn’t mean benchmarking is useless |
17:33:39 | FromDiscord | <Rika> Just in case someone got the wrong idea |
17:34:18 | FromDiscord | <ieltan> In reply to @Rika "Haskell for example doesn’t": Well I agree with you, but I think if the language are similar enough then it could be worth a shot? |
17:34:29 | FromDiscord | <Rika> Performance is, in a broad idea, from design which both language and implementation stem from |
17:35:49 | FromDiscord | <Rika> In reply to @ieltan "Well I agree with": If you limit people by “idiomaticity”then they will just push the limits of that |
17:36:00 | FromDiscord | <ieltan> In reply to @dom96 "Every language is slow": I was thinking that this sort of benchmarking would reveal what makes the other language fast and maybe we could borrow some of what makes it faster into the other language (if reasonable enough to do it, I don't think that if the difference comes from fundamental design choices that we should copy it of course) |
17:36:03 | FromDiscord | <Rika> What is the limit of idiomatic anyway |
17:36:09 | FromDiscord | <Rika> Depends on the programmer usually |
17:36:32 | FromDiscord | <Rika> In reply to @ieltan "I was thinking that": Most of the time speed comes from fundamental design choice. |
17:37:31 | FromDiscord | <Phil> In reply to @Rika "Just in case someone": And here I thought you were about to question my perfectly well spent time to squeeze 0.0001% more performance out of some trivial proc for voidwalker last thursday |
17:37:45 | FromDiscord | <Rika> In reply to @Isofruit "And here I thought": Your time your loss |
17:37:53 | FromDiscord | <Rika> Ain’t my problem |
17:38:01 | FromDiscord | <ieltan> In reply to @Rika "Most of the time": Then fair enough, but this sort of model would make it clear about what problem a language is more appropriate for and also why compared to other languages. In the end the results would be informative anyways. |
17:38:23 | FromDiscord | <dom96> I built a web server that makes some heavy sqlite queries in Rust recently. Only now realising that the queries aren't async so they block the freaking process and make it unresponsive to other requests. Would your general benchmarks find that? no. |
17:38:33 | FromDiscord | <dom96> Nim would have the same issue btw |
17:38:54 | FromDiscord | <ieltan> In reply to @Rika "If you limit people": Which is why I said there are different levels |
17:39:24 | FromDiscord | <ieltan> Basically higher levels cannot be compared to lower levels (which is idiomatic, default and all) |
17:40:15 | FromDiscord | <Rika> How do you measure that |
17:40:37 | * | dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:40:44 | FromDiscord | <Rika> and thats not exactly what i mean |
17:40:51 | FromDiscord | <dom96> The difference is whether someone actually built a library that is async and makes that fast. For Rust it appears that someone did https://www.reddit.com/r/rust/comments/s5cgbx/dieselasync_an_async_version_of_diesel/ |
17:40:57 | FromDiscord | <Rika> what i mean is that if you limit people to be idiomatic with a definition like this |
17:41:05 | FromDiscord | <Rika> then people will push the limit of your definition |
17:41:41 | FromDiscord | <Phil> In reply to @dom96 "The difference is whether": You make me want to write an async version of norm |
17:41:47 | FromDiscord | <Rika> i was gonna say |
17:41:51 | FromDiscord | <Rika> get to it, phil |
17:42:05 | FromDiscord | <dom96> First you'd need to build an async sqlite/mysql/etc driver |
17:42:06 | FromDiscord | <Phil> Let me get sync norm to a featureset I want first dangit! |
17:42:11 | FromDiscord | <dom96> but yes, that would be awesome |
17:42:29 | FromDiscord | <Phil> I want my damn Django Signalling system and I want it in code I don't have to maintain |
17:42:33 | FromDiscord | <Rika> imagine the time you're losing from using sync norm |
17:42:34 | FromDiscord | <Rika> smh |
17:42:34 | FromDiscord | <Phil> I mean I want it available for all |
17:42:50 | FromDiscord | <Phil> cough |
17:43:17 | FromDiscord | <Phil> To be fair it's not like I'm insanely productive, I'm slowly adding stuff here and there and filling out featuresets and writing up docs |
17:43:48 | FromDiscord | <dom96> ffs https://media.discordapp.net/attachments/371759389889003532/1008068368806453444/unknown.png |
17:44:07 | FromDiscord | <dom96> See, in this case I probably could have used Python and gotten a faster server |
17:44:15 | FromDiscord | <dom96> I bet they have an async sqlite orm |
17:44:36 | FromDiscord | <Phil> sent a long message, see http://ix.io/47vm |
17:44:53 | FromDiscord | <enthus1ast> @dom96\: the way to build something like this is in the end is "finishing" a future right? |
17:44:58 | FromDiscord | <Phil> For 8 months that's kinda small |
17:45:17 | FromDiscord | <Rika> more than me |
17:45:18 | FromDiscord | <enthus1ast> and then hope that the lib you're using can work with callbacks |
17:45:20 | FromDiscord | <Rika> do you know what ive made |
17:45:24 | FromDiscord | <Rika> you dont, exactly |
17:45:39 | FromDiscord | <Phil> You've answered like a million questions on here |
17:45:55 | FromDiscord | <dom96> In reply to @enthus1ast "and then hope that": you should hope that your lib can be integrated into epoll/kqueue/etc |
17:46:05 | FromDiscord | <Rika> so what lmao i spend my time here answering questions and thats it |
17:46:46 | FromDiscord | <enthus1ast> mh i see↵(@dom96) |
17:47:17 | FromDiscord | <dom96> I need to write a blog post about this benchmarking malarkey |
17:47:21 | FromDiscord | <Rika> i'm still learning about ioring |
17:47:51 | FromDiscord | <dom96> so little time, so much to do https://media.discordapp.net/attachments/371759389889003532/1008069387774853231/unknown.png |
17:47:55 | FromDiscord | <Rika> wait is it ioring or io uring |
17:47:55 | FromDiscord | <Rika> idk |
17:47:57 | FromDiscord | <Rika> im dum |
17:48:29 | FromDiscord | <Phil> In reply to @dom96 "The difference is whether": By async driver do you mean there literally is no sqlite code capable of doing async or do you mean nim-code that fires sqlite queries in an async manner? |
17:48:48 | FromDiscord | <Rika> In reply to @Isofruit "By async driver do": nim code id assume |
17:48:49 | FromDiscord | <ieltan> In reply to @dom96 "I built a web": I haven't programmed much but I dare say that this sounds more of a implementation flaw rather than a language issue, I haven't thought much about bugs when I was thinking about the whole benchmark model thingy. What I was talking about earlier was that using async/threading/etc was an optimization choice not critical for the program to function and proceed normally which yours does need. |
17:48:59 | FromDiscord | <Rika> soemone made a rust async driver so sqlite is async capable |
17:49:06 | FromDiscord | <dom96> In reply to @Isofruit "By async driver do": the C sqlite library will have a way to use it in an async manner, you need to wrap that and figure out how to integrate it into Nim's event loop |
17:49:32 | FromDiscord | <dom96> or rather how to integrate it into the hundreds of Nim async event loops since everyone loves to fork their own :P |
17:49:42 | FromDiscord | <Phil> In reply to @dom96 "the C sqlite library": Wait, fuck, I'll need to learn about event loops and not just at one point "oh, err this piece of code will return a Future" and be happy? |
17:49:56 | FromDiscord | <dom96> yep |
17:50:01 | FromDiscord | <ieltan> The point of the model is to reduce the whole "it's a programmer contest rather than a language one" as much of possible |
17:50:14 | FromDiscord | <dom96> I mean... maybe you can get away without learning about event loops |
17:50:23 | FromDiscord | <dom96> depends how sqlite exposes its async capabilities |
17:50:33 | FromDiscord | <Rika> C async is fun (: |
17:50:37 | FromDiscord | <Phil> I barely have JS loop... event loop? in my head |
17:51:05 | FromDiscord | <Phil> So (assuming these are the same concept) it's not like I'm completely new to the concept |
17:51:25 | FromDiscord | <dom96> wait a minute |
17:51:28 | FromDiscord | <dom96> I just realised I'm dumb |
17:51:28 | FromDiscord | <Phil> I've just never gone below "oh some proc returns a Promise/Future/Mono/whateverdatatypetheycallit" |
17:51:42 | FromDiscord | <dom96> SQLite runs in the process, so its queries are CPU bound |
17:51:54 | FromDiscord | <dom96> async won't help you there |
17:51:54 | FromDiscord | <ieltan> In reply to @Rika "then people will push": That's not a problem because I said we would have levels to accommodate those people who wanna push it to the max, you just won't be able to compare it to other languages if they haven't also pushed it to the same "level" as yours if you understand what I mean. |
17:52:08 | FromDiscord | <Rika> In reply to @ieltan "That's not a problem": again not what i mean |
17:52:22 | FromDiscord | <Rika> when you define a level, someone will try their best to push right below your level |
17:52:38 | FromDiscord | <ieltan> In reply to @Rika "again not what i": Ah so you think they won't respect the definition basically |
17:52:44 | FromDiscord | <ieltan> In reply to @Rika "when you define a": Ah I get it |
17:52:45 | FromDiscord | <Phil> In reply to @dom96 "async won't help you": You likely would want it anyway since it likely is useful for postgres and you'd want to be able to swap out dbs |
17:52:47 | FromDiscord | <Rika> no, they will maliciously comply |
17:53:00 | FromDiscord | <dom96> https://www.sqlite.org/asyncvfs.html |
17:53:06 | FromDiscord | <Rika> so you're now wasting time rigorously defining your levels |
17:53:09 | FromDiscord | <dom96> Looks like sqlite does offer async I/O but specifically for writing |
17:53:15 | FromDiscord | <dom96> and it does so by just creating a thread lol |
17:53:21 | FromDiscord | <Rika> or arbitrarily denying entries because "doesnt look idiomatic enough" or smth |
17:53:24 | FromDiscord | <ieltan> Yeah that's a legitimate concern indeed I haven't thought about it |
17:53:50 | FromDiscord | <ieltan> In reply to @Rika "or arbitrarily denying entries": Do we have a clear understanding of what is idiomatic and what is not? |
17:54:02 | FromDiscord | <dom96> you might as well just run spin up a thread for each sqlite query |
17:54:17 | FromDiscord | <Rika> no i dont think there is an objective definition for idiomaticity |
17:54:40 | FromDiscord | <Rika> its kinda like defining "polite english" |
17:54:44 | FromDiscord | <Phil> In reply to @dom96 "you might as well": Well, as stated you'd likely want the API either way. |
17:54:45 | FromDiscord | <Rika> and "casual english" |
17:54:51 | FromDiscord | <Rika> it depends on the user |
17:54:59 | FromDiscord | <dom96> In reply to @Isofruit "Well, as stated you'd": sure, to be consistent with the other DBs |
17:55:12 | FromDiscord | <dom96> the sqlite would then just run in a new thread |
17:55:45 | FromDiscord | <dom96> Maybe since sqlite works that way anyway you might as well run all DB queries in their own thread |
17:55:55 | FromDiscord | <ieltan> sent a code paste, see https://play.nim-lang.org/#ix=47vq |
17:56:00 | * | pro joined #nim |
17:56:14 | FromDiscord | <ieltan> I just saw that definition is from 2008 |
17:56:15 | FromDiscord | <ieltan> Lol |
17:56:40 | FromDiscord | <dom96> thinking about it an async db driver would be pretty simple in that case |
17:57:19 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=47vr |
17:57:30 | FromDiscord | <ieltan> Yup |
17:57:59 | FromDiscord | <Rika> so yeah its hard to tell |
17:58:21 | FromDiscord | <Rika> and sure you can fudge it but i think its also hard to fudge it as well |
17:59:03 | FromDiscord | <dom96> In reply to @dom96 "thinking about it an": so go build one @Phil so we can get it on TechEmpower's benchmarks and win all categories :P |
18:00:44 | FromDiscord | <enthus1ast> regarding the zigcc thing, it does not work on windows, because the nim compiler calls zigcc.exe but nimble creates a zigcc and zigcc.cmd file arrgggh |
18:00:58 | FromDiscord | <enthus1ast> so zigcc.exe is an invalid command ;\_; |
18:01:13 | FromDiscord | <dom96> zigcc is a Nimble package? |
18:01:20 | FromDiscord | <enthus1ast> just done it |
18:01:51 | FromDiscord | <Phil> In reply to @dom96 "so go build one": I find it fascinating that you guys have this hope in my code when it my connection pooling package couldn't pass a code review from beef even at a glance |
18:02:07 | FromDiscord | <enthus1ast> any idea how to make this work? |
18:02:09 | FromDiscord | <enthus1ast> on windows? |
18:02:12 | FromDiscord | <dom96> In reply to @Isofruit "I find it fascinating": I believe in you |
18:02:49 | FromDiscord | <dom96> In reply to @enthus1ast "on windows?": can you give Nim an extension for the compiler it calls? |
18:02:53 | FromDiscord | <dom96> Try passing "zigcc.cmd" or something |
18:02:56 | FromDiscord | <Rika> In reply to @Isofruit "I find it fascinating": doesnt matter if its nice looking as long as it quick bro |
18:02:59 | FromDiscord | <Rika> its a benchmark |
18:03:16 | FromDiscord | <Rika> then again ig some people are gonna read the code and bad code isnt a good representative |
18:03:34 | FromDiscord | <enthus1ast> yes |
18:03:38 | FromDiscord | <enthus1ast> this works |
18:03:42 | FromDiscord | <dom96> In reply to @Rika "then again ig some": hah, most won't read it. Vast majority will see it's number 1 and then spread the "Nim is fastest" news :D |
18:03:46 | FromDiscord | <enthus1ast> ahh to many workarounds imho |
18:04:02 | FromDiscord | <dom96> workarounds is what makes the world round |
18:04:12 | FromDiscord | <dom96> or something, lol |
18:04:39 | FromDiscord | <enthus1ast> can i tell nimble to place the exe in .nimble/bin ? |
18:04:57 | FromDiscord | <dom96> nope |
18:05:37 | FromDiscord | <enthus1ast> is the .cmd also created on linux? |
18:05:59 | FromDiscord | <dom96> nope |
18:06:08 | FromDiscord | <dom96> it's only because Windows doesn't support symlinks properly |
18:06:09 | FromDiscord | <enthus1ast> \:D |
18:06:13 | FromDiscord | <enthus1ast> yes |
18:06:16 | FromDiscord | <ieltan> In reply to @Rika "and sure you can": Well I think a very experienced programmer would be able to determine whether or not some piece of code is idiomatic or not but yeah I get it, it's not a very robust system |
18:06:29 | FromDiscord | <ieltan> I think there's a way, but eh |
18:12:18 | * | pro quit (Quit: pro) |
18:16:05 | * | jmdaemon joined #nim |
18:18:40 | FromDiscord | <dom96> looks like actix has a nice way to offload db queries to another thread already https://www.reddit.com/r/rust/comments/kvnq36/does_anyone_know_how_to_use_an_auxiliary_worker/gizijm5/ |
18:18:55 | FromDiscord | <dom96> it should be that easy in Nim too |
18:19:27 | * | pro joined #nim |
18:19:35 | FromDiscord | <dom96> sadly the thread support just isn't there |
18:20:08 | FromDiscord | <dom96> last I hear we were gonna grab yglukhov's threadpool into the stdlib but then it didn't seem to happen |
18:20:12 | FromDiscord | <dom96> (edit) "hear" => "heard" |
18:20:34 | FromDiscord | <Phil> I wonder what Araq is working on |
18:23:26 | FromDiscord | <dom96> same |
18:24:40 | FromDiscord | <haxscramper> the next book |
18:25:12 | FromDiscord | <dom96> nimskull book when |
18:27:05 | FromDiscord | <haxscramper> when we have a compiler that works and not "works for me" |
18:27:10 | FromDiscord | <haxscramper> (edit) "me"" => "me (TM)"" |
18:27:18 | FromDiscord | <Phil> Needs more TM |
18:27:22 | FromDiscord | <Phil> 2/10 |
18:27:25 | FromDiscord | <Phil> Would not compile again |
18:28:11 | FromDiscord | <enthus1ast> nimskull needs python to install right? |
18:29:48 | FromDiscord | <haxscramper> more or less, although `koch.py` is a convenience wrapper around main koch |
18:30:20 | FromDiscord | <enthus1ast> wondering why since back then when i saw it |
18:30:36 | FromDiscord | <haxscramper> I think it would be possible to build from csources as well, but I that's more of a CI/deployment question, I'm not up-to-date on this topic |
18:30:49 | FromDiscord | <treeform> In reply to @dom96 "You can either `GC_ref`": GC_ref works on strings? |
18:31:07 | FromDiscord | <treeform> if ref/unref works that's great news |
18:31:31 | FromDiscord | <treeform> I though because it its a var object it did not have ref/unref |
18:31:36 | FromDiscord | <treeform> like ref objects do |
18:32:19 | FromDiscord | <dom96> whoa, that's an old message |
18:32:44 | FromDiscord | <dom96> strings aren't "var objects", not sure that even is a category |
18:33:03 | FromDiscord | <dom96> but yes, you can gc_ref a string: https://nim-lang.org/docs/system.html#GC_ref%2Cstring |
18:39:19 | * | kenran joined #nim |
18:44:05 | * | dnh joined #nim |
18:46:20 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=47vH |
18:47:10 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=47vH" => "https://play.nim-lang.org/#ix=47vI" |
18:49:17 | FromDiscord | <dom96> are you actually using multiple threads? |
18:50:16 | FromDiscord | <dom96> if not consider `--threadAnalysis:off` |
18:50:28 | FromDiscord | <dom96> (disables gc safety) |
18:50:46 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=47vJ |
18:51:12 | FromDiscord | <dom96> well, you might want to consider avoiding threads :D |
18:51:19 | FromDiscord | <Phil> Denied! |
18:51:23 | FromDiscord | <dom96> bbl |
18:51:34 | FromDiscord | <Ras> is there a tutorial for async nim? Mind you I've only ever done async in Python, and on a pretty primitive level |
18:51:43 | FromDiscord | <Phil> You don't solve a problem by avoiding it! Something here is buggy and I want to fix it squint |
18:52:20 | FromDiscord | <Phil> particularly since I don't have this problem with std/db_sqlite.exec but just because I'm doing this from ndb shouldn't magically cause something that causes the compiler to ignore my precious "Shut up about gc-safety" command |
18:52:34 | FromDiscord | <Ras> In reply to @Ras "is there a tutorial": I'm really comfortable with `fork()` and the classic threading model, though |
19:02:35 | FromDiscord | <enthus1ast> this maybe https://ssalewski.de/nimprogramming.html#_code_execution_with_asyncawait @Ras |
19:02:46 | FromDiscord | <Ras> thanks |
19:09:15 | FromDiscord | <Phil> Waaaaaait |
19:10:41 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=47vM |
19:11:19 | FromDiscord | <Phil> And if so, since they apparently manage to overcome cast-gcsafe, how do I uber shut them up? |
19:17:46 | * | daanb joined #nim |
19:21:30 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=47vS |
19:21:50 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=47vS" => "https://play.nim-lang.org/#ix=47vT" |
19:22:34 | FromDiscord | <Phil> For those on matrix (not sure if you see the edit): I removed the 2 pragmas `raises: []` and `tags: []` from the body proc |
19:31:32 | FromDiscord | <SaAnd> looks good over here \:) |
19:32:51 | FromDiscord | <Phil> I'm still not incredibly happy that I had to manipulate the ndb lib code on my machine to make the warnings go away =/ |
19:33:25 | * | daanb quit (Quit: Leaving) |
19:34:52 | FromDiscord | <Elegantbeef> You can just cast the gcunsafeness away↵(@Phil) |
19:35:09 | FromDiscord | <Phil> I tried beef! |
19:35:10 | FromDiscord | <Phil> I tried! |
19:35:20 | FromDiscord | <SaAnd> ^↵(@Phil) |
19:35:23 | FromDiscord | <Phil> I used so much cast gc-safeness it should've been a cast-iron block! |
19:35:42 | FromDiscord | <Elegantbeef> Is this a threaded program? |
19:36:00 | FromDiscord | <Phil> webserver backend basically, with threads on |
19:36:18 | FromDiscord | <Phil> technically i don't need it but I keep it on for learning purposes for exactly teaching me to deal with stuff like this |
19:36:44 | FromDiscord | <Phil> (I say technically because the server this binary runs on in the end only has 1 thread and like 1 GB Ram) |
19:36:50 | FromDiscord | <Elegantbeef> remove the `gcsafe` annotation on the proc |
19:37:33 | FromDiscord | <Elegantbeef> I believe annotating gcsafe with threads on forces the procedure to be gcsafe and it doesnt play well with cast |
19:37:35 | FromDiscord | <Elegantbeef> I could be wrong |
19:38:13 | FromDiscord | <Phil> The sad thing is that the final proc that calls all of this, the proc that gets called to handle the request |
19:38:16 | FromDiscord | <Phil> must be gcsafe |
19:38:45 | FromDiscord | <Phil> So this specific proc may not necessarily need to be gc-safe, but the one 3 layers up the call stack does |
19:38:50 | FromDiscord | <Elegantbeef> Nim infers gc safety |
19:39:05 | FromDiscord | <Phil> Yeh and it infers wrongly if I don't force it |
19:39:24 | FromDiscord | <Elegantbeef> Well you have a bug so time to make a min repro |
19:39:35 | FromDiscord | <Phil> dangit |
20:05:34 | FromDiscord | <Bubblie> Is there a va_list equivalent in nim |
20:07:07 | FromDiscord | <huantian> like `varargs`? |
20:07:16 | FromDiscord | <enthus1ast> varargs maybe? |
20:26:47 | FromDiscord | <dom96> In reply to @Isofruit "*technically* i don't need": honestly the gc safety stuff doesn't deserve learning |
20:26:55 | FromDiscord | <dom96> I'm pretty sure it will be gone with arc/orc |
20:27:08 | FromDiscord | <dom96> (but someone correct me if I'm wrong) |
20:27:37 | FromDiscord | <Phil> In reply to @dom96 "honestly the gc safety": I mean I'm using ORC and it's still there so unless it's a planned feature I'd disagree |
20:30:42 | FromDiscord | <dom96> well there is https://github.com/nim-lang/RFCs/issues/142 |
20:50:33 | * | kenran quit (Quit: WeeChat info:version) |
21:23:09 | FromDiscord | <Elegantbeef> Oh is it `{.gcsafe.}:` and not `{.cast(gcsafe).}:` 😄 |
22:12:03 | * | Jjp137 quit (Quit: Leaving) |
22:14:35 | * | Jjp137 joined #nim |
22:27:38 | * | pro quit (Quit: pro) |
22:44:15 | FromDiscord | <Bubblie> In reply to @huantian "like `varargs`?": Ill look into that :) |
22:44:34 | FromDiscord | <Bubblie> Its just weird cause the bindings im using have va_list which I actually dont use much in C in general either |
22:44:41 | FromDiscord | <Bubblie> Thank you tho |
23:28:57 | FromDiscord | <amadan> Is it possible to make a NimNode with a certain line and column? |
23:38:41 | FromDiscord | <Elegantbeef> You can only copyLineInfo |
23:38:50 | FromDiscord | <Elegantbeef> Consider using the `erroor`/`hint`/`warn` procedures in std/macros |
23:39:37 | FromDiscord | <huantian> The world if fmt could inject errors into the steing |
23:43:42 | * | dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
23:59:33 | FromDiscord | <!Patitotective> In reply to @huantian "The world if fmt": wdym? |