<< 09-10-2022 >>

00:14:16NimEventerNew thread by tcheran: How to properly init a Table of seq, see https://forum.nim-lang.org/t/9515
00:23:56FromDiscord<Elegantbeef> @Patitotective\: so i got a little bored https://github.com/beef331/recyclable/blob/master/src/recyclable/unicode.nim
00:24:13FromDiscord<Elegantbeef> Parseutils is next but it uses magic so it's' a bit of a pain
00:25:38FromDiscord<konradmb> @albassort\: there is `parallel for` in stdlib https://nim-lang.org/docs/system.html#%7C%7C.i%2CS%2CT%2Cstaticstring
00:44:57*fallback joined #nim
02:08:50*arkurious quit (Quit: Leaving)
03:01:19*rockcavera joined #nim
03:01:19*rockcavera quit (Changing host)
03:01:19*rockcavera joined #nim
03:11:32FromDiscord<Mr.Ender> So I noticed something about links if you type "steam:(something)" it will take you to that page on the steam desktop app. How could I have links with my own custom thing: that would redirect to my app and send the url data to it?
03:11:41FromDiscord<Mr.Ender> (edit) "it?" => "it?↵↵(Please ping in reply)"
03:24:54FromDiscord<Rika> In reply to @Mr.Ender "So I noticed something": https://stackoverflow.com/questions/796748/how-can-i-add-a-custom-url-handler-on-windows-like-itunes-itms
03:36:48FromDiscord<Mr.Ender> In reply to @Rika "https://stackoverflow.com/questions/796748/how-can-": Thank you
03:37:05FromDiscord<Rika> It won’t really work for Linux , would prolly need a different solution
03:37:11FromDiscord<Rika> Probably also easily searchable
03:46:26FromDiscord<huantian> with linux you have to register a mime type
05:35:21FromDiscord<Not Saucx> Hi, How come when i try printing to console, terminal is blank unless i input something?
05:37:12FromDiscord<JustADigimon (she/her)> In reply to @Not Saucx "Hi, How come when": show code
05:38:28FromDiscord<Not Saucx> sent a code paste, see https://play.nim-lang.org/#ix=4cDO
05:38:47FromDiscord<Elegantbeef> You might need to do `stdoud.flushFile`
05:38:52FromDiscord<Elegantbeef> `stdout` rather
05:39:34FromDiscord<Not Saucx> In reply to @Elegantbeef "You might need to": where?
05:39:45FromDiscord<Elegantbeef> After you writeline
05:41:11FromDiscord<Not Saucx> In reply to @Elegantbeef "After you writeline": I still have to input
05:41:17FromDiscord<Not Saucx> b/4 it shows anything
05:41:25FromDiscord<Not Saucx> like why is it blank
05:41:33FromDiscord<Elegantbeef> Cause you dont flush the file
05:41:44FromDiscord<Elegantbeef> Your order is wrong
05:41:53FromDiscord<Not Saucx> what do I do?
05:41:57FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4cDS
05:41:58FromDiscord<Elegantbeef> swap those two lines
05:42:31FromDiscord<Not Saucx> yup
05:42:32FromDiscord<Not Saucx> haha
05:42:33FromDiscord<Not Saucx> ok
05:49:05*CyberTailor joined #nim
06:43:34*CyberTailor quit (Remote host closed the connection)
06:46:16*CyberTailor joined #nim
06:54:05*CyberTailor quit (Remote host closed the connection)
06:56:33*CyberTailor joined #nim
07:03:37FromDiscord<oswaltmalcolmbtc> sent a long message, see http://ix.io/4cE1
07:04:57*CyberTailor left #nim (Konversation terminated!)
07:09:39FromDiscord<Phil> <@&371760044473319454> The scum has invaded!
07:16:15FromDiscord<Elegantbeef> I've always been here
07:30:29strogon14When I set a cleanup proc with setControlCHook my program still exits with a return code of 130 and prints a traceback when I press Control-C to end it. How can I exit cleanly with Control-C?
07:33:11FromDiscord<Elegantbeef> `quit QuitSuccess` iirc
07:41:21strogon14No, that doesn't seem to have any effect (I had 'quit 0' before too)
08:28:46*Jjp137 quit (Ping timeout: 246 seconds)
08:29:06*Jjp137 joined #nim
08:37:26*pro joined #nim
09:34:22FromDiscord<qb> Hey I got issues to create a wrapper for a c library with nimterop. Two conditions I would like to have is just exporting symbols with `Ex` in it and also this library uses a lot of custom type definitions which I would like to have as standard nim types (https://github.com/rdbo/libmem/blob/master/libmem/libmem.h#L504). Could someone help out? I want to mention that this is the first time I'm using nimterop.
09:34:58FromDiscord<qb> Not sure if the type definition issue is doable
09:52:09*kenran joined #nim
10:11:48FromDiscord<skiddie99> hello alllll
10:11:54FromDiscord<skiddie99> I'm excited to be here:DD
10:12:03FromDiscord<skiddie99> may I ask you if anyone has used nim for making rest apis?
10:14:15FromDiscord<Bung> https://github.com/search?q=language%3Anim+rest
10:15:40FromDiscord<Phil> In reply to @skiddie99 "may I ask you": I have a medium large-ish rest api in production for a private website
10:16:11FromDiscord<skiddie99> In reply to @Isofruit "I have a medium": wow! Interesting! Is it running smoothly?
10:16:12FromDiscord<Phil> I am surprised it only shows up on page 2 of bungs search
10:17:03FromDiscord<Phil> In reply to @skiddie99 "wow! Interesting! Is it": Once it compiles it pretty much runs no issue. Did what I could to basically crash either during compilation or during start-up if anything is incorrect.
10:17:05FromDiscord<skiddie99> also, is there any possible way to connect it postgres? How nim handles json serialization?
10:17:46FromDiscord<Phil> there is db_postgres if you don't want to use an ORM and interact directly with the database.↵If you want an ORM there's norm. There are also other ORMs, but I don't use them so I can't say much about them.
10:18:05FromDiscord<skiddie99> I'm making rest apis with fastapi and other python frameworks, but found this fast http server library and I'm hooked:↵↵https://github.com/marcospereirampj/python-keycloak
10:18:08FromDiscord<Phil> And for json Serialization just look at jsony for direct JSON-string --> object instance conversion
10:18:12FromDiscord<skiddie99> I hate orms
10:18:32FromDiscord<skiddie99> does the db_postgres have pooling methods?
10:18:33FromDiscord<Phil> In reply to @skiddie99 "I hate orms": Personally I prefer them vastly over writing INSERT INTO statements manually.
10:18:48FromDiscord<skiddie99> raw sql is good for complex queries
10:19:09FromDiscord<skiddie99> I've seen huge performance improvement by using asyncpg in python and making sql queries directly
10:19:14FromDiscord<Phil> In reply to @skiddie99 "raw sql is good": Which is why norm has recently added support for raw SQL queries and converts them into object instances for you as long as you supply the correct type
10:19:56FromDiscord<skiddie99> okay but there is connection pooling with this db_postgres library, for many async connections, right?
10:20:01FromDiscord<Phil> Connection pooling you have to supply yourself.↵I did write a connection pooling lib out there that should work, but I work with sqlite in my spare time, not postgres so never bothered to in-depth test if it works flawlessly
10:21:18FromDiscord<Phil> Though you might also want to take a look at gatabase
10:22:05FromDiscord<Phil> Back when I went searching for ORMs I stumbled over it but dismissed it due to no sqlite support back then IIRC↵If I remember that correctly it comes with connection pooling built in
10:22:30FromDiscord<skiddie99> https://github.com/juancarlospaco/nim-gatabase
10:22:32FromDiscord<skiddie99> oh it's cool!
10:22:52FromDiscord<skiddie99> I appreciate it!
10:22:56FromDiscord<skiddie99> which http server are you using?
10:23:28FromDiscord<skiddie99> I've seen this one
10:23:28FromDiscord<skiddie99> https://github.com/dom96/httpbeast
10:23:31FromDiscord<skiddie99> seems top
10:24:05FromDiscord<Phil> I use the http server bundled with my webframework, that is prologue so I use httpx (a fork of httpbeast with windows compatibility. Not that I use windows but I have no reason to use async-http)
10:24:25FromDiscord<Phil> (edit) "async-http)" => "async-http, which is the alternative httpserver)"
10:25:08FromDiscord<skiddie99> what about httpbeast?
10:25:10FromDiscord<Phil> Jester, the more popular framework IIRC and Sinatra inspired (whatever that means) also comes with httpbeast
10:25:22FromDiscord<skiddie99> I mean would it be good for rest apis?
10:25:57FromDiscord<skiddie99> (edit) "I mean would it be good for rest apis? ... " added "(the httpbeast)"
10:26:28FromDiscord<Phil> Define good↵I'd choose Jester or prologue to build a rest api any day for the convenience procs that they provide
10:26:44FromDiscord<Phil> And they're both using httpbeast (or a fork of it) under the hood either way
10:27:53*kenran quit (Remote host closed the connection)
10:27:57FromDiscord<skiddie99> That's perfect! I really appreciate your help
10:28:02FromDiscord<skiddie99> One last dumb question
10:32:06FromDiscord<skiddie99> sent a long message, see http://ix.io/4cEx
10:32:22FromDiscord<skiddie99> dumbest question ever, ik
10:33:04FromDiscord<skiddie99> (edit) "http://ix.io/4cEx" => "http://ix.io/4cEy"
10:33:07FromDiscord<skiddie99> (edit) "http://ix.io/4cEy" => "https://paste.rs/d4R"
10:33:33FromDiscord<Phil> In reply to @skiddie99 "I want to use": Basically you want to use nim code in python or the other way around?↵nimpy
10:34:13FromDiscord<Phil> Though keep in mind that does not pull the python code into your binary. Which means to get your application running you'll need to have a python interpreter and the necessary libs installed
10:35:25FromDiscord<skiddie99> In reply to @Isofruit "Basically you want to": I mean to use nim code inside python
10:36:15FromDiscord<Phil> Though you could also look into a split service architecture, where you have one python server that deals with auth and provides a token that can be validated in the nim-server that deals with the majority of the actual request
10:37:07FromDiscord<skiddie99> yes!
10:37:13FromDiscord<Phil> containerize it all into 3 separate containers (reverse proxy, python-auth-server, nim-server) and bring it up via docker-compose
10:37:31FromDiscord<skiddie99> I have no idea with nim though, at first I thought it was a pythonic alternative, but no
10:37:31FromDiscord<Phil> or whatever other container-solution you want to use
10:37:35FromDiscord<skiddie99> and that's impressive
10:37:59FromDiscord<Phil> I mean, the syntax is reminiscent, and to me felt very familiar
10:38:02FromDiscord<skiddie99> I have never used containers.. aren't they slowing down in production?
10:38:10FromDiscord<Phil> But my god do I love the type safety
10:39:31FromDiscord<Phil> In reply to @skiddie99 "I have never used": Not really. For reference, I do containerize, my JSON responses take, on the server, somewhere between 12-70ms.↵The network latency of 30ms from my browser to the server and from the server to my browser is often way longer than the request takes to be processed on the server
10:40:02FromDiscord<skiddie99> what container do you use?
10:40:04FromDiscord<Phil> And that is with simple token auth, so I do hit the database always at least twice, once for auth, once to perform whatever query is required
10:40:09FromDiscord<skiddie99> (edit) "what" => "which"
10:40:21FromDiscord<Phil> (edit) "for auth," => "to check if the token is in my database,"
10:40:29FromDiscord<Phil> just simple docker containers
10:40:37FromDiscord<skiddie99> oh okay
10:40:42FromDiscord<skiddie99> do you think nim is faster than golang?
10:41:42FromDiscord<Phil> both are compiled languages. I don't know how much low-level optimization golang allows, in nim you can literally go as low as C and control when a particular piece of memory gets copied, when it gets moved etc.↵That allows for pretty fine-grained optimization
10:42:35FromDiscord<Phil> I also don't know how fast requests get processed in go typically, but I'd assume in either case the server will be well fast enough to deal with whatever you throw at it
10:42:48FromDiscord<Phil> (edit) "server" => "server/application"
10:43:21FromDiscord<Phil> And when it isn't that's 99% of the time a hint that you need tweak your algorithm and refactor some inefficient part instead of a language issue
10:43:32FromDiscord<Phil> (edit) "And when it isn't that's 99% of the time a hint that you need tweak your algorithm and refactor some inefficient part instead of a language ... issue" added "speed"
10:43:40FromDiscord<skiddie99> indeed
10:43:52FromDiscord<skiddie99> on python, FastAPI is fast only on development
10:44:03FromDiscord<skiddie99> well okay, it performs better than most of the python frameworks
10:44:13FromDiscord<skiddie99> but a great bottleneck is the json serialization
10:44:32FromDiscord<skiddie99> https://www.techempower.com/benchmarks/#section=data-r21&test=json
10:44:43FromDiscord<Phil> I'm surprised that it is, I'd have assumed somebody would have written some ridiculously fast serializer in CPP by now
10:45:13FromDiscord<skiddie99> Japronto is the first python framework on json serialization and when I combined it it performed better than fastapi or other frameworks
10:45:25FromDiscord<skiddie99> https://github.com/squeaky-pl/japronto
10:45:31FromDiscord<skiddie99> japronto is 50% C
10:46:18FromDiscord<Phil> Keep in mind that synthetic benchmarks are to be enjoyed with a planetary load of salt
10:46:19FromDiscord<skiddie99> but httpbeast is higher on that list
10:47:25FromDiscord<Phil> httpbeast is just a webserver. A ridonculously fast webserver, but it itself doesn't do json serialization (unless dom hid that somewhere in there).↵Things that (de)serialize are either std/json or jsony (which is considerably faster at that job than std/json)
10:47:26FromDiscord<skiddie99> they do provide the code though
10:47:26FromDiscord<skiddie99> https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/Nim/httpbeast/techempower.nim
10:48:29FromDiscord<Phil> That's not really measuring serialization though
10:48:56FromDiscord<Phil> That measures how quickly you can turn a predefined string into a json object and server that back (which converts the json object into a string again)
10:50:19FromDiscord<Phil> A measure for JSON de(serialization) performance would be to receive 10.000.000 different json-strings of the same shape but with different values and turn them all into objects.↵Or have 10.000.000 different objects and turn them into json strings and serve them
10:50:41FromDiscord<skiddie99> That is true
10:51:01FromDiscord<skiddie99> is there any chance that you have a sample code of a get request where I could test versus golang?
10:51:10FromDiscord<Phil> Basically, what you can for sure believe, is that general code in python will always be slow.
10:51:33FromDiscord<Phil> The only exception is once a C/C++ wrapper gets involved (numpy)
10:52:08FromDiscord<Phil> That's just by virtue of how python works. Everything else is... mostly a matter of how much time you spent on optimizing the crap out of every facet of your code
10:52:51FromDiscord<Phil> In reply to @skiddie99 "is there any chance": I mean, for what? A static HTML response?
10:53:25FromDiscord<skiddie99> In reply to @Isofruit "I mean, for what?": I would really appreciate a connection pooling to postgres, so I could compare it with golang and other frameworks
10:53:43FromDiscord<skiddie99> I'm afraid that if I do it by myself I'll break the code from the first few lines
10:54:00FromDiscord<skiddie99> like as simple as possible with minimal effort
10:54:24FromDiscord<skiddie99> like a get request "SELECT id, text, timestamp FROM table WHERE id = $1", id
10:54:28FromDiscord<Phil> In reply to @skiddie99 "I would really appreciate": I mean, that you can look into building yourself with gatabase 😛↵Given I'd need to set up postgres and all I'm a tad too lazy to do so
10:54:48FromDiscord<skiddie99> no I'll provide the postgres credits
10:55:00FromDiscord<Phil> Particularly given that the bottlenecks you'll run into are everywhere but your webserver
10:55:03FromDiscord<skiddie99> like the server and the rest
10:55:15FromDiscord<Phil> That is one of the reasons udemy can get away with using Django in prod even though its (comparatively) slow as molasses
10:56:18FromDiscord<skiddie99> I see.. could you please make me this basic skeleton in nim? I would really appreciate it and I'll send you db credits for the table
10:57:15FromDiscord<Phil> Basic examples for setting up a prologue application can be found in the prologue repository.↵From there you can basically just use db_postgres for raw database interaction without connection pooling (or see how to write it up in gatabase)
10:58:04FromDiscord<skiddie99> what if I buy you a beer? xD
10:58:54FromDiscord<Phil> Not going to happen either way, just look into it, it's really not the world
11:01:08FromDiscord<skiddie99> okay I'll give it a try. So the code junks (xD) I need are gatabase and Jester ?
11:03:39FromDiscord<Phil> In reply to @skiddie99 "okay I'll give it": a running postgres instance, jester/prologue (I use prologue, for jester there's a decent chunk of other folks around afaik... like, I'm one of 2 people by now that I'm aware are actively using prologue in this discord), gatabase (or db_postgres if you want to try without connection pooling) and jsony for the serialization from object to JSON
11:05:03*pro quit (Quit: pro)
11:05:14FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4cEJ
11:05:24FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4cEJ" => "https://play.nim-lang.org/#ix=4cEK"
11:06:11FromDiscord<Phil> The setup for the pragma should be completely correct, norm set up its own fk pragma similarly and that one works flawlessly:↵`template fk(val: typed) {.pragma.}`
11:06:26FromDiscord<skiddie99> jsony seems to handle datetime, where other libs in python failed (besides orjson). Thank you very much, I appreciate it!↵↵I gotta give it a try! Never used nim before
11:06:36FromDiscord<skiddie99> I'm super excitedxD
11:06:43FromDiscord<Phil> In reply to @skiddie99 "jsony seems to handle": Jsony can also trivially be expanded to deal with any custom datatype
11:07:46FromDiscord<Phil> I used that when I migrated from django to prologue.↵Django provided me with some seriously bad Datetime strings in the db, so I had to do my own date-time type that would seamlessly convert these strings to DateTime and back
11:08:35FromDiscord<Phil> (edit) "I used that when I migrated from django to prologue.↵Django provided me with some seriously bad Datetime strings in the db, so I had to do my own date-time type that would seamlessly convert these strings ... to" added "(when received via JSON)"
11:09:19FromDiscord<skiddie99> 2 questions,↵1. Which is faster overall (performance, productivity), jester or prologue?↵2. What's your take on NIM versus Julia? Can nim be used for machine learning in the future or Julia is better than NIM for data science etc?
11:11:03FromDiscord<Phil> In reply to @skiddie99 "2 questions, 1. Which": I haven't seen benchmarks, but either way I'd say it doesn't matter.↵We're talking about sub millisecond differences at that point.↵I'd say pick whatever jives with you more. If you coded with a sinatra-like framework before, I'd assume jester will feel familiar.↵To me, coming from Django, Prologue felt more at home so I used that.
11:11:04FromDiscord<Rika> Nim isn’t an acronym so just capitalise it like normal
11:11:44FromDiscord<Rika> A Sinatra like framework by the way is akin to a “microframework” which might be more familiar of a term for you
11:11:55FromDiscord<Phil> Ohhhhh that makes so much more sense
11:12:12FromDiscord<Rika> Haha
11:12:19FromDiscord<Rika> Sinatra is a Ruby library by the way
11:12:23FromDiscord<Phil> Due to my lack of using Jester I just had to go with what it self-described as
11:12:32FromDiscord<Rika> So jester is to Sinatra while prologue is to rails I guess
11:13:08FromDiscord<Phil> Though I wouldn't call prologue overly feature rich either, it basically simplifies configs a bit for you and deals with routing, both of which I'd assume jester does as well, no?
11:13:32FromDiscord<Phil> The main difference I've seen so far is that prologue comes with middlewares and allows you to swap out http server
11:13:59FromDiscord<Rika> That’s pretty much the main differences
11:14:00FromDiscord<Phil> Either way you're still wiring up everything yourself once a controller proc comes into play
11:14:01FromDiscord<Rika> I believe
11:15:04FromDiscord<skiddie99> I think I'll try the jester/gatabase and jsony
11:15:16FromDiscord<skiddie99> is there any faster alternative to jsony btw? I'm trying to overoptimize things xd
11:15:33FromDiscord<skiddie99> (edit) "I think I'll try the jester/gatabase and jsony ... " added "combo"
11:15:42FromDiscord<skiddie99> (edit) "combo" => "combo. What do you think?"
11:15:50FromDiscord<Rika> No
11:16:00FromDiscord<Rika> Faster alternative is not to use JSON I guess
11:16:20FromDiscord<Rika> JSON is just slow for computers because it’s human readable first
11:16:31FromDiscord<skiddie99> I'm trying to make a rest api
11:16:32FromDiscord<ngangngong> ok, so what's good?
11:16:35FromDiscord<Phil> I'd be hard pressed tbh.↵If there were, it'd need to be significantly faster than JSONY for me to even consider it due to how easily useable jsony is
11:16:49FromDiscord<ngangngong> CSV ftw Rika?
11:16:50FromDiscord<Phil> In reply to @skiddie99 "I'm trying to make": REST doesn't mean much, you can also do a REST api with XML
11:16:58FromDiscord<Phil> In reply to @ngangngong "CSV ftw Rika?": Binary formats
11:17:02FromDiscord<Rika> CBOR
11:17:05FromDiscord<Rika> I’d use CBOR
11:17:22FromDiscord<skiddie99> now that's crazy
11:17:37FromDiscord<Rika> I mean you do you really
11:17:48FromDiscord<Rika> If you wanna over optimise then there’s a strategy
11:18:04FromDiscord<Phil> Allow me to point out
11:18:12FromDiscord<Phil> We're talking about saving maybe 2ms
11:18:26FromDiscord<Phil> Unless you're sending/receiving gigantic amounts of JSON
11:18:42FromDiscord<Rika> In reply to @Isofruit "Unless you're sending/receiving gigantic": If you were you would probably not be looking at Nim really
11:19:12FromDiscord<skiddie99> In reply to @Isofruit "We're talking about saving": no not at all. Is there async support for jester?
11:19:17FromDiscord<Rika> Yes
11:19:37FromDiscord<Phil> In reply to @Rika "If you were you": I mean, at that scale I'd assume you just store it in a file and have a separate process crunch through the file
11:19:44FromDiscord<skiddie99> Awesome. I can't thank you enough guys for out chat, I really appreciate it!
11:19:47FromDiscord<Phil> (edit) "In reply to @Rika "If you were you": I mean, at that scale I'd assume you just store it in a file ... and" added "via a reverse-proxy like nginx"
11:20:17FromDiscord<skiddie99> you pointed out some great ideas
11:20:23FromDiscord<skiddie99> I'll try the coding part
11:20:48FromDiscord<Rika> I’d say weigh the effort to benefit before doing over optimisation lol
11:20:59FromDiscord<Rika> Done it before, feels so wasteful
11:21:30FromDiscord<Phil> ~~Mine didn't, and all I did was crunch down from 200ms-500ms to 40ms-100ms
11:21:34FromDiscord<Phil> (edit) "40ms-100ms" => "40ms-100ms~~"
11:21:47FromDiscord<Rika> Well that’s just optimisation if you’re reducing tens of milliseconds
11:22:07FromDiscord<skiddie99> I'm basically interested in making an api that can handle many concurrent users without failing
11:22:21FromDiscord<skiddie99> json serialization was the biggest bottleneck in python
11:22:27FromDiscord<skiddie99> along with the web server itself
11:22:29FromDiscord<Phil> Ah, you meant over-optimisation so that you can technically see the difference, not just that he user can feel a difference.↵Because my users certainly didn't notice one ^^'
11:22:34FromDiscord<skiddie99> besides the code
11:23:21FromDiscord<Phil> Anyway, any experience with writing your own pragmas Rika?
11:23:25FromDiscord<Rika> Yes
11:24:32FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4cEN
11:25:21FromDiscord<Phil> Argh, wait, no, I think I've got it, the 3rd time copy pasting revealed it I think
11:25:23FromDiscord<ngangngong> Which exactly (45, 23) is?
11:25:26FromDiscord<Rika> Lol
11:25:59FromDiscord<Phil> In reply to @ngangngong "Which exactly (45, 23)": It was the line with description
11:26:27FromDiscord<Phil> I was so overly focussed to make sure that the pragma declaration itself was correct my eyes just glossed over the fact that the pragma must be put before the type annotation
11:26:28FromDiscord<ngangngong> I think, i've never seen pragma like that? {.async.} or {.gcsafe.}
11:27:01FromDiscord<ngangngong> In reply to @Isofruit "I was so overly": so, {.pragma.} T
11:27:17FromDiscord<Phil> In reply to @ngangngong "I think, i've never": Its a custom pragma, down the line I need to annotate norm-model fields with it to specify whether a file should be stored directly in a configured media directory or a subdirectory of it
11:27:50FromDiscord<Phil> Like image fields, when an image is uploaded, store it in the subdirectory defined by the pragma within the root media directory
11:28:23FromDiscord<ngangngong> So correct one is {.pragma.} T over T {.pragma.} ?
11:28:48FromDiscord<Rika> Yes
11:28:51FromDiscord<ngangngong> Nice, gave me insight about custom pragma, even idk when to use.
11:28:58FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4cEO
11:29:02FromDiscord<Rika> Wait I misread
11:29:06FromDiscord<Rika> Me dumb lo
11:29:16FromDiscord<Phil> Don't forget the column after the pragma
11:29:24FromDiscord<Phil> colon?
11:29:24FromDiscord<Rika> Yeah it’s kind of strange, since it doesn’t apply to proc pragmas
11:29:28FromDiscord<Phil> Double point I mean
11:29:39FromDiscord<ngangngong> yeah it's colon
11:29:39FromDiscord<Rika> : is called colon indeed
11:30:00FromDiscord<Phil> Its one of those words I forget on a weekly basis
11:30:07FromDiscord<Rika> Not daily!
11:30:08FromDiscord<Phil> Because the german one is just that different
11:30:08FromDiscord<Rika> ?
11:30:14FromDiscord<Rika> Cologne
11:30:24FromDiscord<ngangngong> siblings of `;` the semi.
11:30:33FromDiscord<Phil> Word memory resets on Sunday 23:00 stat. We're efficient that way
11:31:02FromDiscord<Phil> In reply to @Rika "Cologne": That's the city.↵In german its "Doppelpunkt" - double point
11:31:09FromDiscord<Rika> It’s a joke
11:31:12FromDiscord<Phil> (edit) "its" => "it's"
11:31:16FromDiscord<Phil> Ahhh wooshed right over me
11:31:39FromDiscord<Phil> Ironically, the semicolon is called similar in german so that one I never forget
11:35:43FromDiscord<Rika> Semi cologne
11:38:04FromDiscord<Phil> Half a city or half fragrant water, that is the question
11:44:57FromDiscord<Phil> Alright, custom pragma works
11:55:01FromDiscord<skiddie99> how am I supposed to install the packages?
11:55:18FromDiscord<skiddie99> it's weird but I'm hooked, can't find it though lol
11:56:02FromDiscord<skiddie99> nimble install
11:56:04FromDiscord<skiddie99> ok got it
12:21:09FromDiscord<skiddie99> what are your thoughts about this one?↵https://github.com/treeform/pg
12:23:14FromDiscord<Rika> Looks fine to me
12:25:19FromDiscord<skiddie99> may I ask you how I can make pass a parameter to the query given by user in nim?
12:26:15FromDiscord<skiddie99> I don't know how to make the connection between jsony and the query basically
12:41:35FromDiscord<skiddie99> anyone? I'm stuck😅
12:42:00*derpydoo quit (Quit: derpydoo)
12:45:33FromDiscord<Patitotective> In reply to @Elegantbeef "<@762008715162419261>\: so i got": :]]]]]]]]]]
12:47:58*arkurious joined #nim
12:50:02FromDiscord<auxym> In reply to @skiddie99 "may I ask you": Like this? https://nimdocs.com/treeform/pg/pg.html#examples-inserting-data
12:50:59FromDiscord<skiddie99> https://media.discordapp.net/attachments/371759389889003532/1028650784050663424/unknown.png
12:51:13FromDiscord<skiddie99> that's my dumb code
12:52:02FromDiscord<skiddie99> I know it's bad
12:52:03FromDiscord<skiddie99> too bad
12:52:40FromDiscord<skiddie99> can't cope with nim language, I need help
12:54:00FromDiscord<auxym> well for one thing you can't name your `pg` variable with the same name as a module
12:54:35FromDiscord<skiddie99> it's totally crap the code, I know
12:54:39FromDiscord<auxym> I'm not familiar with jester otherwise, but compile, and fix errors one by one. if you can't figure out a specific error post the message here
12:54:44FromDiscord<skiddie99> hasn't anyone implemented rest apis in nim?
12:56:16FromDiscord<auxym> I haven't, I'm sure people have. Notably https://github.com/nim-lang/nimforum and possibly https://github.com/zedeus/nitter. you can try asking in #webdev tool
12:56:20FromDiscord<auxym> (edit) "tool" => "too"
13:00:00FromDiscord<skiddie99> oh okay, thank you mate
13:03:12*sagax joined #nim
13:10:03FromDiscord<Phil> Generally, posting the error message you receive during compilation also does help 😛
13:14:49FromDiscord<skiddie99> I have no idea how to struct code
13:14:51FromDiscord<skiddie99> it's day 0
13:15:00FromDiscord<skiddie99> so I would really appreciate any help
13:16:16FromDiscord<skiddie99> https://media.discordapp.net/attachments/371759389889003532/1028657146247778364/unknown.png
13:16:17FromDiscord<skiddie99> nim is weird
13:16:28FromDiscord<skiddie99> I beg for some help
13:17:30FromDiscord<auxym> your first error is `let id`, let is a constant/immutable variable so it needs to be assigned to something. if you want a mutable use `var` (and specify the type)
13:17:56FromDiscord<auxym> Have you read the nim tutorials at all? I'd recommend doing that first
13:18:33FromDiscord<skiddie99> I don't even know if "let id" is the problem at this point
13:18:45om3gaHi there! What I'm missing here: I have 2d sequence, declared like that: let seq = newSeqWith(len(spectrogram), newSeq[float64](255)), and I want to see it's element length: ... let len = high(seq[i]), it should work right?
13:18:50FromDiscord<skiddie99> I don't have any blueprint of how rest apis are made in nim
13:19:22FromDiscord<auxym> In reply to @skiddie99 "I don't even know": it's 100% one of your problems. like I said, fix problems one at a time...
13:19:46FromDiscord<vestel> In reply to @om3ga "Hi there! What I'm": You wanna see row or column len?
13:19:52om3gaclarification, that's just example, actually length of seq[i] is not known
13:20:10om3gavestel, the number of elements of row
13:20:16FromDiscord<Rika> High is not length of sequence
13:20:40FromDiscord<skiddie99> In reply to @auxym "it's 100% *one* of": but as I said, I'm not even sure if the structure of the code is correct, it would be pointless to fix the syntax if the struct is wrong be default
13:20:44om3gasorry, not length, but for loop
13:20:55om3gaelement count minus 1
13:21:10FromDiscord<Rika> In reply to @skiddie99 "but as I said,": As said before, your let id is wrong
13:21:35FromDiscord<auxym> In reply to @skiddie99 "but as I said,": fixing the syntax isn't pointless , it's required for the program to work...
13:21:46FromDiscord<skiddie99> In reply to @Rika "As said before, your": what about the db? is this even the correct way to make async apis?
13:21:59FromDiscord<Rika> Probably
13:22:04FromDiscord<Rika> Looks fine to me other than mentioned
13:22:48FromDiscord<Rika> I don’t remember how jester works anymore so I might be wrong
13:23:13FromDiscord<skiddie99> https://media.discordapp.net/attachments/371759389889003532/1028658895310307498/unknown.png
13:23:26FromDiscord<Rika> Ah
13:23:28FromDiscord<Rika> I didn’t notice
13:23:37FromDiscord<Rika> The database variable isn’t global
13:23:42FromDiscord<Rika> So you can’t access it in the route
13:24:06FromDiscord<skiddie99> just give me a chunk of code that works pleaase
13:24:37FromDiscord<skiddie99> I've no idea on how to do it in nim
13:25:43FromDiscord<Horizon [She/Her]> What's the most sensible way to see if an object type is in a sequence?
13:26:42FromDiscord<Horizon [She/Her]> I have an array of components and i want to be able to check if a certain component type is in an array
13:27:08FromDiscord<Horizon [She/Her]> Should i just add a `ComponentType` field?
13:28:53FromDiscord<skiddie99> https://media.discordapp.net/attachments/371759389889003532/1028660324938825878/unknown.png
13:29:21FromDiscord<skiddie99> 😕
13:31:05FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4cFc
13:31:21FromDiscord<skiddie99> In reply to @Isofruit "what's pg? The gatabase": https://github.com/treeform/pg
13:32:00FromDiscord<skiddie99> "Very simple PostgreSQL async api for nim."
13:32:14FromDiscord<skiddie99> issue here is the global variable
13:32:49FromDiscord<skiddie99> I have no idea how to struct the nim code, I'm trying to fix it the pythonic way though I'm not even sure what I'm doing at this point
13:36:17FromDiscord<Horizon [She/Her]> Does Nim have an alternative to interfaces in Java?
13:37:19FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4cFh
13:37:46FromDiscord<Phil> Given that you do not need any sql-arguments, you can just throw in an empty seq (seq = list in python)
13:37:53FromDiscord<Phil> A list you can instantiate via `@[]`
13:38:19FromDiscord<Phil> Like so: `let x: seq[string] = @[]`
13:39:11FromDiscord<Phil> the entire `let db` line I'd move out of the main proc and into general execution space, simply since that's the scope in which it'll be available anyway
13:39:32FromDiscord<Phil> If you do that you can also save yourself the global pragma
13:40:50*oisota quit (Quit: Ping timeout (120 seconds))
13:40:59FromDiscord<skiddie99> I don't even understand how I connect the get from the get route to the sql
13:41:14FromDiscord<skiddie99> https://media.discordapp.net/attachments/371759389889003532/1028663434042146817/unknown.png
13:41:18FromDiscord<skiddie99> I feel too dumb at this point
13:42:05FromDiscord<Phil> sent a long message, see http://ix.io/4cFi
13:42:17FromDiscord<skiddie99> sent a long message, see http://ix.io/4cFj
13:42:22FromDiscord<Phil> Backticks, ma dude
13:42:27FromDiscord<skiddie99> https://media.discordapp.net/attachments/371759389889003532/1028663736963182623/main.nim
13:43:00FromDiscord<skiddie99> sent a code paste, see https://play.nim-lang.org/#ix=4cFj
13:43:24FromDiscord<Phil> sent a long message, see http://ix.io/4cFk
13:43:36FromDiscord<Phil> (edit) "long message," => "code paste," | "http://ix.io/4cFk" => "https://play.nim-lang.org/#ix=4cFl"
13:43:48FromDiscord<auxym> yeah I have no idea how jester's macros works, but your `db` variable probably isn't accessible in that routes block. `{.global.}` doesn't make the variable accessible from the global scope, it just means that it's stored globally, like `static` in C, so it persists across function calls (non re-entrancy or somehting like that)
13:43:57*oisota joined #nim
13:44:21FromDiscord<skiddie99> I can change jester to anything else if somebody could guide me on that😅
13:45:29FromDiscord<Phil> Also your global pragma is borked↵you wrote `{.global}`, it must be `{.global.}`
13:45:40FromDiscord<Phil> Dots on both sides of the pragma name
13:46:09FromDiscord<skiddie99> sent a code paste, see https://play.nim-lang.org/#ix=4cFp
13:46:27FromDiscord<skiddie99> how am I supposed to get it work without getting drained?
13:48:37FromDiscord<auxym> In reply to @Isofruit "Also your global pragma": I'm pretty sure that the global pragma doesn't make a variable visible from the global scope, it just persists across function calls
13:48:53FromDiscord<skiddie99> so I gotta change the pg library?
13:49:28FromDiscord<auxym> you'd need to actually declare `db` in the top level scope. but I'm not sure if that's the best pattern, like I said I'm not familiar with jester and webdev in general
13:50:29FromDiscord<Patitotective> In reply to @Elegantbeef "<@762008715162419261>\: so i got": huh, it just fails now https://github.com/Patitotective/kdl-nim/actions/runs/3214356710/jobs/5254690133
13:51:25FromDiscord<skiddie99> https://github.com/treeform/pg/issues/3
13:51:29FromDiscord<Phil> In reply to @auxym "you'd need to actually": Its sometimes unavoidable. Particularly for connection pools I'd be okay with this.
13:53:36FromDiscord<Rika> In reply to @Isofruit "Also your global pragma": By the way single dot is actually valid syntax iirc
13:55:06FromDiscord<skiddie99> should this be supposed to work?
13:55:07FromDiscord<skiddie99> sent a code paste, see https://play.nim-lang.org/#ix=4cFu
13:56:16FromDiscord<skiddie99> taken from: https://github.com/treeform/pg/issues/3
13:58:22FromDiscord<skiddie99> I'll try db_postgres
13:59:02FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4cFv
13:59:20FromDiscord<Phil> db_postgres isn't going to let you escape from that as you need to also define all the stuff that newAsyncPool asks you to define, other than the number of connections
13:59:46FromDiscord<skiddie99> In reply to @Isofruit "First things first, do": I have my own database, the above code chunk was from a dude on issues of that lib
14:00:04FromDiscord<skiddie99> it seems that pg uses db_postgres internally
14:00:17FromDiscord<Phil> In reply to @skiddie99 "I have my own": That's fine, does that mean you know username, password and database-name to connect to?
14:00:26FromDiscord<skiddie99> In reply to @Isofruit "That's fine, does that": yes?
14:00:28FromDiscord<skiddie99> ofc
14:00:34FromDiscord<skiddie99> do you want me to send you access maybe?
14:00:52FromDiscord<Phil> No, that thing is on your machine, I couldn't access it anyway assuming its running local
14:01:04FromDiscord<skiddie99> I have a server running
14:01:21FromDiscord<skiddie99> so it's not on my machine, it's just on a machine
14:01:44FromDiscord<Phil> So I can assume you've accurately replaced "remote.host.domain", "user", "password", "dbname" in your actual code that you're compiling?
14:02:06FromDiscord<skiddie99> I didn't even compile the code
14:02:28FromDiscord<skiddie99> https://media.discordapp.net/attachments/371759389889003532/1028668771533066352/unknown.png
14:02:32FromDiscord<skiddie99> because of those errors
14:03:07FromDiscord<Phil> Remember what I wrote earlier about the missing third parameter?
14:03:20FromDiscord<skiddie99> yes..
14:03:23FromDiscord<Phil> That'd get you rid of one of the errors
14:04:06FromDiscord<skiddie99> you mean:↵↵WHERE id = ?", @[id]
14:04:06FromDiscord<Phil> I'm almost certain that's the only error actually
14:04:35FromDiscord<skiddie99> sent a code paste, see https://play.nim-lang.org/#ix=4cFy
14:04:39FromDiscord<skiddie99> how do I connect it with the get endpoint?
14:04:59FromDiscord<Phil> connect as in fire an http request to it to look at the generated HTML?
14:05:25FromDiscord<skiddie99> I mean is the code now correct?
14:05:44FromDiscord<skiddie99> https://media.discordapp.net/attachments/371759389889003532/1028669597974536192/unknown.png
14:05:46FromDiscord<Phil> Try to compile it and look at the error if one props up
14:06:02FromDiscord<Phil> Ah, one sec, you want a path parameter id
14:06:08FromDiscord<Phil> correct?
14:06:08FromDiscord<skiddie99> yes
14:06:38FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4cFz
14:06:48FromDiscord<Phil> Jesters way of declaring routes and everything looks pretty wild I'm not gonna lie
14:07:27FromDiscord<Phil> So you need to first add that parameter to your route string, aka `"/@id"`
14:08:19FromDiscord<Phil> And then you can access it via @"id" ... I assume it'll be recognized as a string, so if you want it as number you'll have to parse it into a number first.↵The procs for that are in std/strutils, should be called parseInt
14:08:42FromDiscord<Phil> (edit) "@"id"" => "`@"id"`"
14:11:07FromDiscord<skiddie99> or .format(id) I guess?
14:12:05FromDiscord<Horizon [She/Her]> In reply to @Isofruit "Dots on both sides": That doesn't matter
14:12:11FromDiscord<Horizon [She/Her]> From what ik at least
14:12:19FromDiscord<Phil> In reply to @Event Horizon "That doesn't matter": It does when the formatting looks unreadable
14:12:24FromDiscord<skiddie99> wait
14:12:32FromDiscord<skiddie99> sent a code paste, see https://play.nim-lang.org/#ix=4cFC
14:12:34FromDiscord<skiddie99> this stopped the errors
14:12:54FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4cFD
14:13:33FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4cFE
14:13:57FromDiscord<skiddie99> let me test it please
14:14:01FromDiscord<Horizon [She/Her]> In reply to @Isofruit "It does when the": Ah fair
14:15:19FromDiscord<Horizon [She/Her]> Does Nim have a way to add another value to an enum at compile time?
14:15:22FromDiscord<skiddie99> sent a code paste, see https://play.nim-lang.org/#ix=4cFG
14:16:53FromDiscord<auxym> macro?
14:17:01FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4cFI
14:17:24FromDiscord<Horizon [She/Her]> In reply to @auxym "macro?": I would have to be able to ectend it from another file, not in the same block
14:17:59FromDiscord<Horizon [She/Her]> So `enumName.addEnumField(ComponentName)`
14:18:22FromDiscord<skiddie99> sent a code paste, see https://play.nim-lang.org/#ix=4cFJ
14:18:47FromDiscord<auxym> In reply to @Event Horizon "I would have to": I'm not a huge macro expert, but I don't think that's possible. I think however with a `typed` macro you should be able to create a new enum typedef that extends the first
14:18:51FromDiscord<Horizon [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4cFK
14:18:56FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4cFL
14:19:31FromDiscord<Phil> In reply to @Event Horizon "I would have to": Best I can suggest is have that thing in the other file be a seq[string], fill that across files and finally turn that seq[string] into an enum latter
14:19:34FromDiscord<Phil> (edit) "latter" => "later"
14:19:49FromDiscord<Phil> Though even that I'm not fully sure how that'd work
14:19:52FromDiscord<Horizon [She/Her]> Hm
14:20:00FromDiscord<Horizon [She/Her]> Probably with a lot of macro hell haha
14:20:12FromDiscord<Horizon [She/Her]> I'd need to do this at compile time i'd imagine
14:20:15FromDiscord<skiddie99> I just want a json response with jsony of that data of the table
14:20:28FromDiscord<Phil> In reply to @Event Horizon "I'd need to do": You want to generate a type, that's forcibly at compiletime
14:20:45FromDiscord<Horizon [She/Her]> Yeah i mean in the way that, afaik, seqs aren't compile time
14:20:52FromDiscord<skiddie99> I don't get why there should be for row in rows: ? I guess it takes data from than 1 row only?
14:21:23FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4cFN
14:22:00FromDiscord<auxym> In reply to @Event Horizon "Yeah i mean in": seqs can be used in the vm, sure
14:22:11FromDiscord<skiddie99> sent a code paste, see https://play.nim-lang.org/#ix=4cFO
14:22:34FromDiscord<auxym> sent a code paste, see https://play.nim-lang.org/#ix=4cFP
14:22:37FromDiscord<Horizon [She/Her]> In reply to @auxym "seqs can be used": With the `static` block?
14:22:39FromDiscord<Phil> In reply to @Event Horizon "Yeah i mean in": They can be used that way ^^
14:22:48FromDiscord<Phil> Since you can have `const a = @[1,2,3,4]`
14:22:58FromDiscord<skiddie99> that's all I see
14:23:01FromDiscord<skiddie99> https://media.discordapp.net/attachments/371759389889003532/1028673946679251014/unknown.png
14:23:02FromDiscord<Phil> That means you can have compile-time seqs
14:23:18FromDiscord<auxym> In reply to @Event Horizon "With the `static` block?": or in a macro, a const def, a compiletime proc, anything that runs at compile time...
14:23:32FromDiscord<Horizon [She/Her]> Ah fair
14:23:41FromDiscord<Phil> In reply to @skiddie99 "that's all I see": Does that message pop up actively when you try to compile or is that just your IDE pre-emptively warning you?
14:23:49FromDiscord<Phil> Because chances are your IDE is wrong in this case
14:24:04FromDiscord<Horizon [She/Her]> In reply to @skiddie99 "": Are you using the Nimsaem extension?
14:24:15FromDiscord<skiddie99> sent a code paste, see https://play.nim-lang.org/#ix=4cFR
14:24:54FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4cFS
14:25:05FromDiscord<Phil> Treeform may have forgotten a dependency in his nimble file
14:25:29FromDiscord<skiddie99> you're god
14:26:35FromDiscord<Phil> Could you do me a favor, open your vscode on the pg nim file and copy paste me the first 10 lines?↵SOmething feels very wrong
14:26:38FromDiscord<Phil> (edit) "lines?↵SOmething" => "lines?↵Something"
14:27:37FromDiscord<skiddie99> sent a code paste, see https://play.nim-lang.org/#ix=4cFT
14:28:26FromDiscord<skiddie99> oh you mean that you cannot see any print on the lines of https://github.com/treeform/pg/blob/master/src/pg.nim ?
14:28:52FromDiscord<Phil> Yeah
14:29:06FromDiscord<Phil> Wait... god damnit if db_postgres imports print
14:29:46FromDiscord<skiddie99> I don't get it.. what should I do?
14:30:53FromDiscord<Phil> Alright, first things first, what data type do you think is `@["id"]`?
14:31:01FromDiscord<skiddie99> it's integer
14:31:05FromDiscord<skiddie99> on the postgres db
14:31:07FromDiscord<Phil> nope, that's seq[string]
14:31:30FromDiscord<Phil> "id" is the string "id"↵@"id" is likely the path parameter value, but still in string form
14:32:17FromDiscord<Phil> And what's happening is that db_postgres is taking your "id" parameter and put that into the select query placeholder and failing since it expects an integer there (see error)
14:32:35FromDiscord<skiddie99> yup I've faced it with python before
14:32:45FromDiscord<skiddie99> I need to declare it as integer like let id L int ?
14:32:51FromDiscord<skiddie99> (edit) "L" => ":"
14:32:57FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4cFW
14:33:22FromDiscord<Phil> You can of course do more at once, but this is the sort of thing where writing down every type is beneficial
14:33:50FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4cFW" => "https://play.nim-lang.org/#ix=4cFX"
14:34:01FromDiscord<Phil> Try to get into the habit of going in small steps at first and always writing out the types you expect to see
14:34:44FromDiscord<Phil> Helps catch errors faster as soon as the compiler says that variable "X" is of type "Y" but you said its of type "Z"
14:35:05FromDiscord<skiddie99> https://media.discordapp.net/attachments/371759389889003532/1028676981115592816/unknown.png
14:35:19FromDiscord<Phil> The star was a typo
14:36:07FromDiscord<skiddie99> sent a code paste, see https://play.nim-lang.org/#ix=4cFY
14:36:30FromDiscord<Phil> Looks like it compiled
14:36:44FromDiscord<Phil> So no syntax errors
14:37:53FromDiscord<Phil> Sidenote btw., for now keep compiling as you are.↵Once you compile for production you want to add the flag `-d:release` in order for gcc to do all proper optimizations, gives you roughly a 10x speed up
14:38:10FromDiscord<skiddie99> sent a code paste, see https://paste.rs/eNA
14:38:16FromDiscord<skiddie99> sent a code paste, see https://paste.rs/ptt
14:40:07FromDiscord<skiddie99> is this how it should be?
14:40:08FromDiscord<skiddie99> sent a code paste, see https://play.nim-lang.org/#ix=4cG0
14:40:49FromDiscord<Phil> Just checked the proc again, it eats a seq string... I'm not sure why the heck it would, but apparently it does.↵Try to do `@[idStr]`
14:41:17FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4cG1
14:41:40FromDiscord<Phil> I've been to spoiled by ndb which handles these types properly I guess
14:42:12FromDiscord<skiddie99> it run but 2 issues
14:42:14FromDiscord<skiddie99> 1.
14:42:33FromDiscord<skiddie99> sent a code paste, see https://play.nim-lang.org/#ix=4cG2
14:43:22FromDiscord<skiddie99> 2. https://media.discordapp.net/attachments/371759389889003532/1028679067689566318/unknown.png
14:43:30FromDiscord<skiddie99> it doesn't look like json
14:44:23FromDiscord<skiddie99> I mean in the api format
14:44:51*jmdaemon quit (Ping timeout: 248 seconds)
14:45:25FromDiscord<skiddie99> it seems that the favicon thing happens only at the beginning
14:45:37FromDiscord<skiddie99> and then for the json that's because of DEBUG 200 OK {"content-type": @["text/html;charset=utf-8"]}
14:45:43FromDiscord<skiddie99> content type
14:46:33FromDiscord<Phil> In reply to @skiddie99 "2.": That's a perfect JSON representation of what you gathered out of the database.↵You fire a query and receive a `Row`.↵Row is just another name for `seq[string]`.↵If you want some sort of key-value thing, you need to first parse the `Row` into an object, that's what ORMs in nim are for
14:46:56FromDiscord<Phil> An absolutely minimal one that is solely for converting Row into object and does nothing else would be nisane
14:47:03strogon14To answer my question from this morning "How can I exit cleanly with Control-C?". The traceback and exit code I was seeing was actually from the compiler (nim compile -r), not my program. That got me confised :-(
14:49:01FromDiscord<skiddie99> In reply to @Isofruit "That's a perfect JSON": can I please have a content type response: json ?
14:51:22FromDiscord<skiddie99> In reply to @Isofruit "That's a perfect JSON": I think it's the response that should be returned as json to get key-value result, not the orm itself. In python I can have this json content headers without using orm at all
14:52:29FromDiscord<skiddie99> sent a code paste, see https://play.nim-lang.org/#ix=4cGa
14:52:58FromDiscord<skiddie99> (edit) "https://play.nim-lang.org/#ix=4cGa" => "https://play.nim-lang.org/#ix=4cGb"
14:55:58FromDiscord<Horizon [She/Her]> Trying to make a macro that does a check for if a certain component exists but idk how i'm supposed to implement that really
14:56:18FromDiscord<Horizon [She/Her]> Also, is it possible to define a custom pragma?
14:56:53FromDiscord<skiddie99> found it
14:56:57FromDiscord<skiddie99> I added , "application/json"
14:57:01FromDiscord<Horizon [She/Her]> I wanna make an `ensureComponents` pragma, so you'd do `{.ensureComponents: BaseComponent, InfoComponent.)`
14:58:47FromDiscord<auxym> pragma macros are a thing IIRC, never used them. that might be possible if you pass your enum type as a `typed` argument to the macro, so it can introspect it
14:59:16FromDiscord<auxym> I think
14:59:20FromDiscord<Horizon [She/Her]> Alright, thanks!
14:59:29FromDiscord<Horizon [She/Her]> So would a pragma macro just be a macro definition?
14:59:38FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4cGe
14:59:58FromDiscord<Horizon [She/Her]> In reply to @Event Horizon "So would a pragma": I'd imagine it'd pass the proc as the first param
15:00:40FromDiscord<Phil> Also solves the favicon issue.↵Favicon is the icon it shows on the top left in your tab. Typically its served on `<DOMAIN>/favicon.ico`.↵Due to the pattern you set up (`<DOMAIN>/<Anything as String>`) it also tried to resolve that request for the favicon
15:01:58FromDiscord<Phil> Note that with nisane it is mandatory that the order of fields in your Object-type and the order of columns in your SQL query match perfectly.↵So if you have an "id" column first, your first field on the object type must be called "id"
15:03:33*derpydoo joined #nim
15:04:07FromDiscord<skiddie99> sent a code paste, see https://play.nim-lang.org/#ix=4cGm
15:09:20FromDiscord<Rika> In reply to @Event Horizon "I'd imagine it'd pass": last param i believe
15:09:52FromDiscord<Horizon [She/Her]> Aah, thanks!
15:10:07FromDiscord<skiddie99> @Phil what about the
15:10:14FromDiscord<skiddie99> ?
15:10:19FromDiscord<skiddie99> sent a code paste, see https://play.nim-lang.org/#ix=4cGp
15:10:21FromDiscord<Phil> sent a long message, see https://paste.rs/an6
15:10:45FromDiscord<skiddie99> which would be the most performant way to do it?
15:10:49FromDiscord<Phil> (edit) "http://ix.io/4cGr" => "http://ix.io/4cGq"
15:10:52FromDiscord<skiddie99> is my approach bad?
15:11:22FromDiscord<Phil> Ah, no I just didn't see that particular resp definition
15:11:24FromDiscord<Phil> Should be fine
15:11:29FromDiscord<Phil> It's more explicit that way
15:11:55FromDiscord<Phil> ~~jester really could use some better docs~~
15:12:54FromDiscord<skiddie99> @Phil , I have no words to thank you enough for your support!
15:13:03FromDiscord<skiddie99> this is our final result I guess?
15:13:11FromDiscord<skiddie99> sent a code paste, see https://play.nim-lang.org/#ix=4cGs
15:13:24FromDiscord<skiddie99> (edit) "https://play.nim-lang.org/#ix=4cGs" => "https://play.nim-lang.org/#ix=4cGt"
15:15:46FromDiscord<Phil> pretty much.↵↵Sidenote: I'll admit prologue is more verbose than this, but given that I can more easily split out associating procs with routes, I know my preference.
15:16:37FromDiscord<Phil> Also a lot less magic
15:16:41FromDiscord<Phil> (edit) "magic" => "magic, which I prefer"
15:17:13FromDiscord<skiddie99> less magic in prologue or jester?
15:17:40FromDiscord<Phil> prologue
15:17:47FromDiscord<skiddie99> oh okay
15:18:04FromDiscord<skiddie99> I'd like to see a prologue version as well, to be honest
15:18:42FromDiscord<skiddie99> compared to python, I was expecting to write a lot more lines of code
15:18:51FromDiscord<skiddie99> those 9 lines? wow
15:19:19FromDiscord<Horizon [She/Her]> Is there a generic type for `proc` i should use for macros?
15:19:25FromDiscord<Phil> Prologue would've been easily double that I think
15:19:38FromDiscord<Horizon [She/Her]> Since the pragma could be used on a method with any amount of arguments
15:19:48FromDiscord<Horizon [She/Her]> And return value
15:19:49FromDiscord<skiddie99> In reply to @Isofruit "Prologue would've been easily": yeah I don't mind, I'd like to see that.. By the way, isn't the 9 lines better than making classes?
15:19:50FromDiscord<Phil> In reply to @Event Horizon "Is there a generic": You can write generic proc types, I use generic proc types all the time
15:19:58FromDiscord<Horizon [She/Her]> How do i do them?
15:20:31FromDiscord<Horizon [She/Her]> Also need a way to check if it should be executed lol
15:20:31FromDiscord<Phil> In reply to @Event Horizon "How do i do": Like anything else. Here an example proc type:↵type ReadProc[REQUESTPARAMS: object, ENTRY: Model] = proc(connection: DbConn, params: REQUESTPARAMS): ENTRY
15:20:41FromDiscord<Phil> (edit) "type:↵type" => "type:↵`type" | "ENTRY" => "ENTRY`"
15:20:46FromDiscord<Horizon [She/Her]> Yeah but that isn't generic?
15:20:57FromDiscord<Horizon [She/Her]> Since it'd require at least two params
15:21:08FromDiscord<Horizon [She/Her]> and a return type
15:21:12FromDiscord<Phil> That is a generic proc type with the 2 generic parameters REUQESTPARAMS and ENTRY.↵Or do you mean variable number of parameter of varying types?
15:21:15FromDiscord<Horizon [She/Her]> I'm using the macro as a pragma
15:21:25FromDiscord<Horizon [She/Her]> In reply to @Isofruit "That is a generic": Yeah
15:21:40FromDiscord<Horizon [She/Her]> I'm making a macro that ensures that X components exist
15:22:04FromDiscord<Horizon [She/Her]> Maybe i'd be better off modifying the nodes directly or something?
15:22:18FromDiscord<Phil> That one I'm fairly sure is only possible via macros, if at all.↵You can pass pointers to procs around no problem, but if you want to use them you need to unsafely typecast them back to their original proc type and that one you just have to know
15:22:26FromDiscord<Phil> (edit) "That one I'm fairly sure is only possible via macros, if at all.↵You can pass pointers to procs around no problem, but if you want to use them you need to unsafely typecast them back to their original proc type and that one you just have to know ... " added "in the place where you're executing the proc"
15:23:10FromDiscord<Horizon [She/Her]> Yeah i'm using a macro for that
15:23:24FromDiscord<Rika> In reply to @Isofruit "prologue": why would prologue be less magic?
15:23:27FromDiscord<Rika> id say it is more
15:23:37FromDiscord<Rika> or roughly the same actually, not more
15:23:43FromDiscord<Horizon [She/Her]> I don't need to call it, simply need to modify it to add an `if` check to it
15:24:28FromDiscord<Phil> In reply to @Rika "why would prologue be": You explicitly need to extract your path parameters via an explicit proc from a context and don't have to just "know" that the `@` symbol allows you to access the path parameter in string form.
15:25:00FromDiscord<Rika> okay, anything else?
15:25:12FromDiscord<Phil> You also have a single proc to create a response with defaults instead of 10 resp templates
15:25:25FromDiscord<Rika> okay
15:25:35FromDiscord<Phil> Wait no, damnit flywind made extensions around that proc with "jsonResponse"
15:25:42FromDiscord<Phil> (edit) "Wait no, damnit flywind made extensions around that proc with ... "jsonResponse"" added "stuff like"
15:26:10FromDiscord<Phil> Further, you get to explicitly add the route to an explicit variable that represents your server
15:26:37FromDiscord<Phil> Here a server magically starts up though it was never explicitly coded, and magically gets a corresponding route attached which was never explicitly done either
15:27:22FromDiscord<Phil> You can't read that that happens out of the context of the code itself, you have to know jester to know that this happens automatically
15:28:02FromDiscord<Phil> Similarly you just get magically access to a request object in the context of your route even though it was never explicitly stated anywhere that that even exists
15:28:23FromDiscord<Horizon [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4cGx
15:28:45FromDiscord<Horizon [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4cGy
15:29:08FromDiscord<Phil> In reply to @Event Horizon "`/home/raees/projects/Nim/TextAdventureGame/src/ent": What's componentType?
15:29:14FromDiscord<skiddie99> oh guys sorry to interrupt
15:29:23FromDiscord<Horizon [She/Her]> In reply to @Isofruit "What's componentType?": It's an enum
15:29:31FromDiscord<skiddie99> how do I specify the host on the above script / jester?
15:29:41FromDiscord<Horizon [She/Her]> Well, a list of enums
15:30:01FromDiscord<Phil> In reply to @skiddie99 "how do I specify": Define specifying host. Do you mean setting up your domain?
15:30:09FromDiscord<skiddie99> sent a code paste, see https://play.nim-lang.org/#ix=4cGz
15:30:11FromDiscord<Phil> Or do you mean port?
15:30:12FromDiscord<skiddie99> I want to access that ip
15:30:17FromDiscord<skiddie99> from my browser
15:30:24FromDiscord<Phil> localhost:5000
15:30:24FromDiscord<Rika> localhost:5000
15:30:25FromDiscord<skiddie99> that's running on a linux server
15:30:26FromDiscord<Rika> fuck you
15:30:28FromDiscord<Phil> HAH! Faster
15:30:31FromDiscord<Phil> Bite me!
15:30:33FromDiscord<Rika> ok
15:30:35FromDiscord<Rika> how hard
15:30:46FromDiscord<skiddie99> In reply to @skiddie99 "that's running on a": -.-" 😛
15:30:56FromDiscord<Rika> whats the ip of your server
15:30:57FromDiscord<Rika> use that
15:31:07FromDiscord<skiddie99> I mean on terminal command?
15:31:25FromDiscord<skiddie99> I'm running it as:↵↵nim c -r app.nim -d:release
15:31:45FromDiscord<Rika> what?
15:32:01FromDiscord<skiddie99> on python you type the host on the command, is it possible in nim?
15:32:03FromDiscord<Phil> In reply to @Rika "how hard": Take the strength of like you're about to draw blood and multiply by 0.25
15:32:13FromDiscord<Rika> also put `-d:release` before `app.nim`
15:32:24FromDiscord<skiddie99> oh okay
15:32:28FromDiscord<skiddie99> but what about the host?
15:32:57FromDiscord<Phil> For the most part you just need to change the port to 443...was 443 the http one?
15:33:08FromDiscord<Horizon [She/Her]> In reply to @Event Horizon "Well, a list of": Nvmthat was unrelated
15:33:13FromDiscord<Phil> Nah, port 80
15:33:46FromDiscord<skiddie99> In reply to @Isofruit "For the most part": how?
15:35:10FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4cGA
15:35:15FromDiscord<Rika> `let settings = newSettings(port=Port(<port number here>), bindAddr="<address here>")`
15:36:15*def- quit (Quit: -)
15:36:25*def- joined #nim
15:37:05FromDiscord<skiddie99> thank you very much guys
15:37:06FromDiscord<skiddie99> one last thing please
15:37:19FromDiscord<skiddie99> is this useful in my case?
15:37:28FromDiscord<skiddie99> sent a code paste, see https://play.nim-lang.org/#ix=4cGE
15:37:36FromDiscord<skiddie99> I mean the way he uses main and jester.serve() ?
15:38:01FromDiscord<Phil> Personally I love the main-proc-pattern, stole that from python as well
15:38:13FromDiscord<Phil> The entire "isMainModule" doesn't make a difference for you
15:38:27FromDiscord<Phil> Could basically leave out the when check and always call main()
15:39:06FromDiscord<Phil> And the entire thing of you swapping out your router is also not useful for you yet
15:39:09FromDiscord<dom96> sent a code paste, see https://play.nim-lang.org/#ix=4cGF
15:39:16FromDiscord<Horizon [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4cGG
15:39:22FromDiscord<Horizon [She/Her]> It looks like it should work, but it doesn't
15:39:50FromDiscord<Rika> components should be made into whatever the field's type is
15:40:08FromDiscord<Rika> ...i think that should be done
15:41:17FromDiscord<Horizon [She/Her]> In reply to @Rika "components should be made": It's an openarray which is why I'm confused
15:41:37FromDiscord<Horizon [She/Her]> sent a code paste, see https://paste.rs/38F
15:42:56FromDiscord<skiddie99> thank you very much guys
15:42:59FromDiscord<skiddie99> I highly appreciate it
15:43:08FromDiscord<skiddie99> let's make some benchmarks now
15:43:22FromDiscord<skiddie99> https://tenor.com/view/hehe-raccoon-ornery-gif-10625001
15:46:23FromDiscord<Phil> Note that your windows binary is unlikely to run on a linux server. So better compile the binary on linux.
15:46:49FromDiscord<Phil> At least from what I gather from this channel there should be compat issues
15:47:14FromDiscord<JustADigimon (she/her)> open wsl, and compile it from here
15:47:40FromDiscord<Phil> Ah, right, windows has that, yeah wsl compile
15:48:29FromDiscord<skiddie99> sent a code paste, see https://play.nim-lang.org/#ix=4cGI
15:49:05FromDiscord<skiddie99> 🤦‍♂️
15:49:22FromDiscord<Phil> Not enough connections in the async pool?
15:49:30*kenran joined #nim
15:50:05FromDiscord<skiddie99> I let it 50.000
15:50:15FromDiscord<skiddie99> I really hope that it closes the connections afterwards
15:50:45FromDiscord<skiddie99> I cannot connect to the db now
15:50:47FromDiscord<skiddie99> wtf
15:50:58FromDiscord<skiddie99> I mean from the script
15:52:57*Alecui joined #nim
15:53:01FromDiscord<Horizon [She/Her]> Is there a way for me to append this node: https://hastebin.com/ogecekunus.nginx↵to the start of my proc? (So this is executed when the proc is called)
16:10:21*kenran quit (Remote host closed the connection)
16:16:43FromDiscord<JustADigimon (she/her)> what the hell is that-
16:40:51FromDiscord<Patitotective> In reply to @Event Horizon "Is there a way": https://github.com/Patitotective/kdl-nim/blob/main/src/kdl/lexer.nim#L95
16:44:26*derpydoo quit (Ping timeout: 268 seconds)
16:47:14FromDiscord<Patitotective> you just insert your statements at the start of the procedure's body (which is the last children `body[^1]`)
17:00:45*Alecui left #nim (ERC 5.4.1 (IRC client for GNU Emacs 29.0.50))
17:20:19FromDiscord<!!sharpcdf!!> sent a code paste, see https://play.nim-lang.org/#ix=4cHg
17:20:52FromDiscord<Horizon [She/Her]> Ah thanks :)
17:29:52FromDiscord<Horizon [She/Her]> In reply to @JustADigimon (she/her) "what the hell is": Nim AST formatted into a tree
17:29:58*wallabra_ joined #nim
17:30:00FromDiscord<Horizon [She/Her]> It's just macro stuff
17:30:29FromDiscord<Horizon [She/Her]> In reply to @Event Horizon "Why is this code": Anyone know the issue? Still haven't figured it out
17:31:36*wallabra quit (Ping timeout: 264 seconds)
17:32:09*wallabra_ is now known as wallabra
17:32:43*derpydoo joined #nim
17:34:24*rockcavera quit (Remote host closed the connection)
17:35:08FromDiscord<Rika> I don’t remember being able to put open arrays as a field, do you have any experimental flags on
17:36:40*rockcavera joined #nim
17:36:41*rockcavera quit (Changing host)
17:36:41*rockcavera joined #nim
17:37:09*xet7 quit (Remote host closed the connection)
17:40:10*def- quit (Quit: -)
17:40:20*def- joined #nim
17:40:51FromDiscord<Horizon [She/Her]> Ah, no i don't, that'd make sense
17:42:16FromDiscord<Horizon [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4cHl
17:50:06FromDiscord<Horizon [She/Her]> Figured it out
18:07:25*PMunch joined #nim
18:31:05*derpydoo quit (Read error: Connection reset by peer)
18:54:40FromDiscord<Goel> Isn't possible to use `&` to concatenate two already defined `cstring`?
19:02:00FromDiscord<Patitotective> In reply to @Goel "Isn't possible to use": i think you need to convert them to strings to do that
19:02:13FromDiscord<Patitotective> or you could define your own procedure 🤷
19:03:33strogon14yes, you can use $
19:10:54FromDiscord<Goel> Uhm, the thing is they are expecting to be put to a proc that needs cstring, so the Objects i created have cstring, and 90% of the time is fine, but in some cases i need to concatenate two of them, as i usually do but since they are cstring i can't do as they are normal strings. So even if now i change back their type to normal strings, i'll still need to conver them to .cstring when needed and that will even be more annoying
19:11:00FromDiscord<Horizon [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4cHM
19:11:24FromDiscord<Horizon [She/Her]> In reply to @Goel "Uhm, the thing is": You could just make a proc to concat them?
19:12:23FromDiscord<Horizon [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4cHO
19:12:57FromDiscord<Horizon [She/Her]> It converts `a` and `b` to a Nim string, then joins them, and then returns a `cstring` of the concatted string
19:13:05FromDiscord<Horizon [She/Her]> Probably a better way to do it though
19:13:27FromDiscord<Horizon [She/Her]> In reply to @Event Horizon "Anyone know why this": Also yeah, idk why this happens at all, it's confusing
19:16:01FromDiscord<Horizon [She/Her]> It's for a basic ECS system that feels clean to use in general
19:17:18FromDiscord<Goel> sent a code paste, see https://play.nim-lang.org/#ix=4cHT
19:17:23*PMunch quit (Quit: leaving)
19:17:28FromDiscord<Horizon [She/Her]> 👍
19:23:23FromDiscord<Patitotective> In reply to @Goel "Oh wait actually this": you may get a `CStringConv` warning tho
19:27:42FromDiscord<Goel> In reply to @Patitotective "you may get a": Yes i noticed, i just made the convCString proc and i hope its the end of the story
19:30:20FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4cHW
20:02:16*xet7 joined #nim
20:10:05FromDiscord<Goel> @Patitotective doesn't work like that
20:35:07FromDiscord<FireLite> Is there a class? Or is there any way to simulate a c++ vtable in nim?
20:38:05FromDiscord<Phil> I have no idea what a vtable is, but given you're mentioning class, is this going into the direction of dynamic dispatch?
20:38:13FromDiscord<Phil> Because the concept of methods exists in nim
20:39:43FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4cI7
20:40:22FromDiscord<Phil> In reply to @FireLite "Is there a class?": https://nim-lang.org/docs/tut2.html#object-oriented-programming-dynamic-dispatch↵Does this maybe answer the question? ↵I'm still assuming this is overall about the mechanisms of dynamic dispatch for polymorphisms
20:40:38FromDiscord<Phil> > Performance note: Nim does not produce a virtual method table, but generates dispatch trees. This avoids the expensive indirect branch for method calls and enables inlining. However, other optimizations like compile time evaluation or dead code elimination do not work with methods.
21:00:39FromDiscord<Elegantbeef> A vtable is an array of procedures bound to a type for dynamic dispatch so yes↵(@Phil)
21:00:58FromDiscord<Elegantbeef> Each type gets a array of procedures so when you call methods you just look them up
21:01:20FromDiscord<Elegantbeef> This is somewhat better than what Nim does with a bunch of case statements on a method call
21:03:40FromDiscord<Horizon [She/Her]> In reply to @Event Horizon "Anyone know why this": Anyone? :P
21:05:18FromDiscord<jos> is there any way to have a nim macro (or something like a nim macro) accept the block as a string instead of having nim parse it first
21:05:54FromDiscord<jos> i wanna have a macro that reads in s-expressions for emitting webassembly and parsing it as a string seems easier/simpler
21:06:12FromDiscord<jos> worst case scenario i guess i can just accept literally a string, but i dont want the quotes aha
21:07:42FromDiscord<Patitotective> In reply to @jos "is there any way": accept it as a block and do `repr body`
21:08:55FromDiscord<jos> i don't know enough about nim to understand what you said really
21:09:16FromDiscord<jos> do u mean like `macro xyz(input: block): let blockAsString = repr block`
21:09:39FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4cIc
21:09:40FromDiscord<jos> ah ok
21:09:53FromDiscord<jos> ok so FWIU the body would still have to be parseable nim
21:10:08FromDiscord<jos> is there any way to avoid that
21:10:51FromDiscord<Patitotective> i dont think there is way to do that, you should instead just use a multiline string
21:11:03FromDiscord<jos> fair enough, thanks
21:11:13FromDiscord<jos> if anyone knows that would be great though
21:13:09FromDiscord<jos> also if anybody knows of an s-expression macro implementation in nim that would be cool, i couldn't find one
21:16:04FromDiscord<matkuki> Hey, @treeform can you tell me what is the status of Fidget? Is it still developed? It's an excellent library.↵I asked this in the github issues already some time ago, but there's still no reply.
21:16:54FromDiscord<Patitotective> In reply to @matkuki "Hey, <@107140179025735680> can you": i dont know if treeform is still developing it but, elcritch shares updates about his fork of fidget in the forum https://forum.nim-lang.org/t/9476
21:18:33FromDiscord<matkuki> Thanks, does that mean it shouldn't be used for new projects? Better to use elctritch's `Fidgetty`?
21:19:44FromDiscord<Patitotective> i would say yes https://media.discordapp.net/attachments/371759389889003532/1028778819756241007/unknown.png
21:30:50FromDiscord<Patitotective> is there something like python's keyword arguments `kargs` in nim? something like `kargargs[int]`
21:37:00FromDiscord<Elegantbeef> Eh just use a `static string` and triple quote↵(@jos)
21:37:20FromDiscord<jos> yeah that's what I'm doing now
21:37:34FromDiscord<jos> it kind of sucks because the keyword highlighting would be nice
21:37:49FromDiscord<Elegantbeef> then write it in another file and staticRead it in
21:37:55FromDiscord<jos> eh
21:38:07FromDiscord<jos> its way nicer inline
21:38:29FromDiscord<jos> I'm just trying to do something like quasi quote s expressions
21:38:43FromDiscord<Elegantbeef> Sure but arbitrary code inside macros is different syntax which is sketchy
21:39:00FromDiscord<Elegantbeef> What are you doing exactly?
21:39:07FromDiscord<jos> I mean if ultra opinionated rust supports arbitrary token streams
21:39:32FromDiscord<jos> I want to emit s expressions for wasm with a macro
21:40:07FromDiscord<jos> but whitespace rules make reasonably formatted sexprs not valid n
21:40:14FromDiscord<jos> not valid nim
21:40:36FromDiscord<jos> oh maybe I can escape the newline?
21:40:39FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4cIe
21:40:46FromDiscord<Elegantbeef> Hardly an argument given that their procedural are a mess↵(@jos)
21:41:25FromDiscord<Elegantbeef> `varargs[untyped]` does that↵(@Patitotective)
21:42:04FromDiscord<Elegantbeef> QED
21:42:05FromDiscord<Patitotective> but im not going to be able to accept a last body block :[
21:42:12FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4cIf
21:42:13FromDiscord<Elegantbeef> Yea you are
21:43:50FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4cIg
21:45:54FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4cIi
21:48:26FromDiscord<Patitotective> :]
21:50:59FromDiscord<Elegantbeef> Can even error after the first `nnkExprEqExpr` if you dont get a stmtlist or another nnkexpreqexpr
21:57:06FromDiscord<treeform> In reply to @matkuki "Hey, <@107140179025735680> can you": Its currently kind of limbo, I am trying to get the underlaying libraries right, windy/pixie/boxy. Once that is done i'll be back to fidget.
22:08:25FromDiscord<ChocolettePalette> > nnkexpreqexpr
22:08:42FromDiscord<Elegantbeef> Yes
23:11:30FromDiscord<Patitotective> In reply to @Patitotective "is there way to": any workarounds beef?
23:15:07FromDiscord<SYN_ACK_SICARI0🐍> Good evening everyone hope you are all enjoying your weekend, does anyone know where I can find the original Pascal source for the first Nim compiler?
23:16:49*jmdaemon joined #nim
23:25:50FromDiscord<Elegantbeef> No↵(@Patitotective)
23:28:56FromDiscord<auxym> In reply to @SYN_ACK_SICARI0🐍 "Good evening everyone hope": https://github.com/nim-lang/Nim/tree/ea1f1ec6d4d6c776eb0f81c2bebdd4cb4c817ebe/nim
23:29:15FromDiscord<auxym> found that linked on wikipedia
23:29:49FromDiscord<SYN_ACK_SICARI0🐍> In reply to @auxym "found that linked on": Oh sweet, thank so much!
23:32:22*xet7 quit (Remote host closed the connection)
23:53:22FromDiscord<jos> when i get an error like this:
23:53:23FromDiscord<jos> https://media.discordapp.net/attachments/371759389889003532/1028817483047637013/unknown.png
23:53:25FromDiscord<jos> is there any way to know why?
23:53:31FromDiscord<jos> like what feature am i using that isn't supported
23:53:56FromDiscord<Elegantbeef> compile the code
23:54:01FromDiscord<jos> i do, nothing helpful comes up
23:54:04FromDiscord<jos> it's the same error from nimble build
23:54:09FromDiscord<jos> barring that, can macros even return static values?
23:54:28FromDiscord<Elegantbeef> you dont need `static` for a macro
23:54:34FromDiscord<Elegantbeef> macros are inherently static
23:54:45FromDiscord<Elegantbeef> `block:`
23:54:48FromDiscord<jos> i changed it into a static proc btw
23:54:56FromDiscord<jos> i still get the same error, cannot evaluate at compile time: parser
23:54:59FromDiscord<jos> but i'm not sure how to get more
23:57:21FromDiscord<jos> it might be because i'm using patty
23:57:34FromDiscord<jos> it might use some feature under the hood that isn't compatible with compile time eval
23:57:49FromDiscord<huantian> is parser a ref obj? i don't think those work at compile time
23:58:05FromDiscord<Elegantbeef> `ref obj` work at compile time, they dont work as constants
23:58:09FromDiscord<huantian> ah
23:58:32FromDiscord<Elegantbeef> So if SexprNode is a ref object there's the issue
23:58:49FromDiscord<huantian> sex pr node
23:58:58FromDiscord<jos> it is a ref object
23:59:13FromDiscord<jos> ok
23:59:18FromDiscord<jos> i think distinct will work fine here
23:59:25FromDiscord<jos> i think!! 🙂
23:59:46FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/fPU
23:59:54FromDiscord<Elegantbeef> But that obviously doesnt work if your sexpr object has references