00:00:22 | FromDiscord | <Yardanico> `interface` and `out` are unused keywords |
00:00:47 | FromDiscord | <juan_carlos> `-d:interfaces` Wow, it compiles!. |
00:00:55 | FromDiscord | <juan_carlos> I jk. ;P |
00:02:34 | FromDiscord | <exelotl> I feel like we missed an opportunity to use `as` in `mapIt`, `withValue` and other templates that introduce symbols |
00:03:07 | FromDiscord | <exelotl> sent a code paste, see https://paste.rs/CFz |
00:03:42 | FromDiscord | <Rika> looks cursed to me |
00:04:27 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2Qhi |
00:05:07 | FromDiscord | <Yardanico> @exelotl nobody stops you from doing it like this :P |
00:05:10 | FromDiscord | <Yardanico> since it's valid nim syntax |
00:05:19 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/813199701083160586/unknown.png |
00:06:51 | FromDiscord | <exelotl> yeah, I implemented it the other day: https://play.nim-lang.org/#ix=2ORy |
00:07:08 | FromDiscord | <exelotl> well, I called it `lookup` |
00:09:45 | FromDiscord | <Yardanico> nice |
00:13:36 | FromDiscord | <exelotl> the other advantage it has over withValue is that it doesn't expose a pointer |
00:16:53 | FromDiscord | <Yardanico> you can make it even more "cursed" but this doesn't make it easier to read |
00:17:00 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2Qhj |
00:18:17 | * | krux02 quit (Remote host closed the connection) |
00:19:30 | FromDiscord | <exelotl> oh no xD |
00:20:45 | FromDiscord | <exelotl> I don't think the original is cursed... it's consistent with `try: ... except FooError as e:` |
00:21:39 | FromDiscord | <Yardanico> well, that's why I quoted the word |
00:23:56 | FromDiscord | <exelotl> Something possibly neat would be allowing `else` to pass a second block, instead of `do` |
00:24:24 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2Qhl |
00:52:59 | * | Tanger joined #nim |
00:57:41 | * | Tlangir joined #nim |
01:00:06 | * | Tanger quit (Ping timeout: 260 seconds) |
01:33:56 | * | lritter quit (Ping timeout: 240 seconds) |
01:42:48 | * | sz0 quit (Quit: Connection closed for inactivity) |
01:52:19 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
01:52:41 | * | njoseph joined #nim |
01:54:00 | FromDiscord | <~355/113 Man> is there a compile time equivalent of `for`? |
01:54:38 | FromDiscord | <ElegantBeef> yea `for` |
01:55:03 | FromDiscord | <~355/113 Man> ? |
01:55:22 | FromDiscord | <~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2QhC |
01:59:21 | FromDiscord | <ElegantBeef> Well for works at compile time https://play.nim-lang.org/#ix=2QhF |
01:59:37 | FromDiscord | <ElegantBeef> The issue is that for loop is done at runtime the `for n in 1..m` |
01:59:54 | FromDiscord | <~355/113 Man> oh I see |
02:00:23 | FromDiscord | <~355/113 Man> so it needs to be in a static block |
02:00:41 | FromDiscord | <ElegantBeef> Well you're wanting it to be ran at compile time |
02:02:45 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
02:07:22 | * | Lord_Nightmare joined #nim |
03:14:41 | * | ebb joined #nim |
03:25:51 | FromDiscord | <y_yu> sent a code paste, see https://play.nim-lang.org/#ix=2QhY |
03:28:17 | FromDiscord | <ElegantBeef> Well the type is the same for all the Nodes, to differentiate it you have to at runtime with the kind somehow |
03:29:06 | FromDiscord | <y_yu> In reply to @ElegantBeef "Well the type is": In Rust, it might be possible to implement it using ghost types and where clauses, etc. Is such a pattern valid in nim? |
03:29:20 | FromDiscord | <ElegantBeef> Can you show the rust version? |
03:29:29 | FromDiscord | <ElegantBeef> I mean it's certainly possible due to macros |
03:29:41 | FromDiscord | <ElegantBeef> But the question is whether it's already implemented in a library |
03:35:04 | * | muffindrake quit (Ping timeout: 258 seconds) |
03:35:11 | nisstyre | is there a Nim standard library that implements message authentication codes? (e.g. HMAC-SHA1) |
03:35:16 | nisstyre | all I see is hash functions |
03:35:41 | nisstyre | or should I use nimcrypto? |
03:36:19 | FromDiscord | <ElegantBeef> I'd wager you should use nimcrypto, but no clue if the stdlib can |
03:36:43 | nisstyre | looks like stdlib doesn't have it but nimcrypto does |
03:37:03 | * | muffindrake joined #nim |
03:37:56 | FromDiscord | <y_yu> In reply to @ElegantBeef "Can you show the": I'm using Rust (1.50.0), Nim (1.4.2). |
03:38:07 | FromDiscord | <ElegantBeef> I mean the rust implementation |
03:38:16 | FromDiscord | <ElegantBeef> Like i want to see what the rust code does 😄 |
03:41:38 | FromDiscord | <y_yu> In reply to @ElegantBeef "Like i want to": Sorry, I haven't implemented it in Rust yet. I'm just thinking that it could probably be implemented with ghost types.↵But I am interested in Nim, so I am going to try to implement it in Nim. |
03:42:05 | FromDiscord | <ElegantBeef> Yea i was just trying to figure out what i could suggest if i knew of something akin to it |
03:42:54 | FromDiscord | <Yjuq> In reply to @Yjuq "Hey, can I group": sent a code paste, see https://play.nim-lang.org/#ix=2Qi6 |
03:45:44 | FromDiscord | <ElegantBeef> In reply to @y_yu "Sorry, I haven't implemented": My current idea is something like `proc toStr(n: Node) {.variant: nkInt.}` with would subscribe that proc to an enum array and emit a `toStr(n: Node)` procedure which is meant to be called |
03:49:55 | FromDiscord | <ElegantBeef> But yea need a macro to avoid the manual case stmt |
03:55:33 | FromDiscord | <y_yu> In reply to @ElegantBeef "My current idea is": Thank you very much. I'll try your idea first, and then I'll try the macro. If I get a good implementation, I will post it to the community via blog or other means. |
03:55:47 | FromDiscord | <ElegantBeef> Well my idea would need a macro 😛 |
03:56:14 | FromDiscord | <y_yu> (edit) "first, and then I'll try the macro." => "first." |
03:57:41 | FromDiscord | <ElegantBeef> I have issues with macros so i've already started a silly impl 😄 |
04:26:42 | FromDiscord | <ElegantBeef> @y_yu hey i did it, practically a silly Vtable really though afaik https://play.nim-lang.org/#ix=2Qie |
04:27:01 | FromDiscord | <ElegantBeef> Skip to line 44 to see it in action |
04:34:05 | * | spiderstew joined #nim |
04:36:18 | * | spiderstew_ quit (Ping timeout: 256 seconds) |
04:49:03 | FromDiscord | <ElegantBeef> Has anyone actually used the macrocache, seems like it'd be able to remove that vtable but i'm uncertain how to use it |
04:50:15 | leorize[m] | you don't need it here |
04:51:02 | leorize[m] | actually don't mind me :P |
04:51:08 | FromDiscord | <ElegantBeef> Lol |
04:51:34 | leorize[m] | though it would be hard for your macro to reliably work cross-module |
04:51:35 | FromDiscord | <ElegantBeef> I figure you'd use a macro cache to store the bodies then drop them into a `toStr`'s case stmt |
04:52:01 | FromDiscord | <ElegantBeef> Yea though i dont know many people that'd do this type of thing cross module |
04:54:38 | FromDiscord | <ElegantBeef> The way i see it, it'd still require some manual invokation of something to pack it into a case stmt |
04:56:18 | * | rockcavera quit (Remote host closed the connection) |
05:01:50 | saem | Wondering how this will work with CI's broader testing, but this might fix a bunch of conditional compilation issues: https://github.com/nim-lang/Nim/pull/17143 🤞 |
05:04:09 | leorize[m] | nimvim? |
05:05:19 | FromDiscord | <Yjuq> What does the \` in nim actually means? |
05:05:40 | saem | Whoops |
05:05:46 | saem | need to fix that typo |
05:06:13 | FromDiscord | <ElegantBeef> Depends on context in the quote do it implants the value of the nim node, outside it's for stropping |
05:06:28 | leorize[m] | more about stropping: https://nim-lang.org/docs/manual.html#lexical-analysis-stropping |
05:07:01 | FromDiscord | <Yjuq> Ah |
05:07:08 | FromDiscord | <Yjuq> Thanks |
05:09:23 | FromDiscord | <Yjuq> sent a code paste, see https://paste.rs/Gge |
05:09:52 | FromDiscord | <ElegantBeef> yea it's used a bit even in the stdlib, the `dom.div` proc |
05:11:52 | FromDiscord | <DARTHVADER NAXXX> Hello,↵what is the best packages to manipulate images `(imageman,nimage,stbimage)`? |
05:12:33 | FromDiscord | <ElegantBeef> flippy might work aswell |
05:16:25 | FromDiscord | <DARTHVADER NAXXX> thanks |
05:20:41 | FromDiscord | <y_yu> In reply to @ElegantBeef "<@!558157391657435143> hey i did": thank a lot |
05:21:03 | FromDiscord | <y_yu> (edit) "thank" => "thanks" |
05:21:26 | FromDiscord | <ElegantBeef> It's not the fastest but gives a you a place to start later 😛 |
05:36:18 | * | narimiran joined #nim |
05:46:49 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
05:46:58 | * | njoseph joined #nim |
05:47:40 | * | njoseph quit (Client Quit) |
05:47:48 | * | njoseph joined #nim |
06:02:11 | ForumUpdaterBot | New thread by Halloleo: Can't give testament compiler switches when running a pattern, see https://forum.nim-lang.org/t/7544 |
06:06:42 | * | zedeus quit (Ping timeout: 260 seconds) |
06:07:10 | * | zedeus joined #nim |
06:29:05 | * | sz0 joined #nim |
06:40:33 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
06:53:55 | * | wasted_youth2 quit (Quit: Leaving) |
06:58:45 | * | Sembei quit (Ping timeout: 264 seconds) |
07:01:53 | * | krux02 joined #nim |
07:09:28 | * | vicfred quit (Quit: Leaving) |
07:11:56 | * | Tlangir quit (Ping timeout: 240 seconds) |
07:15:14 | * | Tanger joined #nim |
07:17:04 | * | Sembei joined #nim |
07:17:29 | * | Tlangir joined #nim |
07:19:58 | * | Tanger quit (Ping timeout: 260 seconds) |
08:41:18 | * | Arrrrrrrr joined #nim |
08:41:53 | * | PMunch joined #nim |
08:42:12 | * | oculuxe quit (Ping timeout: 246 seconds) |
08:45:18 | saem | @Araq, FYI this is a blocker for building the IDE presently https://github.com/nim-lang/Nim/pull/17143. 😅 I couldn't sort out a minimised test case, but it's follow-on from the stability work merge. If it's not too offensive would appreciate a merge. |
08:49:36 | PMunch | Building he IDE? |
08:50:09 | Clonkk[m] | I'm guessing it's about the Nim VSCode extensions |
08:57:43 | saem | Yeah |
09:09:14 | * | moleike joined #nim |
09:09:30 | * | moleike quit (Client Quit) |
09:29:56 | * | ^Q-Master^ quit (Ping timeout: 240 seconds) |
09:57:39 | * | Q-Master joined #nim |
10:02:22 | * | Q-Master quit (Ping timeout: 260 seconds) |
10:14:19 | FromDiscord | <Kiloneie> @Araq Hey, you maybe got some time today ? |
10:14:37 | * | Kiloneie joined #nim |
10:14:47 | Arrrrrrrr | For what? |
10:16:59 | * | Q-Master joined #nim |
10:23:11 | * | Kiloneie left #nim ("Leaving") |
10:23:13 | FromDiscord | <exelotl> https://media.discordapp.net/attachments/371759389889003532/813355204845895700/42689802_1962504587164766_7691432261220040704_n.png |
10:30:07 | Arrrrrrrr | what if we make --hint[conf]:off by default |
10:35:30 | * | Tlanger joined #nim |
10:38:21 | * | Tlangir quit (Ping timeout: 264 seconds) |
10:42:54 | * | abm joined #nim |
11:17:54 | * | rockcavera joined #nim |
11:19:28 | * | Vladar joined #nim |
11:26:53 | * | Q-Master quit (Read error: Connection reset by peer) |
11:26:57 | * | ^Q-Master^ joined #nim |
11:39:26 | * | rinzlxr quit (Ping timeout: 260 seconds) |
11:49:17 | * | rinzlxr joined #nim |
12:00:40 | * | wasted_youth2 joined #nim |
12:13:46 | * | Tlanger quit (Quit: Leaving) |
12:53:03 | * | asdflkj_ joined #nim |
13:00:48 | * | xet7 quit (Remote host closed the connection) |
13:01:25 | ForumUpdaterBot | New thread by Alexeypetrushin: How to implement universal `collection.pick(field_or_fn)`?, see https://forum.nim-lang.org/t/7545 |
13:01:37 | * | xet7 joined #nim |
13:05:26 | * | xet7 quit (Remote host closed the connection) |
13:17:22 | * | clemens3 joined #nim |
13:45:57 | FromDiscord | <Jett> hello |
13:46:08 | FromDiscord | <Jett> how fast is nim compared to other languages? |
13:46:20 | liblq-dev | fast as C |
13:46:26 | FromDiscord | <Jett> Oh shit really |
13:46:31 | FromDiscord | <Jett> (edit) "really" => "really?" |
13:46:38 | liblq-dev | it depends on what you're doing though |
13:46:42 | FromDiscord | <Jett> Hmm |
13:46:45 | liblq-dev | if your code is allocation-heavy it might be slower |
13:46:55 | liblq-dev | but still faster than interpreted languages for example |
13:47:05 | FromDiscord | <Jett> I just need something that won't be as sluggish with python |
13:47:10 | FromDiscord | <Jett> as python |
13:47:26 | liblq-dev | nim could work, but keep in mind the ecosystem is still young |
13:47:35 | liblq-dev | so there might not be packages for what you need |
13:47:45 | FromDiscord | <Jett> I would only need a websocket lib for what I want to do |
13:47:49 | FromDiscord | <Rika> Nim will not be as sluggish as Python provided the same algorithms are used to compare |
13:47:56 | FromDiscord | <Yardanico> @Jett https://github.com/treeform/ws |
13:48:09 | liblq-dev | i was about to send that lol |
13:48:34 | FromDiscord | <Yardanico> i'm sleepy but my repo recognition brain interface still functions normally |
13:49:07 | * | Jettford joined #nim |
13:49:27 | * | Jettford quit (Client Quit) |
13:50:10 | FromDiscord | <Yardanico> @PMunch we both replied to https://forum.nim-lang.org/t/7545 :P |
13:51:02 | PMunch | Ooh, that was the only issue? |
13:51:31 | PMunch | I for some reason thought that v.`field` wasn't recognised as calling |
13:51:35 | * | lritter joined #nim |
13:51:35 | PMunch | I must be tired :P |
13:51:50 | FromDiscord | <Yardanico> yeah typeof(T.field) or typeof(T().field) won't work if field is a proc |
13:51:56 | FromDiscord | <Yardanico> but typeof(list[0].field) works :P |
13:52:02 | FromDiscord | <Yardanico> in both cases |
13:52:38 | PMunch | Yeah because T is `type tuple[name: string]` |
13:52:47 | FromDiscord | <Yardanico> yeah |
13:52:49 | PMunch | And the procedure doesn't take a type definition |
13:53:22 | FromDiscord | <Yardanico> well T() doesn't work either because you can't init a tuple that way |
13:54:22 | PMunch | This works :P https://play.nim-lang.org/#ix=2QlZ |
13:54:52 | PMunch | Not in any way, shape, or form recommended though :P |
13:54:52 | FromDiscord | <Yardanico> wat |
13:55:26 | PMunch | T.`field` calls the template that returns `string` then v.`field` returns the actual strings :P |
13:57:58 | FromDiscord | <Yardanico> also seems like google started indexing some of the pages from my read-only forum frontend |
13:58:05 | FromDiscord | <Yardanico> "nimscript forum" -> |
13:58:13 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/813409315003826186/unknown.png |
13:58:49 | PMunch | Why did you make that? |
13:59:14 | FromDiscord | <Yardanico> just for fun, or maybe for when you just want to read nim forum without any JS |
13:59:15 | FromDiscord | <Yardanico> https://github.com/Yardanico/kuforum/ |
13:59:20 | FromDiscord | <Yardanico> forum.my-toolbox.xyz |
13:59:38 | FromDiscord | <Yardanico> it's static HTML |
13:59:50 | FromDiscord | <Yardanico> since I just get that HTML from the nim forum via the API :P |
14:05:03 | * | xet7 joined #nim |
14:13:01 | FromDiscord | <arnetheduck> https://github.com/arnetheduck/nlvm/issues/28 - @Araq this would be inspiration for whatever's going on in the compiler |
14:16:49 | FromDiscord | <mratsim> In reply to @Rika "Nim will not be": except for strings. |
14:27:44 | Prestige | PMunch: the selector solution worked great btw, thanks :) |
14:27:52 | PMunch | Oh nice .) |
14:28:03 | PMunch | I meant to ask you about that whenever I saw you online |
14:32:42 | Prestige | I have it working, there's just an issue with 2 commands but it's unrelated to the ipc code. Haven't looked into it yet |
14:52:22 | FromDiscord | <dom96> In reply to @Yardanico ""nimscript forum" ->": You should rename it to not say Nim forum in its title lol |
14:52:58 | FromDiscord | <dom96> Oh. I thought it was another instance of Nim forum |
15:15:07 | ForumUpdaterBot | New post on r/nim by Ericarthurc: Is it worth learning nim? (In my case), see https://reddit.com/r/nim/comments/lpqdqt/is_it_worth_learning_nim_in_my_case/ |
15:15:28 | * | haxscramper joined #nim |
15:16:50 | Clonkk[m] | Is it possible to use the name of a ``importc`` proc as ``newCall`` argument inside a macro ? |
15:18:00 | FromDiscord | <Yardanico> Why not? importc'd procs don't differ from normal ones in this case |
15:22:01 | * | Clonkk[m] sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/IxZGPdciIdaLeyUzNkQykJjc/message.txt > |
15:22:39 | Clonkk[m] | (Also I have like ~ 20 type to e=ncode and typing ``when... elif`` for each case is boring) |
15:23:32 | * | vicfred joined #nim |
15:30:40 | FromDiscord | <hamidb80> https://github.com/ksimka/go-is-not-good |
15:30:43 | * | waleee-cl joined #nim |
15:31:59 | * | PMunch quit (Quit: leaving) |
15:33:04 | * | PMunch joined #nim |
15:34:46 | FromDiscord | <Rika> ? |
15:39:22 | FromDiscord | <mratsim> offtopic |
15:41:57 | * | tane joined #nim |
16:04:02 | FromDiscord | <XxDiCaprioxX> hey, I was wondering is there a way to include c code in the same file the nim code is in? |
16:04:09 | FromDiscord | <neow> same search on startpage |
16:04:12 | FromDiscord | <neow> https://media.discordapp.net/attachments/371759389889003532/813441010406260766/unknown.png |
16:04:19 | FromDiscord | <neow> oh im 3 hours late |
16:06:56 | PMunch | @XxDiCaprioxX, check out the emit pragma |
16:07:04 | FromDiscord | <mratsim> In reply to @XxDiCaprioxX "hey, I was wondering": `{.emit: "my C code".}` |
16:07:53 | FromDiscord | <XxDiCaprioxX> alright thank you |
16:09:26 | FromDiscord | <XxDiCaprioxX> hm it doesnt show up in the manual |
16:09:44 | Clonkk[m] | https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-emit-pragma |
16:10:12 | FromDiscord | <XxDiCaprioxX> thank you |
16:10:34 | * | PMunch quit (Remote host closed the connection) |
16:11:09 | FromDiscord | <XxDiCaprioxX> and I can put the c-code directly into the `""" """`? |
16:11:19 | Clonkk[m] | Yup |
16:11:25 | FromDiscord | <XxDiCaprioxX> okay thanks |
16:11:39 | Clonkk[m] | Or if you prefer you can write a C file a,d use {.compile: "csrc.c".} |
16:11:53 | Clonkk[m] | https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compile-pragma |
16:11:59 | FromDiscord | <XxDiCaprioxX> I am limited to one file so that is the point why I asked |
16:12:21 | Clonkk[m] | You can also write a bash script that write both file for you if you really want to |
16:12:34 | Clonkk[m] | Simple solution are overrated |
16:12:47 | Clonkk[m] | (I'm kidding please don't do that) |
16:14:19 | FromDiscord | <XxDiCaprioxX> xDD |
16:19:38 | FromDiscord | <XxDiCaprioxX> hold up - if I use {.compile: "csrc.c".} does it get compiled together into one .exe? |
16:19:42 | FromDiscord | <XxDiCaprioxX> then that solution might be better |
16:20:57 | FromDiscord | <mratsim> sure |
16:21:07 | FromDiscord | <mratsim> you can replace CMake or make with Nim |
16:21:14 | FromDiscord | <mratsim> and you can compile assembly files as well |
16:21:24 | Clonkk[m] | I believe compile will create an object file that will be linked with your Nim file |
16:21:30 | FromDiscord | <mratsim> https://github.com/status-im/nim-blscurve/blob/master/blscurve/blst/blst_lowlevel.nim#L25-L26 |
16:22:19 | FromDiscord | <mratsim> replacing CMake: https://github.com/numforge/agent-smith/blob/master/third_party/ale_build.nim#L66-L83 |
16:22:32 | FromDiscord | <XxDiCaprioxX> Actually hold up I just noticed sth |
16:22:51 | FromDiscord | <XxDiCaprioxX> Thank you for your help! |
16:28:05 | FromDiscord | <XxDiCaprioxX> Also - does nim have a module that allows one to work with images (like cropping and merging images)? |
16:28:30 | FromDiscord | <Rika> many, but depends on what formats you need |
16:30:32 | FromDiscord | <XxDiCaprioxX> ~~(does your pfp change every day o.O) ~~ only png is fine |
16:31:26 | FromDiscord | <Rika> no, it changes every few months |
16:31:36 | FromDiscord | <Rika> there is nimPNG |
16:31:38 | FromDiscord | <XxDiCaprioxX> oh then I just hit it lucky cuz yday it was different xD |
16:31:44 | FromDiscord | <XxDiCaprioxX> In reply to @Rika "there is nimPNG": thank you 😄 |
16:32:01 | FromDiscord | <Rika> i mean you can also just search github `language:nim image` |
16:35:18 | FromDiscord | <Rika> nim js compiles to ES5 right? |
16:45:43 | FromDiscord | <XxDiCaprioxX> So uh, I wasn't quite able to understand how I put together two images from the github page. can someone tell me the proc for that? |
16:47:15 | FromDiscord | <Rika> i create a blank image that fits both images and i copy them both (given they have same dimension) |
16:47:19 | FromDiscord | <Rika> if not you can scale one |
16:48:41 | FromDiscord | <XxDiCaprioxX> Okay and if I want to place image A over a certain part of image B, is that possible? |
16:48:54 | FromDiscord | <Solitude> anything is possible |
16:49:04 | FromDiscord | <Rika> yeah im pretty sure thats easily doable |
16:50:03 | FromDiscord | <XxDiCaprioxX> Okay, good to hear.↵Now I just gotta work myself into how on earth png encoding works |
16:50:51 | FromDiscord | <Rika> with nimpng you dont need to deal with that |
16:50:58 | FromDiscord | <Solitude> dont use nimpng directrly, either use pixie or imageman |
16:51:16 | FromDiscord | <XxDiCaprioxX> Now that's conflicting crap |
16:51:59 | FromDiscord | <XxDiCaprioxX> Anyways, I will look into both |
16:52:08 | FromDiscord | <XxDiCaprioxX> Is there a documentation page for nimpng? |
16:53:20 | FromDiscord | <Rika> okay i think i didnt use nimpng for the combining images |
16:53:25 | FromDiscord | <Rika> i'd recommend imageman |
16:53:44 | FromDiscord | <XxDiCaprioxX> Okay thanks, if you both recommend it, imagemann it is |
16:54:37 | FromDiscord | <Rika> to ask again, nim compiles to ES5 right? |
17:06:30 | FromDiscord | <dom96> In reply to @Rika "to ask again, nim": I believe so, yes |
17:06:56 | FromDiscord | <Rika> oh hi dom haha how do you js module export on nim 😓 |
17:07:05 | FromDiscord | <dom96> But note that any JS library can emit code. And that may or may not be ES5 |
17:07:23 | FromDiscord | <dom96> In reply to @Rika "oh hi dom haha": Emit is your friend lol |
17:07:34 | FromDiscord | <Rika> okay so i just emit and exportc? |
17:08:13 | FromDiscord | <dom96> Yep. Pretty much. Do have a Google though, there might be better advice on the forums 🙂 |
17:10:48 | FromDiscord | <Rika> js backend needs more love xd |
17:15:30 | FromDiscord | <mratsim> js.find("love") "FileNotFoundException" |
17:18:54 | FromDiscord | <XxDiCaprioxX> Ij ust realized `.add` is deprecated, what do I use now instead? |
17:19:23 | FromDiscord | <Solitude> which add |
17:19:35 | FromDiscord | <XxDiCaprioxX> seq |
17:19:48 | FromDiscord | <Solitude> ? |
17:20:14 | FromDiscord | <XxDiCaprioxX> `seq[T].add(content)` has deprecated since 1.4 it says |
17:20:31 | FromDiscord | <XxDiCaprioxX> oh wait no |
17:20:33 | FromDiscord | <XxDiCaprioxX> table |
17:20:53 | FromDiscord | <XxDiCaprioxX> (edit) "`seq[T].add(content)`" => "`Table[T].add(key, content)`" |
17:21:35 | FromDiscord | <Solitude> use table[key] = value |
17:21:49 | FromDiscord | <Solitude> or ignore the warning |
17:21:52 | FromDiscord | <XxDiCaprioxX> do I have to add the key beforehand or is it just included? |
17:22:10 | FromDiscord | <Solitude> you dont have to |
17:22:33 | FromDiscord | <XxDiCaprioxX> so it does literally the same, just with a different command |
17:23:04 | FromDiscord | <XxDiCaprioxX> ? |
17:23:56 | FromDiscord | <Solitude> no, add can add duplicate keys |
17:24:17 | FromDiscord | <XxDiCaprioxX> so with add I could have accidentally added a duplicate key |
17:24:20 | FromDiscord | <haxscramper> https://forum.nim-lang.org/t/7055 |
17:24:34 | FromDiscord | <haxscramper> ^ about `.add` etc. |
17:24:54 | FromDiscord | <haxscramper> But in short - yes, `.add` can create duplicate values, which was more confusing than necessary |
17:25:00 | FromDiscord | <XxDiCaprioxX> okay thanks |
17:25:38 | FromDiscord | <XxDiCaprioxX> In reply to @haxscramper "^ about `.add` etc.": yeah I read that but I was not fully able to understand what was written and wanted to make sure it wouldn't break |
17:27:42 | * | xet7 quit (Quit: Leaving) |
17:34:07 | FromDiscord | <XxDiCaprioxX> umm is there a good way of dealing with the reoccurring issue of "could not load: zlib1.dll" |
17:34:16 | FromDiscord | <XxDiCaprioxX> sometimes it works, sometimes it doesnt |
17:41:54 | FromDiscord | <mratsim> use Linux |
17:42:33 | FromDiscord | <treeform> In reply to @XxDiCaprioxX "Okay, good to hear.": You can also checkout our very fast pure nim png loading/saving here: https://github.com/treeform/pixie/blob/master/src/pixie/fileformats/png.nim |
17:43:23 | FromDiscord | <mratsim> when PPM support :p |
17:43:41 | FromDiscord | <treeform> I don't even know what PPM is? |
17:44:28 | FromDiscord | <Kiloneie> Oo nice |
17:44:42 | FromDiscord | <mratsim> what you use for teaching graphics https://en.wikipedia.org/wiki/Netpbm#PPM_example |
17:44:55 | FromDiscord | <mratsim> https://raytracing.github.io/books/RayTracingInOneWeekend.html#outputanimage/theppmimageformat |
17:45:19 | FromDiscord | <mratsim> I have an exporter here: https://github.com/mratsim/trace-of-radiance/blob/master/trace_of_radiance/io/ppm.nim#L14-L49 |
17:46:20 | * | rockcavera quit (Remote host closed the connection) |
17:46:42 | FromDiscord | <Rika> what can i do to see some "easy" perf. gains when using nim's js backend |
17:47:03 | FromDiscord | <mratsim> In reply to @Rika "what can i do": Google closure compiler |
17:47:32 | FromDiscord | <Rika> that can improve performance? TIL |
17:48:42 | FromDiscord | <mratsim> When I'm bored, maybe I'll explore Javascript performance but I'm already full with C/Assembly/Nim perf |
17:50:42 | FromDiscord | <Rika> yeah its because the peg i made in npeg is giving me like 500ms per run |
17:52:06 | FromDiscord | <mratsim> maybe compile it to a library/object file. AFAIK regexp/pcre does that. |
17:52:16 | FromDiscord | <Rika> i cannot, its to run in browser |
17:54:08 | * | Arrrrrrrr quit (Quit: Arrrrrrrr) |
17:54:19 | FromDiscord | <haxscramper> There is a pure nim regex implementation, and maybe you can try to use wasm (though I don't know anything wrt. to tradeoffs yet, but just compiling & running nim code via wasm turned out to be not that difficult) |
17:59:26 | FromDiscord | <Rika> no can do with the pure nim regex, not going to rewrite this massive peg into regex; i will look into wasm though |
18:05:27 | FromDiscord | <DARTHVADER NAXXX> In reply to @treeform "I don't even know": Neighbours from hell sprites depth conversion flashbacks |
18:05:43 | FromDiscord | <Rika> emscripten is what you guys use? or the 3rd party wasm backends thingies in gh? |
18:08:47 | FromDiscord | <haxscramper> emscripten |
18:09:38 | FromDiscord | <Rika> ok |
18:09:42 | FromDiscord | <haxscramper> I have a small example (about 1/2 of flags from what I found when I was searching for it too) - https://gist.github.com/haxscramper/0aef37a22c17cdf830fbe85f87de6188 |
18:09:50 | FromDiscord | <Rika> thank you |
18:11:49 | FromDiscord | <haxscramper> And completely cursed one for using nim compiler in wasm https://github.com/haxscramper/hack/tree/master/testing/c/wasm/niminterop - it also shows how to interface nim functions in js code etc. |
18:30:57 | Oddmonger | when i debug nim exes with gdb, i have code printed in red in the tui mode |
18:31:10 | Oddmonger | i want to change it, but i don't see where it's defined |
18:31:32 | * | beeswax joined #nim |
18:31:39 | Oddmonger | « show style » doesn't show red style |
18:33:35 | beeswax | Hi! I've been playing around with the nim bencode example on Nim-Days. Have any of the more experienced devs here looked at the code? The code seems super repetitive, is that really what idiomatic nim looks like? |
18:35:49 | liblq-dev | it's not |
18:35:59 | liblq-dev | the author just didn't engage their brain i think |
18:36:03 | FromDiscord | <haxscramper> Most likely nim-days author choose not to introduce any syntactic sugar because it was not really necessary |
18:36:13 | liblq-dev | we have `.toOrderedTable` which can shorten the table construction |
18:36:39 | liblq-dev | in the first example |
18:36:43 | liblq-dev | otherwise it looks ok |
18:39:55 | beeswax | okay thanks for the info. What's the best way to get into nim actually? I've programmed in Python and C before it's just with the more advanced language features it becomes difficult to not miss the forest for the trees. I've been coding for a while but I'm not a CS major so it seems a little overwhelming at first |
18:41:17 | liblq-dev | idk just write something in it |
18:41:26 | liblq-dev | i learned nim mainly by trying to write a game engine in it |
18:41:36 | FromDiscord | <haxscramper> For general learning links you can also visit https://nim-lang.org/learn.html and look into tutorials if you haven't already. Then just find something to write in nim and go from there |
18:41:53 | liblq-dev | so pick whatever tickles your fancy and code away |
18:42:41 | beeswax | okay that's pretty much the answer I expected ;) Thank you! |
18:47:06 | FromDiscord | <apollo> In reply to @liblq-dev "i learned nim mainly": noice |
18:47:47 | FromDiscord | <apollo> In reply to @beeswax "okay thanks for the": if u ever needed something close to a CS degree i think this covers alot of stuff for free ↵http://cs50.harvard.edu/x/2021/ |
18:49:18 | FromDiscord | <carpal> sent a long message, see http://ix.io/2QoA |
18:49:26 | FromDiscord | <carpal> (edit) "sent" => "I know that this is" | "long message, see http://ix.io/2QoA" => "stupid test, but why is this code so slow compared to the rust version?" |
18:49:30 | FromDiscord | <carpal> https://media.discordapp.net/attachments/371759389889003532/813482613796503582/d.png |
18:51:35 | FromDiscord | <carpal> maybe the stopwatch import? |
18:52:04 | FromDiscord | <carpal> is there a more reliable stopwatch include? |
18:52:43 | Prestige | can you share the code instead of a screenshot? |
18:52:56 | liblq-dev | how did you compile the code? |
18:53:37 | FromDiscord | <Rika> what is stopwatch> |
18:53:38 | liblq-dev | and |
18:53:41 | liblq-dev | what is the rust version? |
18:55:22 | FromDiscord | <Solitude> and you can freely convert between byte and char without cast |
18:55:56 | FromDiscord | <carpal> sent a code paste, see https://play.nim-lang.org/#ix=2QoE |
18:56:17 | FromDiscord | <carpal> ah, this rot13 does not work lol, but it is for a missmatch alphabet count |
18:56:37 | FromDiscord | <carpal> In reply to @liblq-dev "what is the rust": something wrote very more bad |
18:56:59 | liblq-dev | that doesn't tell me anything. |
18:57:02 | liblq-dev | please send the rust code. |
18:57:20 | FromDiscord | <Recruit_main707> and nim compilation flags |
18:57:21 | FromDiscord | <Recruit_main707> pls |
18:57:29 | liblq-dev | yeah |
18:57:30 | FromDiscord | <Solitude> idk wtf is stopwatch, you should just compare your programs with hyperfine |
18:57:47 | liblq-dev | yeah, good idea too |
18:58:15 | liblq-dev | generally you wanna compare the whole program runtime instead of just this small segment where it rot13-encodes the text |
19:03:44 | FromDiscord | <carpal> https://media.discordapp.net/attachments/371759389889003532/813486200458707014/main.rs |
19:04:32 | FromDiscord | <carpal> In reply to @Solitude "idk wtf is stopwatch,": hyperfine? I tried it some hours ago and got me 4 ms of execution with a program didn't anything lol |
19:05:24 | FromDiscord | <Solitude> In reply to @carpal "hyperfine? I tried it": what |
19:05:38 | FromDiscord | <carpal> https://gitlab.com/define-private-public/stopwatch |
19:05:46 | FromDiscord | <carpal> this is the stopwatch I used in nim |
19:10:34 | * | xet7 joined #nim |
19:13:12 | FromDiscord | <Rika> didnt use hyperfine, cba to install https://media.discordapp.net/attachments/371759389889003532/813488574623383562/unknown.png |
19:13:43 | FromDiscord | <Rika> they seem to be "the same"? though what the difference is in user time and system time, i do not know |
19:14:52 | FromDiscord | <Rika> using rust 1.49.0, nim devel |
19:16:22 | FromDiscord | <Rika> let me make the code "more equivalent" and use hyperfine |
19:18:09 | FromDiscord | <Rika> looks like it really is pretty much the same? https://media.discordapp.net/attachments/371759389889003532/813489823637569576/unknown.png |
19:19:50 | FromDiscord | <carpal> but you don't compile in release lol |
19:20:29 | FromDiscord | <Solitude> -O is release |
19:21:27 | FromDiscord | <Rika> bruh |
19:21:35 | FromDiscord | <Rika> i didnt use cargo, i used rustc |
19:21:45 | FromDiscord | <Rika> they use different parameters |
19:21:50 | FromDiscord | <Rika> http://stackoverflow.com/questions/45593026/ddg#45593027 |
19:22:18 | FromDiscord | <carpal> okay using include "system/timers" it works fine |
19:22:29 | FromDiscord | <carpal> 124 nanos |
19:22:36 | FromDiscord | <Rika> okay |
19:23:12 | FromDiscord | <Rika> using the listed cmd there `rustc -C debuginfo=0 -C opt-level=3` gives the same speed |
19:23:16 | FromDiscord | <Rika> rather, results |
19:23:36 | FromDiscord | <carpal> mh but your computer is probably better than mine |
19:23:46 | FromDiscord | <carpal> you can't perform a test on different machines |
19:24:23 | FromDiscord | <Rika> then the tests are irrelevant, if test data is not comparable why even test |
19:25:23 | FromDiscord | <carpal> on my computer the rust version is performed in 500 nanos, but it uses function pointers and more heavy |
19:26:03 | FromDiscord | <Rika> then make the code equivalent again |
19:32:11 | FromDiscord | <carpal> yes |
19:48:34 | * | xet7 quit (Quit: Leaving) |
19:55:39 | * | kitech1- joined #nim |
19:56:36 | * | kitech1 quit (Ping timeout: 240 seconds) |
20:01:33 | FromDiscord | <Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2Qp9 |
20:03:06 | FromDiscord | <Anonymous Poet> in particular, i think the big challenge i have is figuring out how to set the name of the generated function, since nim interprets anything i pass in as a string |
20:05:23 | liblq-dev | @carpal that whole section with `isAlphabeticLetter` seems very redundant in your code, you can reduce that proc to just `proc isAlphabeticLetter(chr: char): bool = chr in {'a'..'z', 'A'..'Z'}` |
20:06:12 | liblq-dev | but i feel like you're overoptimizing such a dumb example |
20:06:29 | FromDiscord | <Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2Qpd |
20:06:49 | liblq-dev | there are better things to optimize than rot13 which is like, not heavy at all :) |
20:07:34 | FromDiscord | <Seedofarson> bruh |
20:07:35 | FromDiscord | <hamidb80> https://media.discordapp.net/attachments/371759389889003532/813502267528970270/unknown.png |
20:07:43 | FromDiscord | <hamidb80> just wow |
20:07:43 | FromDiscord | <Seedofarson> I dont get functioons in this language |
20:07:59 | FromDiscord | <Seedofarson> if I want to make a function |
20:08:05 | FromDiscord | <Seedofarson> that just prints "hello world" |
20:08:32 | FromDiscord | <hamidb80> In reply to @Seedofarson "that just prints "hello": functions has no side effects |
20:08:38 | FromDiscord | <Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2Qpg |
20:08:40 | FromDiscord | <Seedofarson> Huh |
20:08:45 | FromDiscord | <Seedofarson> thats my best guess |
20:08:48 | FromDiscord | <Seedofarson> wont work |
20:08:48 | liblq-dev | ah |
20:08:50 | FromDiscord | <Seedofarson> im coming from python |
20:08:53 | FromDiscord | <Anonymous Poet> sure it will |
20:08:55 | FromDiscord | <hamidb80> writing in stdout has sideeffect |
20:08:58 | liblq-dev | `proc hello() = echo "hello world"` |
20:09:04 | liblq-dev | is the syntax in nim |
20:09:11 | FromDiscord | <Anonymous Poet> `proc != func` |
20:09:15 | FromDiscord | <Seedofarson> hmm |
20:09:21 | liblq-dev | but he's not even referring to func… |
20:09:24 | liblq-dev | they're* |
20:09:27 | FromDiscord | <Anonymous Poet> `func` = `proc {.noSideEffect.}` |
20:09:31 | FromDiscord | <Seedofarson> um |
20:09:38 | FromDiscord | <Seedofarson> whats difference between func and proc |
20:09:39 | FromDiscord | <Seedofarson> haha |
20:09:42 | FromDiscord | <Seedofarson> im coming from python |
20:09:42 | liblq-dev | really they were just confused about proc declaration syntax |
20:09:45 | FromDiscord | <Seedofarson> I feel so dumbrn |
20:09:55 | FromDiscord | <Seedofarson> (edit) "dumbrn" => "dumb rn" |
20:09:57 | FromDiscord | <Seedofarson> okay |
20:10:02 | liblq-dev | @Seedofarson, you see, Nim has an effect tracking system which helps you eliminate side effects like I/O |
20:10:03 | FromDiscord | <Seedofarson> lets get a more complicated example |
20:10:13 | FromDiscord | <Seedofarson> ? |
20:10:27 | liblq-dev | if you're just a beginner don't worry about it |
20:10:39 | liblq-dev | the others were thinking you were referring to the `func` feature of the language |
20:10:45 | FromDiscord | <Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2Qpi |
20:10:52 | liblq-dev | which is a syntactic sugar for a `proc` with the {.noSideEffect.} pragma |
20:11:10 | FromDiscord | <Seedofarson> what is "{.noSideEffect.}"? |
20:11:16 | * | haxscramper quit (Remote host closed the connection) |
20:11:27 | FromDiscord | <hamidb80> In reply to @Seedofarson "what is "{.noSideEffect.}"?": it's a pragma |
20:11:31 | FromDiscord | <Seedofarson> elaborate |
20:11:32 | FromDiscord | <Anonymous Poet> you can think of it as a python decorator |
20:11:36 | FromDiscord | <Seedofarson> idk what pragma is either |
20:11:38 | * | haxscramper joined #nim |
20:11:44 | liblq-dev | really don't worry about it, you'll learn in due time |
20:11:47 | FromDiscord | <Rika> yall dinguses just confused them more |
20:11:52 | FromDiscord | <Anonymous Poet> it asks the compiler to enforce that your function wont have any effects on the programs state outside of its return value |
20:11:54 | FromDiscord | <Seedofarson> return function |
20:11:58 | FromDiscord | <Seedofarson> (edit) "return function" => "return?" |
20:12:01 | FromDiscord | <Seedofarson> uh |
20:12:02 | FromDiscord | <Seedofarson> yeah |
20:12:04 | * | haxscramper quit (Remote host closed the connection) |
20:12:10 | FromDiscord | <Seedofarson> I know what return is but |
20:12:13 | FromDiscord | <Rika> back to the issue at hand |
20:12:24 | FromDiscord | <Seedofarson> cuz |
20:12:25 | liblq-dev | https://play.nim-lang.org/#ix=2Qpj |
20:12:25 | FromDiscord | <Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2Qpi |
20:12:28 | FromDiscord | <Seedofarson> what you did |
20:12:29 | liblq-dev | this would be the syntax |
20:12:31 | FromDiscord | <Seedofarson> was put it all on one line |
20:12:39 | FromDiscord | <Seedofarson> ahhh |
20:12:43 | FromDiscord | <Seedofarson> so you need an equal sign |
20:12:52 | liblq-dev | yes. nim uses `=` because `:` is used for types |
20:13:06 | liblq-dev | so `proc aaa(): ` makes it expect a return type after the colon |
20:13:13 | FromDiscord | <Seedofarson> so like |
20:13:22 | FromDiscord | <Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2Qpk |
20:13:22 | FromDiscord | <Anonymous Poet> you're assigning the "body" to the "name" of the function |
20:13:36 | FromDiscord | <Anonymous Poet> ignore that, its not important right now |
20:13:39 | liblq-dev | @Seedofarson yes |
20:13:46 | FromDiscord | <Seedofarson> ok |
20:13:49 | FromDiscord | <Seedofarson> what about returning something in nim |
20:13:49 | liblq-dev | and you can put more lines after the echo ofc |
20:13:51 | FromDiscord | <Seedofarson> if I want |
20:13:56 | FromDiscord | <Seedofarson> sum(a,b) |
20:13:57 | liblq-dev | there are a few options |
20:14:08 | liblq-dev | one is assigining to the implicit `result` variable |
20:14:13 | liblq-dev | another is using `return x` |
20:14:26 | FromDiscord | <Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2Qpl |
20:14:32 | liblq-dev | another is just leaving the expression you want to return as the last statement in the procedure |
20:14:38 | FromDiscord | <Seedofarson> like that? |
20:14:44 | FromDiscord | <hamidb80> In reply to @hamidb80 "": @Rika , i thought the first example would give me an error |
20:14:47 | liblq-dev | nim is a typed language, so you need type annotations |
20:14:57 | FromDiscord | <Seedofarson> hmmm |
20:15:03 | liblq-dev | https://play.nim-lang.org/#ix=2Qpm |
20:15:05 | liblq-dev | like that |
20:15:32 | liblq-dev | because you're returning a single expression, you can omit the `return` and just have `proc sum(a, b: int): int = a + b` |
20:15:43 | FromDiscord | <Seedofarson> um |
20:15:44 | FromDiscord | <Seedofarson> ok |
20:15:44 | FromDiscord | <Seedofarson> so |
20:16:17 | FromDiscord | <hamidb80> @Seedofarson i suggest take a look at this:↵https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers |
20:16:36 | FromDiscord | <Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2Qpp |
20:16:52 | FromDiscord | <Seedofarson> there is no .upper in nim |
20:16:56 | FromDiscord | <Seedofarson> ofc |
20:17:02 | FromDiscord | <Seedofarson> but if there was |
20:17:05 | FromDiscord | <Rika> .toUpperAscii |
20:17:08 | FromDiscord | <Rika> in strutils |
20:17:20 | liblq-dev | or .toUpper in unicode |
20:17:20 | FromDiscord | <Seedofarson> ah |
20:17:24 | FromDiscord | <Seedofarson> would that work? |
20:17:30 | FromDiscord | <Rika> no |
20:17:34 | FromDiscord | <Rika> missing equals sign |
20:17:42 | FromDiscord | <Rika> then it would work |
20:17:47 | FromDiscord | <Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2Qpq |
20:17:47 | FromDiscord | <Rika> need to import strutils |
20:17:48 | FromDiscord | <Seedofarson> (edit) "https://play.nim-lang.org/#ix=2Qpp" => "https://play.nim-lang.org/#ix=2Qpq" |
20:17:49 | FromDiscord | <Seedofarson> yay |
20:17:56 | FromDiscord | <Rika> (edit) "import strutils" => "`import strutils`" |
20:18:01 | FromDiscord | <Rika> at the top |
20:18:05 | FromDiscord | <Rika> "like python" |
20:18:34 | FromDiscord | <Seedofarson> yeah |
20:19:21 | FromDiscord | <Seedofarson> ok |
20:19:26 | FromDiscord | <Seedofarson> so |
20:19:30 | FromDiscord | <Seedofarson> I jumped forwards to that |
20:19:30 | FromDiscord | <Seedofarson> sent a code paste, see https://paste.rs/exn |
20:19:38 | FromDiscord | <Seedofarson> how do I declare that it is a string |
20:19:38 | FromDiscord | <Rika> no need to echo, there is no return value |
20:19:41 | FromDiscord | <Seedofarson> or w/e |
20:19:47 | FromDiscord | <Rika> oh |
20:19:50 | FromDiscord | <Rika> you changed it to return |
20:19:56 | FromDiscord | <Seedofarson> yeah |
20:20:26 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=2Qpt |
20:20:41 | FromDiscord | <Rika> you should really just read the manual, it might be faster |
20:20:53 | FromDiscord | <Seedofarson> alright |
20:23:47 | FromDiscord | <IndianGoldSmith> @Seedofarson Here us a youtube video series for beginners. ↵https://www.youtube.com/watch?v=5tVIsDYPClA&list=PLvwc2YT9MFOlPPexrsY-t7BNTdg2Vsx06 |
20:23:55 | FromDiscord | <IndianGoldSmith> (edit) "<@!798398880584171530>" => "@Seedofarson" | "us" => "is" |
20:24:12 | FromDiscord | <Solitude> https://nim-lang.org/docs/tut1.html |
20:25:51 | reversem3 | anyone using wasmrt on maxOSX? |
20:26:11 | * | beeswax quit (Quit: leaving) |
20:27:28 | reversem3 | Has anyone seen Yuriy ? |
20:31:56 | FromDiscord | <mratsim> I have seen him. Over a year ago. |
20:32:02 | FromDiscord | <mratsim> at FOSDEM |
20:32:25 | reversem3 | umm.. ok |
20:34:43 | * | Kiloneie joined #nim |
20:35:01 | * | Kiloneie quit (Client Quit) |
20:36:17 | FromDiscord | <Seedofarson> how do I compile something with "-d:ssl" |
20:37:03 | liblq-dev | just compile it but add `-d:ssl` to the command, before your program's filename |
20:37:11 | liblq-dev | like `nim r -d:ssl file` |
20:37:46 | FromDiscord | <Seedofarson> ty |
20:44:52 | * | reversem3 sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/FOjsnEnLoSeiSjRaNJzuMBtZ/message.txt > |
20:45:20 | reversem3 | https://github.com/yglukhov/nimx/blob/master/nimx/layout_vars.nim |
20:46:26 | FromDiscord | <carpal> In reply to @liblq-dev "<@699146708466008115> that whole section": it is not the same thing, else I used utils lol |
20:46:36 | FromDiscord | <Hi02Hi> In reply to @liblq-dev "like `nim r -d:ssl": isnt it `nim c -r -d:ssl file` intead of `nim r -d:ssl file` ? |
20:46:47 | FromDiscord | <Rika> theyre not equivalent |
20:47:00 | FromDiscord | <Rika> former puts binary in pwd, latter puts binary in cache folder |
20:47:12 | liblq-dev | it… is? |
20:47:13 | FromDiscord | <Seedofarson> ty |
20:47:13 | liblq-dev | it compiles down to the same code |
20:47:16 | FromDiscord | <Seedofarson> it worked |
20:47:24 | FromDiscord | <Seedofarson> im trying to execute a discorrd webhook in nim's httpclient |
20:47:26 | FromDiscord | <Seedofarson> lol |
20:47:44 | liblq-dev | yeah |
20:47:45 | liblq-dev | `nim r` is new |
20:48:17 | FromDiscord | <exelotl> nim r is cool |
20:50:12 | FromDiscord | <Rika> i mean equivalent in functionality |
20:50:18 | FromDiscord | <Rika> they dont do the same thing |
20:50:38 | FromDiscord | <Rika> or do you mean to carpal, i just realized |
20:51:41 | reversem3 | I don't see any -newExpression in kiwi https://github.com/yglukhov/kiwi/blob/master/kiwi/expression.nim |
20:54:49 | FromDiscord | <Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2QpH |
20:55:14 | FromDiscord | <hamidb80> A nested proc can have generic parameters only when it is used as an operand to another routine and the types of the generic paramers can be inferred from the expected signature. |
20:55:34 | FromDiscord | <hamidb80> In reply to @Seedofarson "is there any other": strformat module |
20:55:48 | FromDiscord | <Seedofarson> import strformat |
20:56:02 | FromDiscord | <hamidb80> In reply to @Seedofarson "import strformat": https://nim-lang.org/docs/strformat.html |
20:56:37 | FromDiscord | <hamidb80> In reply to @hamidb80 "A nested proc can": any idea? |
20:59:13 | FromDiscord | <mratsim> Was there a question? |
20:59:50 | FromDiscord | <Seedofarson> ty |
21:00:13 | FromDiscord | <hamidb80> https://media.discordapp.net/attachments/371759389889003532/813515507634012190/unknown.png |
21:00:59 | FromDiscord | <carpal> In reply to @liblq-dev "it… is?": are you referring to my message? |
21:01:15 | liblq-dev | @carpal yea |
21:01:28 | FromDiscord | <carpal> mhhh |
21:01:30 | FromDiscord | <Seedofarson> the thing is |
21:01:36 | FromDiscord | <carpal> I don't think it |
21:01:46 | FromDiscord | <Seedofarson> I am trying to put variables in a json string and they are full of "{"'s |
21:01:51 | FromDiscord | <hamidb80> In reply to @hamidb80 "": i can't understant what compiler trying to say |
21:01:57 | FromDiscord | <Seedofarson> so |
21:02:03 | FromDiscord | <carpal> in is an operator, what I wrote is a logic solution |
21:02:08 | FromDiscord | <Seedofarson> idk how to put varibales in it |
21:02:57 | FromDiscord | <mratsim> In reply to @hamidb80 "i can't understand what": why do you have a dangling `;` |
21:02:59 | FromDiscord | <Seedofarson> (edit) "varibales" => "variables" |
21:03:02 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
21:03:17 | FromDiscord | <mratsim> on line 26 |
21:03:33 | FromDiscord | <Seedofarson> guy's |
21:03:40 | FromDiscord | <Seedofarson> if I want to put variables in a json string |
21:03:44 | FromDiscord | <Seedofarson> I cat use strformat |
21:03:48 | * | pbb joined #nim |
21:03:52 | FromDiscord | <Seedofarson> cuz there are already so many curly brackets |
21:04:22 | FromDiscord | <hamidb80> In reply to @mratsim "why do you have": you can write `using ti: TerminalInteractable` and then wherever in your function calls `ti` type would be `TerminalInteractable` |
21:04:34 | FromDiscord | <hamidb80> (edit) "calls" => "parameter list" |
21:04:47 | * | pbb quit (Client Quit) |
21:04:56 | FromDiscord | <mratsim> that doesn't mean that `proc foo(ti;)` is valid though |
21:05:10 | FromDiscord | <mratsim> shouldn't it be `proc foo(ti)` ? |
21:05:18 | FromDiscord | <hamidb80> In reply to @mratsim "that doesn't mean that": it's valid |
21:05:28 | * | pbb joined #nim |
21:05:40 | FromDiscord | <mratsim> the error points to that line and pretty sure it's the parser erroring |
21:05:47 | FromDiscord | <neow> it's the other file |
21:05:58 | Prestige | Hm I need pmunch to magically appear |
21:06:17 | FromDiscord | <neow> it's pointing to ttunnel.nim (left) not tunnel.nim (right) |
21:06:51 | FromDiscord | <hamidb80> In reply to @mratsim "the error points to": it refers to the other file (left side that is shown in screenshoft |
21:07:06 | FromDiscord | <hamidb80> (edit) "screenshoft" => "screenshot" |
21:07:10 | FromDiscord | <Solitude> In reply to @Seedofarson "guy's": https://nim-lang.org/docs/strformat.html#fmt.m%2Cstring%2Cchar%2Cchar |
21:07:10 | FromDiscord | <mratsim> oh right |
21:07:52 | FromDiscord | <mratsim> try using the proc syntax, the sugar is finicky from time to time. |
21:08:21 | FromDiscord | <mratsim> This is something that we need to solve because right now lambdas are a really clunky |
21:10:57 | FromDiscord | <hamidb80> In reply to @mratsim "This is something that": wow |
21:11:08 | FromDiscord | <hamidb80> i replaced it with a simple proc |
21:11:23 | FromDiscord | <hamidb80> i think that's kinda bug |
21:11:46 | FromDiscord | <Rika> its more of a quirk of sugar i guess |
21:12:42 | FromDiscord | <mratsim> It actually become worse |
21:14:51 | FromDiscord | <mratsim> looking for the example |
21:16:13 | FromDiscord | <konsumlamm> In reply to @hamidb80 "i can't understand what": have you also tried annotating `s` (the lambda parameter)? |
21:16:50 | FromDiscord | <hamidb80> In reply to @konsumlamm "have you also tried": (s:string) => ... ? |
21:16:54 | liblq-dev | @carpal `in` is an operator, just like `>=` and `<=` are operators. good observation. |
21:17:00 | FromDiscord | <konsumlamm> In reply to @hamidb80 "(s:string) => ... ?": ye |
21:17:49 | FromDiscord | <hamidb80> In reply to @konsumlamm "ye": that works |
21:17:51 | FromDiscord | <hamidb80> wow |
21:17:55 | FromDiscord | <hamidb80> why?! |
21:18:01 | FromDiscord | <hamidb80> 😕 |
21:18:58 | FromDiscord | <konsumlamm> lambdas can't infer generic arguments and apparently your lambda uses a generic proc |
21:19:37 | FromDiscord | <mratsim> This one is fun: https://github.com/nim-lang/Nim/issues/8432 |
21:21:56 | FromDiscord | <mratsim> well I can't find it again but I remember that for one of Arraymancer functions I suddently had to add some {.nimcall, gcsafe.} where Nim could previously infer that |
21:23:43 | liblq-dev | @carpal https://godbolt.org/z/33hj6W |
21:24:05 | liblq-dev | the assembly produced by `c in 'a'..'z'` and `c >= 'a' and c <= 'z'` is exactly the same |
21:27:35 | FromDiscord | <mratsim> the C code is different though |
21:27:41 | FromDiscord | <Seedofarson> how would I do for charcter in string? |
21:27:44 | FromDiscord | <mratsim> 'a'..'z' should use the GCC range extension |
21:28:20 | FromDiscord | <Seedofarson> just |
21:29:25 | * | rockcavera joined #nim |
21:33:54 | FromDiscord | <Seedofarson> im |
21:33:55 | FromDiscord | <Seedofarson> so confusde |
21:33:58 | FromDiscord | <Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2QpV |
21:34:00 | FromDiscord | <Seedofarson> im trying to stop bothering yall |
21:34:05 | FromDiscord | <Seedofarson> and figure it out on my own |
21:34:06 | FromDiscord | <Seedofarson> but |
21:34:10 | FromDiscord | <Seedofarson> im actually stupid |
21:34:10 | FromDiscord | <Seedofarson> lol |
21:37:40 | FromDiscord | <hamidb80> In reply to @Seedofarson "im actually stupid": don't say that word |
21:39:21 | FromDiscord | <hamidb80> In reply to @Seedofarson "``` proc sprint(message: string):": this code doesn't have any problem |
21:39:34 | FromDiscord | <hamidb80> (edit) "In reply to @Seedofarson "``` proc sprint(message: string):": ... this" added "there is no problem with" | removed "doesn't have any problem" |
21:39:35 | * | narimiran quit (Ping timeout: 260 seconds) |
21:40:35 | FromDiscord | <Seedofarson> expression 'sprint("hello")' is of type 'string' and has to be used (or discarded) |
21:41:04 | FromDiscord | <hamidb80> In reply to @Seedofarson "expression 'sprint("hello")' is of": your `sprint` returns a value with type of `string` |
21:41:41 | FromDiscord | <Seedofarson> ohhhh |
21:41:42 | FromDiscord | <Seedofarson> so |
21:41:43 | FromDiscord | <Seedofarson> I have to do |
21:41:44 | FromDiscord | <Seedofarson> echo(sprint("test")) |
21:41:49 | FromDiscord | <Seedofarson> also |
21:42:01 | FromDiscord | <Seedofarson> there are \n's between all the characters |
21:42:42 | FromDiscord | <hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=2Qq0 |
21:43:12 | FromDiscord | <hamidb80> (edit) "https://play.nim-lang.org/#ix=2Qq0" => "https://play.nim-lang.org/#ix=2Qq2" |
21:43:47 | FromDiscord | <Seedofarson> hmm |
21:43:47 | FromDiscord | <Seedofarson> ok |
21:43:55 | FromDiscord | <Seedofarson> there aare still \n's between |
21:44:00 | FromDiscord | <Seedofarson> but |
21:44:12 | FromDiscord | <hamidb80> In reply to @Seedofarson "there aare still \n's": oh , if you dont want new line |
21:44:25 | FromDiscord | <hamidb80> you can use `stdout.write "some things"` |
21:44:39 | FromDiscord | <Seedofarson> ahhh |
21:44:40 | FromDiscord | <Seedofarson> tysm |
21:45:56 | FromDiscord | <Seedofarson> hmm |
21:45:57 | FromDiscord | <Seedofarson> wait |
21:46:01 | FromDiscord | <Seedofarson> it still writes the whole thing at once |
21:46:02 | FromDiscord | <Seedofarson> idk why |
21:46:09 | FromDiscord | <Seedofarson> (edit) "still" => "just" |
21:46:10 | FromDiscord | <hamidb80> In reply to @Seedofarson "idk why": ?? |
21:46:17 | FromDiscord | <hamidb80> ah |
21:46:25 | FromDiscord | <hamidb80> sleep takes milisecconds |
21:46:30 | FromDiscord | <hamidb80> (edit) "sleep" => "`sleep`" |
21:46:41 | FromDiscord | <hamidb80> ok? |
21:46:52 | FromDiscord | <hamidb80> (edit) "milisecconds" => "miliseconds" |
21:47:03 | FromDiscord | <hamidb80> (edit) "ah" => "oh" |
21:47:29 | FromDiscord | <Seedofarson> https://ideone.com/eXTxOm |
21:47:30 | FromDiscord | <Seedofarson> ik |
21:47:32 | FromDiscord | <Seedofarson> I did 1000 |
21:47:34 | FromDiscord | <Seedofarson> and it just waited |
21:47:35 | FromDiscord | <Seedofarson> a second |
21:47:36 | FromDiscord | <Seedofarson> then |
21:47:38 | FromDiscord | <Seedofarson> printed |
21:48:24 | FromDiscord | <Seedofarson> nvm |
21:48:27 | FromDiscord | <Seedofarson> its a repl.it thing |
21:48:27 | FromDiscord | <Seedofarson> lol |
21:48:28 | FromDiscord | <hamidb80> stdout.write "k"↵ stdout.flushFile |
21:48:34 | FromDiscord | <hamidb80> (edit) ""k"↵ stdout.flushFile" => ""k"↵stdout.flushFile" |
21:48:53 | FromDiscord | <hamidb80> (edit) ""k"↵stdout.flushFile" => ""some thing"↵stdout.flushFile" |
21:50:28 | FromDiscord | <Seedofarson> sent a code paste, see https://paste.rs/erV |
21:50:40 | FromDiscord | <Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2Qq7 |
21:50:51 | FromDiscord | <hamidb80> In reply to @Seedofarson "``` proc sprint(message: string,": sleep(int) ?? |
21:50:55 | * | madnight joined #nim |
21:51:01 | FromDiscord | <Seedofarson> ohhh |
21:51:01 | FromDiscord | <Seedofarson> lmao |
21:51:02 | FromDiscord | <Seedofarson> my bad |
21:51:15 | FromDiscord | <hamidb80> i think you wanted to write `sleep sleeptime` |
21:51:23 | FromDiscord | <Seedofarson> yeah |
21:51:24 | FromDiscord | <Seedofarson> lol |
21:51:28 | FromDiscord | <Seedofarson> haha |
21:51:31 | FromDiscord | <Seedofarson> tysm bruh |
21:52:06 | FromDiscord | <hamidb80> oh that 1 AM |
21:53:07 | FromDiscord | <hamidb80> i should go to sleep |
21:55:10 | FromDiscord | <Seedofarson> hmmm |
21:55:15 | FromDiscord | <Seedofarson> how could I add an optional param |
21:55:38 | FromDiscord | <Seedofarson> I want to add an optional parameter that if is filled doesnt add a newline at the end |
21:55:55 | * | FromDiscord quit (Remote host closed the connection) |
21:56:10 | * | FromDiscord joined #nim |
21:56:29 | FromDiscord | <Seedofarson> if the parameter is not passed than it adds a "\n" at the end |
21:56:38 | FromDiscord | <Seedofarson> if a parameter is passed, then it doesnt add the "\n" |
21:56:44 | FromDiscord | <Seedofarson> @hamidb80 |
21:58:23 | FromDiscord | <hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=2Qqb |
21:59:29 | reversem3 | seriously why would something work fine on linux but on macosx ? |
21:59:57 | FromDiscord | <hamidb80> In reply to @reversem3 "seriously why would something": what is that `something`? |
22:00:02 | reversem3 | /Users/.env/nim/nimx/nimx/layout_vars.nim(19, 32) Error: type mismatch: got <Variable> |
22:00:25 | reversem3 | but I can build nimx and rod just fine on linux |
22:00:38 | FromDiscord | <hamidb80> In reply to @reversem3 "/Users/.env/nim/nimx/nimx/layout_vars.nim(19, 32) E": i think you should ask in froum |
22:00:51 | reversem3 | ok |
22:02:57 | FromDiscord | <Seedofarson> yay |
22:03:02 | FromDiscord | <Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2QoU |
22:03:06 | FromDiscord | <Seedofarson> I did sleep(0) lmao |
22:03:12 | FromDiscord | <Seedofarson> whats the equivalent of "pass" in nim |
22:03:39 | FromDiscord | <juan_carlos> discard |
22:03:55 | FromDiscord | <Seedofarson> hhaa |
22:03:58 | FromDiscord | <Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2Qqi |
22:03:59 | FromDiscord | <Seedofarson> final function!!! |
22:05:09 | ForumUpdaterBot | New thread by Reversem3: Building nimx and rod on MacOSX (get error, but not using linux), see https://forum.nim-lang.org/t/7546 |
22:12:18 | FromDiscord | <Seedofarson> are there "and" or "or" statements in nim if statements? |
22:13:20 | reversem3 | https://nim-lang.org/docs/tut1.html#control-flow-statements |
22:14:28 | FromDiscord | <Seedofarson> like that? |
22:14:29 | FromDiscord | <Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2Qqm |
22:15:41 | * | tane quit (Quit: Leaving) |
22:15:51 | FromDiscord | <ElegantBeef> That's not a feature of if statments it's boolean logic |
22:33:33 | * | Vladar quit (Quit: Leaving) |
22:35:34 | * | qwr quit (Ping timeout: 244 seconds) |
22:40:41 | * | qwr joined #nim |
22:44:34 | * | xet7 joined #nim |
22:47:22 | FromDiscord | <carpal> sent a long message, see http://ix.io/2QqA |
22:56:30 | FromDiscord | <ElegantBeef> nope it's `initMyType` |
22:56:50 | FromDiscord | <ElegantBeef> The reason we use `init` and `new` is it tells you in the construction where the object exists |
22:57:27 | FromDiscord | <ElegantBeef> intializing happens on the stack, new objects are created on the heap |
23:00:30 | FromDiscord | <ElegantBeef> @Anonymous Poet hey, it kinda works now(global fields dont work atm) https://media.discordapp.net/attachments/371759389889003532/813545779087147038/unknown.png |
23:01:13 | FromDiscord | <ElegantBeef> I say global but i mean base object fields outside a case statement |
23:02:33 | FromDiscord | <Seedofarson> hey guys |
23:02:38 | FromDiscord | <Seedofarson> I just finsihed my first program |
23:02:40 | FromDiscord | <Seedofarson> gg |
23:02:45 | FromDiscord | <ElegantBeef> Congrats |
23:02:55 | FromDiscord | <Seedofarson> idk if im allowed to share |
23:03:15 | FromDiscord | <Seedofarson> https://media.discordapp.net/attachments/371759389889003532/813546472234156042/firstnim.exe |
23:03:22 | FromDiscord | <Seedofarson> https://media.discordapp.net/attachments/371759389889003532/813546502886129694/firstnim.nim |
23:03:26 | FromDiscord | <Seedofarson> suorce code |
23:03:26 | FromDiscord | <Seedofarson> and |
23:03:29 | FromDiscord | <Seedofarson> nim |
23:03:43 | FromDiscord | <Seedofarson> in the source code there are some functions that I dont use, they are what I used to learn |
23:03:44 | FromDiscord | <ElegantBeef> No point sharing a binary, plus you can just through the source code on https://play.nim-lang.org/ |
23:03:46 | FromDiscord | <Seedofarson> you can ignore them |
23:04:28 | FromDiscord | <Seedofarson> https://play.nim-lang.org/#ix=2QqI |
23:04:59 | * | xet7 quit (Ping timeout: 260 seconds) |
23:05:12 | FromDiscord | <ElegantBeef> Isnt that webhook url supposed to be kept secret? |
23:07:34 | FromDiscord | <ElegantBeef> Also you can replace a lot of those if statements with a case statment |
23:12:06 | FromDiscord | <ElegantBeef> @Seedofarson less repetitive code and more readable https://play.nim-lang.org/#ix=2QqL |
23:13:15 | FromDiscord | <Seedofarson> ahh |
23:13:15 | FromDiscord | <Seedofarson> ok |
23:17:26 | FromDiscord | <Seedofarson> bro |
23:17:30 | FromDiscord | <Seedofarson> nim is such a goated language |
23:18:59 | krux02 | goated? |
23:19:36 | FromDiscord | <ElegantBeef> Nothing makes me feel out of the loop more than seeing someone say something i have 0 clue what it means |
23:21:33 | FromDiscord | <Yjuq> Can I access if something is compiled with the backend c or cpp? |
23:21:45 | FromDiscord | <Yjuq> (edit) "access" => "determine" |
23:22:08 | FromDiscord | <Yjuq> (edit) "determine" => "determine/access (don't know a better english word xd)" |
23:22:52 | FromDiscord | <Yjuq> (edit) "determine/access (don't know a better english word xd)" => "detect" |
23:23:11 | FromDiscord | <ElegantBeef> `when defined(c)` |
23:23:17 | FromDiscord | <Rika> greatest of all time-ed i believe, krux |
23:23:43 | krux02 | good |
23:23:55 | krux02 | ;) |
23:24:01 | FromDiscord | <Rika> i wish it was better but wishing gets us nowhere |
23:24:42 | FromDiscord | <Yjuq> In reply to @ElegantBeef "`when defined(c)`": thanks |
23:32:56 | FromDiscord | <Seedofarson> lmao |
23:33:05 | FromDiscord | <Seedofarson> Greatest↵Of↵All↵Time |
23:33:10 | FromDiscord | <Seedofarson> GOAT |
23:33:15 | FromDiscord | <Seedofarson> goated |
23:33:39 | FromDiscord | <Yjuq> If I {.push.} a calling convention in a file and don't pop it in the end, does this influence the files where I import this particular file? |
23:34:14 | FromDiscord | <Yjuq> (edit) "pop" => "{.pop.}" |
23:35:10 | FromDiscord | <Yjuq> Is a calling convention even needed if I get them out of a c header? |
23:35:24 | FromDiscord | <Yjuq> How does it interact with a cpp backend and a c header? |
23:35:28 | * | wasted_youth2 quit (Quit: Leaving) |
23:35:51 | FromDiscord | <Yjuq> Don't know what nim does in the background. sigh :( |
23:49:06 | * | krux02 quit (Remote host closed the connection) |