<< 22-09-2023 >>

00:16:27FromDiscord<thugshaker.online> this language is fucking horrible and i love it
00:16:38FromDiscord<thugshaker.online> (edit) "this language is fucking horrible ... and" added "to use as a beginner"
00:16:45FromDiscord<thugshaker.online> (edit) "this language is fucking horrible to use as a beginner ... and" added "(me)"
00:18:04FromDiscord<raynei486> In reply to @thugshaker.online "is it just me": I think you're just not used to reading docs
00:31:44*lumo_e joined #nim
00:41:29FromDiscord<millymox> sent a code paste, see https://play.nim-lang.org/#ix=4H28
00:41:42FromDiscord<leorize> s/export/var
00:41:49FromDiscord<leorize> and you're of to the races
00:42:06FromDiscord<leorize> and add a `` after `console`, too
00:42:45FromDiscord<raynei486> yeah nim has no export keyword
00:42:50FromDiscord<millymox> In reply to @leorize "s/export/var": I’m slow sorry what do you mean? S/export?
00:42:53FromDiscord<raynei486> it's just a `` after the name to export
00:43:11FromDiscord<millymox> In reply to @raynei486 "yeah nim has no": Ahhh i see okay
00:43:13FromDiscord<raynei486> In reply to @millymox "I’m slow sorry what": it means replace export with var
00:43:24FromDiscord<raynei486> it's sed commands
00:43:28FromDiscord<raynei486> or vim idk
00:44:38FromDiscord<millymox> Hmm i did what you guys said still doens’t seem to working
00:44:51FromDiscord<millymox> Doesn’t do what its suppose to do + intellisense would recognize it
00:46:43FromDiscord<millymox> sent a code paste, see https://paste.rs/TBLAS
00:46:56FromDiscord<millymox> import nim_module/app
00:47:00FromDiscord<millymox> Then i try to use it
00:47:06FromDiscord<millymox> And fails, what am i doing wrong here?>
00:47:50FromDiscord<leorize> wdym by fails?
00:48:32FromDiscord<millymox> It’s not exporting it seems, because intellisense won’t see it and when i try to use it, it doesn’t log anything
00:48:52FromDiscord<Elegantbeef> "not exporting"?
00:49:02FromDiscord<Elegantbeef> You're also not calling it in the above code
00:49:15FromDiscord<millymox> I’m trying to use it from another file
00:49:27FromDiscord<Elegantbeef> `log`
00:51:08FromDiscord<millymox> Did this jus now tried again and its still not working, i also noticed intellisense doesn’t pick up on it https://media.discordapp.net/attachments/371759389889003532/1154580604436893776/IMG_4949.png
00:54:36FromDiscord<leorize> do you have sample files for us to test?
00:57:26FromDiscord<millymox> sent a code paste, see https://play.nim-lang.org/#ix=4H2a
00:57:55FromDiscord<millymox> And main.nim is empty with just a proc
00:58:24FromDiscord<millymox> The init custom console is just pseudo code
00:58:28FromDiscord<millymox> But it doesn’t bring any errors up
01:02:56FromDiscord<millymox> Works fine in app.nim but not outside of it
01:03:48FromDiscord<Elegantbeef> You didnt do `import app`
01:04:18FromDiscord<millymox> In reply to @Elegantbeef "You didnt do `import": I did import nim_module/app
01:04:23FromDiscord<millymox> I’m making a library
01:04:29FromDiscord<millymox> I think its because of the directories
01:09:54FromDiscord<millymox> Works fine
01:09:56FromDiscord<millymox> sent a code paste, see https://play.nim-lang.org/#ix=4H2e
01:09:58FromDiscord<millymox> In main.nim
01:10:18FromDiscord<millymox> But mine doesn’t
01:10:27termerIs it reasonably feasible to call Nim from C in the same project
01:10:35termerI have no issues calling C from Nim in the same project
01:16:22FromDiscord<Elegantbeef> You can write system libraries, so why not
01:18:04FromDiscord<fenilli> sent a long message, see http://ix.io/4H2g
01:18:20FromDiscord<fenilli> (edit) "http://ix.io/4H2g" => "http://ix.io/4H2h"
01:19:06termerIf you want to do virtual methods, you can use the `method` syntax which will do that for you
01:19:17termerI'm not really equipped to answer the rest right now though
01:19:25termerElegantbeef, I mean more from a project perspective
01:19:44termerobviously I can generate Nim C files and then include them in C
01:19:53termerbut that introduces 2 build steps
01:20:49FromDiscord<leorize> build a binding then create a library
01:20:50FromDiscord<Elegantbeef> Right, that's the sane thing to do
01:21:01FromDiscord<leorize> either a dynamic or static, doesn't matter
01:21:09FromDiscord<leorize> then consume it just like any other deps in your C pipeline
01:21:15FromDiscord<Elegantbeef> Make a static library for your Nim code, include that in your C, problem solved
01:21:56FromDiscord<leorize> is this a C++ interop or just a Nim best practices question?↵(@fenilli)
01:22:37FromDiscord<fenilli> Nim best practices, I'm following a c++ tutorial on how to build and simple engine called `Dragonfly`, and it uses class and stuff, but I want to write it in nim style.
01:22:45FromDiscord<fenilli> as to learn nim and that at the same time.
01:23:02FromDiscord<fenilli> (edit) "and" => "a"
01:23:19FromDiscord<leorize> you should start by doing the tutorial verbatim
01:23:28FromDiscord<leorize> unless they're doing multiple inheritance
01:23:41FromDiscord<leorize> in that case then you'll have to analyze the data flow
01:25:21FromDiscord<fenilli> but if it wasn't in the tutorial per say, would it be better to construct a class variant of `Manager` with kind? if so I would have to write overload procs with kinds of startup/shutdown correct?
01:26:38FromDiscord<fenilli> and in that case could there be a proc without kind that would run in "base" without a kind? for any kind? for example?
01:28:05FromDiscord<fenilli> sent a code paste, see https://paste.rs/YO2uR
01:28:10FromDiscord<leorize> inheritance and variants lets you polymorph your object at runtime
01:28:11FromDiscord<leorize> if you can get away with generics + overloads, then go for it instead
01:28:39FromDiscord<Elegantbeef> Yes
01:28:49FromDiscord<Elegantbeef> Nim has overloading
01:30:45FromDiscord<leorize> as a quick tip, composition isn't very popular with beginners is because they are really hard to do well
01:31:37FromDiscord<leorize> inheritance is a simple tree model where things are progressively enhanced, which vibes a lot better with human thinking
01:33:34FromDiscord<fenilli> but even with inheritance, nim doesn't provide the same level of OOP as C++, so wouldn't there be a roadblock at some point if following that?
01:34:15FromDiscord<fenilli> but sure I might as well try to write using inheritance at first and convert it to overloads later.
01:37:09FromDiscord<millymox> In reply to @raynei486 "yeah nim has no": Uh i did export console and it works now
01:37:42FromDiscord<Elegantbeef> @raynei486\: Nim has an export keyword
01:48:02FromDiscord<millymox> Why is logging console?
01:48:03FromDiscord<millymox> sent a code paste, see https://play.nim-lang.org/#ix=4H2l
01:48:27FromDiscord<millymox> sent a code paste, see https://play.nim-lang.org/#ix=4H2m
01:50:28FromDiscord<Elegantbeef> cause it's the first parameter
01:51:01FromDiscord<leorize> or rather because the wrapper is wrong
01:51:57FromDiscord<leorize> I think you should be able to get away with just importjs and no string has to be supplied
01:55:06FromDiscord<millymox> sent a long message, see http://ix.io/4H2n
01:55:10FromDiscord<millymox> When i remove the string param
02:01:29FromDiscord<leorize> that's not what I meant
02:01:43FromDiscord<leorize> but rather `{.importjs.}` is all you needed
02:02:14FromDiscord<leorize> it comes with a default pattern that do `firstparam.log(the, rest, of, params)`
02:02:50FromDiscord<millymox> Oh i was trying to bind it to nim so it has intellisense lol\
02:03:26FromDiscord<leorize> sent a code paste, see https://play.nim-lang.org/#ix=4H2o
02:04:28FromDiscord<millymox> Ohh i get it let me try
02:07:32FromDiscord<leorize> if you ever want to wrap a npm package, then I do have this old thing (which maybe someone else already make something better)\: https://github.com/alaviss/setup-nim/blob/ng/src/private/utils.nim#L145
02:07:44FromDiscord<millymox> .importjs. Routine requires a pattern
02:07:45FromDiscord<leorize> which can be used like this\: https://github.com/alaviss/setup-nim/blob/ng/src/private/actions/core.nim#L34
02:07:47FromDiscord<millymox> Says compiler
02:08:17FromDiscord<leorize> I guess you can cheat with importcpp, but lemme dig that pattern up for you
02:09:22FromDiscord<leorize> `#.log(@)` \<- that&#x27;s your pattern
02:09:39FromDiscord<leorize> looks like nim removed the default pattern?
02:09:41FromDiscord<leorize> weird choice
02:11:13FromDiscord<millymox> Okay now why is it doing this lmfao↵↵ console.log(makeNimstrLit("HEYYY"));
02:12:06FromDiscord<Elegantbeef> `cstring`
02:12:07FromDiscord<leorize> because you used `string` as your input type
02:12:09FromDiscord<leorize> switch to `cstring`
02:13:40FromDiscord<millymox> It works now, God bless you all
02:13:45FromDiscord<millymox> For putting up with my idiocy
02:14:13*lumo_e quit (Quit: Quit)
02:14:43FromDiscord<leorize> well this is a support channel \:P
02:15:12FromDiscord<Elegantbeef> If that's the case why have I not got the support I clearly need?!
02:15:37FromDiscord<leorize> you've used up your free trial, that's why
02:15:47FromDiscord<Elegantbeef> Ah
02:16:09FromDiscord<Elegantbeef> Guess I'll just eat these homeopathic pills until the voices stop
02:43:06FromDiscord<millymox> sent a long message, see http://ix.io/4H2s
03:09:20FromDiscord<millymox> Fixed it
03:41:55*azimut quit (Ping timeout: 252 seconds)
03:53:36*greaser|q quit (Changing host)
03:53:36*greaser|q joined #nim
03:53:39*greaser|q is now known as GreaseMonkey
04:47:10*rockcavera quit (Remote host closed the connection)
04:54:10FromDiscord<n00nehere> anyone know why ratel says that nimeval is missing when installing it?
04:54:55FromDiscord<Elegantbeef> try `nimble install --path:"$nim" ratel`
04:55:05FromDiscord<Elegantbeef> What OS are you on?
05:22:25*NimEventer quit (Remote host closed the connection)
05:22:39*NimEventer joined #nim
06:15:53*advesperacit joined #nim
06:16:52*disso-peach quit (Quit: Leaving)
06:37:04FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Guess I'll just eat": Embrace the voices, you are many, many are one...
06:52:47*advesperacit quit ()
07:01:11*PMunch joined #nim
07:08:48*advesperacit joined #nim
07:29:42*ntat joined #nim
07:52:30*ntat quit (Quit: leaving)
08:29:44*flalom joined #nim
08:32:53*junaid_ joined #nim
08:37:41*junaid_ quit (Remote host closed the connection)
08:46:57*flalom quit ()
08:57:09FromDiscord<xerxemi> how do you convert an IntLit to an int?
09:00:44FromDiscord<Elegantbeef> If you're in a macro you do `.intVal`
09:01:18FromDiscord<Elegantbeef> Depending on what you're doing you might just want `static int`
09:01:39FromDiscord<xerxemi> alr
09:11:46*flalom joined #nim
09:12:26*flalom quit (Client Quit)
09:28:46FromDiscord<xerxemi> is there any way to make a macro remember certain variables? since macros run at compile time it also seems impossible to use a global
09:49:12*xmachina quit (Ping timeout: 260 seconds)
09:50:03*blop_ quit (Ping timeout: 252 seconds)
09:57:54FromDiscord<odexine> https://nim-lang.org/docs/macrocache.html
10:03:26*xmachina joined #nim
10:07:12PMunchxerxemi, you can use a global `var myGlobal {.compileTime.} = 100`
10:08:48NimEventerNew thread by rajmac: Ggplot and lapack revisited, see https://forum.nim-lang.org/t/10509
10:30:32*PMunch_ joined #nim
10:33:38*PMunch quit (Ping timeout: 246 seconds)
10:33:48*PMunch_ is now known as PMunch
10:34:56*def- quit (Quit: -)
10:36:41*def- joined #nim
10:58:49*xmachina quit (Ping timeout: 255 seconds)
11:12:48*xmachina joined #nim
11:25:31*Batzy_ quit (Ping timeout: 264 seconds)
11:26:46FromDiscord<juh9870> Hello, is there a method to take `n` items from iterator and skip the rest? I want to only print first 5 items from an iterator
11:26:50*Batzy joined #nim
11:34:03FromDiscord<vindaar> sent a code paste, see https://play.nim-lang.org/#ix=4H48
11:42:11*azimut joined #nim
11:49:22*jmdaemon quit (Ping timeout: 260 seconds)
12:24:38*def- quit (Quit: -)
12:25:52*def- joined #nim
12:49:32*xmachina1 joined #nim
12:49:38*derpydoo joined #nim
12:51:04*xmachina quit (Ping timeout: 244 seconds)
12:54:14*xmachina1 is now known as Co2
12:57:25*Co2 quit (Quit: WeeChat 4.0.4)
13:00:04FromDiscord<fabric.input_output> how is it looking https://fabriciopashaj.github.io/yarolin/results.html
13:02:00FromDiscord<odexine> ?
13:09:21FromDiscord<fabric.input_output> I mean like what do you think, does it look good?
13:09:31FromDiscord<fabric.input_output> the library
13:14:47*def- quit (Quit: -)
13:15:37*def- joined #nim
13:18:05FromDiscord<juh9870> sent a code paste, see https://play.nim-lang.org/#ix=4H4s
13:28:56*def- quit (Quit: -)
13:29:09*def- joined #nim
13:38:35*xmachina joined #nim
13:43:23*xmachina quit (Client Quit)
13:46:51*PMunch quit (Quit: Leaving)
13:53:15*xmachina joined #nim
13:53:15*xmachina is now known as Co2
13:53:43*Co2 is now known as xmachina
13:53:58*edr joined #nim
13:54:26*rockcavera joined #nim
13:59:29arkanoidnim forum web app is giving me lots of ux glitces, recently. For example the preview button just prints to console, the reply button doesn't actually reply, delete button doesn't work
14:17:52*blop_ joined #nim
14:23:13*blop_ quit (Ping timeout: 252 seconds)
14:31:09*junaid_ joined #nim
14:35:20FromDiscord<Chronos [She/Her]> Are tables the fastest way to store key-value structures?
14:35:34FromDiscord<Chronos [She/Her]> I'm mapping a string to another string (for translation keys)
14:35:53FromDiscord<odexine> fastest depends on the structures and what other properties you need...
14:36:19FromDiscord<odexine> and start worrying about performance when you really have a performance problem
14:36:42FromDiscord<Chronos [She/Her]> Just curiousity rn
14:37:01FromDiscord<Chronos [She/Her]> In reply to @odexine "fastest depends on the": Another requirement is being usable across threads
14:37:09FromDiscord<.aingel.> What would be faster than a table
14:37:14FromDiscord<Chronos [She/Her]> Tho ig that's why I'd allocate shared memory manually
14:37:16FromDiscord<.aingel.> Maybe with a custom faster hash func?
14:37:25FromDiscord<Chronos [She/Her]> In reply to @.aingel. "What would be faster": 🤷‍♀️ that's why I'm asking
14:38:25FromDiscord<juancarlospaco> In reply to @chronos.vitaqua "Are tables the fastest": If it wont need to grow, an array like `var t = {"a": "b"}`
14:39:54FromDiscord<Chronos [She/Her]> Makes sense, it'll be read from a file though
14:40:01FromDiscord<Chronos [She/Her]> Or some other string input I'd assume
14:41:09FromDiscord<.aingel.> In reply to @juancarlospaco "If it wont need": What do u mean?
14:41:26FromDiscord<.aingel.> Oh this is not a dynamic memory store?
14:41:29FromDiscord<odexine> yes
14:41:35FromDiscord<odexine> arrays are non-heap
14:41:40FromDiscord<toma400> I wish there was extendable tuple/various-typed hash table type, if we talk about dictionary types
14:41:49FromDiscord<odexine> but i dont know if arrays can be string indexed
14:42:01FromDiscord<.aingel.> It would require some sort of hash anyways
14:42:19FromDiscord<juancarlospaco> In reply to @.aingel. "Oh this is not": Nah.
14:42:32FromDiscord<.aingel.> I meant more like it was not a requirement for Rika
14:42:38FromDiscord<demotomohiro> afaik, tables are the fastest to set/get a value with a key.
14:42:39FromDiscord<.aingel.> Not your code sample
14:42:45FromDiscord<odexine> it's not my question
14:42:50FromDiscord<.aingel.> oh sorry
14:42:53FromDiscord<.aingel.> Chronos
14:43:03FromDiscord<.aingel.> My bad 😆
14:43:07FromDiscord<odexine> lol
14:43:15FromDiscord<juancarlospaco> `vat t = {"a": "b"}` is an array of tuples.
14:43:19FromDiscord<.aingel.> What's the default hash function for a table?
14:44:52FromDiscord<demotomohiro> Is `proc hash(t: Table): Hash` defined?
14:45:02FromDiscord<juancarlospaco> If it can me immutable an enum with values `type Foo = enum A = "foo", B = "bar"`
14:45:54FromDiscord<odexine> In reply to @juancarlospaco "`vat t = {"a":": i forgot about that lol
14:46:05FromDiscord<odexine> but that means a linear search if unsorted anyway
14:46:10FromDiscord<odexine> hash tables are likely faster
14:46:15FromDiscord<odexine> (edit) "hash tables are likely faster ... " added "for large data"
14:46:25FromDiscord<odexine> easier to use for most cases
14:46:29FromDiscord<juancarlospaco> Yeah, it depends
14:46:41FromDiscord<demotomohiro> In reply to @.aingel. "What's the default hash": https://github.com/nim-lang/Nim/blob/devel/lib/pure/hashes.nim
14:46:45FromDiscord<odexine> In reply to @.aingel. "What's the default hash": i believe nim's hashes module is based on wyhash
14:48:07FromDiscord<Chronos [She/Her]> In reply to @odexine "hash tables are likely": Yeah it will be p large tbh
14:48:19FromDiscord<Chronos [She/Her]> Depending on the application
14:48:30FromDiscord<odexine> large as in more than a few thousand keys i'd say...
14:48:40FromDiscord<odexine> maybe even more
14:52:44FromDiscord<Chronos [She/Her]> I mean you could imagine something like Minecraft....or you could imagine a small CLI tool
15:05:04*def- quit (Quit: -)
15:06:20*def- joined #nim
15:16:18FromDiscord<millymox> sent a code paste, see https://paste.rs/nRFPc
15:22:10FromDiscord<demotomohiro> In reply to @millymox "attempting to call routine:": https://nim-lang.org/docs/system.html#on
15:23:12FromDiscord<demotomohiro> Or you forget to export mark to proc `on`?
15:24:03FromDiscord<demotomohiro> Or you need to `export on`
15:34:13FromDiscord<sirolaf> Is there a preferred way to deal with pragmas in untyped type sections or am I on my own there in terms of stdlib
15:35:57FromDiscord<sirolaf> sent a code paste, see https://play.nim-lang.org/#ix=4H76
15:36:29FromDiscord<odexine> "deal with"?
15:37:14FromDiscord<sirolaf> Yes, it gives me a nnkRecList with ident defs in it but depending on what pragmas are attached I wanna change what it does
15:37:48FromDiscord<vindaar> there's https://nim-lang.github.io/Nim/macros.html#hasCustomPragma.m%2Ctyped%2C and friends. Not sure if that's what you have in mind
15:38:34FromDiscord<sirolaf> Tried that already, the pragma is an ident insted of a sym so it doesn't recognize it
15:38:40FromDiscord<sirolaf> (edit) "insted" => "instead"
15:39:49FromDiscord<millymox> In reply to @demotomohiro "Or you need to": Neither of these solutions work for me unfourntely
15:41:24*ntat joined #nim
15:42:19FromDiscord<millymox> In reply to @demotomohiro "Or you forget to": I do not have a proc named on
15:44:35FromDiscord<millymox> In reply to @demotomohiro "Or you need to": No this did fix it thank you, i made a typo lol
15:51:45*xmachina quit (Ping timeout: 258 seconds)
15:55:02FromDiscord<.aingel.> In reply to @demotomohiro "https://github.com/nim-lang/Nim/blob/devel/lib/pure": Thanks!
15:55:24FromDiscord<.aingel.> In reply to @odexine "i believe nim's hashes": Gotcha
15:57:11*blop_ joined #nim
16:00:39FromDiscord<Chronos [She/Her]> In reply to @millymox "attempting to call routine:": Oh btw you might like the `do` macro
16:01:05FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4H7v
16:01:18FromDiscord<Chronos [She/Her]> Think it's in the std/sugars library
16:03:20FromDiscord<mratsim> In reply to @sirolaf "Is there a preferred": I have something somewhere
16:03:55FromDiscord<mratsim> The {.push mypragma.} are tricky
16:05:40*xmachina joined #nim
16:15:05FromDiscord<mratsim> In reply to @sirolaf "Is there a preferred": Here you go: https://github.com/mratsim/constantine/blob/master/constantine/platforms/code_generator/bindings/c_abi.nim#L37
16:16:26FromDiscord<mratsim> You can use getAst with this macro or quote do to this kind of macro to deal with pragmas in an untyped macro
16:23:48*azimut_ joined #nim
16:24:35*azimut quit (Ping timeout: 252 seconds)
16:30:06FromDiscord<Chronos [She/Her]> I'm depending on if I should make a component builder or if I should figure out a way to not do that
16:30:38FromDiscord<Chronos [She/Her]> I want to make it so properties are inherited by the parent component by default but hm
16:33:14*Mister_Magister quit (Ping timeout: 244 seconds)
16:34:39*derpydoo quit (Ping timeout: 245 seconds)
16:48:44*Mister_Magister joined #nim
16:54:08*krux02 joined #nim
16:57:50FromDiscord<Chronos [She/Her]> Not sure what's the best way to code this lol
17:08:13*blop_ quit (Ping timeout: 252 seconds)
17:08:39FromDiscord<Chronos [She/Her]> Hm maybe concepts will be useful for this because of people wanting custom component types...?
17:08:48FromDiscord<Chronos [She/Her]> But hm
17:10:56FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4H7I
17:11:04FromDiscord<Chronos [She/Her]> Literally the only thing I can think of oof-
17:11:07*blop_ joined #nim
17:11:26FromDiscord<Chronos [She/Her]> They need to also chain upon eachother tho so ugh....
17:12:04FromDiscord<Chronos [She/Her]> ` next: BaseComponent`?
17:12:49FromDiscord<Chronos [She/Her]> I should really figure out a better way to do this, tho ig I do have to leave serialisation to the implementer of the component anyway so not my issue
17:14:43FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4H7L
17:14:51FromDiscord<Chronos [She/Her]> I am fucking up markdown sorry
17:15:36FromDiscord<Chronos [She/Her]> Wait couldn't the `std/streams` module be rewritten with components?
17:16:40FromDiscord<Chronos [She/Her]> Very tempting to try... But I need to do my own thing first....or do I?
17:35:38FromDiscord<Chronos [She/Her]> Enough of that, sigh
17:37:08FromDiscord<.aingel.> What are you building?
17:38:32FromDiscord<Chronos [She/Her]> Text component library
17:38:56FromDiscord<Chronos [She/Her]> For things such as formatting text in a way that can be implemented in other libraries
17:40:12FromDiscord<.aingel.> Oh right, what sort of formatting
17:40:17FromDiscord<.aingel.> Other than i18n
17:40:50FromDiscord<Chronos [She/Her]> Text colours, italics/bold/underlining, something like this here: https://docs.advntr.dev/text.html
17:41:37FromDiscord<Chronos [She/Her]> I also plan for it to be possible to implement custom serializing logic too, so you could output JSON if needed, or instead you could output something for the terminal
17:41:47FromDiscord<Chronos [She/Her]> Just want to do it in a way that isn't distinctly... Java
17:42:41*azimut_ quit (Ping timeout: 252 seconds)
17:45:03FromDiscord<voidwalker> isn't that in notcurses/ncurses ?
17:45:27FromDiscord<Chronos [She/Her]> Not sure? Haven't looked into it
17:45:41FromDiscord<Chronos [She/Her]> But either way I still need it so it could be implemented in a game too
17:45:42FromDiscord<voidwalker> or is this html text?
17:46:57*advesperacit quit (Ping timeout: 260 seconds)
17:47:09FromDiscord<Chronos [She/Her]> Not HTML
17:47:20FromDiscord<voidwalker> how do you bold non html text ? unicode ?
17:47:21*advesperacit joined #nim
17:49:56FromDiscord<Chronos [She/Her]> That's up to who implements the library, but terminals have ANSI codes for that stuff
17:51:30*azimut joined #nim
17:53:25FromDiscord<Chronos [She/Her]> Okay this is very difficult
17:55:31*derpydoo joined #nim
17:56:37*azimut quit (Ping timeout: 252 seconds)
18:00:57*azimut joined #nim
18:06:08FromDiscord<Chronos [She/Her]> I don't this is doable in the way I want oof
18:11:33FromDiscord<jviega> I have a library like that. There's a `print()` statement that allows you to add html tags for formatting. It converts markdown automatically too, and then renders for the terminal. We already use it pretty extensively, generating a lot of tables, etc. Will probably pretty it up for other people in a few weeks.
18:16:33FromDiscord<jviega> You can inline stuff like `print("<atomiclime><bg-black>Hello</bg-black></atomiclime>") `but you can also do `print("<h1>Hello</h1>") `and apply a style to h1. I need to implement html class and id attributes soon, but it all is quite nifty
18:17:18FromDiscord<jviega> We have a ton of inline documentation and I wanted to be able to both generate web pages and render in-app on the command line, with one automation path.
18:22:21FromDiscord<Chronos [She/Her]> In reply to @jviega "I have a library": Sounds useful! My library was also supposed to add stuff like translatable keys tho rip
18:22:45FromDiscord<jviega> What does that mean?
18:22:47FromDiscord<.aingel.> Is there a way to do `cast[xmlchar](name.cstring)` something like name.cstring.cast[xmlchar]
18:22:52FromDiscord<.aingel.> (edit) "name.cstring.cast[xmlchar]" => "`name.cstring.cast[xmlchar]`"
18:23:40FromDiscord<jviega> What are you trying to actually accomplish, Aingel? Don't understand the question
18:24:00FromDiscord<Chronos [She/Her]> So you could load a file with translation keys (probably a .ini file), pass it to a component serializer, and then have it output the string with the translation + formatting↵↵An example would be `TranslatableKey("this.is.a.key").bold().italic().colour(Green)`
18:24:05FromDiscord<jviega> What kind of data are you trying to cast in what circumstances?
18:24:32FromDiscord<.aingel.> In reply to @jviega "What are you trying": Just want to type it with different syntax
18:24:35FromDiscord<Chronos [She/Her]> Then to serialise it you'd do `serialise(TranslationKeys, ...)` where the `...` is the components
18:24:41FromDiscord<.aingel.> Sort of like foo.`$` vs $foo
18:24:52FromDiscord<.aingel.> Ruby style vs python style
18:25:13FromDiscord<.aingel.> Not sure what it's really called
18:25:29FromDiscord<jviega> Got it. Doesn't really matter what it is from my perspective, Chronos. You could automatically apply styles to it, and substyles if it's structured data
18:25:39FromDiscord<.aingel.> (edit) "foo.`$`" => "foo.\`$\`"
18:26:43FromDiscord<Chronos [She/Her]> Point would be to just make it near effortless to just swap in translatable text with existing formatting
18:26:49FromDiscord<jviega> Well, `name.cstring` is essentially `cstring(name)` which is a cooercion operation itself. `cast(x)` is too, but the one that is effectively the C cast that says, "just fing do it even if it makes little sense"
18:27:10FromDiscord<.aingel.> Yeah thats why I want to keep doing it postfix
18:27:13FromDiscord<.aingel.> Can I do the cast with postfix
18:27:55FromDiscord<.aingel.> Regardless if the code can be more efficient or if I don't need to do cstring, that's a secondary thin
18:27:57FromDiscord<.aingel.> (edit) "thin" => "thing"
18:28:47FromDiscord<jviega> Yeah, same here, you don't have to use `print` at all. I, for instance, have a simpletable() that takes a seq[seq[string]] and automatically formats. Again, like with style sheets, you can hit individual elements without having to write things inline
18:29:14FromDiscord<jviega> I've honestly never tried, if it doesn't work when you try it then I doubt it
18:34:03*def- quit (Quit: -)
18:38:59*def- joined #nim
18:41:06FromDiscord<.aingel.> @jviega Do you know how to do the cast in postfix
18:41:09FromDiscord<.aingel.> If that's the right term
18:41:56FromDiscord<jviega> Where the argument goes to the left of the function?
18:43:07FromDiscord<.aingel.> Um sort of
18:43:25FromDiscord<.aingel.> > Ruby supports functional style (pipe-like) programming more easily
18:43:31FromDiscord<.aingel.> I saw it described that way on stack overflow
18:43:52FromDiscord<.aingel.> Basically just chaining functions from left to right
18:44:06FromDiscord<.aingel.> I know nim does it, but just wondering about the cast operation
18:44:10FromDiscord<jviega> So here's an oddity of nim. Usually you can turn `foo(a, b)` into `a.foo(b)`. But the second you need to provide a type parameter like with `foo[string](a, b)`, that syntax does not work, as it's too ambiguous w/ array access. So you can't do `a.foo[string](b)` but there's an alternate syntax: `a.foo[:string](b)`
18:44:33FromDiscord<jviega> Well if you want to chain functions their return values have to support it
18:45:31FromDiscord<jviega> Some people have done macros to get around that, but there's no simple way in the language to get those kinds of semantics
18:55:08FromDiscord<.aingel.> Okay that's cool
18:57:31FromDiscord<.aingel.> @jviega I can't do two chains of functions it seems
18:57:35FromDiscord<.aingel.> :type doesn't help
18:57:42FromDiscord<.aingel.> name.cstring.cast[:xmlchar]
18:57:44FromDiscord<.aingel.> Doesn't work
18:57:55FromDiscord<.aingel.> /Users/saint/code/margaretXML/parse.nim(84, 46) Error: undeclared identifier: 'cast'
18:57:57FromDiscord<jviega> Yeah I figured, cast seemed unlikely to actually be a function call, and more a builtin
18:58:08FromDiscord<Elegantbeef> Cast is not a procedure
18:58:24FromDiscord<.aingel.> So is there any way to what I want to do with that sort of syntax
18:58:28FromDiscord<.aingel.> chaining syntax I guess
18:58:30FromDiscord<.aingel.> Or not for cast
18:58:31FromDiscord<Elegantbeef> Make your own cast procedure or template that internally does ast
18:58:57FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4H8o
18:59:10FromDiscord<Elegantbeef> `name.cstring.castTo[:XmlChar]()` now should work
18:59:20FromDiscord<jviega> Like I said people do it w/ the macro/template system if they care. I've seen libraries that will auto-chain on the first parameter
18:59:39FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4H8p
18:59:46FromDiscord<Elegantbeef> Then you can jusut do `name.cstring.castTo(XmlChar)`
19:04:02FromDiscord<.aingel.> Interesting, thanks!
19:05:26*junaid_ quit (Remote host closed the connection)
19:11:07*advesperacit quit (Ping timeout: 264 seconds)
19:11:32*advesperacit joined #nim
19:13:02FromDiscord<Chronos [She/Her]> In reply to @chronos.vitaqua "So you could load": Hey Beef, do you think concepts would be a good fit for this or should I just scrap it completely?
19:13:40FromDiscord<Elegantbeef> Where is the concept part?
19:14:14FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4H8r
19:14:19FromDiscord<Chronos [She/Her]> Was tryna do something like this but
19:14:24FromDiscord<Elegantbeef> You've just described a fixed API 😄
19:14:36FromDiscord<Chronos [She/Her]> Oh?
19:14:56FromDiscord<Elegantbeef> I mean what would be generic in the above case?
19:15:17FromDiscord<Chronos [She/Her]> Anything that implements the `next` field?
19:15:28FromDiscord<Chronos [She/Her]> Oh wait I don't need a concept for this do I
19:15:33FromDiscord<Elegantbeef> What would next even do?
19:15:49FromDiscord<Chronos [She/Her]> Store a child component
19:15:58FromDiscord<Chronos [She/Her]> Basically like a linked list I think
19:16:01FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4H8s
19:16:29FromDiscord<Elegantbeef> Atleast it probably doesnt work
19:16:48FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4H8u
19:17:05*mio joined #nim
19:17:20FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4H8v
19:17:33FromDiscord<Elegantbeef> But that's also an endlessly recursive concept, so it might explode
19:18:05FromDiscord<Chronos [She/Her]> Hm
19:18:42FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4H8w
19:18:55FromDiscord<Chronos [She/Her]> `cannot instantiate: 'none[T]'`, which makes sense but is also really annoying
19:19:20FromDiscord<Elegantbeef> `none[T]` is the default state
19:19:27FromDiscord<Elegantbeef> So it doesnt matter
19:19:32FromDiscord<Elegantbeef> Also it's `none(T)`
19:20:32FromDiscord<Chronos [She/Her]> concept
19:20:33FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4H8x
19:21:00FromDiscord<Elegantbeef> Nah
19:21:08FromDiscord<Elegantbeef> It's just default values does not work with generics
19:21:23FromDiscord<Elegantbeef> Also your `TextComponent` needs to be generic
19:21:32FromDiscord<Chronos [She/Her]> Tbf I don't even need a concept, but then I don't know how I'd know what proc I need to use, unless I make it `method`s instead
19:21:49FromDiscord<Elegantbeef> Why is that an issue
19:21:53FromDiscord<Elegantbeef> You are not using runtime dispatch
19:22:34FromDiscord<Chronos [She/Her]> Wait am I being stupid hold on
19:22:58FromDiscord<Elegantbeef> I have an entire GUI that doesnt use `method`s 😄
19:24:04FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4H8A
19:24:07FromDiscord<Chronos [She/Her]> No clue about the issue honestly
19:24:25FromDiscord<Elegantbeef> Again `= none(T)` is useless
19:24:26FromDiscord<Elegantbeef> The default state of `Option[T]` is `none(T)`
19:25:00FromDiscord<Chronos [She/Her]> Ah I misread then
19:26:08FromDiscord<Elegantbeef> Well I said two things 😄
19:26:09FromDiscord<Elegantbeef> It's `none(T)` and it's uselss
19:26:13FromDiscord<Elegantbeef> useless\
19:28:31FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4H8B
19:28:41FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "It's `none(T)` and it's": you underestimate how blind I can be
19:28:48FromDiscord<Elegantbeef> read my messages
19:28:58FromDiscord<Elegantbeef> you made text component a generic but did not inherit it generically
19:29:07FromDiscord<Elegantbeef> `object of RootComponent[T]`
19:29:08FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Also your `TextComponent` needs": I made it generic
19:29:13FromDiscord<Chronos [She/Her]> Wait
19:29:16FromDiscord<Chronos [She/Her]> Ah...
19:29:33FromDiscord<Chronos [She/Her]> Still does not help tho oof
19:30:39FromDiscord<Elegantbeef> `RootComponent[T: RootComponent] = object of RootObj` is endlessly recursive aswell
19:31:00FromDiscord<Chronos [She/Her]> Not sure what else to do :p
19:31:30FromDiscord<Elegantbeef> Not make your type endlessly recursive?
19:32:14FromDiscord<Chronos [She/Her]> By removing `T: RootComponent` and just doing `T` or...
19:32:24FromDiscord<Chronos [She/Her]> Maybe I should just stop being insane :p
19:33:42FromDiscord<Elegantbeef> Probably
19:33:43FromDiscord<Elegantbeef> `T: RootComponent` makes no sense on these
19:33:55FromDiscord<Chronos [She/Her]> Yeah it still doesn't work even with that
19:34:06FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "`T: RootComponent` makes no": On `TextComponent` too? Why?
19:34:40FromDiscord<Chronos [She/Her]> No matter what I do tho it still dies so... Lost
19:34:47FromDiscord<.aingel.> Is there a way to access values from a named tuple by name without defining the type?
19:35:30FromDiscord<juancarlospaco> In reply to @.aingel. "Is there a way": By index.
19:35:36FromDiscord<.aingel.> so if I have var a = (cat: "meow", dog: "woof"), but I don't define a type, is there a way to get a.cat or something similar, apart from a[0]
19:35:41FromDiscord<.aingel.> In reply to @juancarlospaco "By index.": Yeah by name
19:35:51FromDiscord<.aingel.> Is there any way to do it by name without defining the type
19:36:01FromDiscord<juancarlospaco> In reply to @.aingel. "so if I have": `a.cat`
19:36:47FromDiscord<Elegantbeef> I don't know what to say Chronos this just an odd data type
19:37:50FromDiscord<.aingel.> In reply to @juancarlospaco "`a.cat`": Without defining the type?
19:38:05FromDiscord<.aingel.> It doesn't seem like I can do a.cat if I don't have a type defined
19:38:06FromDiscord<Elegantbeef> That's what named tuple fields are for
19:38:18FromDiscord<juancarlospaco> In reply to @.aingel. "so if I have": Thats an assign.
19:38:29FromDiscord<Elegantbeef> Also @Chronos [She/Her] it's `TextComponent[RootComponent[...]](...)`
19:38:38FromDiscord<Elegantbeef> You need to specify the generic parameter everywhere
19:39:15FromDiscord<.aingel.> In reply to @juancarlospaco "Thats an assign.": I'm talking about using a.meow given I have that
19:39:53FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4H8D
19:40:15FromDiscord<.aingel.> Yeah hmm
19:40:34FromDiscord<.aingel.> Let me find another example where I think it breaks
19:40:42FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/eLWzv
19:42:43FromDiscord<.aingel.> sent a code paste, see https://play.nim-lang.org/#ix=4H8G
19:42:44FromDiscord<.aingel.> Right here is my problem
19:42:48FromDiscord<.aingel.> The last line gives me a compile error
19:43:19FromDiscord<Elegantbeef> Of course it does
19:43:27FromDiscord<Elegantbeef> You want a object
19:43:29FromDiscord<Elegantbeef> Use an object
19:43:40FromDiscord<Elegantbeef> You can do `tuple[cat, dog: string]` but ugh
19:43:53FromDiscord<.aingel.> Oh
19:43:53FromDiscord<Elegantbeef> Better to do `array[Animal, string]` imo
19:44:04FromDiscord<.aingel.> Let me try that tuple syntax
19:44:48FromDiscord<.aingel.> `var b = initTable[string, tuple[cat: string, dog: string]]()`
19:44:51FromDiscord<.aingel.> Nice this works
19:44:54FromDiscord<.aingel.> Excellent
19:44:57FromDiscord<.aingel.> Ty
19:45:11FromDiscord<juancarlospaco> Named tuples can have enums as names too.
19:45:21FromDiscord<.aingel.> Gotcha
19:45:23FromDiscord<Elegantbeef> It's' also awful
19:45:32FromDiscord<Elegantbeef> > Named tuples can have enums as names too.↵What?
19:45:32FromDiscord<.aingel.> This is more about just the idea of writing something fast
19:45:43FromDiscord<.aingel.> Or flexibl
19:45:44FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "I don't know what": Yeah fair enough
19:45:53FromDiscord<Chronos [She/Her]> Maybe I can get by, by using a linked list
19:46:19FromDiscord<Chronos [She/Her]> I could even just use a seq but like
19:46:22FromDiscord<Chronos [She/Her]> Eh
19:46:36FromDiscord<Elegantbeef> DOD 😄
19:46:52FromDiscord<Chronos [She/Her]> Wdym?
19:47:06FromDiscord<Chronos [She/Her]> I didn't understand DOD a year ago and not now either
19:48:06FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4H95
19:48:43FromDiscord<Elegantbeef> Oh I actually have a DOD fractal tree
19:49:09FromDiscord<Chronos [She/Her]> If next is smaller than `0`, that means there's no more left?
19:49:15FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4H9b
19:49:25FromDiscord<Elegantbeef> In this tree yes
19:49:31FromDiscord<Elegantbeef> It's the last in the branch
19:53:39*ntat quit (Quit: leaving)
19:57:16FromDiscord<Chronos [She/Her]> Fun
19:57:42FromDiscord<Chronos [She/Her]> Any benefits compared to a typical linked list? They seem like they do the same function
19:58:24FromDiscord<.aingel.> Whats DOD?
19:58:25FromDiscord<Chronos [She/Her]> Also all would be recasted into `RootComponent` which means I need to do refs and use methods (because if someone implements their own component, I need to be able to call it)
19:58:33FromDiscord<Chronos [She/Her]> Data-oriented design
19:58:38FromDiscord<.aingel.> Ah
20:10:20FromDiscord<Elegantbeef> DOD is cache coherent↵(@Chronos [She/Her])
20:12:53arkanoidthe web ui of nim forum is not working correctly for me
20:35:35*disso-peach joined #nim
20:51:42NimEventerNew post on r/nim by momoPFL01: PR for NeoVim Treesitter support for Nim, see https://reddit.com/r/nim/comments/16pl1xg/pr_for_neovim_treesitter_support_for_nim/
21:10:55FromDiscord<.aingel.> In reply to @NimEventer "New post on r/nim": ooh
21:35:21arkanoidwhy nimlsp vs Nim-lang/langserver ?
21:40:58FromDiscord<Mike> If I'm using nimlangserver, where are the project-specific settings supposed to go? The readme spells out the config options but not where I'm supposed to put them
21:44:30FromDiscord<Chronos [She/Her]> https://github.com/treeform/llama2.nim this is interesting, I wonder if there's anywhere that using it would actually have a point
21:45:50FromDiscord<Elegantbeef> I believe the configuration options listed are specifically for vscode, configuration for other editors is undocumented
21:46:02*advesperacit quit ()
21:46:04FromDiscord<Mike> Ah. So on neovim i'm just out of luck?
21:46:15FromDiscord<Elegantbeef> Actually no, neovim and vim are documented now
21:46:43FromDiscord<Elegantbeef> Though those are global settings, so what do I know
21:47:46FromDiscord<Mike> Yeah I made it that far, but it kinda breaks when I open files in my project directory that aren't the main project file
21:48:14FromDiscord<Mike> Which I think means i need to add a config file for the project, which I don't know how to do
21:48:30FromDiscord<Elegantbeef> Time to make an issue
21:48:52FromDiscord<Mike> Yeah guess so. Just wanted to make sure I wasn't missing something. Thanks
22:01:31*def- quit (Quit: -)
22:03:01*def- joined #nim
22:08:43FromDiscord<Langosta> In reply to @Elegantbeef "It's' also awful": What makes tuples bad? Are there large negatives to tuples besides not being indexable? Or is it that they are inappropriate within this context? I ask since I'm still learning and want to learn best practices.
22:10:10FromDiscord<jviega> What do you mean by "not indexable?"
22:10:53FromDiscord<jviega> If you do:
22:11:08FromDiscord<jviega> `var f = ("a", "b", "c")` and then ask for `f[1]` you will get `"b"`
22:11:45FromDiscord<jviega> And named tuples can obviously be indexed by name
22:11:48FromDiscord<Chronos [She/Her]> In reply to @alendrik "What makes tuples bad?": Tuples mostly aren't great because having an actual object is just better, by most people's standards
22:11:59FromDiscord<Chronos [She/Her]> Better to have dedicated types with clear names
22:12:48FromDiscord<jviega> Yeah, if it's more than 2, maybe 3 items, or if the data object is going to be used across more than a function or so, an object is generally better
22:17:10FromDiscord<Elegantbeef> Tuples cannot be runtime indexed
22:17:19FromDiscord<Elegantbeef> Tuples are also structurally typed
22:18:19FromDiscord<jviega> Well sure, not at runtime, but if you aren't treating it as a mini struct anyway, you're doing it wrong. Never even occured to me people might try dynamic indices 🙂
22:24:41*derpydoo quit (Ping timeout: 246 seconds)
22:31:53FromDiscord<Elegantbeef> I mostly agree with Odin's stance of multi return types
22:32:31FromDiscord<Elegantbeef> It does not have tuples but it does have `name :: proc(..) -> (X, Y)`
22:33:08FromDiscord<Elegantbeef> Using tuples is generally a code smell in my view, though there are cases they're completely fine
22:33:27FromDiscord<Elegantbeef> I really like using them as varadic generics
22:34:56FromDiscord<Chronos [She/Her]> My event system thing uses them by unpacking a tuple to be used when calling a proc :p
22:35:11FromDiscord<Chronos [She/Her]> https://github.com/Nimberite-Development/Trigger-Nim
22:35:56FromDiscord<Elegantbeef> Right, did I ever mention I added part of that functionality to Micros? 😄
22:36:03FromDiscord<Chronos [She/Her]> https://github.com/Nimberite-Development/Trigger-Nim/blob/main/src/trigger.nim#L22 here
22:36:11FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Right, did I ever": Oh? You haven't actually lol
22:36:24FromDiscord<Elegantbeef> https://github.com/beef331/micros/blob/master/src/micros/introspection.nim
22:37:20FromDiscord<Chronos [She/Her]> Epic!
22:37:31FromDiscord<Chronos [She/Her]> No reason for me to use micros as a dep for this single piece of code tho xD
22:37:52FromDiscord<Chronos [She/Her]> Also I wonder how well this would even map to C, probably pretty poorly lol (the API)
22:38:12FromDiscord<jviega> I think it's fine for something small like splitPath()
22:38:28FromDiscord<jviega> Esp when named, that's basically an object at that point.
22:38:37FromDiscord<Elegantbeef> I do really want to have micros full of things like this
22:38:37FromDiscord<Elegantbeef> Right jviega, that's a return type meant to be directly consumed
22:39:03FromDiscord<Elegantbeef> People base entire libraries on tuples and it's such a typeless hellscape
22:39:11FromDiscord<jviega> I do hate unpacking syntaxes and the overloading of the parenthesis
22:40:40FromDiscord<Elegantbeef> Meh the syntax is the least of my issues
22:40:45FromDiscord<.aingel.> In reply to @Elegantbeef "Tuples cannot be runtime": Whats an example when u want to runtime index something? Also what do you mean by structurally typed?
22:41:15FromDiscord<Elegantbeef> I mean I do not have a case right now, but I've seen it and ran into it myself
22:41:37FromDiscord<Elegantbeef> Structural typing is where only the fields have to match type
22:41:54FromDiscord<jviega> "structurally typed" means type equality occurs when the structure of the object is the same, even if the names are different
22:42:04FromDiscord<Chronos [She/Her]> In reply to @.aingel. "Whats an example when": Choosing options from a fixed array based on user input, perhaps?
22:42:05FromDiscord<.aingel.> Oh gotcha @jviega
22:42:22FromDiscord<Chronos [She/Her]> For the first question
22:42:30FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Ha9
22:42:33FromDiscord<.aingel.> In reply to @chronos.vitaqua "For the first question": Oh so u can't do that with tuples?
22:42:47FromDiscord<Elegantbeef> whoops
22:42:49FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Haa
22:42:52FromDiscord<Chronos [She/Her]> Nope, at least, I don't think so according to Beef
22:42:58FromDiscord<.aingel.> Gotcha
22:43:03FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Hab
22:43:33FromDiscord<.aingel.> How do you use the nim bot thing on discrd btw
22:43:39FromDiscord<.aingel.> Nim eval or whatever it is
22:43:58FromDiscord<jviega> Wow, `let` to a constant isn't treated as a constant?
22:44:14FromDiscord<Elegantbeef> Of course not
22:44:16FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Had
22:44:20FromDiscord<Elegantbeef> What if you take the address of it somewhere
22:44:46FromDiscord<jviega> I mean, you can take the address of static data
22:44:48FromDiscord<.aingel.> In reply to @jviega "Wow, `let` to a": let is evaluated at run time right
22:45:12FromDiscord<Elegantbeef> You'd have to analyse the entire usage of the variable
22:45:18FromDiscord<.aingel.> In reply to @Elegantbeef "You need to do": Yeah I was thinking that you could do some sort of if statement and then put a constant in there
22:45:32FromDiscord<Elegantbeef> And if you write to that address?
22:46:03FromDiscord<Elegantbeef> Of course that proc only works on homogenously typed tuples
22:46:27FromDiscord<jviega> I suppose when `let` means "this one data object won't change, but its contents might"...
22:46:46FromDiscord<Elegantbeef> Well you can also override `let`
22:47:49FromDiscord<jviega> Personally, I'd rather just have `var` and `const`, the extra performance you can eke out isn't worth the complex semantics in my view.
22:47:59FromDiscord<jviega> Still I use `let` all the time
22:48:04FromDiscord<Elegantbeef> Eh immutability is nice
22:48:14FromDiscord<jviega> Except it's not really immutable
22:48:21FromDiscord<Elegantbeef> Except it is
22:48:23FromDiscord<jviega> In the sense that people except
22:48:25FromDiscord<jviega> expect
22:48:50FromDiscord<Elegantbeef> Nim is a language that says the programmer knows better
22:48:51FromDiscord<jviega> No, because you can still go into an "immutible" object and change its mutable fields
22:49:04FromDiscord<jmgomez> I would love to see const ref in Nim ngl
22:49:04FromDiscord<Elegantbeef> If you tell the compiler you know what you're doing, it's on you
22:49:26FromDiscord<Elegantbeef> You cannot go into an immutable value object and change it
22:49:27FromDiscord<Elegantbeef> Plus with strict funcs you cannot mutate a ref
22:49:53FromDiscord<jviega> Yeah but that's what I mean about complex semantics
22:49:59FromDiscord<Elegantbeef> It's not that complex imo
22:52:13FromDiscord<jviega> For my experience with the typical programmer, they occasionally still get surprised when stuff that automatically passes by ref is mutated by a call-ee, even if they've been programming in the language for decades. Or when local changes AREN'T reflected when things are truly immutable across a call boundry. And those are much simpler semantics.
22:52:34FromDiscord<Elegantbeef> jmgomez with `type ConstRef[T: ref] = distinct T` and `.` macros we technically can have const refs with an ok API
22:54:10FromDiscord<.aingel.> Is there a Debug Adapters DAP implementation for nim?
22:54:21FromDiscord<.aingel.> (edit) "Adapters DAP" => "Adapter (DAP)"
22:54:29FromDiscord<jviega> I'm personally fine with most levels of complexity. I've done most of my programming in life in C or some variant 🙂 But I care a lot about usability, let's remove as much of the knowledge burden from other smart people as possible. Not everyone cares about compilers, etc. How simple can you make it to equip them to be effective at what THEY do.
22:54:42FromDiscord<Chronos [She/Her]> In reply to @.aingel. "How do you use": !eval echo "Hi"
22:54:48FromDiscord<Chronos [She/Her]> Uh
22:54:53FromDiscord<Chronos [She/Her]> !eval echo "Hi"
22:54:56FromDiscord<Chronos [She/Her]> Hm
22:54:56NimBotHi
22:55:07FromDiscord<Chronos [She/Her]> Oh there it is, just very slow lol
22:55:32FromDiscord<.aingel.> It seems to work better on IRC haha
22:55:32FromDiscord<jviega> Honestly, Nim's a lot better on that front than most languages in its class, which is part of why I'm here.
22:55:43FromDiscord<jviega> But it was mostly on accident I think 🙂
22:56:09FromDiscord<Elegantbeef> I'd say that the present `let` semantics are a bit more useful than immutable refs
22:56:29FromDiscord<Elegantbeef> In your case you declare all `ref` as `var` and then can mutate where they point
22:56:39FromDiscord<millymox> sent a code paste, see https://play.nim-lang.org/#ix=4Hai
22:57:48FromDiscord<jmgomez> @jviega you seem to have a love/hate relationship with Nim 😛
22:58:01FromDiscord<jviega> I suppose
22:58:42FromDiscord<jmgomez> In reply to @Elegantbeef "jmgomez with `type ConstRef[T:": yes, I guess. A bit convoluted but could work
22:59:24FromDiscord<jviega> I would say I've always loved languages and compilers. Used to teach uni classes on them at NYU too. Every language makes trade-offs, so will have stuff one doesn't like. I don't expect any to make all the tradeoffs I would make.
23:00:22NimEventerNew thread by Millymox: How do i add and utilze a nested object when wrapping JS?, see https://forum.nim-lang.org/t/10510
23:01:45FromDiscord<.aingel.> How do you get syntax highlight in the code blocks?
23:01:54FromDiscord<.aingel.> On discord
23:02:05FromDiscord<jmgomez> In reply to @jviega "I would say I've": Yes, that's a good take. I guess Nim is plus attractive on that context because you could technically build small things that you miss
23:02:12FromDiscord<millymox> In reply to @.aingel. "How do you get": Put the language just before making a new Line to input code block
23:02:26FromDiscord<millymox> sent a code paste, see https://play.nim-lang.org/#ix=4Hal
23:02:28FromDiscord<.aingel.> Ahh gotcha
23:02:28FromDiscord<millymox> sent a code paste, see https://play.nim-lang.org/#ix=
23:02:34FromDiscord<.aingel.> Thank you!
23:02:37FromDiscord<millymox> Np!
23:03:23FromDiscord<jviega> Yeah. I think there are plenty of corners of the language that are messy, where people dinked around a lot and things aren't polished enough. And I don't love that. But they're mostly in the corners, where most people don't see them. And I do like that.
23:03:51FromDiscord<jviega> Concepts for instance, are still pretty half baked
23:04:11FromDiscord<Elegantbeef> Don't you insult those poor little guys
23:04:13FromDiscord<jmgomez> Yeah, I feel that too. But it's kind of normal, there arent much resources
23:04:16FromDiscord<Elegantbeef> Concepts are lovely in their present state
23:05:14FromDiscord<jviega> The danger zone I think is with generics, especially the interaction with UFCS, but in general, I think when I've seen people stray outside the basic functionality zone, they tend to feel like they're playing "guess the syntax"
23:06:10FromDiscord<jmgomez> you mean the `[:` thing?
23:06:47FromDiscord<jviega> IDK, Beef. I've used them one or two places just fine, but EVERYONE we see ask questions about them ends up having a hard time wrapping their head around the fact that they're compile-time only. They really want to basically have as much static checking as possible, and then a boxed object at runtime, and have it be all automatic. Everyone expects interfaces
23:06:59FromDiscord<Chronos [She/Her]> Really wish I could make my own language sigh, but I just don't really have the motivation for them
23:07:20FromDiscord<Chronos [She/Her]> In reply to @jviega "IDK, Beef. I've used": Haha my mistake :p
23:07:21FromDiscord<Elegantbeef> Yea I don't disagree there
23:07:24FromDiscord<Elegantbeef> But once you grok them you realise that it's grand, plus I've got traitor 😛
23:07:30FromDiscord<jviega> Yeah, more that if you don't know about [: the errors you end up with are often a big surprise in most ways
23:08:11FromDiscord<jmgomez> In reply to @jviega "IDK, Beef. I've used": Yeah, but as you said the issue is expectations not concepts itself. Concepts are a good take on parametric polymorphism, better than others IMO
23:08:28*krux02 quit (Remote host closed the connection)
23:08:56FromDiscord<jviega> I don't think they add enough value over the parametric polymorphism that's already there if you then have to manually translate to dynamic types
23:08:59FromDiscord<jmgomez> In reply to @jviega "Yeah, more that if": right, but this is more like a first class problem. Bugs are worst than that when they appear. It was disccused not so long ago in the compiler, and seems fixable
23:09:27FromDiscord<jmgomez> (edit) "In reply to @jviega "Yeah, more that if": right, but this is more like a first ... class" added "world"
23:09:51FromDiscord<jmgomez> (edit) "compiler," => "internal channel,"
23:10:05FromDiscord<jviega> For me personally, I always hated the C++ style for generics, and preferred the ML style, where they're just type variables. `x is better than [T] for me
23:11:17FromDiscord<Elegantbeef> Any example of that ML style?
23:11:36FromDiscord<jviega> I just gave you one 🙂
23:11:42FromDiscord<jmgomez> I prefer ML style too over C++ but I have to grant to C++ the flexibility that Nim seems inspired by
23:12:05FromDiscord<Elegantbeef> No you didnt
23:12:06FromDiscord<jviega> Yeah, if you want to constrain the types more you need to do something else
23:12:09FromDiscord<Elegantbeef> You just said `x` is better than `[T]` but without context that means less than Nothing
23:12:13FromDiscord<jviega> Sure
23:12:44FromDiscord<jmgomez> In reply to @jviega "Yeah, if you want": that's why concepts exists in both langs 🙂
23:13:08FromDiscord<jviega> sent a code paste, see https://play.nim-lang.org/#ix=
23:13:43FromDiscord<Elegantbeef> So implicit generics
23:13:44FromDiscord<Elegantbeef> Gotcha
23:14:00FromDiscord<jviega> sent a code paste, see https://play.nim-lang.org/#ix=
23:14:09FromDiscord<jviega> There's nothing implicit about it. I still give a name to the types.
23:14:16FromDiscord<Elegantbeef> I mean it's implicit
23:14:26FromDiscord<jviega> ML did do type inference of course, but that's beside the point
23:14:29FromDiscord<Elegantbeef> `proc sort(a: auto): typeof(a)`
23:14:35FromDiscord<jviega> ML was the first language w/ generics
23:15:28FromDiscord<jmgomez> I mean, what I like more (or used to) about the ML family is the strictness. But nowdays I think I prefer flexibility
23:16:10FromDiscord<jviega> You can get flexibility w/ a syntax where you don't have to overload the bracket that badly if types can be first class parameters
23:17:01FromDiscord<Elegantbeef> Just use Zig style generics with Nim UFCS
23:17:16FromDiscord<jviega> I've done some pretty involved hindley-milner based systems with tons of features
23:18:18FromDiscord<jmgomez> didnt look into Zig yet, doesnt attract me much but I guess I will to take the time to go over it at some point
23:18:32FromDiscord<jmgomez> In reply to @jviega "I've done some pretty": oh really? You should help with the compiler 😛
23:18:37FromDiscord<jviega> Anyway, my wife isn't thrilled with this discussion on type systems, and would much rather follow through on our dinner plans.
23:18:57FromDiscord<Langosta> you should invite her!
23:19:03FromDiscord<Elegantbeef> Zig doesnt have generics and to do it you have to make a function that takes in the typedesc
23:19:08FromDiscord<Langosta> I'm sure she would love to talk more about tuples and type systems
23:19:21FromDiscord<Chronos [She/Her]> Generics are something I like tbh
23:19:25FromDiscord<Elegantbeef> so like `proc sort(t: typedesc, s: ptr UncheckedArray[t]) ...`
23:19:31FromDiscord<jviega> I think Nim's got too much legacy cruft for me to want to wade in that deep. Maybe if I cared enough about something I'd do some small PRs, but wouldn't get excited to work on it
23:20:00FromDiscord<Elegantbeef> Araq wants to replace the Nim TypeNodes so it's the perfect time!
23:20:25FromDiscord<Elegantbeef> Or atleast clean it up
23:20:31FromDiscord<jmgomez> exactly, I had zero experience with compilers before Nim and didnt find the code that legacy
23:20:43FromDiscord<jmgomez> Im also used to UE which is real legacy 😛
23:21:14FromDiscord<jmgomez> In reply to @Elegantbeef "so like `proc sort(t:": I see, thanks
23:21:58FromDiscord<jviega> I mean, how many different memory managers are there again?
23:22:25FromDiscord<jviega> Okay see ya!
23:22:33FromDiscord<Elegantbeef> There are really only 3( + JS) supported ones
23:32:13FromDiscord<millymox> In reply to @Elegantbeef "There are really only": How can i make an option param for a proc?
23:34:04FromDiscord<Chronos [She/Her]> In reply to @millymox "How can i make": Option param as in default value?
23:34:17FromDiscord<Chronos [She/Her]> Or as in actual Option type
23:34:26FromDiscord<millymox> No like a param that basically doesn’t need to be set its purely optional
23:34:54FromDiscord<millymox> Proc main(param1: string)
23:34:59FromDiscord<Chronos [She/Her]> And if it's not set, does nothing in the code? Assuming a boolean doesn't work
23:35:08FromDiscord<millymox> Yeah does nothing
23:35:11FromDiscord<Chronos [She/Her]> Does an empty string work? `param1: string = ""`?
23:35:30FromDiscord<Chronos [She/Her]> It's the go-to for most people
23:35:33FromDiscord<millymox> What about a Boolean?
23:35:45FromDiscord<millymox> Optionally set true por false or leave blank
23:35:50FromDiscord<millymox> Or
23:36:13FromDiscord<Chronos [She/Her]> Booleans have to be true or false, but you can use `std/options`
23:36:57FromDiscord<Chronos [She/Her]> It has an `Option` type, so you could do `var a = none(bool)` for example, and that'd mean that no value was given
23:36:58FromDiscord<Chronos [She/Her]> Hold on
23:37:47FromDiscord<Chronos [She/Her]> sent a long message, see http://ix.io/4Haw
23:37:49FromDiscord<Chronos [She/Her]> I hope that works lol
23:38:04FromDiscord<millymox> sent a code paste, see https://paste.rs/S2dGj
23:38:37FromDiscord<Chronos [She/Her]> Nope it most definitely will not lol
23:38:48FromDiscord<Chronos [She/Her]> Why are you doing `show = bool`?
23:38:55FromDiscord<Chronos [She/Her]> `bool` is the type
23:39:11FromDiscord<Chronos [She/Her]> You probably want `show = false` since that's considered the default value for everything
23:39:21FromDiscord<Chronos [She/Her]> Though look at the docs
23:39:26FromDiscord<Chronos [She/Her]> They may say something different
23:39:28FromDiscord<Chronos [She/Her]> (JS docs)
23:39:39FromDiscord<Chronos [She/Her]> I'm not an expert in the JS backend really
23:39:50FromDiscord<millymox> ahh okay okay thank you
23:39:58FromDiscord<Chronos [She/Her]> Sorry aha
23:40:00FromDiscord<millymox> ill see the show = false
23:40:04FromDiscord<millymox> Np np
23:41:03FromDiscord<millymox> In reply to @chronos.vitaqua "You *probably* want `show": This works!
23:41:06FromDiscord<millymox> Thanks so much
23:41:31FromDiscord<Chronos [She/Her]> Eyy nice!
23:45:25FromDiscord<millymox> Yep!