00:08:15 | * | noeontheend quit (Ping timeout: 272 seconds) |
00:12:24 | * | noeontheend joined #nim |
00:16:30 | FromDiscord | <TryAngle> how can I exit a nim program on a error that is not an error |
00:16:38 | FromDiscord | <TryAngle> something like rusts panic! and todo! |
00:16:44 | FromDiscord | <TryAngle> (edit) "something like rusts panic! and todo! ... " added "or unimplemented!" |
00:16:47 | FromDiscord | <Elegantbeef> `quit` |
00:17:19 | FromDiscord | <TryAngle> In reply to @Elegantbeef "`quit`": 👍 |
00:19:18 | FromDiscord | <Elegantbeef> Or if you're really lazy you can always go for the ol' faithful `assert false, "unimplemented"` |
00:25:51 | FromDiscord | <TryAngle> In reply to @Elegantbeef "Or if you're really": lol true |
00:26:39 | FromDiscord | <TryAngle> does tryRecv block?↵or does dataAvailable == false and no block? |
00:27:21 | FromDiscord | <Elegantbeef> channels? |
00:27:34 | FromDiscord | <TryAngle> ye |
00:28:39 | FromDiscord | <Elegantbeef> It's non blocking |
00:28:56 | FromDiscord | <TryAngle> ok ty |
00:29:17 | FromDiscord | <carlosri> Hi everyone, I have a friend who is realy into nim, and get me interested in the language. I wonder if it is posible to make an android app using nim without android studio? |
00:29:41 | FromDiscord | <Elegantbeef> Due to how android software works kinda |
00:29:57 | FromDiscord | <Elegantbeef> You will need to get a basic java program to compile, but you can use ndk to include your Nim code |
00:33:22 | FromDiscord | <Elegantbeef> https://github.com/yglukhov/nimx i think does support android so you can look at what they do |
00:36:09 | FromDiscord | <treeform> In reply to @carlosri "Hi everyone, I have": I would just use Android studio. It's not that bad once you have everything setup. It will sign everything and work well with google play. If you want to do anything advanced with Android it will require some sort of Java shim anyways. |
00:36:29 | FromDiscord | <Elegantbeef> It's tedious as hell to setup and get the proper sdk ime |
00:36:29 | FromDiscord | <carlosri> In reply to @Elegantbeef "You will need to": thanks ,will give it a look |
00:36:32 | FromDiscord | <Elegantbeef> But ymmv |
00:37:27 | FromDiscord | <treeform> Android studio is a huge pain. But once you have it going you just open it to press build, play in simulator or upload to phone. You don't have to use it for writing your code, just compiling. |
00:37:56 | FromDiscord | <treeform> some instructions here: https://github.com/treeform/glfm |
00:38:54 | FromDiscord | <treeform> example draws a openGl triangle in nim with NDK on android |
00:39:06 | FromDiscord | <treeform> (and iOS) |
00:39:25 | FromDiscord | <TryAngle> is this still compatible with nim? https://github.com/haxscramper/hmatching |
00:39:53 | * | noeontheend quit (Ping timeout: 244 seconds) |
00:41:14 | FromDiscord | <Elegantbeef> Probably does |
00:41:42 | * | nullsh quit (Ping timeout: 260 seconds) |
00:55:03 | * | nullsh joined #nim |
01:04:58 | FromDiscord | <Arathanis> Can anyone explain whats going on here? Trying to play with concepts and adapt the Functor example in the experimental docs: https://media.discordapp.net/attachments/371759389889003532/996582979763720212/unknown.png |
01:05:27 | FromDiscord | <Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=44cW |
01:06:21 | FromDiscord | <Elegantbeef> All this sugar is giving me eye cancer |
01:06:32 | FromDiscord | <Arathanis> i can de-sugar it real fast if thar helps |
01:07:09 | FromDiscord | <Elegantbeef> I've got it |
01:08:39 | FromDiscord | <Arathanis> also the echo for `Option[int] is Functor` prints false, even the code in the docs does not work as expected. |
01:09:13 | FromDiscord | <Arathanis> (edit) "false," => "false;" | "expected." => "expected and prints false." |
01:10:01 | FromDiscord | <Arathanis> i should have stripped some of the superfluous code from this, oh well |
01:10:05 | FromDiscord | <Arathanis> let me know if you want me to clean it up |
01:10:17 | FromDiscord | <Elegantbeef> I can write Nim, i think |
01:10:35 | FromDiscord | <Arathanis> oh i just meant theres random test code that has nothing to do with the question im asking that I should remove |
01:10:41 | FromDiscord | <Arathanis> i very well know you can write Nim lol |
01:10:45 | FromDiscord | <Arathanis> sorry |
01:16:24 | FromDiscord | <TryAngle> can I leak ref object fields somehow? something like java's public static |
01:16:44 | FromDiscord | <Elegantbeef> You dont mean leak do you? |
01:16:50 | FromDiscord | <carlosri> In reply to @treeform "I would just use": mi pc can't handle android studio |
01:17:03 | FromDiscord | <TryAngle> In reply to @Elegantbeef "You dont mean leak": I mean leak in syntax way, not memory way |
01:17:10 | FromDiscord | <Elegantbeef> So the first issue arath is that you passed the `type` in the parameter |
01:17:23 | FromDiscord | <Elegantbeef> `A -> S` or w/e is a type not an instance |
01:17:30 | FromDiscord | <Elegantbeef> But now we have another issue |
01:18:11 | FromDiscord | <Elegantbeef> There is no way to instantiate the `S` |
01:19:01 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44cZ |
01:19:08 | FromDiscord | <Elegantbeef> How does one instantiate a `S` for the `fmap`? |
01:20:01 | FromDiscord | <Arathanis> Ahhh ok. |
01:21:32 | FromDiscord | <Arathanis> So are the docs just incorrect right now? |
01:21:45 | FromDiscord | <Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=44d1 |
01:21:57 | FromDiscord | <Elegantbeef> let's see |
01:21:57 | FromDiscord | <Arathanis> which I was adapting from |
01:25:10 | FromDiscord | <Elegantbeef> It might not be wrong just relying on a legacy API, need to look harder myself |
01:31:39 | FromDiscord | <Elegantbeef> Yea i think it's wrong |
01:31:45 | FromDiscord | <Elegantbeef> I cannot see how it can instantiate the `T` |
01:31:59 | FromDiscord | <Arathanis> I see what you are saying, I figured high magic was going on |
01:39:12 | NimEventer | New Nimble package! nimiSlides - Create Reveal.js slideshows in Nim, see https://github.com/HugoGranstrom/nimib-reveal/ |
01:40:30 | * | noeontheend joined #nim |
01:43:05 | FromDiscord | <Elegantbeef> Niifty another nice doc tool |
01:44:10 | FromDiscord | <Elegantbeef> Yea arath i tried a bunch of things but couldnt get it to compile |
01:44:21 | FromDiscord | <Elegantbeef> Even an example that had a `Functor[X, S]` |
01:44:35 | FromDiscord | <Arathanis> yeah im fiddling with it too, same results |
01:46:52 | FromDiscord | <Elegantbeef> The issue seems to be the procedure callback |
01:48:18 | FromDiscord | <Elegantbeef> Oh it might be the usage of `genericHead` |
01:48:23 | FromDiscord | <Elegantbeef> Actually nevermind |
01:49:06 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=44d5 |
01:49:34 | FromDiscord | <TryAngle> (edit) "https://play.nim-lang.org/#ix=44d5" => "https://play.nim-lang.org/#ix=44d6" |
01:49:37 | FromDiscord | <Elegantbeef> Does gflw not allow user data? |
01:49:54 | FromDiscord | <Elegantbeef> Eventually i''l write that properly aswell |
01:50:07 | FromDiscord | <Elegantbeef> Most callback libraries allow attaching userdata |
01:50:12 | FromDiscord | <TryAngle> In reply to @Elegantbeef "Does gflw not allow": what do you mean? From what I konw is u have to add Callback functions |
01:51:09 | FromDiscord | <TryAngle> `SIGSEGV: Illegal storage access. (Attempt to read from nil?)` I get this error when eventLoop.windowHandleToId[handle] is called |
01:52:00 | FromDiscord | <Elegantbeef> Is eventloop heap or stack allocated? |
01:52:12 | FromDiscord | <TryAngle> In reply to @Elegantbeef "Is eventloop heap or": it's a ref |
01:52:39 | FromDiscord | <Elegantbeef> Ok so then you can do `GcRef` to allow it to outlive it's scope |
01:52:48 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=44d8 |
01:52:58 | FromDiscord | <Elegantbeef> I mean you can use global variables |
01:53:10 | FromDiscord | <Elegantbeef> If it's easier/safer for you to write it that way do it that way |
01:53:19 | FromDiscord | <TryAngle> In reply to @Elegantbeef "Ok so then you": what do you eman? |
01:53:26 | FromDiscord | <TryAngle> does that work on ARC / ORC aswell? |
01:53:32 | FromDiscord | <Elegantbeef> Yes |
01:53:42 | FromDiscord | <TryAngle> ok what is GcRef |
01:53:52 | FromDiscord | <Elegantbeef> It increments the reference counter manually |
01:53:57 | FromDiscord | <Elegantbeef> as the name implies |
01:54:09 | FromDiscord | <TryAngle> yes but how do I use it 😄 |
01:54:19 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44d9 |
01:54:27 | FromDiscord | <Elegantbeef> How do you think you use it? |
01:54:43 | FromDiscord | <Elegantbeef> I know i'm rather kind but can people atleast attempt to look before asking follow ups |
01:54:57 | FromDiscord | <TryAngle> In reply to @Elegantbeef "How do you think": is it a pragma 😐 |
01:55:17 | FromDiscord | <Elegantbeef> No |
01:55:19 | FromDiscord | <Elegantbeef> It's a procedure |
01:56:19 | FromDiscord | <Arathanis> makes my head hurt |
01:56:22 | FromDiscord | <Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=44da |
01:57:24 | FromDiscord | <Elegantbeef> It gets even worse |
01:57:30 | FromDiscord | <Arathanis> oh no |
01:57:36 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44db |
01:57:51 | FromDiscord | <Arathanis> hug |
01:57:56 | FromDiscord | <Elegantbeef> Even the new concepts dont work |
01:57:58 | FromDiscord | <Arathanis> (edit) "hug" => "guh" |
01:58:15 | FromDiscord | <Arathanis> what do you mean "the new concepts"? |
01:58:29 | FromDiscord | <Elegantbeef> I mean what i said |
01:58:38 | FromDiscord | <Elegantbeef> Nim has a new concept API |
01:58:53 | FromDiscord | <Elegantbeef> Instead of using when compiles magic it just does the look ups |
01:58:58 | FromDiscord | <Arathanis> wow, where do you even find information like that |
01:59:21 | FromDiscord | <Elegantbeef> RFCs and PRs |
01:59:25 | FromDiscord | <Arathanis> ah got it |
01:59:34 | FromDiscord | <Arathanis> so new style concepts dont work either |
01:59:49 | FromDiscord | <Elegantbeef> Well they do just not for this case |
02:00:45 | FromDiscord | <Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=44dd |
02:00:51 | FromDiscord | <Arathanis> in this case `apply` = `fmap` |
02:01:03 | FromDiscord | <Elegantbeef> Well a similar thing |
02:01:11 | FromDiscord | <Elegantbeef> It's this |
02:01:12 | FromDiscord | <Arathanis> similar enough to demonstrate that it does not work |
02:01:22 | FromDiscord | <Girvo> Hi all 🙂 |
02:01:30 | FromDiscord | <Elegantbeef> It's very much the proc declaration that causes the issue |
02:01:41 | FromDiscord | <Arathanis> i very much want concepts to work haha |
02:01:43 | FromDiscord | <Elegantbeef> So lets see if we can contort the compiler |
02:01:49 | FromDiscord | <Arathanis> specifically this kind of concept |
02:02:02 | FromDiscord | <Arathanis> In reply to @Elegantbeef "So lets see if": should i get a crowbar? :P |
02:02:08 | FromDiscord | <Elegantbeef> Nah |
02:02:24 | FromDiscord | <Elegantbeef> You just have to play darts until you can change the evaluation enough that it behaves differently |
02:03:16 | FromDiscord | <Elegantbeef> Fuck yea |
02:03:24 | FromDiscord | <Elegantbeef> Compiles |
02:03:28 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44df |
02:03:39 | FromDiscord | <Elegantbeef> So now back to the docs example |
02:04:07 | FromDiscord | <Arathanis> Are there docs for the new concept API you are using somewhere? |
02:04:18 | FromDiscord | <Elegantbeef> Nope |
02:04:39 | FromDiscord | <Elegantbeef> They're 'very' experimental |
02:04:48 | FromDiscord | <Arathanis> capital V Very |
02:04:52 | FromDiscord | <Arathanis> (edit) "V" => "'V'" |
02:05:01 | FromDiscord | <Elegantbeef> I mean i've used them with great effect |
02:05:42 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/RFCs/issues/168 is the RFC |
02:06:50 | FromDiscord | <Dino> hello, I'm learning nim and I have a question about` nimporter`/`nimpy` - hopefully this is an appropriate place for it. If not let me know. ↵↵Basically, I'm curious if there is a way to make it so that things imported in nim that are not things you will call in python can stay nim without having to rewrite all of them with the `{.exportpy.}` thing? I realize if it imports them, they use them, but is there a way to 'compile' that porti |
02:07:06 | FromDiscord | <Dino> (edit) "hello, I'm learning nim and I have a question about` nimporter`/`nimpy` - hopefully this is an appropriate place for it. If not let me know. ↵↵Basically, I'm curious if there is a way to make it so that things imported in nim that are not things you will call ... in" added "directly" |
02:07:49 | FromDiscord | <Elegantbeef> No Nim/C compilers do dead code elimination so the code is just not considered |
02:08:31 | FromDiscord | <Elegantbeef> Also they do name mangling |
02:08:42 | FromDiscord | <Dino> Fair enough. I figured it was lofty, but it would've saved me a ton of time so figured worth asking. |
02:09:12 | FromDiscord | <Elegantbeef> Arath hopefully that workaround helps you a bit |
02:09:33 | FromDiscord | <Arathanis> yeah gonna approach it using the new knowledge see if I can find purchase |
02:09:46 | FromDiscord | <Elegantbeef> It probably also works with the new syntax aswell then |
02:10:35 | FromDiscord | <Elegantbeef> Nope nevermind |
02:35:36 | * | arkurious quit (Quit: Leaving) |
02:45:34 | * | wallabra_ joined #nim |
02:47:20 | * | wallabra quit (Ping timeout: 260 seconds) |
02:47:20 | * | wallabra_ is now known as wallabra |
02:56:07 | * | sagax joined #nim |
02:59:09 | * | wallabra quit (Quit: ZNC 1.8.2 - https://znc.in) |
03:00:43 | * | wallabra joined #nim |
03:18:32 | * | wallabra_ joined #nim |
03:20:35 | * | wallabra quit (Ping timeout: 244 seconds) |
03:20:35 | * | wallabra_ is now known as wallabra |
04:04:35 | * | noeontheend quit (Ping timeout: 255 seconds) |
04:06:11 | * | toluene quit (Quit: Ping timeout (120 seconds)) |
04:09:35 | * | toluene joined #nim |
04:34:42 | FromDiscord | <xflywind> sent a code paste, see https://play.nim-lang.org/#ix=44dG |
04:35:10 | FromDiscord | <xflywind> It doesn't work with Arc/Orc, is there a known issue or intended? |
04:35:22 | FromDiscord | <xflywind> (edit) "there" => "it" |
04:40:01 | * | kenran joined #nim |
04:40:12 | FromDiscord | <Elegantbeef> It might just be a bug, I dont have a clue |
04:40:31 | FromDiscord | <xflywind> I see, thanks. Just filed one. |
04:41:45 | * | kenran quit (Client Quit) |
04:42:17 | FromDiscord | <Elegantbeef> A similar thing is that `GcRef` and `GcUnref` dont work with `seq` and `string` |
04:43:22 | FromDiscord | <xflywind> Yeah, I hope not many libraries use it. |
04:44:01 | FromDiscord | <Rika> I don’t think most do |
04:44:06 | FromDiscord | <Rika> Maybe those by advanced users |
04:45:34 | FromDiscord | <Elegantbeef> It adds another pointer indirection but it's not big deal |
04:45:54 | FromDiscord | <Elegantbeef> Have to use `ref string` or `ref seq[T]` if you pass the ref as a pointer |
04:46:10 | FromDiscord | <Elegantbeef> It probably creates 'safer' code though |
04:46:32 | FromDiscord | <Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=44dJ |
04:46:50 | FromDiscord | <Elegantbeef> No clue it still doesnt have a way to instantiate the S if you ask me |
04:47:07 | FromDiscord | <Arathanis> That is apparently exactly what each is supposed to solve |
04:47:14 | FromDiscord | <Arathanis> https://media.discordapp.net/attachments/371759389889003532/996638914267848744/unknown.png |
04:47:37 | FromDiscord | <Elegantbeef> Ah ok it's `auto` |
04:47:53 | FromDiscord | <Arathanis> yeah I read it as "for all types" kind of thing |
04:48:05 | FromDiscord | <Arathanis> or maybe `each T: Hashable` will be syntactically valid |
04:48:18 | FromDiscord | <Arathanis> semantically |
04:48:48 | FromDiscord | <Arathanis> (edit) "syntactically" => "~~syntactically~~ semantically" |
05:22:31 | * | sagax quit (Quit: Konversation terminated!) |
05:44:16 | CyberTailor | Error: Invalid node kind nnkBracketExpr for macros.`$` |
05:44:20 | CyberTailor | any macro gurus here? |
05:44:29 | FromDiscord | <Elegantbeef> Yes |
05:45:57 | CyberTailor | maybe i use "weave" wrong |
05:46:16 | FromDiscord | <Elegantbeef> Seems it's expecting a identifier or symbol and you passed a bracket expr |
05:46:19 | FromDiscord | <Elegantbeef> So probably generic related |
05:46:31 | FromDiscord | <Elegantbeef> If you can make a min repro make an issue |
05:48:10 | CyberTailor | what is bracket expr? |
05:48:40 | FromDiscord | <Elegantbeef> `someSymbol[someargs]` |
05:49:19 | CyberTailor | ah, i have seq[string] indeed |
05:49:37 | CyberTailor | so i need to make a type alias, i suppose |
05:50:05 | FromDiscord | <haxscramper> Yes↵(@TryAngle) |
05:50:30 | FromDiscord | <haxscramper> Yes it is compatible with nim 1.6.2 or whatever version I used at the time of writing |
05:51:06 | CyberTailor | yaay it works |
05:51:10 | FromDiscord | <haxscramper> Newer versions might have breakages that I didn't account for |
06:10:17 | CyberTailor | deadlocks, deadlocks |
06:10:22 | CyberTailor | of course deadlocks |
06:10:28 | CyberTailor | what could i expect |
07:00:02 | FromDiscord | <lantos> sent a long message, see http://ix.io/44e9 |
07:04:16 | * | rockcavera quit (Remote host closed the connection) |
07:27:06 | FromDiscord | <jan0809> neat |
08:45:00 | * | CyberTailor quit (Read error: Connection reset by peer) |
08:45:55 | * | CyberTailor joined #nim |
09:16:40 | FromDiscord | <Goel> Once i do this, am I 100% sure that the data contained in labelArray will reimain the same during all program execution?↵`let labelArray = makeLabelArray(40)` |
09:17:12 | FromDiscord | <Elegantbeef> Unless you use unsafe mechanisms yes |
09:17:28 | FromDiscord | <Elegantbeef> Or if it's a reference |
09:18:35 | FromDiscord | <Goel> I have this bug that i can't seem to figure out what causes it. Its probably from a C fall of a function of Raylib, because its data are modified after a nim procedure call |
09:18:43 | FromDiscord | <Rika> If it’s a reference and you don’t have strict functions or something on |
09:18:44 | FromDiscord | <Goel> (edit) "fall" => "call" |
09:23:35 | FromDiscord | <Goel> sent a code paste, see https://play.nim-lang.org/#ix=44eH |
09:24:08 | FromDiscord | <Elegantbeef> No |
09:24:19 | FromDiscord | <Goel> (edit) "https://play.nim-lang.org/#ix=44eH" => "https://play.nim-lang.org/#ix=44eI" |
09:24:22 | FromDiscord | <Elegantbeef> Nim does not have a mechanism to ensure data is never mutated in the entirety of runtime |
09:24:28 | FromDiscord | <Elegantbeef> `const` in Nim is compile time constant |
09:24:30 | FromDiscord | <Goel> (edit) "https://play.nim-lang.org/#ix=44eI" => "https://paste.rs/Y1x" |
09:24:56 | FromDiscord | <Goel> So how can i assure that the data won't be changed? |
09:25:05 | FromDiscord | <Elegantbeef> You dont mutate it 😄 |
09:25:43 | FromDiscord | <Goel> But i'm not mutating it, in fact, thats i call it a bug. I'm just using that array to read its data from, i'm not modifing any data |
09:25:48 | FromDiscord | <Elegantbeef> I assume `label` is an array of strings? |
09:26:18 | FromDiscord | <Goel> label is labelArray that is `array[40, cstring]` |
09:26:41 | FromDiscord | <Elegantbeef> And how is it being mutated? |
09:27:07 | FromDiscord | <Elegantbeef> And what bindings are you using? |
09:27:09 | FromDiscord | <Goel> All its data are changed to another value, that come from another Nim procedure (writeFile) |
09:27:12 | FromDiscord | <Rika> If you’re passing pointers of any sort you’re pretty much boned |
09:27:26 | FromDiscord | <Goel> But that procedure have nothing to do with labelArray, its not part of it nor it call it |
09:27:51 | FromDiscord | <Elegantbeef> Code |
09:27:53 | FromDiscord | <Elegantbeef> Give us code |
09:27:58 | FromDiscord | <Elegantbeef> I think i see the issue |
09:28:07 | FromDiscord | <Elegantbeef> You're doing `label[i] = myString.cstring` |
09:28:19 | FromDiscord | <Elegantbeef> Then mutating `myString` |
09:29:04 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44eK |
09:29:09 | FromDiscord | <Elegantbeef> Nim's `cstring` conversion on string is non allocating |
09:29:16 | FromDiscord | <Phil> so b is also world |
09:29:17 | FromDiscord | <Phil> ? |
09:29:34 | FromDiscord | <Elegantbeef> b is a pointer to the first element of `a` |
09:29:51 | FromDiscord | <Elegantbeef> I meant to do \`assert b == "world" |
09:30:50 | FromDiscord | <Elegantbeef> Actually that example is wrong |
09:31:40 | FromDiscord | <Goel> https://github.com/PrimaIVoid/nimRaylib_tests |
09:32:40 | FromDiscord | <Elegantbeef> Why are you using cstrings? |
09:32:43 | FromDiscord | <Elegantbeef> Just use strings |
09:33:10 | FromDiscord | <Elegantbeef> Cstrings are only meant for interop with the backend |
09:33:21 | FromDiscord | <Elegantbeef> you can convert a string ot a cstring without any cost |
09:34:43 | FromDiscord | <Goel> It seems like changing from `let` labelArray to `const` labelArray fixes it |
09:35:22 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/996711423558287380/unknown.png |
09:35:26 | FromDiscord | <retkid> i've been doing some ml |
09:35:32 | FromDiscord | <Elegantbeef> What's happening is you're copying pointers to a string and then they get collected and your data is getting replaced |
09:35:32 | FromDiscord | <Elegantbeef> cstring is an unsafe pointer |
09:35:38 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44eM |
09:36:13 | FromDiscord | <Elegantbeef> Yea in this case it will since you removed the pointers↵(@Goel) |
09:36:43 | FromDiscord | <Elegantbeef> But it's not cause it makes them immutable, it's cause it makes the collection at compile time so the cstrings are encoded in your program |
09:36:52 | FromDiscord | <Goel> So i can simply create a string in Nim and pass it into a C call of a cstring, without coverting it? |
09:37:02 | FromDiscord | <Goel> (edit) "coverting" => "converting" |
09:37:09 | FromDiscord | <Elegantbeef> you should do `cstring myString` |
09:37:18 | FromDiscord | <Elegantbeef> but yes you can do it without converting it with 1.6.6 |
09:37:26 | FromDiscord | <Elegantbeef> Though it's a warning as it's unsafe |
09:38:31 | FromDiscord | <Phil> In reply to @Elegantbeef "you can convert a": Why is that btw? Aren't nim strings all characters and an associated counter for the length of the string? |
09:38:46 | FromDiscord | <Elegantbeef> Cause Nim puts a `\0` at the end of the string data |
09:39:03 | FromDiscord | <Elegantbeef> this ensures you can give it to a procedure expecting a null terminated string without any issues |
09:39:17 | FromDiscord | <Phil> ... that's so pragmatic I'm asking myself why I thought it'd be complicated |
09:39:34 | FromDiscord | <Elegantbeef> No clue it's how most languages handle their pascal strings |
09:39:48 | FromDiscord | <Elegantbeef> You just have to make sure all growths/shrinks put that `\0` and you're golden |
09:40:04 | FromDiscord | <Tuatarian> Can I get nim to compile to a standalone .c file? |
09:40:09 | FromDiscord | <Tuatarian> Or .cpp I don't really care |
09:40:20 | FromDiscord | <Phil> Check, to see whether I got this correctly though, the inverse conversion would be an allocation, right?↵Since you'd need to put a number that is the length of the string where the null termination is and that is overall more memory than the cstring occupied previously, right? |
09:41:40 | FromDiscord | <Phil> Like, string --> cstring works because you don't need as much memory as you occupied before, you just, essentially chop some off.↵cstring --> string needs to reallocate some memory because a string needs more memory space than the same cstring, correct? |
09:42:09 | FromDiscord | <Phil> (edit) "same" => "equivalent" |
09:42:45 | FromDiscord | <TryAngle> In reply to @haxscramper "Newer versions might have": Ah ok thanks good to know bc this library looks sick, I remembered u wanted to rewrite some of ur libs to nim skull once derivations exist, is this the case for this library also or do I misremember all along? |
09:42:54 | FromDiscord | <Rika> In reply to @iWonderAboutTuatara "Can I get nim": No all files from Nim require nimbase.h |
09:43:14 | FromDiscord | <Rika> Well you can always manually preprocess it I guess |
09:43:27 | FromDiscord | <Rika> Yardanico did it but it’s kinda a pain so |
09:44:31 | FromDiscord | <Elegantbeef> not only that but it's also GC'd↵(@Phil) |
09:44:34 | FromDiscord | <Tuatarian> Asking since most online judges on codeforces, leetcode etc don't support nim |
09:44:37 | FromDiscord | <Elegantbeef> cstrings are not always gc'd |
09:47:39 | FromDiscord | <TryAngle> In reply to @iWonderAboutTuatara "Asking since most online": Is leet code not just a meme for jobs or do ppl actually grind it? |
09:47:41 | FromDiscord | <Phil> In reply to @Elegantbeef "not only that but": As in, the cstring is GC'd upon creation of the string?↵Hmm that's also the case with orc, right? |
09:48:02 | FromDiscord | <TryAngle> Or do u do competivie programming as hobby |
09:48:08 | FromDiscord | <Tuatarian> I don't do leetcode but it might be some fun to do codeforces |
09:48:11 | FromDiscord | <Tuatarian> Second one yeah |
09:48:30 | FromDiscord | <Tuatarian> It's a decent way to kill small amounts of time |
09:48:41 | FromDiscord | <TryAngle> Ah I see, that's really cool then 😎 |
09:48:52 | FromDiscord | <Tuatarian> Lmao thanks but I'm not good at it |
09:52:04 | FromDiscord | <Rika> https://web.archive.org/web/20210614091703/https://zen.su/posts/amalgamating-nim-programs/ |
10:16:16 | * | toluene quit (Quit: Ping timeout (120 seconds)) |
10:18:20 | * | toluene joined #nim |
10:20:51 | FromDiscord | <Yardanico> you can go to zeta.su |
10:20:57 | FromDiscord | <Yardanico> I sold zen.su :) |
10:29:51 | * | wallabra_ joined #nim |
10:31:29 | * | wallabra quit (Ping timeout: 244 seconds) |
10:31:29 | * | wallabra_ is now known as wallabra |
10:34:39 | FromDiscord | <Rika> I see |
11:00:03 | * | CyberTailor quit (Remote host closed the connection) |
11:00:07 | FromDiscord | <mirandaniel> Any idea if treeform/ws can be used to host a wss server too? |
11:01:06 | * | CyberTailor joined #nim |
11:01:38 | * | LyndsySimon quit (Quit: Connection closed for inactivity) |
11:03:57 | FromDiscord | <hotdog> In reply to @mirandaniel "Any idea if treeform/ws": I don't think so, but you can put a reverse proxy in front of it |
11:07:06 | FromDiscord | <laker31> Anyone know why `import nimsuggest/sexp` gives the following error?↵`Error: cannot open file: nimsuggest/sexp`↵↵I have installed Nim and its tool via choosenim. |
11:11:38 | FromDiscord | <planetis> not good enough you need to nimble install compiler |
11:12:29 | FromDiscord | <mirandaniel> In reply to @hotdog "I don't think so,": Do you know of any public key/private key encryption package? |
11:12:56 | FromDiscord | <enthus1ast> @mirandaniel libsodium |
11:13:28 | FromDiscord | <enthus1ast> or use ed25519 by hand and do the shared secret exchange, then use any other crypto |
11:14:12 | FromDiscord | <mirandaniel> thanks! |
11:14:17 | FromDiscord | <laker31> In reply to @planetis "not good enough you": Woo thank you! That fixed it 🙂 |
11:14:21 | FromDiscord | <Rika> In reply to @enthus1ast "or use ed25519 by": Scary |
11:15:00 | FromDiscord | <enthus1ast> @mirandaniel\: another smaller option is to use https://github.com/enthus1ast/nimMonocypher/blob/master/monocypherll.nim |
11:15:11 | FromDiscord | <enthus1ast> but this is a low leve wrapper over monocypher |
11:15:27 | FromDiscord | <enthus1ast> why?↵(@Rika) |
11:15:54 | xigoi | @Yardanico why did you sell it? |
11:16:09 | FromDiscord | <Phil> My eyes glaze over the second I even think of looking at the libsodium docs. I'm... Too ignorant for that level of cryptographic knowledge still |
11:16:10 | FromDiscord | <mirandaniel> Interesting |
11:16:34 | FromDiscord | <enthus1ast> i think the libsodium docs are superb |
11:17:00 | FromDiscord | <Phil> Though I guess demos blog took some of the fear away from looking at c |
11:34:12 | FromDiscord | <Rika> I think sodium is one of the simpler libraries for cryptography so far |
11:55:38 | FromDiscord | <planetis> There was an unsafe set the case discriminator for object variants, somewhere? How is it called? |
11:57:01 | FromDiscord | <planetis> Was I dreaming it, why I can't find it anywhere... |
11:58:39 | FromDiscord | <Rika> You’ll get the warning when you set the discriminate outside of the object construction syntax |
11:58:45 | FromDiscord | <Rika> I assume it’s that that you mean |
11:59:18 | FromDiscord | <Yardanico> In reply to @xigoi "<@177365113899057152> why did you": can't say much, but it's because I'm not particularly attached to the domain and I got some money, not a lot, but quite enough for a random domain |
12:00:03 | FromDiscord | <enthus1ast> https://monocypher.org/ is even simpler↵(@Rika) |
12:00:20 | FromDiscord | <Rika> Never heard of it, I’ll look |
12:01:13 | FromDiscord | <enthus1ast> Another one is https://github.com/jedisct1/libhydrogen |
12:01:18 | FromDiscord | <enthus1ast> i actually meant this... |
12:01:23 | FromDiscord | <Rika> “cannot fail on correct input” so it can fuck itself on wrong input? |
12:02:05 | FromDiscord | <konsumlamm> In reply to @planetis "There was an unsafe": https://nim-lang.github.io/Nim/manual.html#types-cast-uncheckedassign this? |
12:02:18 | FromDiscord | <enthus1ast> i meant libhydrogen not monocypher all the time lol |
12:02:21 | FromDiscord | <planetis> nice thank you so much |
12:02:36 | FromDiscord | <planetis> I was searching for unsafe |
12:04:18 | FromDiscord | <enthus1ast> i meant libhydrogen not monocypher all the time lol https://github.com/enthus1ast/nimHydrogen the high level wrapper is not 100% done yet |
12:04:37 | FromDiscord | <Rika> Nice |
12:05:07 | FromDiscord | <Rika> Mono cypher looks cool too though |
12:07:23 | FromDiscord | <@zaz:sinnfrei.xyz> sent a long message, see http://ix.io/44fp |
12:07:45 | FromDiscord | <enthus1ast> the thing is, i do not know the author, at least in the case of libhydrogen its the same as for libsodium↵(@Rika) |
12:11:21 | FromDiscord | <Phil> Just for my own sanity, I can have inheritance on value object types, right?↵doing `Type A = object of RootObj` doesn't make it automatically a ref type somehow, correct? |
12:11:23 | FromDiscord | <TryAngle> @Phil https://www.youtube.com/watch?v=AVtuFp3lkpI |
12:12:12 | FromDiscord | <Rika> It doesn’t make it a red |
12:12:14 | FromDiscord | <Rika> Reference |
12:12:21 | FromDiscord | <Rika> But it doesn’t give you inheritance either |
12:12:37 | FromDiscord | <enthus1ast> whats the purpose? |
12:15:10 | FromDiscord | <Rika> Composition I believe |
12:16:25 | FromDiscord | <Phil> I'm mostly staring at norm and trying to wrap my head around some design decisions |
12:17:44 | FromDiscord | <Phil> Mainly: ↵1) Why are models ref types?↵2) Why doesn't it just demand that implicitly a constructor function is supplied by the user in the context (e.g. `new(M)`) instead of demanding that the user provides instantiated model objects |
12:18:14 | FromDiscord | <Phil> (edit) "Mainly: ↵1) Why are models ref types?↵2) Why doesn't it just demand that implicitly a constructor function is supplied by the user in the context (e.g. `new(M)`) instead of demanding that the user provides instantiated model objects ... " added "that norm then fills with data it fetches / duplicates if you're querying a list of entries" |
12:18:39 | FromDiscord | <Rika> Perhaps it wasn’t considered |
12:18:52 | FromDiscord | <Phil> In reply to @TryAngle "<@180601887916163073> https://www.youtube.com/watch": I could look at the monad video, or I could focus on norm for now 😛 |
12:18:58 | FromDiscord | <Rika> Make a prototype branch with those design considerations swapped in and see what new limitations you get from it |
12:21:06 | FromDiscord | <Phil> I might. Overall the second question is confusing me a bit more than the first, for I consider the API of "here, have a db connection, an id and the type of model I want and give me the constructed object back" to be simpler than "here, have a db connection, an instantiated object to overwrite and an SQL condition on what to use as where clause" |
12:21:54 | FromDiscord | <Phil> norm's creator did advise against it early on though since apparently they tried and hit a wall somewhere |
12:22:04 | FromDiscord | <Phil> I'm just not seeing where |
12:22:20 | FromDiscord | <TryAngle> In reply to @Isofruit "I *could* look at": 🥵 |
12:23:08 | FromDiscord | <TryAngle> wow didn't know about norm but it looks so nice to use 😳 |
12:23:22 | FromDiscord | <TryAngle> but everything feels nice after using rust's Diesel library I suppose |
12:25:33 | FromDiscord | <Phil> Honestly I'm not a huge fan of the API, it's why I wrote an abstraction layer over norm to make it more useful to me |
12:25:47 | FromDiscord | <Phil> But it does lift a significant chunk of work away from me |
12:25:57 | FromDiscord | <TryAngle> u should take a look at DevOnDuty |
12:26:08 | FromDiscord | <TryAngle> he wrote an insane abstraction for SQL queries |
12:27:41 | FromDiscord | <TryAngle> https://github.com/David-Kunz/Nery/blob/main/tests/test.nim |
12:30:58 | FromDiscord | <Phil> That looks like DIesel but Nim |
12:31:17 | FromDiscord | <Phil> Sadly, doesn't take care of transforming the queried data into an object for me |
12:31:25 | FromDiscord | <Phil> (edit) "Sadly, doesn't take care of transforming the queried data into an object for me ... " added "as far as I can see" |
12:31:45 | FromDiscord | <TryAngle> In reply to @Isofruit "Sadly, doesn't take care": it's just for generating queries afaik |
12:32:00 | FromDiscord | <TryAngle> (edit) "queries" => "the SQL code" |
12:32:23 | FromDiscord | <Phil> So its sole purpose is giving compile-time guarantee of correctness for the SQL? |
12:32:32 | FromDiscord | <Phil> well, syntactic correctness |
12:39:46 | FromDiscord | <TryAngle> In reply to @Isofruit "well, syntactic correctness": I guess so, since Diesel I'm kinda scared of ORMs 💀 |
12:42:13 | FromDiscord | <dom96> Diesel sure helps you see how bad Rust error messages can get |
12:42:28 | FromDiscord | <dom96> So many traits |
12:43:07 | FromDiscord | <jan0809> my fave orm is prisma python |
12:43:31 | FromDiscord | <jan0809> in terms of sql, but i also like edgedb |
12:48:20 | FromDiscord | <Goel> sent a code paste, see https://play.nim-lang.org/#ix=44fx |
12:48:37 | FromDiscord | <TryAngle> tbh after I started writing SQL scripts for pharmaceuticals sql feels easier to use than ORMS |
12:49:03 | FromDiscord | <TryAngle> only annoying thing is writing with some legacy oracle sql |
12:49:13 | FromDiscord | <jan0809> you mean like without models? |
12:51:47 | FromDiscord | <TryAngle> do u mean me? idk what u mean with models, just plain SQL even used some legacy SQL editor lmao |
12:52:22 | * | noeontheend joined #nim |
12:53:32 | FromDiscord | <deech> I'm aware that circular imports don't exist but is there a way to forward declare types? |
12:58:22 | FromDiscord | <Prestige> Just types? Don't think so |
13:22:22 | * | arkurious joined #nim |
13:36:30 | * | noeontheend quit (Ping timeout: 240 seconds) |
13:58:43 | * | CyberTailor quit (Remote host closed the connection) |
13:59:34 | * | CyberTailor joined #nim |
14:09:48 | FromDiscord | <Yardanico> In reply to @deech "I'm aware that circular": There is one feature for that, but I haven't seen anyone actually use it |
14:10:44 | FromDiscord | <jmgomez> In reply to @Yardanico "There is one feature": Really? I had to break the UE convention on the filenames because of it. Do you mind to elaborate? |
14:11:38 | FromDiscord | <Yardanico> It's a very specific feature and is only available for reference (and pointer I guess) types |
14:11:39 | FromDiscord | <Yardanico> https://nim-lang.org/docs/manual_experimental.html#package-level-objects |
14:13:50 | FromDiscord | <jmgomez> Awesome! Thanks!! |
14:25:18 | FromDiscord | <deech> Interesting! I wonder if that works well with lifetime hooks. I guess I would need to specify them when the type is fleshed out and not at the package level. |
14:25:31 | FromDiscord | <TryAngle> how do I add `==` for this? `WindowId = distinct int64` |
14:26:50 | FromDiscord | <Generic> `proc `==`(a, b: WindowId): bool {.borrow.}` |
14:27:10 | FromDiscord | <Generic> (edit) "`proc `==`(a, b: WindowId): bool {.borrow.}`" => "sent a code paste, see https://play.nim-lang.org/#ix=44g2" |
14:27:28 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=44g4 |
15:02:21 | * | noeontheend joined #nim |
15:45:33 | FromDiscord | <TryAngle> can I use nim's new destructors for cleanups in c wrappers? for example glfwDestroyWindow and glfwTerminate? |
15:45:43 | FromDiscord | <TryAngle> (edit) "new" => ""new"" |
15:48:20 | FromDiscord | <Phil> Hmm if I have a ref and it is nil, I can't get the type that nil is supposed to represent out of it again, can I? |
15:49:03 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=44gD |
15:49:28 | FromDiscord | <Phil> Strictly speaking, the variable a might have the information what type it is, but I don't think that info makes it into memory |
15:49:42 | FromDiscord | <Phil> (edit) "Strictly speaking, the variable a might have the information what type ... it" added "the ref inside of" |
15:50:57 | FromDiscord | <xflywind> nil is runtime info, Use if a == nil ? |
15:52:46 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=44gF |
15:54:02 | FromDiscord | <Phil> Wait, no I'M an idiot |
15:54:33 | FromDiscord | <Phil> yeah that works, I had forgotten there were 10 lines of old code in the playground file |
15:55:06 | FromDiscord | <Phil> (edit) "yeah that works, I had forgotten there were 10 lines of old code in the playground file ... " added "which got invalidated by a copy paste thingy and I had to delete them first" |
15:55:24 | FromDiscord | <aMOPel> sent a code paste, see https://paste.rs/sww |
15:56:35 | FromDiscord | <xflywind> it is used in macros/templates to restrict the pattern of the parameters. |
15:56:58 | FromDiscord | <aMOPel> alright, thanks 🙂 |
15:57:10 | FromDiscord | <aMOPel> so it has no effect of procs |
15:57:30 | FromDiscord | <aMOPel> (edit) "of" => "on" |
15:57:35 | FromDiscord | <aMOPel> (edit) "procs" => "procs?" |
15:59:30 | * | noeontheend quit (Ping timeout: 260 seconds) |
15:59:32 | FromDiscord | <xflywind> I think so. |
15:59:40 | FromDiscord | <xflywind> An example https://nim-lang.org/docs/tasks.html#toTask.m |
16:00:06 | FromDiscord | <xflywind> for typed etc. parameters. |
16:01:20 | FromDiscord | <xflywind> In reply to @aMOPel "so it has no": here is the docs https://nim-lang.org/docs/manual_experimental.html#term-rewriting-macros-parameter-constraints |
16:21:24 | * | xet7 joined #nim |
16:37:05 | * | fallback quit (Quit: IRCNow and Forever!) |
16:57:39 | FromDiscord | <mattrb> Is it expected that orc would be significantly slower than refc in some cases? When building my gba emulator with orc, I tend to see a 10-20% decrease in performance |
17:11:30 | * | fallback joined #nim |
17:15:01 | FromDiscord | <TryAngle> I'm having a werid issue, I'm casting a pointer of a ref object and the values of the ref object a the default ones even though the pointer has the same value |
17:16:49 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=44h0 |
17:17:16 | FromDiscord | <TryAngle> (edit) "https://play.nim-lang.org/#ix=44h0" => "https://play.nim-lang.org/#ix=44h1" |
17:17:40 | FromDiscord | <TryAngle> (edit) "https://play.nim-lang.org/#ix=44h1" => "https://play.nim-lang.org/#ix=44h2" |
17:18:50 | FromDiscord | <TryAngle> SharedState is a ref object and is owned by a window and another object |
17:20:06 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=44h3 |
17:20:18 | FromDiscord | <TryAngle> (edit) "SharedState is a ref object and is owned by a window and another object ... " added "and I want to use it in the callbacks aswell but as a pointer obv" |
17:20:21 | * | oddish joined #nim |
17:21:00 | FromDiscord | <TryAngle> EventLoop and WindowObj have the same values for SharedState, only the pointer has issues 🤔 |
17:32:10 | * | noeontheend joined #nim |
17:46:32 | * | soileh quit (Read error: Connection reset by peer) |
17:49:33 | FromDiscord | <Generic> In reply to @mattrb "Is it expected that": yes, it depends a lot on your code, that sounds pretty weird though |
17:50:10 | FromDiscord | <Generic> since you're working on an emulator, you shouldn't really need/have circular data structures right? |
17:50:55 | FromDiscord | <Generic> you can try out how arc performs to see whether the difference comes from the cycle detection/breaking or from other differences |
18:06:16 | FromDiscord | <mattrb> In reply to @Generic "since you're working on": There are probably a dozen circular references that exist for the lifetime of the program. I have a heap-allocated object for each component that references a 'gba' object, which has a reference back to all of the components. I use that to communicate between the components |
18:06:22 | * | kenran joined #nim |
18:06:25 | FromDiscord | <mattrb> In reply to @Generic "you can try out": Good thought, I'll give that a shot |
18:07:42 | FromDiscord | <Generic> In reply to @mattrb "There are probably a": me programming my gc emulator mostly procedurally with global variables |
18:07:54 | FromDiscord | <Generic> I don't have such weakness |
18:17:45 | * | noeontheend quit (Ping timeout: 260 seconds) |
19:25:10 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=44hr |
19:40:05 | FromDiscord | <TryAngle> In reply to @TryAngle "I get the same": actually this works↵I was casting the pointer from getWinoowUserPointer to SharedState but after applying the changes from this, SharedState should have been ptr SharedState now .. .. . .. . adding doing cast[ptr SharedState](...) and ti works XD |
19:40:48 | FromDiscord | <pruno> Hello, how would you do to read a file to a certain string (or bytes for my example since it's a binary file) ? |
19:40:55 | FromDiscord | <TryAngle> so much pain and suffering bc of the pointer not being casted to a ptr but an object and I did not noctice it 😭 😭 |
19:41:37 | FromDiscord | <TryAngle> In reply to @pruno "Hello, how would you": hmm do u mean not reading the whole file? |
19:41:42 | FromDiscord | <TryAngle> maybe std/streams |
19:42:29 | FromDiscord | <enthus1ast> you read in chunks eg of the size of the byte pattern, then if you find the byte patter you break |
19:42:37 | FromDiscord | <pruno> Actually i want to have the whole file in memory but read and print it to stdout before a certain string |
19:45:49 | * | CyberTailor quit (Quit: Konversation terminated!) |
19:48:00 | FromDiscord | <pruno> In reply to @enthus1ast "you read in chunks": How would you do that ? |
19:48:59 | FromDiscord | <enthus1ast> you call eg. read(sizeOfYourBytePattern) in a loop until you reach the end of the file |
19:50:07 | FromDiscord | <pruno> I see, gonna try to that then, thanks |
19:57:32 | FromDiscord | <mattrb> In reply to @Generic "you can try out": Just tested, if you're curious. It seems that arc marginally outperforms orc here, but refc is still significantly faster |
20:00:36 | FromDiscord | <Darkstepan> Hello, what is the Nim equivalent of Python's `ìf name == "main"`↵(check if not imported) |
20:00:51 | FromDiscord | <Darkstepan> (edit) "Hello, what is the Nim equivalent of Python's `ìf name == "main"`↵(check if ... notbeing" added "the code is" | "the code isnot ... imported)" added "being" |
20:01:34 | FromDiscord | <Darkstepan> (edit) "`ìf" => "`if" |
20:01:58 | FromDiscord | <aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=44hy |
20:02:04 | FromDiscord | <aruZeta> (edit) |
20:02:06 | FromDiscord | <Darkstepan> thanks |
20:02:23 | * | kenran quit (Quit: WeeChat info:version) |
20:04:00 | FromDiscord | <enthus1ast> @Darkstepan\: `when` is like a "compiletime if" |
20:09:41 | FromDiscord | <Darkstepan> I'm aware of that, I just wasn't sure about which variable to check |
20:12:30 | FromDiscord | <Darkstepan> btw is there a list of compile time variables? |
20:12:47 | FromDiscord | <Darkstepan> (edit) "btw" => "also," |
20:28:38 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/wiki/Consts-defined-by-the-compiler there is this |
20:33:29 | FromDiscord | <soundmodel> anyone used Quorum https://quorumlanguage.com/? |
20:33:34 | FromDiscord | <soundmodel> (edit) "https://quorumlanguage.com/?" => "https://quorumlanguage.com/ ?" |
20:33:52 | FromDiscord | <soundmodel> (edit) "anyone used Quorum https://quorumlanguage.com/ ? ... " added "A bit worried as to how evidence-basedness could trump even the so-nice Nim syntax." |
20:34:09 | FromDiscord | <soundmodel> (edit) "as to how" => "if" |
20:34:25 | FromDiscord | <soundmodel> (edit) "anyone used Quorum https://quorumlanguage.com/ ? A bit worried if evidence-basedness could trump even the so-nice Nim syntax. ... " added "So if someone has, then a comparison might be interesting." |
20:34:34 | FromDiscord | <huantian> ngl their website looks like a government agency's website lmao |
20:34:52 | FromDiscord | <soundmodel> I think they're still developing it, but the theory is interesting |
20:34:57 | FromDiscord | <Elegantbeef> And the language looks like pascal meets OOP |
20:35:15 | FromDiscord | <Elegantbeef> Shit if only there was an oop pascal |
20:35:24 | FromDiscord | <huantian> what does evidence based mean? |
20:35:41 | FromDiscord | <Elegantbeef> They designed their language based off studies it seems |
20:35:55 | FromDiscord | <soundmodel> In reply to @huantian "what does evidence based": that they've studied a plethora of programming languages and how people use them. Then formed conclusions about how to design a well-usable language. |
20:36:41 | FromDiscord | <huantian> hm based off of the syntax only I think I like python better 😛 |
20:36:43 | FromDiscord | <soundmodel> but since I expect that people here would consider Nim to be well-designed, then that's why I found this interesting |
20:36:49 | FromDiscord | <Elegantbeef> They decided to go for the `end` delimited blocks which is a travesty |
20:37:12 | FromDiscord | <Elegantbeef> This language is much much simpler than Nim though |
20:37:15 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "They decided to go": its a crime |
20:37:25 | FromDiscord | <huantian> same, I prefer {} so much more than `end` |
20:38:04 | FromDiscord | <!Patitotective> why not normal for loops, why `repeate` :[ |
20:38:08 | FromDiscord | <!Patitotective> (edit) "`repeate`" => "`repeat`" |
20:38:16 | FromDiscord | <Elegantbeef> Notice there isnt a while loop |
20:38:35 | FromDiscord | <Elegantbeef> Oh god `repeat while` is a while loop |
20:38:36 | FromDiscord | <soundmodel> Nim is the most interesting language I know, but without that theory, it creates a bit of a stir doesn't it? |
20:38:53 | FromDiscord | <soundmodel> i.e. can it be possible that Nim is as usable, or how usable it's in comparison? |
20:39:07 | FromDiscord | <!Patitotective> nim doesnt have audio library ¯\_(ツ)_/¯ |
20:39:15 | FromDiscord | <!Patitotective> https://media.discordapp.net/attachments/371759389889003532/996878498675294319/unknown.png |
20:39:28 | FromDiscord | <Elegantbeef> Just use miniaudio problem solved |
20:40:05 | FromDiscord | <!Patitotective> wrapping... |
20:40:17 | FromDiscord | <huantian> they do have some ideas that I agree with mentioned in <https://quorumlanguage.com/evidence.html> |
20:40:17 | FromDiscord | <Elegantbeef> I think this language is 100% educational |
20:40:29 | FromDiscord | <Elegantbeef> Oh my https://github.com/beef331/miniaudio/↵(@!Patitotective) |
20:40:40 | FromDiscord | <TryAngle> how big are Variant Types again, their max possible size or sum of all possibilities?↵if I have ~10-20 variants should I split it up into two? |
20:40:53 | FromDiscord | <Elegantbeef> Variant types are as big as your heart desires |
20:40:57 | FromDiscord | <huantian> max possible size |
20:41:03 | FromDiscord | <soundmodel> In reply to @Elegantbeef "I think this language": what do you mean? |
20:41:08 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "I think this language": scratch ¯\_(ツ)_/¯ |
20:41:21 | FromDiscord | <TryAngle> In reply to @Elegantbeef "Variant types are as": I just wanna pay some respect for the cache 💀 |
20:41:26 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Oh my https://github.com/beef331/miniaudio/ (<@7620": not even a readme jk |
20:41:27 | FromDiscord | <Elegantbeef> It doesnt state where/how it runs |
20:41:30 | FromDiscord | <soundmodel> ehh, possibly, but evidence-basedness should be a big deal for real-world languages |
20:41:36 | FromDiscord | <soundmodel> because that can explain e.g. why software projects fail |
20:41:51 | FromDiscord | <soundmodel> (when they fail because of bugs etc.) |
20:41:52 | FromDiscord | <Elegantbeef> It's a union so the largest variant is the one that is the size of the type↵(@TryAngle) |
20:42:10 | FromDiscord | <TryAngle> In reply to @Elegantbeef "It's a union so": ok so all gucci 😎↵thanks |
20:42:53 | FromDiscord | <huantian> In reply to @soundmodel "ehh, possibly, but evidence-basedness": I think it is important, but on the other hand, I think every idea has some "evidence" behind it |
20:42:53 | FromDiscord | <Elegantbeef> Like it seems it's an interpreted language as it's possible to embed it in web |
20:43:23 | FromDiscord | <soundmodel> the other thing is, which I don't know about, is whether experience trumps design |
20:43:36 | FromDiscord | <soundmodel> i.e. that in principle Nim is "as effective", when it's used with experience |
20:43:39 | FromDiscord | <huantian> it kinda looks like statically typed lua 😛 which honestly might not be a bad thing |
20:44:22 | FromDiscord | <Elegantbeef> The big issue to me looking at this language is very much they dont say what it's capable of or how it runs |
20:44:44 | FromDiscord | <Elegantbeef> It's JVM'd language |
20:45:01 | FromDiscord | <Elegantbeef> > Note that running the test suite, by default, runs only on the Java Virtual Machine. To test Quorum's JavaScript transpiled mode, you need to install Node JS. |
20:45:05 | FromDiscord | <huantian> and it doesn't have a linux download?? |
20:45:35 | FromDiscord | <soundmodel> In reply to @Elegantbeef "The big issue to": I interpreted that to mean that maybe it's just not finished yet |
20:45:36 | FromDiscord | <Elegantbeef> So it's a JVM/JS alternative which explains why it's pretty much Pascal C# 😄 |
20:45:42 | FromDiscord | <soundmodel> obviously if they needed to market that to the industry |
20:45:48 | FromDiscord | <soundmodel> then you'd expect to see benchmarks |
20:45:53 | FromDiscord | <huantian> yeah the language definitely is marketed toward education |
20:46:01 | FromDiscord | <Elegantbeef> I mean it's 4.0.3 they should be able eto say what the point of the language is |
20:46:30 | FromDiscord | <huantian> which makes design and the first user experience much more imporant than execution speed or how you actually run the program |
20:46:47 | FromDiscord | <Elegantbeef> Yea that's what it seems |
20:47:54 | FromDiscord | <huantian> And in general I think I do agree with the language’s ideas and it’s evidence based philosophy, but I’m not sure exactly what evidence based entails and how it improved the lang |
20:48:01 | FromDiscord | <soundmodel> ultimately I'm just sick of "yet another language" |
20:48:14 | FromDiscord | <soundmodel> because I'd like to build up libraries, instead of parse different tools |
20:48:50 | FromDiscord | <Elegantbeef> > Inheritance depth is not a significant driver of software maintenance effort↵Is a very questionable statement if you ask me |
20:48:55 | FromDiscord | <huantian> The cynical bit in me says that this is just “yet another language” with a new buzzword |
20:49:23 | FromDiscord | <soundmodel> but not before can one do evidence-based design |
20:49:39 | FromDiscord | <soundmodel> think about it, you need to design a lot of flawed models before you can learn from all of them |
20:49:45 | FromDiscord | <TryAngle> In reply to @soundmodel "ultimately I'm just sick": every language was yet another language when it came out |
20:50:28 | FromDiscord | <soundmodel> yes but they all fail in some sense |
20:50:49 | FromDiscord | <soundmodel> but the point is that it'd be interesting to compare that and Nim |
20:50:55 | FromDiscord | <soundmodel> e.g. on syntax |
20:51:39 | FromDiscord | <huantian> Like I’ve tried to teach people who don’t know programming python and I was bad at it |
20:52:03 | FromDiscord | <huantian> So first we’re gonna learn about the monad |
20:52:09 | FromDiscord | <Elegantbeef> Lol |
20:52:21 | FromDiscord | <huantian> That’s how you teach someone Haskell right |
20:53:07 | FromDiscord | <Elegantbeef> That's my understanding of haskell |
20:53:08 | FromDiscord | <soundmodel> but it'd be also shame to go 10 years from now to |
20:53:19 | FromDiscord | <Elegantbeef> Monads exist and if you dont understand them you're not allowed in the cool kids club |
20:53:26 | FromDiscord | <soundmodel> "oh now we wrote all code with this lang, but it wasn't evidence-based" |
20:53:36 | FromDiscord | <soundmodel> "so now we have to take yet another language" |
20:53:37 | FromDiscord | <huantian> I think the main part is the actual thought process behind programming, and the syntax has to somehow be able to guide the person into thinking programmatically.↵(@soundmodel) |
20:54:06 | FromDiscord | <soundmodel> and also readability |
20:54:16 | FromDiscord | <soundmodel> some languages become really messy when you have a lot of files |
20:54:24 | FromDiscord | <Elegantbeef> What's so hard to understand about `if((MyFlagA | MyFlagB) & myFlags){}`? |
20:54:32 | FromDiscord | <soundmodel> then it's hell to infer what connects to what |
20:54:38 | FromDiscord | <soundmodel> unless you're the program's designer |
20:54:50 | FromDiscord | <huantian> The hard part is knowing that you need an ig statement |
20:54:56 | FromDiscord | <huantian> \if |
20:55:13 | FromDiscord | <Elegantbeef> I mean it doesnt make any sense to a non advanced user |
20:55:19 | FromDiscord | <soundmodel> I think the reason people use Python so much even if it's slow |
20:55:26 | FromDiscord | <Elegantbeef> Why are we using `|`... why are we using `&` |
20:55:28 | FromDiscord | <TryAngle> what is cleaner, I'm wrapping a c library that uses int32 for almost everything, should I for the user interface use int or uint for things that are always above 0 (e.g. window size) or should I just continue the int32 always? |
20:55:37 | FromDiscord | <huantian> You can tell someone what if does and show them you using it, but you can’t tell them when they need an if |
20:55:37 | FromDiscord | <soundmodel> is because it at least allows people to understand what the code does after months and years |
20:55:40 | FromDiscord | <soundmodel> compared to Java |
20:55:41 | FromDiscord | <Elegantbeef> It's up to you try |
20:56:45 | FromDiscord | <TryAngle> In reply to @Elegantbeef "It's up to you": hmm, what would u do if u overengineered it |
20:57:15 | FromDiscord | <soundmodel> but the transitioning from language to language is total pain IMO |
20:57:21 | FromDiscord | <Elegantbeef> I'm going to say it slowly |
20:57:25 | FromDiscord | <Elegantbeef> It's up to you |
20:57:54 | FromDiscord | <TryAngle> In reply to @Elegantbeef "It's up to you": freedom is a scary concept |
20:58:16 | FromDiscord | <!Patitotective> In reply to @TryAngle "freedom is a scary": it is |
20:58:16 | FromDiscord | <huantian> I’ve personally been fine transitioning between languages, like it all makes sense to me (not that I don’t mess up), but I’ve seen other people definitely struggle more than me↵(@soundmodel) |
20:58:32 | FromDiscord | <soundmodel> no I mean reusing code of another language |
20:58:37 | FromDiscord | <soundmodel> JNI, FFIs etc. |
20:58:50 | FromDiscord | <Elegantbeef> If you want to reuse the code the only way is to use system languages otherwise you're fucked 😛 |
20:58:53 | FromDiscord | <huantian> Like maybe I’m just the only person in the world that understands the code I’m writing and everyone else just crutches off of language features?? I don’t know how to express this feeling |
20:59:00 | FromDiscord | <soundmodel> and that's the result when people don't agree on what language to use |
20:59:59 | FromDiscord | <soundmodel> Nim's interop has seemed very nice because you have out-of-the-box calls to C and Python |
21:00:14 | FromDiscord | <Yardanico> python isn't really "out of the box" though, it's a third-party module |
21:00:25 | FromDiscord | <Yardanico> and there are much more modules like that, not only for python |
21:00:35 | FromDiscord | <soundmodel> but the question was still, could "evidence-basedness" bring something unseen on the table |
21:00:51 | FromDiscord | <Elegantbeef> No cause the evidence is opinionated |
21:00:55 | FromDiscord | <soundmodel> I meant out-of-the-box in the sense that it's easy to get running |
21:00:59 | FromDiscord | <soundmodel> compared to e.g. JNI |
21:01:30 | FromDiscord | <Yardanico> https://github.com/Clonkk/nimjl↵https://github.com/yglukhov/jnim↵https://github.com/SciNim/rnim |
21:01:38 | FromDiscord | <Elegantbeef> Bad example 😛 |
21:01:43 | FromDiscord | <Yardanico> julia, java, R |
21:01:57 | FromDiscord | <Yardanico> metaprogramming does wonders even for JNI https://media.discordapp.net/attachments/371759389889003532/996884208339398716/unknown.png |
21:01:59 | FromDiscord | <Yardanico> @soundmodel ^ |
21:02:11 | FromDiscord | <Phil> In reply to @soundmodel "is because it at": I'd only say that it facilitates that, but not much more. Source: I've seen academic python code. It's.... it's a thing |
21:02:58 | FromDiscord | <TryAngle> In reply to @soundmodel "but the question was": I think semi, isn't rust's compiler basically "proofing" the code? |
21:02:59 | FromDiscord | <Phil> Hell, I've started out with writing academic python code and seen the folks writing such code around me. None of it was actually maintainable |
21:03:08 | FromDiscord | <soundmodel> also Nim does have some sort of evidence-basedness perhaps |
21:03:13 | FromDiscord | <soundmodel> but it's not the same as Quorum's |
21:03:53 | FromDiscord | <Elegantbeef> To have something be considered evidence to me atleast it needs to be conclusive and repeatable, a single experiment is the exact opposite |
21:03:58 | FromDiscord | <TryAngle> In reply to @Yardanico "metaprogramming does wonders even": are u srsly writing java in nim |
21:04:02 | FromDiscord | <TryAngle> ???? |
21:04:08 | FromDiscord | <Yardanico> jnim |
21:04:25 | NimEventer | New Nimble package! nimwin - Platform Agnostic Windowing Library for Nim, see https://github.com/TriedAngle/nimwin |
21:04:33 | FromDiscord | <TryAngle> 😳 |
21:05:03 | FromDiscord | <soundmodel> but we also live a time when it's very possible to learn from all the mistakes |
21:05:20 | FromDiscord | <soundmodel> of e.g. unmaintainable C and Java code |
21:05:28 | FromDiscord | <soundmodel> so it'd be dumb to repeat those things |
21:06:05 | FromDiscord | <TryAngle> I mean just wait until AI driven development comes out after and AI writes code for u and u chill and be unemployed gg |
21:06:07 | FromDiscord | <Phil> Yes, there are are some design decisions that are overwhelmingly favoured by a group of programmers, which lead to the rise of system-language alternatives |
21:06:18 | FromDiscord | <TryAngle> (edit) removed "after" |
21:06:36 | FromDiscord | <soundmodel> I've been also reading that something like Rust might fall prey of something down the line |
21:06:40 | FromDiscord | <Phil> But you'll still see peeps preferring C/C++ and feeling they're the better language for arbitrary X reason |
21:06:48 | FromDiscord | <soundmodel> (edit) "of" => "to" |
21:07:08 | FromDiscord | <Phil> And these reasons will still be valid for they are their opinion |
21:07:10 | FromDiscord | <Elegantbeef> Like let's look at a simple Nim bitset vs C bitflags |
21:07:12 | FromDiscord | <TryAngle> In reply to @soundmodel "I've been also reading": I think rust's only mistake is it's strict no braking changes policy |
21:07:17 | FromDiscord | <soundmodel> in essence, it just seems odd that PL designers keep repeating mistakes |
21:07:26 | FromDiscord | <Elegantbeef> Most Nim programmers will say the bitsets are better, most C programmers will say bitflags are better |
21:07:27 | FromDiscord | <TryAngle> rust 2021 was dissapointing tbh |
21:07:30 | FromDiscord | <soundmodel> (edit) "that" => "that/if" |
21:08:40 | FromDiscord | <Elegantbeef> There is no good way to test for which is actually better cause every programmer prefers a different API or has a different knowledge basis |
21:08:52 | FromDiscord | <Phil> In reply to @TryAngle "are u srsly writing": I have been accused of actually performing java deeds in nim |
21:08:58 | FromDiscord | <Phil> It happens |
21:09:00 | FromDiscord | <Elegantbeef> You fucking know you do |
21:09:11 | FromDiscord | <Phil> BASELESS ACCUSATIONS |
21:09:36 | FromDiscord | <Phil> BAAASEEELEEESS |
21:09:53 | FromDiscord | <Elegantbeef> Anyway evidence based design would be great if it was capable to get |
21:09:59 | FromDiscord | <Yardanico> phil is broken, time to replace him |
21:10:34 | FromDiscord | <Elegantbeef> We will replace you |
21:10:48 | FromDiscord | <Phil> Maybe I've looked at too much rust recently, who knows |
21:11:17 | FromDiscord | <huantian> I think the main question is if community opinion driven language is good |
21:11:40 | FromDiscord | <Prestige> That project rename lol |
21:11:51 | FromDiscord | <Elegantbeef> "All the people that contribute on community driven languages say 'yes'" |
21:12:01 | FromDiscord | <TryAngle> In reply to @Isofruit "Maybe I've looked at": I feel that |
21:12:03 | FromDiscord | <Elegantbeef> Context prestige? |
21:12:13 | FromDiscord | <huantian> Like is the community more right than a scientific paper? |
21:12:47 | FromDiscord | <TryAngle> In reply to @Isofruit "Maybe I've looked at": whenever I write something that requires unicode I go back to rust and for everything else I go nim >. < |
21:12:49 | FromDiscord | <Elegantbeef> Does the scientific paper use more than a single study? 😛 |
21:13:10 | FromDiscord | <Phil> Anyway, evidence based design is sth I have a hard time defining. Is it asking people what syntax is the best? Because I can't see anything getting a straight up "that's best".↵Is it realizing things that have proven problematic in the past, such as dealing with memory allocation completely manual is a massive pain in the but and should be avoided if possible? That I can see being sensible, but even that I'm not sure you could find an actu |
21:13:13 | FromDiscord | <dom96> Wasn't there an experiment to build a language solely by community vote? |
21:13:15 | FromDiscord | <Elegantbeef> Make a unicode distinct cmon↵(@TryAngle) |
21:13:26 | FromDiscord | <Phil> In reply to @TryAngle "whenever I write something": ... why? |
21:13:34 | FromDiscord | <soundmodel> also as I suggested evidence-basedness does not guarantee usability |
21:13:39 | FromDiscord | <soundmodel> look all the natural languages |
21:13:43 | FromDiscord | <soundmodel> not designed, still used |
21:13:48 | FromDiscord | <Elegantbeef> I think the issue is mainly phrasing |
21:13:53 | FromDiscord | <huantian> Twitch build a programming language↵(@dom96) |
21:14:00 | FromDiscord | <Elegantbeef> It's "Evidence based language design for ensuring easy learning" |
21:14:19 | FromDiscord | <Phil> In reply to @huantian "Twitch build a programming": They have found a language more brain-breaking than brainfuck? Wow |
21:14:32 | FromDiscord | <Elegantbeef> They call it braindamage↵(@Phil) |
21:14:48 | FromDiscord | <dom96> In reply to @huantian "Twitch build a programming": maybe there were two, the one I recall wasn't on Twitch lol |
21:15:02 | FromDiscord | <dom96> but maybe it went on to get on Twitch too |
21:15:04 | FromDiscord | <Phil> In reply to @Elegantbeef "They call it braindamage": Based on what I've heard about twitch chats, everybody on there might have learned that language already! |
21:15:09 | FromDiscord | <Elegantbeef> I'd hope huan was just making aj oke |
21:15:28 | FromDiscord | <soundmodel> but I think the comparison down the line might still be useful |
21:15:29 | FromDiscord | <huantian> yeah that was just a joke |
21:15:44 | FromDiscord | <soundmodel> there's so much energy going into PLs that the cycle of picking wrong languages is taxing |
21:15:57 | FromDiscord | <Elegantbeef> Then just pick C and shun all the other language users |
21:16:01 | FromDiscord | <huantian> > They already do activities that have some relationship to computing - color-by-number pictures, following algorithms, classifying objects by type. The key is to identify how to frame those activities to make connections with computational thinking, as well as identify what bridge activities could come between existing activities and more mature activities↵I agree with them here, people know the concepts of programming, they just don' |
21:16:12 | FromDiscord | <soundmodel> In reply to @Elegantbeef "Then just pick C": actually this was my initial idea |
21:16:21 | FromDiscord | <huantian> maybe we should just have everyone beat shenzhen I/O before learning to program |
21:16:29 | FromDiscord | <Phil> In reply to @Elegantbeef "Then just pick C": Beef out here, straight up shunning assembly |
21:16:31 | FromDiscord | <soundmodel> but then I looked at "what's the best superset of C that is not C++" |
21:16:33 | FromDiscord | <soundmodel> -> Nim |
21:16:33 | FromDiscord | <Elegantbeef> But i mean every system language is reusable |
21:16:53 | FromDiscord | <dom96> In reply to @soundmodel "there's so much energy": and by the time you invest significant time into one language hundreds new ones pop up |
21:16:56 | FromDiscord | <huantian> beef you should play shenzhen io I think you'd like it |
21:17:23 | FromDiscord | <Elegantbeef> I cant even code my own projects i want to work on you want me to make ICs that are just for a game↵(@huantian) |
21:17:23 | FromDiscord | <TryAngle> In reply to @Isofruit "... why?": we actually had discussion in #internals a week ago↵it just feels foreign and ugly imo.↵but others like it so idk |
21:17:30 | FromDiscord | <soundmodel> one source said that Nim is the best "thin layer" on top of C |
21:17:36 | FromDiscord | <soundmodel> "best in theory" or something |
21:17:40 | FromDiscord | <huantian> In reply to @Elegantbeef "I cant even code": don't worry it's just asm |
21:17:44 | FromDiscord | <Elegantbeef> try is too scared of making their own unicode string for whatever reason |
21:18:03 | FromDiscord | <Elegantbeef> I mean really Nim's unicode should have two distinct variants |
21:18:04 | FromDiscord | <Phil> In reply to @TryAngle "we actually had discussion": Like, I can't say I ever paid specific attention to it, but is the unicode lib somehow painful to use? |
21:18:25 | FromDiscord | <soundmodel> I've been also wondering whether Quorum or something focuses too much on high-level things |
21:18:26 | FromDiscord | <TryAngle> not really, only in specific cases |
21:18:35 | FromDiscord | <soundmodel> i.e. that e.g. if it did realize, it would e.g. be a slow language |
21:18:43 | FromDiscord | <soundmodel> because it's meant to be used like Tcl/Tk or something |
21:18:47 | FromDiscord | <huantian> well I think that their goal is purely educational |
21:18:56 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44hV |
21:19:03 | FromDiscord | <huantian> if they wanted to be fast and good they would need to change up exactly what evidence they're looking at |
21:19:28 | FromDiscord | <Elegantbeef> Though i guess `RuneSeq` doesnt need to be distinct |
21:20:03 | FromDiscord | <TryAngle> In reply to @Elegantbeef "try is too scared": nah I agree with u, it's pretty easy in this case, but the fact u have to redo this everytime and not already built in just feels so amogus |
21:20:08 | FromDiscord | <dom96> hm, actually thinking about it, maybe a language built by votes would work better if those votes were only given to those with a stake in the language |
21:20:16 | FromDiscord | <Elegantbeef> The fuck do you mean "have to redo this everytime |
21:20:21 | FromDiscord | <Elegantbeef> Make a `unicode` module |
21:20:25 | FromDiscord | <Elegantbeef> Problem fucking solved |
21:20:33 | FromDiscord | <Elegantbeef> You can import your own code in your modules |
21:20:41 | FromDiscord | <Elegantbeef> Nim has this wild `import` statement |
21:21:18 | FromDiscord | <Elegantbeef> Like i said I think it should be apart of the stdlib unicode module |
21:22:05 | FromDiscord | <Elegantbeef> that and `proc rune(s: string): Rune = assert s.runeLen == 1; s.runeAt(0)` |
21:22:21 | FromDiscord | <Elegantbeef> This way you can do `rune"h"` |
21:23:01 | FromDiscord | <dom96> _plays the "PRs welcome" song_ |
21:23:08 | FromDiscord | <dom96> :D |
21:24:13 | FromDiscord | <!Patitotective> In reply to @dom96 "_plays the "PRs welcome"": lol |
21:24:45 | * | qwr currently uses nim as a better way to write complicated shell script, occasionally tripping into FP land with mapIt etc - its pretty flexible language |
21:25:19 | FromDiscord | <Elegantbeef> Yea macros/templates make the language very sculptable |
21:25:49 | FromDiscord | <Phil> > This module provides support to handle the Unicode UTF-8 encoding.↵Wait a minute, no UTF-16? Even when UTF-8 support in browsers is terrible? Sad Iso noises |
21:25:54 | FromDiscord | <dom96> Guess I should PR IRC action support for the Discord bridge |
21:26:19 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=44hX |
21:26:47 | FromDiscord | <TryAngle> (edit) "https://play.nim-lang.org/#ix=44hX" => "https://play.nim-lang.org/#ix=44hY" |
21:26:52 | FromDiscord | <Elegantbeef> I think it's elegant |
21:27:03 | FromDiscord | <Elegantbeef> But even if it's not we can resolve this |
21:27:10 | FromDiscord | <huantian> same I really don't like doing a bunch of `encode` and `decode` procs everywhere just to convert between all my strings |
21:27:20 | FromDiscord | <TryAngle> (edit) "https://play.nim-lang.org/#ix=44hY" => "https://play.nim-lang.org/#ix=44hZ" |
21:28:30 | FromDiscord | <dom96> try this `template 📜(x: str): Rune = rune(x)` then you should be able to elegantly write `📜"+"` |
21:28:55 | FromDiscord | <Elegantbeef> QED |
21:28:56 | FromDiscord | <huantian> just let term rewriting macros rewrite `"`s |
21:28:59 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44i0 |
21:29:02 | FromDiscord | <!Patitotective> In reply to @dom96 "try this `template 📜(x:": hahah |
21:29:30 | FromDiscord | <TryAngle> In reply to @dom96 "try this `template 📜(x:": wait nim supports unicode for proc / templates 😳 |
21:29:38 | FromDiscord | <dom96> for all identifiers |
21:29:47 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44i2 |
21:30:16 | FromDiscord | <Elegantbeef> It's really a shame that Nim looks identical to the odin with no work |
21:30:35 | FromDiscord | <Elegantbeef> Without having string be a sequence of runes |
21:30:42 | FromDiscord | <dom96> !eval let 📜 = "You shall not pass 🧙♂️"; echo 📜 |
21:30:45 | NimBot | You shall not pass 🧙♂️ |
21:31:06 | FromDiscord | <TryAngle> In reply to @Elegantbeef "Without having string be": I'm not saying strings should be that, rust or odin don't use sequenes of runes either |
21:31:06 | FromDiscord | <Yardanico> yes nim supports unicode identifiers |
21:31:48 | FromDiscord | <Elegantbeef> Tryangle my point is that what you want is possible |
21:31:54 | FromDiscord | <Elegantbeef> Without any internal changes |
21:32:12 | FromDiscord | <Elegantbeef> Nim is all about extending in userspace |
21:32:27 | FromDiscord | <dom96> Now here is a fun challenge: make emojicode work using Nim macros/templates/procs. (https://www.emojicode.org/) |
21:33:25 | FromDiscord | <TryAngle> In reply to @Elegantbeef "To really chad this": ok this converter is really cool 😳 |
21:33:43 | FromDiscord | <Elegantbeef> Not to mention there is even the case statement macros so you could make your own case statement to convert strings runes at compile time without converters |
21:33:57 | FromDiscord | <dom96> Note that converters are also dangerous, be careful when using them (especially if you export them) |
21:34:29 | FromDiscord | <Elegantbeef> There are multiple methods to remove `rune"SomeUnicode"` |
21:34:46 | FromDiscord | <!Patitotective> In reply to @dom96 "Now here is a": why would someone bother making and emoji based lang lol |
21:34:49 | FromDiscord | <Elegantbeef> So i dont really see a need to make char literals work with unicode |
21:35:22 | FromDiscord | <dom96> In reply to @Patitotective "why would someone bother": It's all about that street nerd cred |
21:35:37 | FromDiscord | <Prestige> emojis were a mistake |
21:35:39 | FromDiscord | <Elegantbeef> Well given that they'd only really need the `static string` variant there really is not much danger↵(@dom96) |
21:35:54 | FromDiscord | <Elegantbeef> How else do i not break poe's law?↵(@Prestige) |
21:35:57 | FromDiscord | <!Patitotective> In reply to @Avahe "emojis were a mistake": why↵theyre awsome 🌈 |
21:37:38 | FromDiscord | <Elegantbeef> Nevermind the static variant doesnt work |
21:37:43 | FromDiscord | <Elegantbeef> 10/10 dispatch |
21:38:12 | NimEventer | New thread by Can-lehmann: Owlkettle 2.0.0 is a declarative GUI framwork for GTK 4, see https://forum.nim-lang.org/t/9302 |
21:38:35 | FromDiscord | <huantian> isn't gtk 5 out already |
21:39:00 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44i4 |
21:39:09 | FromDiscord | <Elegantbeef> Nah huan qt6 is |
21:39:26 | FromDiscord | <Elegantbeef> I swear i've read that forum post before |
21:39:34 | FromDiscord | <Elegantbeef> Seems like hmmm someone's readme |
21:40:11 | FromDiscord | <!Patitotective> why would someone make the documentation markdown files↵github wiki existing and nim docgen?↵https://github.com/yglukhov/nimx/tree/master/doc |
21:40:18 | FromDiscord | <!Patitotective> (edit) "why would someone make the documentation ... markdown" added "using" |
21:40:37 | FromDiscord | <Elegantbeef> You're right why wouldnt they use nimib |
21:41:10 | FromDiscord | <Yardanico> maybe because "7 years ago" |
21:41:59 | FromDiscord | <Elegantbeef> If patito could read he'd ask fewer questions |
21:42:36 | FromDiscord | <TryAngle> In reply to @Elegantbeef "If patito could read": thanks for not calling out me also 😊 |
21:42:40 | FromDiscord | <!Patitotective> yes, my eyes ignore relevant information by default |
21:42:47 | FromDiscord | <Elegantbeef> It was implied↵(@TryAngle) |
21:42:58 | FromDiscord | <TryAngle> 💀 |
21:43:39 | FromDiscord | <Elegantbeef> So for that pointer to glfw you used a reference right? |
21:43:57 | FromDiscord | <TryAngle> no I'm using a pointer wiht sharedAlloc0 |
21:44:04 | FromDiscord | <Elegantbeef> Lol |
21:44:11 | FromDiscord | <TryAngle> I think using ref works also now that I fixed it |
21:44:15 | FromDiscord | <Elegantbeef> what a world |
21:44:47 | FromDiscord | <TryAngle> my whole issue was just at the "derefercing" side I casted the pointer to a object and not to a ptr of an object |
21:45:03 | FromDiscord | <Elegantbeef> The fun part about ref is you just cast it to your ref |
21:45:20 | FromDiscord | <TryAngle> 🤔 ↵doesn't work for glfw |
21:45:42 | FromDiscord | <TryAngle> it needs a `ptr` and gives `pointer` |
21:45:56 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44i6 |
21:46:07 | FromDiscord | <TryAngle> ah I'm not using globals anymore 😎 |
21:46:10 | FromDiscord | <Elegantbeef> `ref` is castable to `ptr T` |
21:46:18 | FromDiscord | <TryAngle> the changes are not pushedy et |
21:46:22 | FromDiscord | <Elegantbeef> `data =` isnt a global you nimskull |
21:46:40 | FromDiscord | <Elegantbeef> It's whatever the api uses |
21:47:47 | FromDiscord | <Elegantbeef> Whoops i said a word that hax follows |
21:47:53 | FromDiscord | <Elegantbeef> Sorry for summoning you |
21:48:53 | FromDiscord | <TryAngle> wait I push code in probably next 5 min and then link u to the lines,↵but I agree I will once I"m done adding all the events try redoing this part with refs, as I said before I think I only messed up at the recieving end and refs would have worked just as well |
21:49:33 | FromDiscord | <TryAngle> Ij ust fixed this end when I was using pointers + sharedAlloc0 already so I didn't redo it |
21:54:28 | * | rockcavera joined #nim |
21:54:28 | * | rockcavera quit (Changing host) |
21:54:28 | * | rockcavera joined #nim |
21:57:52 | FromDiscord | <dom96> guess I shouldn't say nimskull 3 times in front of a mirror eh |
21:58:31 | FromDiscord | <!Patitotective> is this their icon:nim1:💀? it shuld |
21:58:39 | FromDiscord | <!Patitotective> (edit) "shuld" => "should" |
21:59:00 | FromDiscord | <!Patitotective> better↵:nim1: ↵💀 |
22:02:58 | reversem3[m] | I'm not seeing an asymmetric encryption library, has anyone programmed with nim for RSA / ECC/ DES ? |
22:03:03 | FromDiscord | <jan0809> lol true |
22:03:29 | FromDiscord | <jan0809> meant the nimskull icon |
22:06:43 | FromDiscord | <jan0809> In reply to @reversem3 "I'm not seeing an": could that post help?↵https://forum.nim-lang.org/t/6547 |
22:08:32 | FromDiscord | <TryAngle> sent a long message, see http://ix.io/44ia |
22:08:47 | * | jmdaemon joined #nim |
22:19:47 | FromDiscord | <TryAngle> @ElegantBeef ok just changed it to ref and it works ;3 |
22:20:06 | FromDiscord | <TryAngle> and I didn't need any GCref() |
22:35:40 | FromDiscord | <Yardanico> you need GC_ref though, it just works for some time because refc is deferred RC |
22:35:48 | FromDiscord | <Yardanico> or maybe you're keeping your reference alive somewhere else |
22:36:37 | FromDiscord | <Elegantbeef> You want to gcref it to ensure it doesnt get allocated over and your program state is corrupted |
23:30:22 | FromDiscord | <TryAngle> In reply to @Yardanico "you need GC_ref though,": hm I'm using this data until the program ends |
23:31:03 | FromDiscord | <TryAngle> eventloop has a ref to this and the liftetime of eventloop is literally until the program ends |
23:31:20 | FromDiscord | <TryAngle> (edit) removed "has a ref to this" |
23:31:29 | FromDiscord | <Elegantbeef> Well then you're fine |
23:32:08 | FromDiscord | <Elegantbeef> I do have to ask what's the benefit of this over windy? |
23:32:15 | FromDiscord | <TryAngle> what is windy? |
23:32:24 | FromDiscord | <Elegantbeef> https://github.com/treeform/windy |
23:32:33 | FromDiscord | <Elegantbeef> Treeform's windowing library that's crossplatform |
23:33:28 | FromDiscord | <TryAngle> ah I wanted to support multiple window handling |
23:34:12 | FromDiscord | <TryAngle> and the library is talking a lot about opengl, i'm not sure if it's only for that, but I want to mainly focus on vulkan |
23:35:17 | FromDiscord | <TryAngle> (edit) "vulkan" => "vulkan↵ah ye it hard depends on opengl https://github.com/treeform/windy/blob/bba338590dbf30fc3418f5b749b9689a80a1df04/windy.nimble#L9" |
23:36:17 | FromDiscord | <TryAngle> and I liked winit's architecture a lot |
23:40:36 | FromDiscord | <Elegantbeef> I mean yes it currently uses opengl as the default, but you could fork it to support vulkan and other graphics API 😄 |