<< 23-06-2023 >>

00:03:45FromDiscord<millymox> sent a code paste, see https://play.nim-lang.org/#ix=4yRG
00:03:55FromDiscord<Elegantbeef> `when type is`
00:04:01FromDiscord<Elegantbeef> I didnt stutter
00:04:27FromDiscord<Elegantbeef> `when client is HcaptchaTaskProxyless: ... elif client is Bleh`
00:05:04arkanoidwhich ident would you give to importcpp foo::bar::Baz ? FooBarBaz? Foo_Bar_Baz? Just Baz?
00:06:45FromDiscord<Elegantbeef> I'd call it baz this isnt cpp
00:07:17arkanoidok but I'm trying to generate importcpp stuff automatically
00:07:36FromDiscord<Elegantbeef> Then `FooBarBaz`
00:08:05FromDiscord<millymox> In reply to @Elegantbeef "I didnt stutter": words perfectly, thank you
00:11:05arkanoidoki
00:11:48FromDiscord<Elegantbeef> You also could emit a type `Foo` and have a template `Bar` that returns another type that `Baz` takes as a first parameter
00:11:52FromDiscord<Elegantbeef> Though that quickly gets messy
00:12:36*lucasta quit (Remote host closed the connection)
00:14:39*lucasta joined #nim
00:15:08*lucasta quit (Remote host closed the connection)
00:25:06FromDiscord<millymox> /Users/mox/Desktop/Projects/nim/nimcaptcha/captcha/capmonster.nim(107, 27) Error: expression 'join_task_hcaptcha(client, task_id)' is of type 'string' and has to be used (or discarded)
00:25:23FromDiscord<millymox> sent a code paste, see https://play.nim-lang.org/#ix=4yRK
00:26:46FromDiscord<that_dude.> Sounds like it has to be used or discarded
00:26:57FromDiscord<millymox> i am using it
00:27:18FromDiscord<that_dude.> Everywhere?
00:27:32FromDiscord<millymox> proc join_task_result[T](client: T, task_id: int): string =↵ mixin join_task_hcaptcha↵ if client is HcaptchaTaskProxyless:↵ join_task_hcaptcha(client, task_id)
00:27:39FromDiscord<millymox> let result = capmonsterclient.join_task_result(task_id)
00:28:07FromDiscord<Elegantbeef> Yes Nim is expressionful which means anything that returns has to be discarded
00:28:44FromDiscord<millymox> okay got it↵↵ discard join_task_hcaptcha(client, task_id)
00:28:45FromDiscord<millymox> fixed issue
00:28:50FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/e4N88
00:29:15FromDiscord<millymox> any article or docs on how discarding works? Either i haven't been paying attention or ive never seen this in other langs
00:29:37FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#statements-and-expressions-discard-statement
00:29:46FromDiscord<Elegantbeef> It's literally just "I do not care about this value"
00:29:53FromDiscord<that_dude.> Discard is kinda like pass in python, but it also swallows anything you throw into it
00:30:31FromDiscord<Elegantbeef> Yea it's passingly similar to pass 🙂
00:30:52FromDiscord<Elegantbeef> It's used a lot like pass, but technically in Nim any AST can be used like pass
00:31:08FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4yRO
00:31:52FromDiscord<millymox> ahhhh i get it
00:31:57*pbsds1 joined #nim
00:31:59*pbsds quit (Ping timeout: 250 seconds)
00:31:59*pbsds1 is now known as pbsds
00:32:33FromDiscord<millymox> i do care about the value of this however
00:32:42FromDiscord<Elegantbeef> So use it
00:33:08FromDiscord<millymox> sent a long message, see http://ix.io/4yRP
00:33:16FromDiscord<Elegantbeef> So return it?
00:33:22FromDiscord<Elegantbeef> Also why the hell are you still doing `if client is`
00:33:44FromDiscord<millymox> mistake lmao i was going to change it
00:33:50FromDiscord<millymox> i forgot though
00:34:27FromDiscord<that_dude.> Overloading also plays nicer with documentation
00:34:51FromDiscord<Elegantbeef> Overloading is just better than logic internally
00:35:07FromDiscord<Elegantbeef> Generally `when X is T` is just a sign you're doing manual dispatching, which is awful
00:36:02FromDiscord<millymox> im confused lmao
00:36:05FromDiscord<millymox> you told me to do when
00:36:10FromDiscord<millymox> now don't do that?
00:36:29FromDiscord<Elegantbeef> I mean I said don't use when but you could if you really wanted to
00:36:49FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1121599710621351966/image.png
00:37:06FromDiscord<that_dude.> Im pretty sure it was recommended as long as all the logic inside is the same for each type
00:37:19FromDiscord<millymox> oh okay
00:37:22FromDiscord<Elegantbeef> I'm not here to code people's projects, I'm here to mock people's code!
00:37:26FromDiscord<millymox> idk what overloading is so
00:37:47FromDiscord<millymox> does it require me to take apart everything i wrote already?..
00:38:12FromDiscord<Elegantbeef> https://nim-lang.org/docs/tut1.html#procedures-overloaded-procedures
00:38:21FromDiscord<Elegantbeef> No clue I'm not writing your code, now am i
00:38:22FromDiscord<that_dude.> https://nim-lang.org/docs/system.html#xor%2Cbool%2Cbool just a random example
00:38:55FromDiscord<that_dude.> A bunch of procs that use the same name, but have different signatures because the parameters are different
00:39:13FromDiscord<millymox> ah okay i see
00:43:46*derpydoo joined #nim
00:59:22*jmdaemon quit (Ping timeout: 245 seconds)
01:44:49FromDiscord<spotlightkid> sent a code paste, see https://play.nim-lang.org/#ix=4yS4
01:45:51FromDiscord<Elegantbeef> Make a procedure to make your variant
01:46:10FromDiscord<spotlightkid> I have about a dozen variants
01:46:19FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/nYSCb
01:46:23FromDiscord<Elegantbeef> Right, still the best path
01:46:43FromDiscord<Elegantbeef> You no longer need to do `kind: x, fieldName: y`
01:46:43FromDiscord<spotlightkid> Can a template help?
01:46:49FromDiscord<Elegantbeef> it could
01:46:58FromDiscord<JeysonFlores> which communication protocol is it?
01:47:07FromDiscord<spotlightkid> OSC
01:48:27FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4yS6
01:48:45FromDiscord<Elegantbeef> You also could use a macro if you really wanted to automate the branch selection, but alas
01:52:07FromDiscord<spotlightkid> Thanks, I'll try your template tomorrow. It would have probably taken me quite some time to come up with a working template on my own. I don't have any practice iwriting templates (yet).
01:52:21FromDiscord<Elegantbeef> No problem, they're not too bad
01:56:03FromDiscord<JeysonFlores> @spotlightkid Is the repo of the project public?
01:56:41FromDiscord<spotlightkid> not yet, I only started it in earnest yesterday
02:00:26FromDiscord<spotlightkid> I did an implementation for (Micro)Python once, but Python's dynamic typing makes this particular problem easier, so I can only translate some parts to Nim. https://github.com/SpotlightKid/micropython-osc
02:04:25FromDiscord<JeysonFlores> looks neat. Can the OSC protocol handle complex types (lists/arrays, maps)?
02:07:35FromDiscord<spotlightkid> only arrays and byte blobs
02:08:37FromDiscord<spotlightkid> It was designed for communication between and control of interactive gadgets and electronic musicals instruments (synths etc.) and lighting and so on.
02:08:51FromDiscord<Elegantbeef> Well that's technically sufficient to represent all types
02:08:53FromDiscord<spotlightkid> These mostly only need ints and floats
02:09:02FromDiscord<Elegantbeef> You just need to apply your own mapping ontop 😄
02:09:29FromDiscord<spotlightkid> yeah, you could put a msppack msg into a blob
02:09:55FromDiscord<spotlightkid> That's what I do when I use MQTT
02:10:01FromDiscord<Elegantbeef> Well without even going that low level you can represent atleast non cyclical graphs
02:10:14FromDiscord<Elegantbeef> You just expand it into storing the data sequentially
02:11:06FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ySa
02:13:25FromDiscord<spotlightkid> OSC is rather under-specified. It only specifies the msg format, the data types and the format of the message address and timestamps. Communication partners have to agree what message endpoints exist and what types they expect. There's no discovery or reflection.
02:14:28FromDiscord<spotlightkid> maybe a reason why it never really took of. But it's often used for communication between sound engines and controllers.
02:15:48FromDiscord<spotlightkid> Elegantbeef\: BTW, your template works nicely (couldn't wait to try it out). But now I must sleep.
02:16:06FromDiscord<Elegantbeef> No problem, almost like I know how to write Nim 😛
02:24:49FromDiscord<michaelb.eth> sent a long message, see http://ix.io/4ySd
02:25:34FromDiscord<Elegantbeef> Use a distinct 😄
02:25:55FromDiscord<michaelb.eth> hmm, something like that trick you showed me one time...
02:26:11FromDiscord<michaelb.eth> I'm sure you recall 🤪
02:26:26FromDiscord<Elegantbeef> If i remember all the tricks I showed someone I'd have a book inside my head
02:26:59FromDiscord<michaelb.eth> but you do
02:27:21FromDiscord<michaelb.eth> have an encyclopedia (encyclonimia) inside your head
02:32:12FromDiscord<michaelb.eth> The Book of Nimrotica, even
02:33:12FromDiscord<spotlightkid> The Joy of Nim
02:33:43FromDiscord<Elegantbeef> Kamin Sutra
02:36:47FromDiscord<michaelb.eth> 9½ Nimjas
02:47:07*pbsds quit (Quit: The Lounge - https://thelounge.chat)
02:47:35*pbsds joined #nim
03:03:21arkanoidwhich calling convention should I use next to importcpp?
03:05:43FromDiscord<Elegantbeef> `{.cdecl.}`
03:05:51arkanoidok
03:05:53arkanoidthanks
03:25:25arkanoididiomatic nim to join a seq[string] with custom separator by reading the tokens in reverse order?
03:25:40arkanoidis there a reversed iterator, or I have to collect?
03:26:09FromDiscord<Elegantbeef> Sadly there is not a reverse iterator in stdlib, there is in slicerator if memory serves
03:26:27arkanoidok, I'll collect
03:55:46FromDiscord<bungfro> Anyone know what this error means? (lmk if you need additional context)↵↵Error: unhandled exception: Expected [ but got 0 instead. At offset: 149
04:00:24FromDiscord<Elegantbeef> Looks like it expected `[` but got `0`
04:01:53*ehmry quit (*.net *.split)
04:01:53*oisota quit (*.net *.split)
04:01:53*m5zs7k quit (*.net *.split)
04:01:54*hexeme quit (*.net *.split)
04:01:54*henrytill quit (*.net *.split)
04:01:54*casaca quit (*.net *.split)
04:01:54*noeontheend quit (*.net *.split)
04:01:54*bmp quit (*.net *.split)
04:02:12FromDiscord<intellj_gamer> Looks like jsony error↵Guessing your type is `seq` or something but actual JSON is an int
04:02:14*mronetwo quit (Write error: Connection reset by peer)
04:02:14*oddish quit (Read error: Connection reset by peer)
04:02:15*adigitoleo quit (Read error: Connection reset by peer)
04:02:25*mronetwo joined #nim
04:02:27*adigitoleo joined #nim
04:02:31*oddish joined #nim
04:02:39*casaca_ joined #nim
04:02:40*bmp joined #nim
04:02:40*ehmry joined #nim
04:02:40*oisota joined #nim
04:02:40*m5zs7k joined #nim
04:02:40*hexeme joined #nim
04:02:40*henrytill joined #nim
04:02:40*casaca joined #nim
04:02:40*noeontheend joined #nim
04:02:45*casaca quit (Read error: Connection reset by peer)
04:02:46*noeontheend quit (Read error: Connection reset by peer)
04:02:49*henrytill quit (Read error: Connection reset by peer)
04:02:52*bmp quit (Read error: Connection reset by peer)
04:02:54*bmp_ joined #nim
04:02:55*bmp_ is now known as bmp
04:03:08*henrytill_ joined #nim
04:03:08*casaca_ is now known as casaca
04:03:17*henrytill_ is now known as henrytill
04:03:31*noeontheend joined #nim
04:07:26*adigitoleo quit (*.net *.split)
04:07:36*adigitoleo joined #nim
04:07:57*ehmry quit (*.net *.split)
04:07:57*oisota quit (*.net *.split)
04:07:57*m5zs7k quit (*.net *.split)
04:07:57*hexeme quit (*.net *.split)
04:08:24*ehmry joined #nim
04:08:24*oisota joined #nim
04:08:24*m5zs7k joined #nim
04:08:24*hexeme joined #nim
04:08:35*adium quit (*.net *.split)
04:08:35*attah quit (*.net *.split)
04:08:35*antranigv quit (*.net *.split)
04:08:35*marcus quit (*.net *.split)
04:08:35*hernan quit (*.net *.split)
04:08:35*_________ quit (*.net *.split)
04:08:35*lain quit (*.net *.split)
04:08:46FromDiscord<bungfro> In reply to @Elegantbeef "Looks like it expected": tysm
04:08:59FromDiscord<bungfro> In reply to @intellj_gamer "Looks like jsony error": Ah, alright.
04:09:09*adium joined #nim
04:09:09*attah joined #nim
04:09:09*antranigv joined #nim
04:09:09*marcus joined #nim
04:09:09*hernan joined #nim
04:09:09*_________ joined #nim
04:09:09*lain joined #nim
04:09:28*_________ quit (Max SendQ exceeded)
04:09:50*_________ joined #nim
04:10:01*Ekho quit (*.net *.split)
04:10:13*madprops quit (*.net *.split)
04:10:13*syl quit (*.net *.split)
04:10:15*def- quit (*.net *.split)
04:10:48*Ekho joined #nim
04:10:48*madprops joined #nim
04:10:48*syl joined #nim
04:10:48*def- joined #nim
04:11:46*oldpcuser quit (*.net *.split)
04:11:46*om3ga quit (*.net *.split)
04:11:46*Lord_Nightmare quit (*.net *.split)
04:11:46*GreaseMonkey quit (*.net *.split)
04:11:47*nyeaa492842301 quit (*.net *.split)
04:11:47*cm quit (*.net *.split)
04:11:47*tinystoat quit (*.net *.split)
04:11:47*Jjp137 quit (*.net *.split)
04:12:49FromDiscord<bungfro> In reply to @intellj_gamer "Looks like jsony error": How would I fix such a thing?
04:13:33*oldpcuser joined #nim
04:13:33*om3ga joined #nim
04:13:33*Lord_Nightmare joined #nim
04:13:33*GreaseMonkey joined #nim
04:13:33*nyeaa492842301 joined #nim
04:13:33*cm joined #nim
04:13:33*tinystoat joined #nim
04:13:33*Jjp137 joined #nim
04:13:37FromDiscord<intellj_gamer> Fix up your type so it matches↵Best to open up the JSON and go to the 149th character↵See what field it belongs to↵Then make that field an int
04:14:34FromDiscord<bungfro> Alright
04:14:39FromDiscord<bungfro> Thanks
04:14:55FromDiscord<gogolxdong666> Why does this gcsafe annotation doesn't work? https://media.discordapp.net/attachments/371759389889003532/1121654590643904553/image.png
04:15:21FromDiscord<Elegantbeef> try `{.cast(gcSafe).}:`
04:16:14FromDiscord<gogolxdong666> the same
04:16:24FromDiscord<gogolxdong666> `Error: 'connect' is not GC-safe as it accesses 'rlpx_connect_success' which is a global using GC'ed memory`
04:17:02FromDiscord<Elegantbeef> Uhhh
04:17:25FromDiscord<Elegantbeef> Likely an issue with the async macro i guess
04:18:53FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/yJljY
04:20:23FromDiscord<Elegantbeef> Likely the async rewrite loses the `{.gcSafe.}` so no clue what to say
04:27:25FromDiscord<michaelb.eth> In reply to @gogolxdong666 "Why does this gcsafe": just curious, do you know for certain if your code indented under `{.gcsafe.}:` in the body of your `proc connect` is actually gc safe?
04:28:01FromDiscord<Elegantbeef> No locks, no sync logic, of course it's gcsafe! 😛
04:29:47FromDiscord<michaelb.eth> I was on a team that was new to Nim and we didn't know what we were doing at the time, but someone/s "learned" that if you put `{.gcsafe.}:` above your code the compiler is complaining about and indent your code under that, then voila! the code compiles and you can go on about your business, problem solved.
04:30:22FromDiscord<Elegantbeef> See as a non professional developer I'm happy I'm not that silly
04:30:51FromDiscord<mratsim> In reply to @michaelb.eth "I was on a": Sounds like rust.clone()
04:32:19FromDiscord<Elegantbeef> "How I learned to avoid the Rust borrower checker with `.clone`"
04:32:29FromDiscord<Elegantbeef> Fuck that's a fantastic article for april 1st
04:32:36FromDiscord<michaelb.eth> lol
05:06:59FromDiscord<DaveVincent> Hello! I'm giving out 10 trading slots to 10 people on how to earn $100k USD/ in 3days. But I'll take 10% cut after your first payout. Note!! only interested people should send me a messagehttps://t.me/Davevincent
05:25:17*_________ quit (Quit: Reconnecting)
05:25:40*_________ joined #nim
05:32:57arkanoidIf I enable the `when` branch, it doesn't compile. I have no idea why https://termbin.com/dj6wp
05:33:40FromDiscord<Elegantbeef> What's the error?
05:34:00arkanoiderror: ‘MyClass’ was not declared in this scope; did you mean ‘outer::inner::MyClass’?
05:34:21FromDiscord<Elegantbeef> Ah C++ gen isssue, cannot help much
05:35:04arkanoidthanks, I'll try with devel
05:36:29arkanoidsame problem with devel
05:37:39FromDiscord<Elegantbeef> Seems like it's an issue with your interop, but cannot comment much
05:37:49arkanoidinterop?
05:42:40arkanoidinterop?
05:42:52arkanoidoops
05:43:34FromDiscord<Elegantbeef> yes your C++ FFI code
05:43:44*azimut quit (Ping timeout: 240 seconds)
05:54:38arkanoidElegantbeef: I've reduced to a minimal example, do you see anything? https://termbin.com/xvio
05:55:42FromDiscord<elegantbeef> Should that not be `outer::inner::MyClass(@)`?
06:00:00arkanoidsame error with that
06:02:22arkanoidhow can I assure no nim cache is creating issues?
06:03:52FromDiscord<elegantbeef> `-f`
06:06:57arkanoidnot a change
06:07:23arkanoidI don't know how to reduce the problem even more https://termbin.com/57cv
06:15:49FromDiscord<odexine> You didn’t do what beef said to do
06:17:26arkanoidodexine, yes I did (?)
06:17:30arkanoidwhat do you mean
06:18:16FromDiscord<odexine> `proc foobar(a: cshort): MyClass {.importcpp: "outer::inner::MyClass(@)", constructor.}`
06:18:28arkanoidas I said, I already tried that
06:18:36FromDiscord<odexine> Oh it just wasnt in the code
06:19:56arkanoidodexing, please find here https://termbin.com/ohuz
06:22:51*ntat joined #nim
06:28:53arkanoidI hate when Nim breaks the flow with random behaviours like these
06:33:55FromDiscord<odexine> This reads like a bug yeah
06:38:37FromDiscord<millymox> Can someone show me a tutorial or article on making C lib wrappers for nim
06:41:59FromDiscord<ringabout> https://peterme.net/wrapping-c-libraries-in-nim.html
06:48:49FromDiscord<millymox> In reply to @ringabout "https://peterme.net/wrapping-c-libraries-in-nim.htm": Thank you
06:54:49FromDiscord<sigmasd> sent a code paste, see https://play.nim-lang.org/#ix=4ySN
06:54:59FromDiscord<IBot> sent a code paste, see https://play.nim-lang.org/#ix=4ySO
07:00:46FromDiscord<gogolxdong666> `/root/nimbus-eth2/vendor/nim-eth/eth/p2p/p2p_protocol_dsl.nim(192, 10) Error: expression cannot be cast to RootRef=ref RootObj`
07:02:20FromDiscord<gogolxdong666> `return cast[RootRef](res)`
07:10:22FromDiscord<gogolxdong666> sent a code paste, see https://play.nim-lang.org/#ix=4ySU
07:30:01FromDiscord<_gumbercules> little webrtc multiplayer thing I have going - wasm client is written in nim - http://localhost:4000/lobbies/83c5d9a0-7ce0-4ac4-9636-9b8991e6a5db
07:30:46FromDiscord<_gumbercules> little authoritative server webrtc multiplayer thing I have going - wasm client is written in Nim https://media.discordapp.net/attachments/371759389889003532/1121703879667617812/Code_PrkgJj5KWd.mp4
08:13:55*cnx quit (Remote host closed the connection)
08:14:44*cnx joined #nim
08:38:25FromDiscord<gogolxdong666> Any idea?
09:00:12FromDiscord<elamandeep> Hello
09:00:34FromDiscord<elamandeep> I heard about nim from fireship
09:01:32FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4yTa
09:01:51FromDiscord<elamandeep> It's awesome programming language.
09:02:23FromDiscord<elamandeep> I want to know Is nim faster than zig and rust?
09:02:53FromDiscord<gogolxdong666> `return RootRef(res)`?
09:03:04FromDiscord<voidwalker> It's a bit slower from what I've seen, but not that much
09:03:26FromDiscord<gogolxdong666> There is no where to define ProtocolState inherit RootObj
09:03:26FromDiscord<demotomohiro> In reply to @gogolxdong666 "`return RootRef(res)`?": yes
09:03:37FromDiscord<elamandeep> ohk
09:03:45FromDiscord<gogolxdong666> `Error: type mismatch: got 'ref BeaconSyncPeerState:ObjectType' for 'res' but expected 'RootRef = ref RootObj'`
09:04:08FromDiscord<elamandeep> what's make nim special from zig?
09:04:49FromDiscord<elamandeep> usually i see buzz around language's performance.
09:04:58FromDiscord<gogolxdong666> Didn't find any ProtocolState in other place.
09:05:08FromDiscord<elamandeep> (edit) "usually i see ... buzz" added "people's"
09:06:41FromDiscord<Elegantbeef> Nim can be as fast as Zig or Rust, it's purely down to the driver
09:06:49FromDiscord<Elegantbeef> the driver being programmer
09:07:19FromDiscord<elamandeep> ohk
09:07:57*mad_toothbrush joined #nim
09:08:17FromDiscord<voidwalker> Can it ? then why does rust win all the entries here: https://programming-language-benchmarks.vercel.app/rust-vs-nim
09:08:56FromDiscord<Elegantbeef> Cause the implementations differ
09:09:36FromDiscord<voidwalker> do some PR then pls: https://github.com/hanabi1224/Programming-Language-Benchmarks/tree/main/bench/algorithm
09:09:45FromDiscord<elamandeep> hey @voidwalker acutally bot is right
09:09:49FromDiscord<Elegantbeef> Like cmon the mandlebrot for rust uses simd
09:09:54FromDiscord<jmgomez> The question is can C/C++ be as fast as Rust/Zigs? If yes, Nim can too 😛
09:10:56FromDiscord<elamandeep> In reply to @jmgomez "The question is can": so nim is like typescript right?
09:11:21FromDiscord<elamandeep> typescript too complies into js
09:11:27FromDiscord<elamandeep> (edit) "js" => "javascript"
09:11:43FromDiscord<voidwalker> oh yeah, the json serde thing uses std/json, which is a lot slower than jsony. Wonder who wrote those
09:12:18FromDiscord<Elegantbeef> It's not really like typescript
09:12:50FromDiscord<Elegantbeef> Yea a lot of these benchmarks use simd
09:13:01FromDiscord<Elegantbeef> Like the fuck is the point in comparing languages if you use simd in one but not all
09:13:13FromDiscord<Elegantbeef> I mean benchmarks are pointless anyway
09:13:20FromDiscord<Elegantbeef> But the fuck
09:13:46FromDiscord<elamandeep> benchmarks are pointless. I didn't understand'
09:13:52FromDiscord<elamandeep> (edit) "understand'" => "understand"
09:14:26FromDiscord<Elegantbeef> Programming language benchmarks are useless
09:14:26FromDiscord<Elegantbeef> They do nothing but show who can be more clever with code
09:16:45FromDiscord<voidwalker> well they should have equally (maxxed out) clever coders to write them. and no simd/asm, of course. well, those should be treated as a separate benchmark maybe
09:18:41FromDiscord<jmgomez> In reply to @elamandeep "so nim is like": No because it isnt a superset but it compiles to them instead. BTW it can also compile to js
09:18:42FromDiscord<elamandeep> ok. I found nim is similar to python. I'm planning to build tools around javascript and python. I'm sure i will be using nim of that.
09:19:16FromDiscord<elamandeep> (edit) "of" => "for"
09:19:41FromDiscord<elamandeep> In reply to @jmgomez "No because it isnt": ok
09:19:46FromDiscord<elamandeep> (edit) "ok" => "great"
09:20:11FromDiscord<Elegantbeef> Well any smart programmer looks at Nim and goes "oh a system language" and carries on not carrying about perceived performance 😄
09:20:12FromDiscord<jmgomez> In reply to @Elegantbeef "Programming language benchmarks are": we should write a GPU backend and start playing with their rules
09:22:55FromDiscord<odexine> In reply to @voidwalker "well they should have": How should one decide on which concepts are allowed to be in the same “category” of benchmark
09:23:08FromDiscord<Elegantbeef> Fuck it just use opencl and call it a day
09:23:09FromDiscord<odexine> And how does one decide whether one piece of code is idiomatic, if that is a criteria
09:23:19FromDiscord<Elegantbeef> "This implementation relies on opencl, it do the good"
09:23:48FromDiscord<elamandeep> can we use nim on the web?
09:23:54FromDiscord<Elegantbeef> It's a system language one could argue idiomatic is whatever solves the problem
09:23:55FromDiscord<odexine> Yes
09:24:03FromDiscord<demotomohiro> Some programming benchmarks are unfair. Some implementation use multithreading, SIMD, different size of int / float size or even different algorithm.↵All implementation should follow same rule and implemented in same condition to be fair.↵Also, popular language likely get good code from good programminger, while less popular one get less contribution and likely get poor code.
09:24:23FromDiscord<odexine> In reply to @Elegantbeef "It's a system language": Exactly the point, idiomatic isn’t something that can be easily determined and can vary depending on the scenario
09:24:47FromDiscord<elamandeep> ohk
09:24:48FromDiscord<Elegantbeef> Or we can just disregard programming benchmarks and fiddle with ourselves in the fields as it's a more useful application of time
09:25:05FromDiscord<odexine> In reply to @demotomohiro "Some programming benchmarks are": In such case, are we benchmarking the language (what does it mean to benchmark a language?) or the compiler?
09:25:49FromDiscord<Elegantbeef> There is nothing to learn when drag racing with a car that is intangible
09:26:37FromDiscord<Elegantbeef> If you want to compare how compilers/languages handle specific things go right ahead, but do not under the guise of empiricism pretend to be able to determine which is better
09:27:35FromDiscord<Elegantbeef> To me language benchmarks attempt to attribute statistics to something that is not really measurable, what is the nim solution to mandlebrot
09:29:48FromDiscord<Andreas> regarding performance, i just started benchmarking a lock-free Hash-Trie - does anybd. have access to a NUMA-machine ? My i5 has 4-cores/8-threads..
09:30:13FromDiscord<Andreas> (edit) "regarding performance, i just started benchmarking a lock-free Hash-Trie - does anybd. have access to a NUMA-machine ? My i5 has 4-cores/8-threads.. ... " added "smth around 16/32-threads would be nice"
09:50:44*ntat quit (Quit: Leaving)
10:27:24*PMunch joined #nim
10:30:22FromDiscord<yepoleb> In reply to @Elegantbeef "Or we can just": i think they can be useful to get a general idea of the performance to expect
10:59:46FromDiscord<gogolxdong666> sent a code paste, see https://play.nim-lang.org/#ix=4yTq
12:23:14FromDiscord<spotlightkid> Maybe, but not more. In most cases the chosen algorithm and its implementation have way more impact on the outcome, often by several orders of magnitude.↵They shouldn't be used to rank PLs, but only to put them in broad performance categories for a specific application.↵(@yepoleb)
12:28:20*ntat joined #nim
12:54:35FromDiscord<Someone.one> Hey guys, just a quick question. Does the {.warning[SomeWarning]:off.} pragma effect the entire file or is there a way to localize it to a few lines?
12:58:24FromDiscord<odexine> You can use the push and pop pragma to scope it to certain lines
12:59:13*derpydoo quit (Quit: derpydoo)
13:06:52*ntat quit (Quit: Leaving)
14:12:07*PMunch quit (Quit: Leaving)
14:23:01*redj joined #nim
14:30:53*redj quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
14:31:59*redj joined #nim
14:55:31*alice quit (Server closed connection)
14:55:47*alice joined #nim
15:03:56*beholders_eye joined #nim
15:13:19arkanoidI don't remember the name for tha nim playgound alternative to share snippets
15:17:03FromDiscord<_gumbercules> http://ix.io/
15:17:04FromDiscord<_gumbercules> The Nim playground uses
15:17:15FromDiscord<_gumbercules> (edit) "The Nim playground uses ... " added "^"
15:17:35arkanoidis playground working for you?
15:18:10FromDiscord<_gumbercules> It originally used gists but at some point after I stopped maintaining it it switched to ix.io
15:18:35FromDiscord<_gumbercules> In reply to @arkanoid "is playground working for": I'm not on my PC ATM but let me try on my phone
15:19:05arkanoidit goes Cloudflare gateway timeout
15:19:44FromDiscord<_gumbercules> It is not for me either
15:23:56arkanoidthanks for the feedback
15:24:36arkanoiddamn, I just figured out I've been banging my head due to a bug in stable that is fixed in devel
15:25:21arkanoid-d:OPT=2 works in devel, but fails in stable: https://termbin.com/kv9w
15:32:12FromDiscord<millymox> Anybody made a kernel or OS in nim? And has anyone used nim for embedded programming? (Audurino etc)
15:32:52FromDiscord<mratsim> In reply to @millymox "Anybody made a kernel": In the awesome-nim repo and ij the #embedded channel
15:39:01FromDiscord<_gumbercules> In reply to @arkanoid "-d:OPT=2 works in devel,": What is opt=2 for?
15:39:27arkanoidconst OPT {.intdefine.}: int = 2
15:44:31*antranigv quit (Quit: ZNC 1.8.2 - https://znc.in)
15:45:42FromDiscord<millymox> In reply to @mratsim "In the awesome-nim repo": Thank you, not sure if you know but I also wanted to ask if nim is viable for web development right now? Honestly I hate JavaScript and typescript and would prefer nim for web dev
15:51:16FromDiscord<jmgomez> In reply to @millymox "Thank you, not sure": It is
15:52:14FromDiscord<jmgomez> It can be used for "native" mobile dev too via React Native. Although that's more involved
15:59:02*antranigv joined #nim
16:09:55NimEventerNew post on r/nim by qtless: Translate all what you need with HappyX!, see https://reddit.com/r/nim/comments/14h2ihh/translate_all_what_you_need_with_happyx/
16:24:14arkanoidI have a question. If C++ class Foo has constructor Foo(short bar) {..} imported in nim as constructFoo, is still legal to call "var foo = Foo()" instead of "var foo = ConstructFoo(42)" ?
16:27:17FromDiscord<jmgomez> it is legal but it wont call the imported constructor but the default one. As long it isnt deleted you are fine (with an extra call)
16:28:24arkanoidthen I've a nim codegen bug
16:30:04arkanoidI'm opening an issue on github, but I have no idea which title to use for the issue. I am not a C++ programmer, would you give me an hint please? https://termbin.com/qr6v
16:31:44FromDiscord<jmgomez> That's not a bug
16:32:08FromDiscord<jmgomez> You deleted the default constructor by adding another
16:32:59arkanoidthat would not explain why case OPT = 2 works
16:33:59arkanoidalso case OPT = 4 shows global vs local context codegen issue stable vs devel
16:34:13FromDiscord<jmgomez> In reply to @arkanoid "also case OPT =": this one I fixed not so long ago
16:34:26FromDiscord<jmgomez> In reply to @arkanoid "that would not explain": probably copyMem
16:34:32FromDiscord<jmgomez> so it isnt calling it
16:35:00arkanoidit a compilation issue, not runtime
16:36:05FromDiscord<jmgomez> Dont follow what you are trying to say
16:36:26arkanoidnevermind, as I said I am not a C++ programmer so I'm confused here
16:36:33FromDiscord<jmgomez> no worries
16:37:47arkanoidwhy case OPT = 2 works in global context, but not in local context, if I have deleted the default constructor by adding another?
16:40:27arkanoidif it's not a bug, I'll post in into the forum. I've spent quite some time on this problem and I think it's relevant for other people like me trying to wrap C++
16:41:04FromDiscord<jmgomez> Not sure, it may be. Didnt notice that. Can you post the generated code of both?
16:41:26FromDiscord<jmgomez> Likely the way it's forward declared
16:45:32arkanoidpick case
16:45:37arkanoid+ nim version
16:45:48arkanoidI'll post generatec cpp for those
16:47:20FromDiscord<jmgomez> The one you just said, that works on global and dont in local
16:48:54arkanoidok, would be case 2 vs 3, case 2 works for both stable and devel, case 3 fails on both, but returns different error for stable vs devel
16:49:02arkanoidI'll use stable here then
16:49:41*xet7 quit (Quit: Leaving)
16:51:14arkanoidcase 2 - stable: https://termbin.com/c9tt , error: mbugg.nim.cpp:77:17: error: no matching function for call to ‘MyClass::MyClass()’
16:51:37arkanoidsorry I mean case 3
16:53:10arkanoidthis is case 2 - stable (that works): https://termbin.com/w66ze
16:54:35FromDiscord<jmgomez> It works by coincidence really
16:54:39FromDiscord<jmgomez> `N_LIB_PRIVATE MyClass objbugg_6 = {0}`
16:55:04FromDiscord<jmgomez> it's calling the constructor you defined without intending to. If you add another parameter probably it will fail
16:57:15FromDiscord<jmgomez> You can ask in #internals or forums or in gh issues if it's the intended behaviors. Im not familiar with how the logic of `{}` is expected to work in Nim
16:57:45arkanoiddoes it mean that case OPT = 2 sould fail in both stable and devel like case OPT = 3 as I have deleted the default constructor by adding another?
16:58:50NimEventerNew thread by giaco: Wrapping C++ classes and constructors lead me to compilation errors global vs local, stable vs devel, see https://forum.nim-lang.org/t/10294
16:59:47arkanoidif you want, please add your insights to forum thread, so other people can leverage. I've been wasting many hours on this
17:00:50FromDiscord<jmgomez> In reply to @arkanoid "does it mean that": No, it should not follow the C++ rules as it cant know. You are the one that has the tools for working around them
17:07:03arkanoidI've been staring on your last line for 5 minutes and yet I don't get the meaning, lol
17:07:29arkanoidseems like a "you can do it, nim!"
17:08:25FromDiscord<jmgomez> There is no way the Nim compiler knows that you deleted the constructor
17:12:17arkanoidthen OPT = 2 should faul
17:12:22arkanoid*fail
17:13:45FromDiscord<jmgomez> https://discord.com/channels/371759389889003530/371759389889003532/1121845772573479063
17:14:43arkanoidyes I got it, I'm just pointing out that working by chance is not consitent
17:15:28FromDiscord<jmgomez> What you need to know if the `{}` rules and IMO what you should ask about
17:15:31FromDiscord<jmgomez> or look in the sources
17:15:39FromDiscord<jmgomez> (edit) "if" => "is"
17:16:17arkanoidsome parts of this conversation should go into that thread forum
17:16:39FromDiscord<jmgomez> feel free to move it if you want
17:18:18arkanoidthanks
17:28:06NimEventerNew thread by dwhall256: Regex find all w/captures, see https://forum.nim-lang.org/t/10295
17:46:31*ntat joined #nim
17:48:16NimEventerNew thread by Angluca: How to easy get a object !??? member name all too longer!!!, see https://forum.nim-lang.org/t/10296
18:05:45arkanoidjmgomez: do you know where I can find a C++ header that contains all/most of the possible/mostry used C++ constructs out there?
18:22:22FromDiscord<jmgomez> https://images-ext-1.discordapp.net/external/7LbHWhY06_y2utOoLlQ5TvdT0bqcDUmKpp-c5Pk-b6E/https/i.imgur.com/3wlxtI0.mp4
18:22:47FromDiscord<jmgomez> https://imgur.com/3wlxtI0
18:23:07FromDiscord<jmgomez> https://media.discordapp.net/attachments/371759389889003532/1121868050426236958/forest-gump-c.mp4
18:23:32FromDiscord<jmgomez> 😛
18:24:55*mad_toothbrush quit (Ping timeout: 250 seconds)
18:36:14FromDiscord<!&luke> How can I print out a c double linked list in nim
18:36:51FromDiscord<Andreas> In reply to @ripluke "How can I print": print out ? traverse the list and print its items ?
18:37:53FromDiscord<!&luke> Ok
18:39:25FromDiscord<Andreas> In reply to @ripluke "Ok": well, there should smth. like a `.next`/`.previous`-pointer on every node. Walk along and grab your value
18:39:38FromDiscord<!&luke> Ok
18:40:44FromDiscord<Andreas> In reply to @ripluke "Ok": and you can do this easily with nim - i mean the complete list - i think there is a Doubly-Linked-List in `std/shared`
18:41:33FromDiscord<!&luke> Ok I'll look there, thanks
18:42:32FromDiscord<Andreas> In reply to @ripluke "Ok I'll look there,": its `std/sharedlist` https://nim-lang.org/docs/sharedlist.html#add%2CSharedList%5BA%5D%2CA
18:43:57FromDiscord<!&luke> Also if I have a variable defined as a pointer type, how do I get the actual value of the variable
18:44:24FromDiscord<Andreas> In reply to @ripluke "Also if I have": dereference `[]`
18:44:35FromDiscord<!&luke> Ok
18:49:47FromDiscord<!&luke> In reply to @Andreas "dereference `[]`": Thank you
18:50:08FromDiscord<!&luke> Sure
19:08:25*mad_toothbrush joined #nim
19:26:01FromDiscord<JJ> is the current status of incremental compilation documented somewhere?
19:50:17*ntat quit (Quit: Leaving)
20:37:32FromDiscord<catnowblue> sent a code paste, see https://play.nim-lang.org/#ix=4yVP
20:39:58arkanoidjmgomez hahahaha
20:41:04arkanoidhow can I wrap c++ class static members in nim?
20:42:24FromDiscord<Andreas> @PMunch playground seems down ?
20:42:36arkanoidnevemind, found https://github.com/nim-lang/Nim/issues/2324
20:57:17*mad_toothbrush quit (Ping timeout: 245 seconds)
21:04:41FromDiscord<catnowblue> sent a code paste, see https://play.nim-lang.org/#ix=4yVU
21:04:59FromDiscord<catnowblue> I know it looks horrible, but is there any idea to unscrew this?
21:05:50FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/35qYU
21:11:59FromDiscord<Andreas> @elegantbeef hey, i'm struggling with smth. rather simple : i need to create a type depending on some parameter. There are types `A1,A2,A3` and depending on some value the initializer-proc will return `A1` or `A2` or `A3` - all types satisfy a `concept` and i tested all of them solo. But no matter how i try, i cannot make this work ? I don't want to make this into a variant-type and i assume that the common way to do this might be a template -
21:12:35FromDiscord<Elegantbeef> Are the parameters static?
21:13:11FromDiscord<Andreas> In reply to @Elegantbeef "Are the parameters static?": no, dynamic.. its `arity` and `depth` both ints
21:13:25FromDiscord<Elegantbeef> So you need runtime logic and cannot return different types
21:13:36FromDiscord<Elegantbeef> Types are static
21:13:53FromDiscord<Elegantbeef> Are the parameters runtime or compile time
21:13:56FromDiscord<Andreas> In reply to @Elegantbeef "So you need runtime": ok, what should i read now ? or can you point me to some example
21:14:05FromDiscord<Elegantbeef> Object variants
21:14:09FromDiscord<Elegantbeef> Could checkout fungus
21:14:33FromDiscord<Andreas> In reply to @Elegantbeef "Are the parameters runtime": parameters are compile-time
21:14:52FromDiscord<Elegantbeef> So then why'd you say they're dynamic?! 😄
21:15:12FromDiscord<Andreas> In reply to @Elegantbeef "So then why'd you": ohh, sry, my bad..
21:15:42FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/I4tUS
21:16:20FromDiscord<Andreas> wow, thats the official way to handle such ? thx.. i'll try
21:19:21FromDiscord<Elegantbeef> Not much of an official araq certified way, but it's the way
21:20:09FromDiscord<Elegantbeef> That's the only way to delimit types statically like this
21:21:31*dv^_^ quit (Server closed connection)
21:22:20*dv^_^ joined #nim
21:23:13arkanoidmmm how can I import a static C++ class member variable, in read/write mode? Nim tests show only read mode https://github.com/nim-lang/Nim/blob/36acac3000b496756ae3fbf561e875a1f9570bac/tests/cpp/tstaticvar_via_typedesc.nim
21:27:00FromDiscord<Andreas> sent a code paste, see https://play.nim-lang.org/#ix=4yVZ
21:27:12FromDiscord<Andreas> (edit) "https://play.nim-lang.org/#ix=4yVZ" => "https://play.nim-lang.org/#ix=4yW0"
21:40:13FromDiscord<Elegantbeef> @Andreas if you have a lot of these you may want to consider stealing the macro here 😄 https://github.com/beef331/nimtrest/blob/master/staticcases.nim#L75-L79
21:42:12*mad_toothbrush joined #nim
21:49:00arkanoidI can't open play.nim-lang.org, where the previus answers for me?
21:49:48*azimut joined #nim
21:49:53FromDiscord<Elegantbeef> No one responded to you
22:23:57FromDiscord<Andreas> sent a code paste, see https://play.nim-lang.org/#ix=4yW5
22:26:44FromDiscord<obi3112> nim coders!
22:26:50arkanoid:(
22:26:52arkanoidhaha
22:26:55FromDiscord<obi3112> have any of u guys tried haxe?
22:27:08arkanoidthe deodorant?
22:27:14FromDiscord<obi3112> lmao no
22:27:20FromDiscord<obi3112> the programming language
22:27:25arkanoidthat's why I smell
22:27:40FromDiscord<obi3112> lol
22:27:42FromDiscord<obi3112> but fr
22:27:48FromDiscord<obi3112> have u guys tried it
22:29:44*azimut quit (Ping timeout: 240 seconds)
22:30:38FromDiscord<Elegantbeef> Nope why?
22:30:39FromDiscord<Elegantbeef> Are we getting evangelised?
22:31:24*azimut joined #nim
22:31:50FromDiscord<huantian> i mostly just saw it existed
22:32:13FromDiscord<obi3112> oh ok so yall barely know it
22:32:18FromDiscord<Elegantbeef> I like language design so I looked into it
22:32:48FromDiscord<Elegantbeef> Do you have a real question
22:32:51FromDiscord<Elegantbeef> Or what
22:33:33FromDiscord<obi3112> if u had experience with haxe just wanted to ask u a question
22:33:57FromDiscord<Andreas> In reply to @obi3112 "if u had experience": go ahead, pls
22:33:57FromDiscord<Elegantbeef> Ask the question 😄
22:34:23FromDiscord<obi3112> uhm but yall barely know it existed 🤣
22:34:35FromDiscord<Elegantbeef> I looked into haxe quite a bit
22:34:37FromDiscord<Elegantbeef> So... no
22:34:47FromDiscord<obi3112> lol
22:34:48FromDiscord<obi3112> nvm
22:34:49FromDiscord<Elegantbeef> You're projecting
22:35:22FromDiscord<Elegantbeef> ...
22:35:26FromDiscord<Elegantbeef> People really are people
22:36:26FromDiscord<obi3112> In reply to @Elegantbeef "You're projecting": bro i aint
22:36:35FromDiscord<Elegantbeef> What was your question
22:37:12FromDiscord<Elegantbeef> Just ask it instead of dancing it
22:37:12FromDiscord<Elegantbeef> dancing around it
22:37:51FromDiscord<obi3112> just wanted to ask them which language had a steeper learning curve and which language was better in performance (from their experience)
22:38:03FromDiscord<Elegantbeef> Nim is a system language, Haxe is not
22:38:06FromDiscord<Elegantbeef> Nim will be faster
22:38:22FromDiscord<Elegantbeef> Nim also likely will have a steeper learning curve depending on what you're doing
22:38:27FromDiscord<Elegantbeef> And your knowledge
22:38:27FromDiscord<Andreas> FYI: theres the #langdev channel for everything ziggy, vadie, haxie etc. - they are all there waiting for a deep conversation..
22:38:46FromDiscord<Elegantbeef> Given you question I assume you have no experience in system programming
22:38:46FromDiscord<Elegantbeef> your\
22:38:56FromDiscord<obi3112> In reply to @Andreas "FYI: theres the <#763409397716090902>": oh ok thanks
22:39:00FromDiscord<obi3112> In reply to @Elegantbeef "Given you question I": yea not at all
22:39:12FromDiscord<Elegantbeef> That's not what that channel is for andreas
22:39:19FromDiscord<Elegantbeef> That's for talking about language development inside Nim 😄
22:39:51FromDiscord<Andreas> In reply to @Elegantbeef "That's for talking about": maybe we could use some cool haxie-features for 3.0 ?\
22:40:07FromDiscord<Elegantbeef> Lol
22:41:39FromDiscord<Andreas> In reply to @Elegantbeef "Lol": and BTW my impression was #internals has the future-topics
22:43:17FromDiscord<Elegantbeef> internals is about the compiler
22:43:35FromDiscord<Elegantbeef> language development is about making new programming languages such as min, arturo, ...
22:44:22FromDiscord<Andreas> In reply to @Elegantbeef "language development is about": ic, that makes sense now..
22:45:48FromDiscord<Andreas> (edit) "now.." => "now..↵regarding the haxie-jonny, i was trying to express in a friendly manner, smth. along the lines : "get off my fucking lawn." but i surely missed it.."
22:47:08FromDiscord<Elegantbeef> Hey i got it i was just correcting you
22:48:37FromDiscord<Andreas> In reply to @Elegantbeef "Hey i got it": well i'm fine, thx for the macro-thinggy - maybe i'll try that or switch to haxie, well see
22:49:36FromDiscord<Elegantbeef> lol
23:36:48*derpydoo joined #nim
23:57:18*mad_toothbrush quit (Ping timeout: 250 seconds)