00:49:55 | * | krux02 quit (Remote host closed the connection) |
02:54:00 | * | derpydoo quit (Read error: Connection reset by peer) |
03:02:19 | NimEventer | New Nimble package! gemmaJSON - json parsing library based on bindings of simdjson, see https://github.com/sainttttt/gemmaJSON |
03:07:20 | NimEventer | New Nimble package! fedi_auth - A basic library to authenticate to fediverse instances, see https://codeberg.org/pswilde/fedi_auth |
03:07:20 | NimEventer | New Nimble package! gts_emoji_importer - A tool for admins to import custom emojis into GoToSocial, see https://codeberg.org/pswilde/gts_emoji_importer |
03:54:24 | * | beholders_eye quit (Ping timeout: 272 seconds) |
03:56:13 | * | beholders_eye joined #nim |
04:18:29 | * | beholders_eye quit (Ping timeout: 255 seconds) |
06:01:29 | * | advesperacit joined #nim |
06:20:07 | * | gooba quit (Ping timeout: 255 seconds) |
06:32:29 | PMunch_ | At least one way.. |
06:32:42 | * | PMunch_ is now known as PMunch |
06:38:56 | * | FromDiscord quit (Remote host closed the connection) |
06:39:10 | * | FromDiscord joined #nim |
06:39:38 | FromDiscord | <pmunch> Bridge has been rebooted, trying it now |
06:43:50 | * | gooba joined #nim |
06:55:23 | FromDiscord | <Chronos [She/Her]> Maybe this is a sign for a new bridge impl :P |
06:55:57 | FromDiscord | <Elegantbeef> Nah just let the boomers talk amongst themselves |
06:55:59 | PMunch | I mean a slight hickup every other year I think we can live with |
06:58:20 | FromDiscord | <Elegantbeef> ps it's hiccup 😛 |
06:58:44 | PMunch | Yeah I felt that was wrong |
06:59:01 | FromDiscord | <Elegantbeef> Hickapp is a application written by someone in the boons |
06:59:03 | FromDiscord | <Elegantbeef> So my software |
06:59:11 | FromDiscord | <ieltan> How do I use term rewriting macros so that they only work on a `let` declaration? I can see it should be possible since it's part of parameter predicate but I'm not sure about the syntax |
06:59:50 | FromDiscord | <Elegantbeef> iirc it's `{(let x = y)}(x, y: untyped` |
07:00:39 | FromDiscord | <ieltan> Alright, thanks! 😁 |
07:00:59 | FromDiscord | <Elegantbeef> Remember that TRMs should not change the typed meaning of a statement |
07:01:46 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4JhP |
07:02:07 | PMunch | Are the new concepts documented anywhere? |
07:02:14 | FromDiscord | <Chronos [She/Her]> In reply to @PMunch "I mean a slight": It has happened semi-often that the bridge breaks for a bit so |
07:02:16 | FromDiscord | <Elegantbeef> Also although you can use `untyped` for parameters TRM happens after typing so it does not particularly matter |
07:02:28 | FromDiscord | <Elegantbeef> The matrix bridge |
07:02:31 | PMunch | Was looking at that forum topic and wanted to look at the concept docs but couldn't find anything |
07:02:37 | FromDiscord | <Elegantbeef> The irc bridge is solid like eating 3lbs of cheese |
07:02:49 | FromDiscord | <Elegantbeef> The closest we have to docs are Araq's RFC |
07:03:00 | PMunch | Right.. |
07:03:51 | FromDiscord | <Elegantbeef> New style concepts are just pointless presently, other than a language built in trait syntax really |
07:04:10 | FromDiscord | <ieltan> In reply to @Elegantbeef "Remember that TRMs should": Well, I am wrapping a library that has a immutable/mutable api and want to bind the immutable api to let declarations and the mutable one to var declarations. Not sure if that's a good use of the feature but it's the only thing I thought of |
07:04:40 | FromDiscord | <ieltan> Both api are wrapped in a single type |
07:04:52 | FromDiscord | <Elegantbeef> Uhhuh |
07:04:59 | FromDiscord | <Elegantbeef> Sounds more like something for type states |
07:05:09 | FromDiscord | <Chronos [She/Her]> What's the use or term rewriting macros anyway? |
07:05:25 | FromDiscord | <Elegantbeef> Optimisations is the design |
07:05:34 | FromDiscord | <Elegantbeef> But I think it's the best semantic linter |
07:05:55 | FromDiscord | <Elegantbeef> https://forum.nim-lang.org/t/9739#64098 I always bring this up |
07:05:58 | FromDiscord | <ieltan> In reply to @Elegantbeef "Sounds more like something": What is a type state? I'm a noob as you can see 😅 |
07:06:06 | FromDiscord | <Chronos [She/Her]> How would you use it for optimisations? I can't see it |
07:06:42 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4JhQ |
07:06:43 | FromDiscord | <Elegantbeef> Read the manual for them |
07:06:54 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual_experimental.html#term-rewriting-macros |
07:07:45 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "https://forum.nim-lang.org/t/9739#64098 I always br": Oh that seems useful |
07:08:01 | FromDiscord | <Elegantbeef> That's an unintended feature really |
07:08:12 | FromDiscord | <Elegantbeef> Once you can introspect ast you can do a bunch of linting |
07:08:39 | FromDiscord | <ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4JhR |
07:08:44 | FromDiscord | <Elegantbeef> To top it off you can make a bunch of linters and just have a `--import:bleh` in your config |
07:08:58 | FromDiscord | <Elegantbeef> So they do not have to be in a single file and it can be quite customizable |
07:09:10 | FromDiscord | <Elegantbeef> But I'm told people do style linting, so it's not that great 😄 |
07:09:47 | FromDiscord | <Elegantbeef> https://forum.nim-lang.org/t/9976#65763 another example of typestates ieltan |
07:09:53 | FromDiscord | <Elegantbeef> Much more complete and 'proper' |
07:14:23 | FromDiscord | <ieltan> Wow, that's much clearer to me |
07:15:04 | FromDiscord | <ieltan> clever use of the type system, i'll steal some of that 😉 |
07:15:25 | FromDiscord | <Elegantbeef> Hey it's under some public domain or sharealike license 😄 |
07:15:33 | FromDiscord | <Elegantbeef> Don't recall what the forum uses |
07:16:37 | FromDiscord | <Elegantbeef> Anyway type states are an awesome part about having static type information |
07:17:00 | FromDiscord | <Elegantbeef> Much more ergonomic than having to have a type per state |
07:25:06 | FromDiscord | <ieltan> Seems like I can use your idea of using the term rewriting macros as a linter too |
07:59:29 | FromDiscord | <hasnainelahi.> Hello and Good Day!↵just a general question: is there any framework in any language that is faster in terms of the loading time of a simple and static web page? ↵Thank you! |
08:08:29 | * | jkl quit (Quit: Gone.) |
08:08:44 | FromDiscord | <nnsee> In reply to @hasnainelahi. "Hello and Good Day!": faster than what? |
08:09:15 | FromDiscord | <nnsee> are you asking if any framework will be able to produce a site that loads faster than a static web page? |
08:09:56 | FromDiscord | <nnsee> because the answer is that it depends on the site itself |
08:09:59 | FromDiscord | <nnsee> but generally, no |
08:12:22 | * | jkl joined #nim |
08:18:41 | * | jkl__ joined #nim |
08:20:05 | * | jkl quit (Ping timeout: 240 seconds) |
08:20:36 | * | jkl__ quit (Client Quit) |
08:26:25 | FromDiscord | <saint._._.> In reply to @chronos.vitaqua "src/gemmaJSON.out": Ooos thank you! |
08:26:48 | FromDiscord | <saint._._.> (edit) "Ooos" => "Ooops" |
08:27:06 | FromDiscord | <hasnainelahi.> In reply to @nnsee "are you asking if": thank you for answering, i updated my question i hope it is now more clear! |
08:27:39 | FromDiscord | <Chronos [She/Her]> In reply to @saint._._. "Ooops thank you!": Np! Also I'm wondering how much converting gemmaJsonNodes into JsonNodes would cost |
08:28:22 | FromDiscord | <nnsee> In reply to @hasnainelahi. "Hello and Good Day!": if it's a static website, why are you using a framework at all? use a static site generator |
08:28:22 | FromDiscord | <Chronos [She/Her]> Performance wise :p |
08:28:44 | FromDiscord | <nnsee> no framework, ever, will be faster than simple HTML + CSS |
08:29:00 | FromDiscord | <nnsee> the loading of the framework libs itself is enough overhead that it will negate any performance gains you might get |
08:29:07 | FromDiscord | <.aingel.> In reply to @chronos.vitaqua "Np! Also I'm wondering": What would be the use case of it |
08:29:22 | FromDiscord | <.aingel.> The main point of using the simdjson parser is that you don't want to parse out the whole object |
08:29:28 | FromDiscord | <.aingel.> If you do that you sort of lose the speed up |
08:29:44 | FromDiscord | <.aingel.> It's for when you want to access just one field, that's when the speedup increases really |
08:29:48 | FromDiscord | <.aingel.> IIRC |
08:31:53 | FromDiscord | <Chronos [She/Her]> That's fair enough |
08:31:53 | FromDiscord | <.aingel.> But yeah I should look into a way of doing it, just for ease of use or completeness if nothing else |
08:32:24 | FromDiscord | <Chronos [She/Her]> May be useful for db-related purposes when you need to store and parse it a lot? |
08:32:40 | FromDiscord | <Chronos [She/Her]> Parse, modify then store |
08:33:21 | FromDiscord | <.aingel.> Hmm yeah, well at least there should be a way to serialize which I don't have rn |
08:34:10 | FromDiscord | <ieltan> Don't need the JsonNodes, just the doc object on top of a std/json like API is enough imo |
08:34:48 | FromDiscord | <.aingel.> Gotcha, yeah |
08:47:56 | FromDiscord | <Chronos [She/Her]> In reply to @ieltan "Don't need the JsonNodes,": Imo it'd be important for compat with existing libs that take a JsonNode (prologue is one) |
08:50:10 | FromDiscord | <hasnainelahi.> In reply to @nnsee "if it's a static": But i want proper routes like domain/blogs ... etc how i can get with simple HTML + CSS ! |
08:50:55 | FromDiscord | <Elegantbeef> Generate a bunch of different pages then link to them |
08:52:41 | FromDiscord | <Elegantbeef> https://github.com/beef331/beef331.github.io/blob/master/website/src/website.nim#L229-L230 all I do in my shittily designed site that uses karax |
08:54:10 | FromDiscord | <nnsee> In reply to @hasnainelahi. "But i want proper": like I said, a static site generator. I use Jekyll for my blog, but I've heard good things about Hugo as well. It's also relatively easy to build your own. |
09:01:11 | * | PMunch_ joined #nim |
09:03:49 | * | azimut quit (Ping timeout: 252 seconds) |
09:04:27 | * | PMunch__ joined #nim |
09:04:55 | * | PMunch quit (Ping timeout: 252 seconds) |
09:05:27 | * | PMunch_ quit (Ping timeout: 240 seconds) |
09:06:19 | * | PMunch_ joined #nim |
09:09:19 | * | PMunch__ quit (Ping timeout: 252 seconds) |
09:23:56 | FromDiscord | <hasnainelahi.> In reply to @nnsee "like I said, a": i just gave the example of a blog site but i want to develop a landing page. |
09:26:12 | FromDiscord | <nnsee> i know, i used my blog as an example as well. you can use static site generators for any site |
09:26:26 | FromDiscord | <nnsee> https://themes.gohugo.io/tags/landing/ |
09:35:19 | FromDiscord | <hasnainelahi.> Thank you! 👍 |
09:42:52 | * | azimut joined #nim |
09:59:57 | FromDiscord | <sOkam! 🫐> Is there a way to give a define some value when declared inside a pragma? Something like:↵`{.define: thing = 1.}` replacing `-d:thing:1` |
10:37:26 | FromDiscord | <vindaar> sent a code paste, see https://play.nim-lang.org/#ix=4JiF |
10:59:31 | * | beholders_eye joined #nim |
11:11:19 | FromDiscord | <sOkam! 🫐> In reply to @vindaar "not quite what you": cannot be farthest from the goal. what I ask would serve as a way to define for those |
11:11:33 | FromDiscord | <sOkam! 🫐> would/could |
11:14:10 | PMunch_ | Anyone know what changed in 2.0.0 to have messed this up? /home/peter/.choosenim/toolchains/nim-2.0.0/lib/pure/unicode.nim(849, 36) Error: type mismatch: got 'int32' for 'RuneImpl(toLower(ar)) - RuneImpl(toLower(br))' but expected 'int' |
11:14:44 | * | PMunch_ is now known as PMunch |
11:24:40 | PMunch | Hmm, weren't there someone who wrote a import mapper thing? |
11:25:08 | PMunch | I get that error from unicode.nim, but I can't find out where it comes from.. |
11:30:32 | * | beholders_eye quit (Quit: WeeChat 3.6) |
11:31:26 | FromDiscord | <Phil> The only mapping I did was generating mapper procedures |
11:31:52 | FromDiscord | <Phil> ~~with excellent documentation~~ |
11:31:58 | PMunch | I meant creating a map of the imports |
11:32:07 | PMunch | Basically a graph of what import what |
11:32:39 | FromDiscord | <Phil> Actually that sounds sick if you output it as a mermaid graph |
11:33:51 | PMunch | Yeah, I'm pretty sure I've seen something like this.. |
12:32:40 | FromDiscord | <Schelz> sent a code paste, see https://play.nim-lang.org/#ix=4Jj5 |
12:33:49 | PMunch | --passL:"-fpass-struct=8"? |
12:38:08 | FromDiscord | <Schelz> thx i got it working |
12:41:03 | PMunch | By the way, you also have the packed pragma |
12:42:34 | FromDiscord | <Schelz> whats that ? |
12:47:06 | PMunch | https://nim-lang.org/docs/manual.html#foreign-function-interface-packed-pragma |
12:50:21 | * | beholders_eye joined #nim |
13:01:42 | FromDiscord | <Chronos [She/Her]> In reply to @heysokam "Is there a way": That seems impossible and just not doable in a sensible way |
13:02:27 | FromDiscord | <Chronos [She/Her]> Since, point of define toggles is that you know the value at time of compilation, before code is actually compiled so you know that when statements will be ran |
13:03:07 | FromDiscord | <sOkam! 🫐> In reply to @chronos.vitaqua "Since, point of define": how do you explain that `{.define:ssl.}` exists, then? |
13:03:16 | FromDiscord | <Chronos [She/Her]> Huh? That's a thing? |
13:03:25 | FromDiscord | <sOkam! 🫐> it does not exist for asigning values, but it does for non-value symbols |
13:03:29 | advesperacit | wow.. not only does testament litter it's trash everywhere, it then goes and reuses some old trash instead of recompiling when running `testament all` |
13:03:30 | FromDiscord | <sOkam! 🫐> In reply to @chronos.vitaqua "Huh? That's a thing?": yeah |
13:03:42 | FromDiscord | <sOkam! 🫐> (edit) "yeah" => "yeah. hence my question" |
13:03:48 | FromDiscord | <Chronos [She/Her]> Huh... Does that apply globally? Or only to the proc you use it on? |
13:04:13 | FromDiscord | <sOkam! 🫐> In reply to @chronos.vitaqua "Huh... Does that apply": it applies onwards since the moment you define it↵its just a C `#define thing` |
13:04:25 | FromDiscord | <sOkam! 🫐> what i was asking for is `#define thing 1` |
13:04:40 | FromDiscord | <sOkam! 🫐> so not that far away... just that I haven't found the syntax to do it |
13:05:32 | FromDiscord | <sOkam! 🫐> If its illegal, I figure it could be because of the lack of any type information, i guess 🤔 |
13:06:11 | FromDiscord | <Chronos [She/Her]> Ah hm |
13:06:42 | FromDiscord | <sOkam! 🫐> I hacked it in my compiler with `{.define: thing -> 1.}`... but was looking for a more standard way to write it |
13:07:00 | FromDiscord | <sOkam! 🫐> `=` is not allowed in pragmas, apparently |
13:07:02 | FromDiscord | <Chronos [She/Her]> Fair enough |
13:07:15 | FromDiscord | <Chronos [She/Her]> That seems really weird that this is even allowed to me but ig it makes sense |
13:08:36 | FromDiscord | <sOkam! 🫐> why? its just a regular compile-time define, and the code is parsed at compile time for macros, so its a lot less complicated that macros/templates, tbh |
13:08:56 | FromDiscord | <sOkam! 🫐> (edit) "the" => "nim" | "nimcode is ... parsed" added "already" |
13:09:41 | FromDiscord | <sOkam! 🫐> its also crazy useful to target certain library funcionality from another library↵like only using vulkan-glfw from a vulkan library |
13:09:44 | FromDiscord | <Chronos [She/Her]> It seems odd to me because that means midway through compilation you can change the behaviour of code that's compiled after that statement |
13:10:07 | FromDiscord | <Chronos [She/Her]> In reply to @heysokam "its also crazy useful": Fair enough |
13:10:32 | FromDiscord | <nnsee> In reply to @chronos.vitaqua "It seems odd to": i mean, yeah? that's the whole principle behind push and pop for example |
13:10:33 | FromDiscord | <sOkam! 🫐> idk when is parsed, though. i figure it must be interpreted during semantics |
13:10:48 | * | PMunch quit (Quit: Leaving) |
13:11:09 | FromDiscord | <sOkam! 🫐> so its probably not changing in-between compilation, but rather being stored before it |
13:11:23 | FromDiscord | <sOkam! 🫐> (edit) "in-between" => "mid" |
13:11:53 | FromDiscord | <sOkam! 🫐> blind guess, don't know for sure. but it seems sensible for it to be that way 🤷♂️ |
13:29:26 | FromDiscord | <Chronos [She/Her]> Fair |
13:44:26 | * | derpydoo joined #nim |
14:00:55 | * | alphacentauri quit (Quit: WeeChat 4.1.0) |
14:15:45 | * | xet7 quit (Remote host closed the connection) |
15:09:01 | * | azimut quit (Ping timeout: 252 seconds) |
15:24:02 | * | alphacentauri joined #nim |
15:31:34 | FromDiscord | <asakura44> hello people |
15:43:07 | FromDiscord | <Phil> Cheers |
16:00:06 | * | arkanoid joined #nim |
16:00:22 | * | alphacentauri quit (Quit: WeeChat 4.1.0) |
16:00:54 | arkanoid | is it just me or nimlsp seems much more stable,faster and less resource intensive than nimlangserver/nimsuggest |
16:01:21 | NimEventer | New thread by dlesnoff: Type introspection, see https://forum.nim-lang.org/t/10554 |
16:20:33 | FromDiscord | <.aingel.> In reply to @arkanoid "is it just me": Theres some big issue with nimlangserver that causes it to not kill the process when it quits or crashes or something |
16:21:00 | FromDiscord | <.aingel.> I saw someone else mentioning it and noticed I had loads of nimlangserver processes on my machine, so I switched back to nimlsp |
16:33:15 | * | alphacentauri joined #nim |
17:35:14 | FromDiscord | <pcarrier> What does vscode use? |
17:35:31 | FromDiscord | <pcarrier> (edit) "What does vscode use? ... " added "I’ll take the lighter stabler solution please 😉" |
17:36:38 | FromDiscord | <leorize> saem plugin uses nimsuggest directly, but I'd recommend something like nimlsp because it's in a better position to provide semantic data like parameter types |
17:36:55 | FromDiscord | <leorize> though it's worth noting that like nimsuggest, nimlsp also crashes a lot |
17:45:36 | FromDiscord | <jmgomez> there is an option to use the nimlangserver as well see https://github.com/saem/vscode-nim#nim-lanugage-server-integration-experimental |
18:30:06 | * | beholders_eye quit (Ping timeout: 260 seconds) |
18:31:45 | * | beholders_eye joined #nim |
18:42:55 | FromDiscord | <pcarrier> Is the nimsaem extension better than Konstantin Zaitsev? ngl went for the first one in the results, which seems to be a popularity contest |
18:44:13 | FromDiscord | <leorize> one is maintained and the other is not |
18:46:18 | FromDiscord | <Chronos [She/Her]> Which one is maintained? :p |
18:50:31 | FromDiscord | <pcarrier> Konstantin's hasn't seen a release since Mar 2020 |
18:50:50 | FromDiscord | <pcarrier> nimsaem's May 2022 |
19:10:57 | arkanoid | the difference is that when something goes wrong with nimlangserver and puppet nimsuggest processes, it's very possible (and happens quite a lot for me) that you end up with an army of puppet nimsuggest processes without master nimlangserver eating all your ram |
19:11:34 | arkanoid | while with nimlsp, which is compiled with nimsuggest logic code internally, it crashes without leaving puppet processes around |
19:11:58 | arkanoid | my personal record is 82 nimsuggest processes in htop |
19:14:20 | * | beholders_eye quit (Ping timeout: 255 seconds) |
19:16:40 | FromDiscord | <bostonboston> I forgot how many I had but my laptop came to a crawl, couldn't even type anymore |
19:16:45 | * | beholders_eye joined #nim |
19:20:16 | FromDiscord | <Chronos [She/Her]> Half-tempted to make a plugin for https://github.com/PMunch/nimlsp in VSC |
19:23:23 | FromDiscord | <Chronos [She/Her]> But I don't understand that stuff at all f |
19:25:36 | FromDiscord | <pcarrier> would love support for vscode's outline, if anybody wants to improve the situation there |
19:26:04 | * | azimut joined #nim |
19:42:49 | FromDiscord | <taperfade> hii |
19:42:55 | * | beholders_eye quit (Ping timeout: 255 seconds) |
19:43:05 | arkanoid | the first candidate for improvements should be nimsuggests, as that would improve basically both LSPs and seam extension when configured to use nimsuggest directly (default) |
19:43:54 | FromDiscord | <taperfade> I always get this error when using the unicode module in my code ↵can show code in dms !↵Error: unhandled exception: C:\Users\sillymee\.nimble\pkgs2\unicodedb-0.12.0-4452416471e2fe8726eb6070ed6ea7368171cc09\unicodedb\types.nim(23, 3) `cp.int <= 0x0010FFFF` [AssertionDefect] |
19:44:23 | arkanoid | but considering the possibility of nimsuggest code crashing anyway even after improvement, also improving the current state of LSPs and native vscode extension is valuable |
19:44:53 | FromDiscord | <JJ> yeah. i don't love that improvements to tooling have been delegated behind incremental compilation |
19:45:03 | * | beholders_eye joined #nim |
19:45:16 | FromDiscord | <JJ> In reply to @arkanoid "while with nimlsp, which": i should try out nimlsp again... |
19:45:23 | FromDiscord | <TӨMΛ ☠> sent a code paste, see https://play.nim-lang.org/#ix=4Jlh |
19:46:48 | FromDiscord | <Chronos [She/Her]> In reply to @arkanoid "the first candidate for": I wonder if a complete rewrite would help |
19:48:07 | FromDiscord | <nervecenter> In reply to @toma400 "Stupid question, but how": An array of char pointers? For a 2-D array or something? |
19:48:09 | FromDiscord | <JJ> In reply to @toma400 "Stupid question, but how": that looks like `newString(len: Natural)` |
19:48:26 | FromDiscord | <JJ> or wait i cannot read |
19:49:24 | FromDiscord | <ElegantBeouf> When can you read |
19:49:36 | FromDiscord | <ElegantBeouf> `let ptrPtr = cast[ptr cstring](create(cstring, BufSize))`↵or `allocCstringArray` |
19:49:40 | FromDiscord | <ElegantBeouf> Bridge be deaded |
19:49:41 | FromDiscord | <Elegantbeef> Or `newCstringArray` |
19:49:43 | FromDiscord | <Elegantbeef> Sorry `allocCstringArray` |
19:49:44 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Jlk |
19:49:44 | FromDiscord | <ElegantBeouf> There he is |
19:49:46 | FromDiscord | <Elegantbeef> Uh oh bridge is dead? |
19:49:48 | FromDiscord | <ElegantBeouf> The guy always is slow |
19:49:56 | FromDiscord | <JJ> rofl |
19:50:14 | FromDiscord | <nervecenter> If we know the context of the original line though, chances are Nim has a better solution, if that's what you might want |
19:50:25 | FromDiscord | <nervecenter> Without having to dip into double pointers |
19:50:26 | FromDiscord | <TӨMΛ ☠> In reply to @nervecenter "An array of char": I assume so, I got it from friend who is C fanatic and I kinda got him interested in Nim |
19:50:43 | FromDiscord | <ElegantBeouf> In reply to @nervecenter "If we know the": of course it's just a `seq[cstring]` afterall |
19:50:44 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Jlo |
19:50:51 | FromDiscord | <Chronos [She/Her]> But idk C that well so |
19:50:54 | FromDiscord | <JJ> that'd just be like. `seq[string]` i think |
19:50:55 | FromDiscord | <ElegantBeouf> you then just pass `mySeq[0].addr` |
19:51:18 | FromDiscord | <nervecenter> In reply to @toma400 "I assume so, I": Asking questions about new languages of C fanatics is kind of a pointless endeavour, they're always going to find pointless magic bullshit that not only serves little purpose but is actively bad practice, just because C can do it and compilers won't complain |
19:51:36 | FromDiscord | <JJ> hey nim can do pointless magic bullshit too |
19:51:41 | FromDiscord | <ElegantBeouf> Not really magic as much as C is not a typed language 😛 |
19:52:00 | FromDiscord | <ElegantBeouf> `char` is the same as `char[][]` or w/e the syntax is |
19:52:21 | FromDiscord | <nervecenter> Yes and C being untyped allows for all kinds of magic |
19:52:31 | FromDiscord | <nervecenter> Well |
19:52:33 | FromDiscord | <ElegantBeouf> I mean you can do the same in Nim though |
19:52:35 | FromDiscord | <nervecenter> Uniformally integer types I guess |
19:52:41 | FromDiscord | <nervecenter> (edit) "types" => "typed" |
19:52:47 | FromDiscord | <ElegantBeouf> You just need to use converters/operator overload |
19:52:47 | FromDiscord | <TӨMΛ ☠> In reply to @nervecenter "Asking questions about new": True, the only reason I'm dealing with him is that I know my Nim propaganda on the server is pretty working, and he is also open-minded to a degree |
19:52:59 | FromDiscord | <TӨMΛ ☠> Thanks everyone for your answers though, appreciating translations a lot ❤️ |
19:55:19 | FromDiscord | <nervecenter> I've replaced an old C program that had some magic in it with basically stock Nim and no magic, works exceedingly well for our business' needs right now. If anyone proposed moving back to C I'd have to berate them for trying to hamstring maintainability and features. |
19:55:58 | FromDiscord | <nervecenter> The old C code was also obfuscated so there's that lol |
19:56:02 | FromDiscord | <nervecenter> deliberately |
19:56:29 | FromDiscord | <nervecenter> entire algorithms of single-letter variable names |
19:58:11 | FromDiscord | <ElegantBeouf> Here I thought C was self obfuscating |
20:02:18 | * | rockcavera is now known as Guest5510 |
20:02:18 | * | tiorock joined #nim |
20:02:19 | * | Guest5510 quit (Killed (cadmium.libera.chat (Nickname regained by services))) |
20:02:19 | * | tiorock is now known as rockcavera |
20:02:25 | FromDiscord | <Chronos [She/Her]> Anyone able to comment on this? Any changes I should make to it so far? https://github.com/Supernovae-Chat/Specification/blob/main/README.md |
20:03:16 | FromDiscord | <ElegantBeouf> I find the usage of 3 32bit integers for your semver very optimistic |
20:03:55 | FromDiscord | <Chronos [She/Her]> Lol |
20:04:06 | FromDiscord | <Chronos [She/Her]> I was gonna use 3 `uint16`s before :p |
20:04:06 | FromDiscord | <ElegantBeouf> 1 32bit integer is more than enough |
20:04:41 | FromDiscord | <Chronos [She/Her]> I wanted to use semver tho? :p |
20:04:47 | FromDiscord | <ElegantBeouf> So? |
20:04:57 | FromDiscord | <Chronos [She/Her]> How would I do that in one uint32? |
20:05:01 | FromDiscord | <ElegantBeouf> bit shifting? |
20:05:14 | FromDiscord | <ElegantBeouf> if you divide it evenly you could have 10 bit semver numbers |
20:05:28 | FromDiscord | <ElegantBeouf> if you divide it unequally you could have 10,10,12 |
20:05:41 | FromDiscord | <ElegantBeouf> which means 1024, 1024, 4096 |
20:05:46 | FromDiscord | <ElegantBeouf> Which is clearly more than enough |
20:06:09 | FromDiscord | <Chronos [She/Her]> Oh that's actually a great idea0 |
20:06:10 | FromDiscord | <Chronos [She/Her]> - |
20:06:25 | FromDiscord | <Chronos [She/Her]> Thank you :D |
20:06:45 | FromDiscord | <Chronos [She/Her]> Tho would I still send it as `1.2.3` in the API or just as one int? Hm |
20:06:48 | FromDiscord | <ElegantBeouf> > One token will be generated for every time a user |
20:06:54 | FromDiscord | <ElegantBeouf> You'd send it as a single uint32 |
20:07:00 | FromDiscord | <ElegantBeouf> This is networking why would you send a string |
20:07:30 | FromDiscord | <ElegantBeouf> "Everytime a user" is really my least favourite thing |
20:07:36 | FromDiscord | <ElegantBeouf> I hate everytiming |
20:08:19 | FromDiscord | <ElegantBeouf> `string:len == 4` does this mean you'll have 4 byte length strings? |
20:08:24 | FromDiscord | <Chronos [She/Her]> My brain was frazzled at that point and I just dropped it for the day :p |
20:08:35 | FromDiscord | <Chronos [She/Her]> In reply to @elegantbeef "`string:len == 4` does": Yeah |
20:08:42 | FromDiscord | <Chronos [She/Her]> A char is a byte so yes |
20:08:48 | FromDiscord | <Chronos [She/Her]> I think |
20:08:56 | FromDiscord | <Chronos [She/Her]> Unless I misunderstand...which is very likely tbh |
20:11:07 | FromDiscord | <ElegantBeouf> Finally 'for external accounts (such as GitHub backed accounts)' thanks I hate it |
20:11:36 | FromDiscord | <Chronos [She/Her]> Lmao |
20:11:45 | FromDiscord | <ElegantBeouf> As an aside there isn't much to talk about really |
20:12:02 | FromDiscord | <Chronos [She/Her]> Hey, I'd make them enter a password so they can still login without that- |
20:12:14 | FromDiscord | <Chronos [She/Her]> Tho idk what to do if they link multiple services with diff emails |
20:12:18 | FromDiscord | <ElegantBeouf> Actually "Validation Token.↵↵ Essentially a 'proof of identity' token, should only be valid for 20 minutes at a time, as well as uniquely generated as soon as any app wants access to it." |
20:12:24 | FromDiscord | <ElegantBeouf> So you're reimplementing TOTP? 😄 |
20:13:54 | FromDiscord | <Chronos [She/Her]> Kinda ig? But it's used for implicit access to a website/other service wanting to access data from the account |
20:14:21 | FromDiscord | <Chronos [She/Her]> And also will allow for manually invalidating the token |
20:16:22 | FromDiscord | <leorize> you mean an app token? |
20:16:23 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Jlu |
20:16:33 | FromDiscord | <leorize> consider the oauth spec |
20:16:53 | FromDiscord | <leorize> what do you want for an output?↵(@Chronos [She/Her]) |
20:17:10 | FromDiscord | <Chronos [She/Her]> In reply to @leorize "consider the oauth spec": I... Completely forgot that existed lol |
20:17:43 | FromDiscord | <Chronos [She/Her]> In reply to @leorize "what do you want": Actually my code is fine I think, it's just my brain not working correctly again |
20:18:55 | FromDiscord | <0ffh> In reply to @chronos.vitaqua "I think I did": shift major by more, you only allowed two bits for minor |
20:19:53 | FromDiscord | <0ffh> sent a long message, see http://ix.io/4Jlv |
20:21:02 | FromDiscord | <Chronos [She/Her]> Ah okay I see what I did wrong, thanks! |
20:22:15 | FromDiscord | <Chronos [She/Her]> `4202499` is what I have now :D |
20:23:13 | FromDiscord | <0ffh> In reply to @chronos.vitaqua "`4202499` is what I": If you make all sizes divisible by 4 you get the distinct numbers neatly divided if you print the resulting number as hex. 😁 |
20:24:10 | FromDiscord | <Chronos [She/Her]> Hm... Nah, it should be fine I think |
20:24:57 | FromDiscord | <Chronos [She/Her]> Only need it as a way to transfer it over the network really |
20:31:22 | FromDiscord | <0ffh> sent a long message, see http://ix.io/4JlA |
20:34:19 | FromDiscord | <Chronos [She/Her]> Lol fair |
20:49:07 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4JlH |
20:49:21 | FromDiscord | <Chronos [She/Her]> I could return a uint16 instead but there's no point, really |
20:50:32 | FromDiscord | <Chronos [She/Her]> Tbf I don't even need the `MAJOR_BITMASK` but it makes my brain happy |
20:51:16 | advesperacit | If I put a test as `batchable: false`, shouldn't testament run that test alone without any other tests running concurrently? |
20:55:50 | FromDiscord | <0ffh> In reply to @chronos.vitaqua "Tbf I don't even": That's correct, but if you're lucky the compiler might even optimize the superfluous `and` away.↵Another thing, if you shift before masking you can use `(1 shl FIELD_SIZE)-1` for all the masks and you can reuse the same `FIELD_SIZE`s for the shifts, but it doesn't really make a difference. |
20:57:46 | FromDiscord | <Chronos [She/Her]> I don't understand what you mean by that sorry |
21:00:53 | FromDiscord | <ElegantBeouf> sent a code paste, see https://play.nim-lang.org/#ix=4JlL |
21:00:54 | FromDiscord | <ElegantBeouf> Even better |
21:01:28 | FromDiscord | <Chronos [She/Her]> That is also a thing that I can do, that I forgot about- |
21:01:29 | FromDiscord | <0ffh> sent a code paste, see https://play.nim-lang.org/#ix=4JlN |
21:01:50 | FromDiscord | <leorize> shift everything to the bottom bits then mask the top away |
21:02:31 | FromDiscord | <0ffh> In reply to @leorize "shift everything to the": That's what I meant, but it's all over now anyeay.↵Thanks to frech meat guy. |
21:02:56 | FromDiscord | <Chronos [She/Her]> Pfff yeah |
21:02:58 | FromDiscord | <0ffh> (edit) "anyeay.↵Thanks" => "anyway.↵Thanks" | "frech" => "french" | "tofrenchmeat guy. ... " added "🤣" |
21:06:15 | FromDiscord | <0ffh> So to recapitulate:↵1. Bit twiddling is fun↵2. Still, it's good to know your language's features |
21:06:42 | FromDiscord | <0ffh> Maybe even use them. |
21:06:50 | FromDiscord | <leorize> I'd recommend masking just because bit fields are terrible |
21:06:53 | FromDiscord | <Chronos [She/Her]> For sure |
21:06:58 | FromDiscord | <Chronos [She/Her]> In reply to @leorize "I'd recommend masking just": Oh? How so? |
21:08:58 | FromDiscord | <leorize> they're not very portable and have many undefined behavior |
21:09:17 | FromDiscord | <Chronos [She/Her]> Ah good to know |
21:09:29 | FromDiscord | <Chronos [She/Her]> I'll stick to masking then |
21:09:55 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4JlP |
21:09:56 | FromDiscord | <Chronos [She/Her]> That's my code then |
21:10:04 | termer | Nim playground is down again |
21:10:10 | termer | PMunch |
21:10:22 | FromDiscord | <Elegantbeef> Likely should have a `major=` for all the fields |
21:10:48 | FromDiscord | <Elegantbeef> and probably a `semver` constructor that takes in integers |
21:10:49 | * | jmdaemon joined #nim |
21:10:55 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "Likely should have a": I don't think I'd need to edit them at any time tbf |
21:11:05 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "and probably a `semver`": That was already planned at least |
21:11:36 | termer | Can I write a free money generator in Nim |
21:11:49 | FromDiscord | <Chronos [She/Her]> Huh? |
21:12:01 | FromDiscord | <Elegantbeef> Of course you can termer |
21:12:16 | FromDiscord | <Elegantbeef> Just make your own crypto currency and find some numpties to invest |
21:12:23 | FromDiscord | <Elegantbeef> Then pump and dump |
21:12:37 | termer | You got it |
21:12:50 | termer | I need to start a discord for dicknutball token |
21:13:19 | FromDiscord | <Chronos [She/Her]> In reply to @chronos.vitaqua "I don't think I'd": Ah wait that's useful when actually making the constructor |
21:13:47 | FromDiscord | <leorize> and hey, status even helpfully write you all the pieces to make a blockchain |
21:14:49 | termer | I will become Status 2.0 |
21:15:09 | FromDiscord | <Elegantbeef> If they're status, you're progress |
21:15:10 | termer | And be able to pump Nim full of money so they'll finally implement CPS in the compiler and fix HCR |
21:16:24 | FromDiscord | <Chronos [She/Her]> Maybe I still need the bitmasks for major, minor and patch anyway so I can actually set the other fields safely |
21:17:43 | FromDiscord | <Chronos [She/Her]> Is there any difference between `s.uint32 shr 22 and BITMASK_10` and `s.uint32 and MAJOR_BITMASK shr 22`? |
21:18:05 | FromDiscord | <Chronos [She/Her]> It doesn't seem like there would be any but hey, what do I know |
21:18:10 | FromDiscord | <0ffh> In reply to @termer "And be able to": I think CPS will only come after NIR is finished. |
21:18:21 | FromDiscord | <Elegantbeef> If you're setting you want to do `or` not `and` |
21:18:33 | termer | Dude, if they added CPS I'd be so happy |
21:18:47 | termer | then I'd begin rewriting everything async-related |
21:18:48 | FromDiscord | <Elegantbeef> Just do not need concurrency, problem solved |
21:18:53 | termer | Simple |
21:19:14 | termer | I write almost entirely network software, so this has been a thorn in my side |
21:19:33 | FromDiscord | <Elegantbeef> Yea I don't even know what a network device is |
21:19:37 | termer | The CPS lib is great, but it's slow because it's a macro |
21:19:45 | FromDiscord | <0ffh> In reply to @termer "Dude, if they added": IIRC the BDFL wrote that NIR will make CPS-tranform easier at lesat. |
21:19:56 | termer | yeah, I read the thing |
21:20:03 | FromDiscord | <Elegantbeef> Are we really going to say BDFL instead of "Araq" |
21:20:16 | termer | The ABDL |
21:20:16 | FromDiscord | <Elegantbeef> It's the same letters and way less dictatory |
21:20:46 | FromDiscord | <0ffh> In reply to @Elegantbeef "Are we really going": The name just escaped me for a second. 😅 |
21:20:47 | advesperacit | you can also write it with one hand |
21:21:09 | termer | Andreas Rumpf, our dear leader, wrote... |
21:21:10 | FromDiscord | <Elegantbeef> You can write anything with one hand |
21:21:19 | FromDiscord | <Elegantbeef> Little known fact, one does not have to touch type |
21:21:25 | advesperacit | but then I have to search for the keys.. |
21:21:32 | FromDiscord | <Elegantbeef> No you do not |
21:21:33 | termer | do you |
21:21:34 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "If you're setting you": How would that work though? Since `0b1010 or 0b0100` gives `0b1110` |
21:21:42 | termer | I can type with one hand without looking |
21:21:46 | FromDiscord | <Elegantbeef> I can mostly touch type with one hand |
21:21:47 | termer | not that I want to |
21:22:33 | FromDiscord | <Elegantbeef> its not that hard, just fairly errory |
21:23:27 | FromDiscord | <Elegantbeef> I always love that I do not even properly touch type with my right hand, I only use my pinky and index finger really |
21:24:11 | termer | pretty much |
21:24:22 | termer | Does anyone know why NIR happened all of a sudden |
21:24:37 | FromDiscord | <Elegantbeef> Araq probably had a whim and decided he wanted to do it |
21:24:37 | FromDiscord | <0ffh> In reply to @chronos.vitaqua "How would that work": Maybe he means, if you want to change a field first clear all the bits with `and` then set the new value with `or`. |
21:24:41 | termer | I didn't see anything about it on the forum and then all of a sudden I see an issue open on the GH repo |
21:25:03 | FromDiscord | <Chronos [She/Her]> In reply to @0ffh "Maybe he means, if": Ah that was what I was gonna do |
21:25:24 | termer | I'm hoping NIR isn't the start of a saga of backend foolery |
21:25:38 | FromDiscord | <Chronos [She/Her]> h? |
21:25:40 | FromDiscord | <Chronos [She/Her]> Oh? |
21:26:25 | * | jmdaemon quit (Ping timeout: 255 seconds) |
21:27:28 | FromDiscord | <0ffh> In reply to @termer "I'm hoping NIR isn't": It might be a good move for the medium to long term at least.↵I'm not sure, but I trust that he's thought it through. |
21:27:50 | termer | but why |
21:28:11 | termer | Is this another vector for creating toys, or is there actually a purpose |
21:28:59 | FromDiscord | <.aingel.> What is NIR? |
21:29:10 | FromDiscord | <muddmaker> nim intermediate representation |
21:29:22 | FromDiscord | <.aingel.> Oh right |
21:29:22 | termer | internal representation of Nim inside the compiler |
21:29:27 | FromDiscord | <0ffh> Kind of a bytecode for Nim. |
21:29:31 | termer | right |
21:29:37 | FromDiscord | <.aingel.> Right, yeah I remember people talking about that |
21:29:44 | FromDiscord | <.aingel.> What benefits will that give us |
21:29:53 | FromDiscord | <Chronos [She/Her]> In reply to @termer "Is this another vector": One use is to make it easier to generate code for different backends, and to make NimScript better (as a side-goal) I believe |
21:30:12 | termer | easier handling of it for transformations and backends supposedly .aingel. |
21:30:36 | FromDiscord | <0ffh> And enabling a REPL. |
21:30:39 | termer | I don't want more or different backends, nobody does |
21:30:48 | termer | NimScript improvements are good |
21:30:52 | FromDiscord | <.aingel.> Gotcha |
21:31:31 | FromDiscord | <Elegantbeef> Well that's not true termer, some people want native wasm, and some weirdos even want Java Python and Lua |
21:31:58 | termer | Native WASM is good, but having even more toys otherwise sucks |
21:32:07 | termer | spreading development effort too thin |
21:32:25 | FromDiscord | <Elegantbeef> I mean the more backends is more of a user done thing |
21:32:44 | FromDiscord | <Elegantbeef> The idea for more backends is down to users to process the generated IR |
21:32:48 | termer | I hope so |
21:33:01 | FromDiscord | <0ffh> Yes, it's only supposed to lower the hurdle. |
21:33:09 | FromDiscord | <Elegantbeef> A benefit of the IR is that it can be stored to the drive, loaded and handled anyway you want |
21:33:24 | FromDiscord | <Elegantbeef> Presently for making any tooling associated with Nim you have to manually plumb the compiler and handle it that way |
21:33:28 | termer | I imagine that could help with HCR |
21:33:30 | FromDiscord | <Chronos [She/Her]> In reply to @termer "I don't want more": By backends I mean existing ones |
21:33:34 | FromDiscord | <Chronos [She/Her]> To make codegen for them better |
21:33:51 | FromDiscord | <0ffh> In reply to @Elegantbeef "A benefit of the": Well, you could do that with an AST too.↵Only the AST is not flat. |
21:33:51 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "Well that's not true": 😛 |
21:34:04 | FromDiscord | <Elegantbeef> Reread what I said |
21:34:16 | FromDiscord | <Elegantbeef> Presently to do that with Nim you need to manually call the compiler then process the ast |
21:34:23 | FromDiscord | <Chronos [She/Her]> Obviously any other backends would be unofficial and community made (and thus, ignored without a hyperspecific usecase) |
21:34:41 | FromDiscord | <Chronos [She/Her]> Isn't another issue that the AST relies heavily on pointers currently? |
21:35:23 | FromDiscord | <Chronos [She/Her]> So a bytecode format is also a way of not needing to do some hackery |
21:36:08 | FromDiscord | <Chronos [She/Her]> (edit) "So a bytecode format is also a way of not needing to do some hackery ... " added "(or making major breaking changes to macros or something)" |
21:36:43 | FromDiscord | <Schelz> hi, how can i specify inside nim.cfg to use custom compile for cc ? |
21:37:01 | FromDiscord | <0ffh> In reply to @Elegantbeef "Presently to do that": Actually I was kind of disappointed that Nim has no option for writing and reading ASTs from disc.↵It could be quite useful. |
21:37:19 | FromDiscord | <ElegantBeouf> And just like that the bridge died briefly |
21:37:25 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4JlX |
21:37:31 | FromDiscord | <ElegantBeouf> I mean reading AST from disc is literally IC |
21:37:32 | FromDiscord | <ElegantBeouf> 😄 |
21:37:44 | FromDiscord | <Chronos [She/Her]> `semVer(1, 2, 3)` gives `3.2.0` |
21:37:54 | FromDiscord | <ElegantBeouf> In reply to @Schelz "hi, how can i": `--cc:....` |
21:38:02 | FromDiscord | <Schelz> i mean not the default one |
21:38:10 | FromDiscord | <Schelz> i want to use cl.exe from vs 2020 |
21:38:34 | FromDiscord | <0ffh> In reply to @elegantbeef "I mean reading AST": IC? |
21:38:39 | FromDiscord | <ElegantBeouf> Incremental compilation |
21:38:51 | FromDiscord | <0ffh> In reply to @elegantbeef "Incremental compilation": Oh, yes. |
21:39:25 | FromDiscord | <0ffh> I wanted to do some AST transforms and found I have to pull in the compiler to get access. |
21:39:50 | FromDiscord | <Elegantbeef> You can serialise pointers as just an index into a sequence that's easy |
21:40:17 | FromDiscord | <ElegantBeouf> I also do wonder whether the IR will aid in making headers for dynamic libraries easier |
21:40:25 | FromDiscord | <0ffh> In reply to @Elegantbeef "You can serialise pointers": Yeah, or just use LISP syntax. |
21:40:42 | FromDiscord | <0ffh> Absolutely trivial to generate and parse. |
21:41:52 | FromDiscord | <0ffh> It's the best and the worst thing about LISP, all at the same time. |
21:42:18 | FromDiscord | <ElegantBeouf> "How we used Lisp as a serialisation format, and how we killed people inccidentally" |
21:43:25 | termer | I laughed out loud |
21:43:39 | FromDiscord | <ElegantBeouf> Termer it wasn't that funny |
21:43:58 | termer | Making fun of LISP is unreasonably funny |
21:44:05 | FromDiscord | <Chronos [She/Her]> Nah, you're comedy gold, Beef |
21:44:12 | FromDiscord | <0ffh> My own language started out as a Scheme and I just added syntax and additional semantics on top. 🤷♂️ ↵Makes for an easy to implement macro system with tree matching, captures, etc. |
21:44:15 | FromDiscord | <ElegantBeouf> I always knew termer was deranged but never knew how deranged |
21:45:07 | FromDiscord | <ElegantBeouf> In reply to @chronos.vitaqua "Nah, you're comedy gold,": My friends assure me I have the comedic skill of a beheaded jester |
21:45:41 | FromDiscord | <0ffh> Imagine doing structured "regexes" on AST trees. |
21:46:36 | FromDiscord | <ElegantBeouf> You've never seen the HTML inspector someone wrote using regex and templates in Nim |
21:46:46 | FromDiscord | <0ffh> (edit) "AST trees." => "ASTs." |
21:47:16 | FromDiscord | <0ffh> In reply to @elegantbeef "You've never seen the": Must habe been a blast. 😂 |
21:47:23 | FromDiscord | <ElegantBeouf> It is awful to read |
21:47:27 | FromDiscord | <0ffh> (edit) "habe" => "have" |
21:47:32 | FromDiscord | <ElegantBeouf> It single handedly destablized the middle east |
21:47:32 | FromDiscord | <0ffh> I'm sure. |
21:48:25 | FromDiscord | <ElegantBeouf> Not that I like shitting on peoples code, but https://github.com/abdulbadii/HTML-XML-Operations-Nim/blob/main/rmHTMLement.nim |
21:48:25 | FromDiscord | <0ffh> I didn't really mean regexes though, that's why I put it in scarequotes. Only the structured analogue. |
21:48:41 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Jm0 |
21:48:54 | FromDiscord | <ElegantBeouf> That is 600 lines of completely unmaintainable code |
21:49:00 | FromDiscord | <Chronos [She/Her]> In reply to @elegantbeef "My friends assure me": Ah, positively hilarious then |
21:49:40 | FromDiscord | <Chronos [She/Her]> In reply to @elegantbeef "That is 600 lines": How so |
21:49:48 | FromDiscord | <ElegantBeouf> You didn't click the link did you? |
21:50:03 | FromDiscord | <Chronos [She/Her]> Aah I thought you meant what I sent lmao |
21:50:07 | FromDiscord | <Chronos [She/Her]> I was so cnfused |
21:50:17 | FromDiscord | <ElegantBeouf> Now now I only have 10 fingers I cannot count that high |
21:50:18 | FromDiscord | <0ffh> In reply to @elegantbeef "Not that I like": Oof, jep that's bad.↵Whenever I want to do something with HTML, XML or sth like that, I generate an AST and work on that. |
21:50:28 | FromDiscord | <ElegantBeouf> I mean of course you parse the code |
21:50:32 | FromDiscord | <ElegantBeouf> Why would you not parse the code |
21:50:36 | FromDiscord | <0ffh> Mixing parsing and processing is just awful. |
21:50:37 | FromDiscord | <ElegantBeouf> Well text rather |
21:50:41 | FromDiscord | <Chronos [She/Her]> In reply to @elegantbeef "Not that I like": A) Yes you do↵B) Wow I agree actually |
21:51:22 | FromDiscord | <ElegantBeouf> I do not like it |
21:51:28 | FromDiscord | <ElegantBeouf> It is just a side product of my humour |
21:52:08 | FromDiscord | <Chronos [She/Her]> The best part about it, then? |
21:52:10 | * | jmdaemon joined #nim |
21:52:30 | FromDiscord | <0ffh> A HTML parser is really a matter of one or two screens full of code. If it's more then something went wrong. |
21:52:50 | FromDiscord | <ElegantBeouf> In reply to @0ffh "A HTML parser is": Well as soon as you use regex for anything you've lost a battle |
21:53:36 | FromDiscord | <0ffh> In reply to @elegantbeef "Well as soon as": My standard tokenizer actually uses regexes. 😂 |
21:54:17 | FromDiscord | <0ffh> I maintain that that's actually a good thing. |
21:54:35 | FromDiscord | <0ffh> Everything hs it's time and place. |
21:54:44 | FromDiscord | <0ffh> (edit) "hs" => "has" |
21:54:58 | FromDiscord | <Chronos [She/Her]> Would using `~=` as an operator for "Major versions match" be fine? |
21:55:04 | FromDiscord | <Chronos [She/Her]> Just as a shorthand :p |
21:55:58 | FromDiscord | <leorize> the typical one for that'd be `^`↵(@Chronos [She/Her]) |
21:56:00 | FromDiscord | <0ffh> Usually the advice is to skimp on overloaded operators. |
21:56:01 | FromDiscord | <leorize> so like `^=`? |
21:56:09 | FromDiscord | <Chronos [She/Her]> Ah good to know! |
21:56:34 | FromDiscord | <Chronos [She/Her]> In reply to @0ffh "Usually the advice is": Obviously not going overboard, just `==` and `^=` (as well as the ones for assignment of fields) |
21:57:57 | FromDiscord | <Chronos [She/Her]> `semVer(1, 2, 3) ^= semVer(1, 0, 12)` epic |
21:58:23 | FromDiscord | <0ffh> In reply to @chronos.vitaqua "Obviously not going overboard,": Stuff like '==' is no trouble at all, if it means "check equality". The problems come in if you invent new operators or (god beware!) use known operaters for something completely different. |
21:58:45 | FromDiscord | <ElegantBeouf> I don't know that `^=` is better than `sameMajor` |
21:59:04 | FromDiscord | <ElegantBeouf> Or `match(a, b, {Major, Minor})` for instance |
21:59:08 | FromDiscord | <Chronos [She/Her]> Fair enough, I'll do that then |
21:59:19 | FromDiscord | <Chronos [She/Her]> In reply to @elegantbeef "Or `match(a, b, {Major,": Oh that actually looks very pleasant |
22:00:58 | * | jmdaemon quit (Ping timeout: 252 seconds) |
22:05:26 | termer | If you guys wanna hear a clusterfuck, let me tell you about the first Rtfl interpreter |
22:05:34 | termer | My scripting lang |
22:05:52 | termer | All weird parsing, it executed line by line as it parsed |
22:06:16 | termer | While loops would store the source and repeatedly parse and execute the body |
22:06:29 | termer | same thing with if blocks, just not repeated |
22:06:47 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Jm2 |
22:07:06 | FromDiscord | <Chronos [She/Her]> In reply to @termer "While loops would store": That sounds horrid |
22:08:24 | FromDiscord | <0ffh> Quite |
22:09:01 | termer | It was so slow |
22:09:05 | termer | absolutely hilarious |
22:09:30 | FromDiscord | <ElegantBeouf> Cmon chronos |
22:09:36 | FromDiscord | <ElegantBeouf> `Major in toMatch` |
22:09:55 | termer | someone needs to fix the playground |
22:10:04 | FromDiscord | <ElegantBeouf> You also can do `result = result and a.minor == b.minor` |
22:10:21 | FromDiscord | <ElegantBeouf> No clue which is nicer |
22:10:22 | FromDiscord | <Chronos [She/Her]> In reply to @elegantbeef "`Major in toMatch`": I used autocomplete ✨ |
22:11:15 | FromDiscord | <Chronos [She/Her]> In reply to @elegantbeef "You also can do": It'd probably be optimised out anyway, but I prefer making sure that the body of an if statement is allowed to run before actually entering the body |
22:11:22 | FromDiscord | <Chronos [She/Her]> Rather than not doing a behaviour in an if block |
22:11:34 | FromDiscord | <Chronos [She/Her]> ...that doesn't make sense, I'm just a dramatic bitch basically lmao |
22:11:50 | FromDiscord | <Chronos [She/Her]> Anyway, done for today! My brain can only handle so much thinking 😛 |
22:11:58 | FromDiscord | <0ffh> In reply to @elegantbeef "You also can do": One drawback of `and` instead of `&`, no `&=`. |
22:12:55 | FromDiscord | <Chronos [She/Her]> Could just implement it yourself but I don't think it's needed, personally |
22:14:12 | termer | Use when instead of if |
22:14:15 | FromDiscord | <0ffh> In reply to @chronos.vitaqua "Could just implement it": Yeah, but it would be inconsistent.↵It would have to be `and=`, and that wont generate a token, so you'd have to use backticks. |
22:14:54 | FromDiscord | <ElegantBeouf> Technically `bleh.and=` should work 😄 |
22:14:54 | FromDiscord | <0ffh> I think. |
22:15:05 | FromDiscord | <ElegantBeouf> Since `and=` would be a field assignment |
22:15:19 | FromDiscord | <ElegantBeouf> But you could also do `bleh.and =` |
22:15:26 | FromDiscord | <ElegantBeouf> So it's ugly |
22:16:02 | FromDiscord | <Chronos [She/Her]> In reply to @termer "Use when instead of": Doesn't work for runtime comparisons though? |
22:16:08 | FromDiscord | <0ffh> I might actually run with this, it's genius! 😂 |
22:16:12 | FromDiscord | <Chronos [She/Her]> That's the entire point :p |
22:16:21 | termer | restructure your code to use when |
22:16:32 | FromDiscord | <ElegantBeouf> lol |
22:16:36 | termer | it's faster |
22:16:43 | FromDiscord | <ElegantBeouf> You can use a `static set[T]` |
22:17:03 | FromDiscord | <ElegantBeouf> We're doing a few if statements it's not going to be the bottleneck in anyprogram |
22:18:25 | * | advesperacit quit () |
22:19:06 | termer | use when instead |
22:19:06 | FromDiscord | <0ffh> In reply to @elegantbeef "Since `and=` would be": I might actually run with this, it's genius! 😂 |
22:19:09 | termer | when is faster |
22:19:17 | FromDiscord | <ElegantBeouf> When is when faster? |
22:19:26 | termer | instant |
22:19:31 | termer | it's faster |
22:19:37 | termer | no runtime check |
22:19:40 | termer | no tradeoffs |
22:19:43 | FromDiscord | <ElegantBeouf> The fastest code is code that does not run |
22:19:50 | termer | everyone should be using when all the time |
22:20:01 | termer | insane that people keep using if |
22:20:28 | FromDiscord | <0ffh> In reply to @termer "insane that people keep": I think it's okay, as long as variables are involved. 😬 |
22:20:34 | termer | Not really |
22:20:40 | FromDiscord | <ElegantBeouf> termer is attempting comedy |
22:20:40 | termer | you're sacrificing performance |
22:21:01 | FromDiscord | <0ffh> In reply to @termer "you're sacrificing performance": to an evil demon? |
22:21:11 | FromDiscord | <ElegantBeouf> Daemon |
22:21:12 | termer | If requires a runtime check |
22:21:16 | termer | Just use when |
22:21:19 | FromDiscord | <ElegantBeouf> Only if a goat or virgin is involved though |
22:21:19 | termer | no runtime check |
22:21:31 | FromDiscord | <0ffh> I think termer is stuck in a loop |
22:21:32 | FromDiscord | <ElegantBeouf> Better yet, just don't check |
22:21:45 | FromDiscord | <ElegantBeouf> Checking at compile time slows down compile time |
22:21:48 | termer | That's not memory safe |
22:21:56 | termer | we have to make tradeoffs for safety |
22:24:49 | FromDiscord | <Chronos [She/Her]> In reply to @termer "restructure your code to": Can't do that via an API :p |
22:25:10 | FromDiscord | <Chronos [She/Her]> In reply to @elegantbeef "You can use a": That I could do tbf but |
22:25:36 | FromDiscord | <Chronos [She/Her]> In reply to @elegantbeef "termer is attempting comedy": I actually didn't notice that and thought he was being serious... 😓 |
22:26:08 | termer | hahahaha |
22:39:36 | * | jmdaemon joined #nim |
23:06:53 | * | jmdaemon quit (Read error: Connection reset by peer) |
23:27:09 | FromDiscord | <.aingel.> In reply to @0ffh "A HTML parser is": Is this really true? |
23:27:27 | FromDiscord | <.aingel.> libxml which is a widely used html/xml parser is way more than two screens of code |
23:28:01 | FromDiscord | <.aingel.> html can be complicated cause there is a lot of broken structure code that still should parse right |
23:28:16 | FromDiscord | <.aingel.> There are also special tags like <p> which cannot be nested, and so on |
23:36:22 | FromDiscord | <0ffh> In reply to @.aingel. "Is this really true?": Assuming it's well-formed. |
23:38:15 | FromDiscord | <0ffh> No trying to fix broken code with a bunch of heuristics. |
23:42:57 | FromDiscord | <0ffh> Also syntactic parsing only, no semantic checks or whatever. Just building the AST. |
23:43:53 | FromDiscord | <0ffh> Also syntactic parsing only, no semantic checks or whatever. |
23:44:20 | FromDiscord | <0ffh> Just building an AST from text source. |
23:46:42 | termer | HTML SUCKS |
23:46:50 | termer | XHTML is where it's at |
23:47:02 | FromDiscord | <0ffh> True. |
23:47:32 | termer | allowing malformed and shitty HTML to be accepted by browsers was a retarded idea |
23:47:44 | FromDiscord | <0ffh> Absolutely |
23:48:01 | FromDiscord | <0ffh> Look, it works on IE, your browser must suck! |
23:48:50 | FromDiscord | <0ffh> I do not consider broken HTML code to be HTML |
23:49:21 | FromDiscord | <0ffh> That's a mistake which is on Microsoft. |
23:49:40 | FromDiscord | <.aingel.> Well I still think there are special cases you have to know like no nested <p> tags |
23:49:48 | FromDiscord | <.aingel.> I bet there are other special rules in html |
23:50:43 | FromDiscord | <0ffh> In reply to @.aingel. "Well I still think": That's semantics. |
23:51:24 | FromDiscord | <0ffh> Doesn't matter for an AST generator. |
23:51:25 | FromDiscord | <.aingel.> Well do you just mean xml then? |
23:51:50 | FromDiscord | <0ffh> No I mean parsing, which is syntactic. |
23:52:06 | termer | <p>para1 <p>para2 |
23:52:16 | termer | technically well-formed HTML |
23:52:21 | termer | 2 paragraphs |
23:52:39 | FromDiscord | <.aingel.> Well @0ffh How are you defining html though |
23:52:44 | FromDiscord | <.aingel.> Seems like you are defining it as xml |
23:54:11 | FromDiscord | <0ffh> In reply to @.aingel. "Seems like you are": Maybe. I mean what I see as describes as "html" on w3schools, for example. |
23:54:41 | FromDiscord | <0ffh> (edit) "describes" => "described" |
23:54:51 | FromDiscord | <0ffh> https://www.w3schools.com/tags/tag_p.asp |
23:54:57 | termer | HTML has a spec |
23:55:03 | termer | it's just too lenient |
23:55:18 | termer | things like self-closing tags |
23:56:44 | FromDiscord | <0ffh> Well, it seems it has 5 specs at least.↵So maybe the name "html" is a bit fuzzy itself. |
23:57:13 | * | derpydoo quit (Read error: Connection reset by peer) |