<< 05-05-2021 >>

00:27:10*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
00:27:29*njoseph joined #nim
00:56:51*D_ quit (Ping timeout: 250 seconds)
01:47:33*rockcavera quit (Read error: Connection reset by peer)
01:48:02*rockcavera joined #nim
02:07:28*D_ joined #nim
02:48:01*thomasross quit (Ping timeout: 260 seconds)
03:01:45*j-james[m] left #nim ("User left")
03:44:25*spiderstew_ joined #nim
03:46:41*spiderstew quit (Ping timeout: 240 seconds)
03:54:21*oprypin quit (Remote host closed the connection)
03:56:18*FromGitter quit (Remote host closed the connection)
03:56:39*FromGitter joined #nim
03:57:42*oprypin joined #nim
04:01:56Benjamin[m]1I noticed xmldom was removed from stdlib in 2018 in favor of xmltree, but as far as I can tell, functions such as nextSibling were never added to xmltree. Am I missing something?
04:21:08*rockcavera quit (Remote host closed the connection)
04:22:05FromDiscord<creonico> Weird question, can I write smart contracts in Ethereum with Nim?
04:22:27*narimiran joined #nim
04:29:03FromDiscord<Rika> I don’t see why not
04:29:22FromDiscord<creonico> I can?
04:29:37FromDiscord<creonico> I though you could only use Solidity or Viper
04:46:35FromDiscord<Rika> I don’t understand the question well
04:46:59FromDiscord<Rika> Ah
04:47:08FromDiscord<Rika> In the VM
04:47:21FromDiscord<Rika> Not sure, do you have a C compiler for the VM?
04:55:17ForumUpdaterBotNew thread by Nnahito: How to use SharedList, see https://forum.nim-lang.org/t/7927
05:53:14*blitzworksD1337d joined #nim
06:24:18*PMunch joined #nim
06:46:30ForumUpdaterBotNew Nimble package! stb_truetype - Nim bindings for stb_truetype., see https://github.com/guzba/stb_truetype
06:59:06*narimiran quit (Ping timeout: 240 seconds)
07:02:48*narimiran joined #nim
07:08:41*narimiran quit (Ping timeout: 240 seconds)
07:09:33*NimBot joined #nim
07:12:38*narimiran joined #nim
07:33:03*kayabaNerve joined #nim
07:34:32kayabaNerveIs it possible to have a Nimble file only require a dependency when not compiled with a specific definition?
07:35:23kayabaNerveAs in, I have a nogui define configured (so `nimble build -d:nogui`), and I only want to require a dependency of the GUI lib when compiled with `nimble build`; not `nimble build -d:nogui`
07:35:41kayabaNerveI did try `when not defined(nogui):`; seems to have had no effect
07:35:50kayabaNerveMy guess is requires are pre processed in some form?
07:37:17FromDiscord<Rika> the nimble file does not dictate what is importable in your library, only what is installed alongside your library
07:38:14FromDiscord<haxscramper> Also `-d:nogui` is passed to compiler, not nimble itself IIRC
07:44:11kayabaNerveYeah, I got that latter part. I'm trying to figure out if it's possible to dynamically use the requires statement.
07:44:43*crem quit (Ping timeout: 260 seconds)
07:45:17*crem joined #nim
07:45:52kayabaNerveAccording to the docs, it looks like I can move requires into a task; question becomes getting the command from Nimscript.
07:46:14kayabaNerveAlso, there are rules on passing to compiler; doesn't Nimble have a depsOnly flag?
07:46:25kayabaNerveLike it is possible to pass a flag to it post-"build"
07:50:05kayabaNerve... does `nimble build` no longer execute the build task if defined?
07:51:34FromDiscord<vieru> the fuck
07:51:43FromDiscord<vieru> i cant even download nim
07:51:48FromDiscord<vieru> windows defender
07:52:01PMunchWow, really?
07:52:11FromDiscord<vieru> yeah
07:52:16FromDiscord<ElegantBeef> Yep 1.4.6 triggers defender
07:52:20FromDiscord<vieru> and ive allowed it like 10times
07:52:23FromDiscord<ElegantBeef> 1.4.4 before does not
07:52:51PMunchI thought you would be able to download it, just not run it
07:53:43FromDiscord<ElegantBeef> All cause of a single malware we get the joys of software being marked as a virus
07:54:40FromDiscord<ElegantBeef> You guys think the malware was published in debug, release or danger?
07:55:19FromDiscord<vieru> https://media.discordapp.net/attachments/371759389889003532/839409908650213386/20210505_105338.jpg
07:55:55FromDiscord<haxscramper> I think they used `-d:degenerate` when building their garbage
07:56:08FromDiscord<vieru> what malware ?
07:56:30FromDiscord<ElegantBeef> nimzbaloader or w/e it's called
07:56:37FromDiscord<ElegantBeef> Vieru follow this https://github.com/dom96/choosenim#installation
07:56:55FromDiscord<ElegantBeef> It's a better way to get Nim anyway
07:57:33FromDiscord<vieru> thanks
07:57:59FromDiscord<ElegantBeef> Sucks that antiviruses are too dumb to actually reason if it's a threat or not, and just do a lazy method of "does it have X"
07:58:29*Vladar joined #nim
08:06:38PMunchHave anyone raised tickets with the popular antivirus vendors by the way?
08:08:54FromDiscord<ElegantBeef> Uncertain, feel like the response would be "sucks to suck"
08:09:08FromDiscord<Rika> well try it
08:16:18*vicfred quit (Quit: Leaving)
08:25:24FromDiscord<FireWire> windows defender security threat page thing -> scroll and find "Virus and threat protection settings" -> click "Manage settings" -> scroll to the bottom and click on "Add or remove exclusions" -> add the .nimble folder as an exclusion
08:29:14FromDiscord<FireWire> also is there any way to sort of load and/or compile at runtime?
08:29:26FromDiscord<FireWire> sort of like how python has cogs and stuff
08:30:02FromDiscord<ElegantBeef> You can use Nimscript or dynamic loaded libraries
08:30:18FromDiscord<FireWire> hmm ok ill look into it
08:30:19FromDiscord<FireWire> thx!
08:31:32FromDiscord<ElegantBeef> My nimscripter library is probably the easiest way to see/play with nimscript from compiled nim https://github.com/beef331/nimscripter
09:06:36*Gustavo6046 quit (Ping timeout: 260 seconds)
09:19:23PMunchHmm, how can I add -lwhatever for my C wrapped functions?
09:29:42*wasted_youth2 quit (Quit: Leaving)
09:30:24FromDiscord<dabmlfz> Is there a way to take a parameter through "reference" or so that it's not copied? `var` works but I don't want to mark my parameter as mutable(or is that okay?). `ptr` seems unidiomatic.
09:30:47FromDiscord<Tavon> ref
09:31:03FromDiscord<ElegantBeef> If the object is large enough it's copied as a reference, so if you're worried about memory consumption dont be
09:31:11FromDiscord<dabmlfz> oh
09:31:29FromDiscord<ElegantBeef> i mean passed as a reference
09:31:44FromDiscord<dabmlfz> thanks, yeah that is what I was worried about.
09:46:42FromDiscord<madman> @ElegantBeef do you code nimscript in VS Code?
09:46:51FromDiscord<madman> that's a nice library
10:00:54*clyybber joined #nim
10:04:22Clonkk[m]<PMunch "Hmm, how can I add -lwhatever fo"> {.passL: "-lwhatever".} ?
10:04:36PMunchIt didn't seem to work..
10:05:08PMunchAh, never mind
10:05:11Clonkk[m]You may need the additionnal {.passL: "-Wl,-rpath," & pathToLib .}
10:05:18PMunchI just couldn't have it as one of my pushes
10:05:22Clonkk[m]And {.passL: "-L" & pathToLib.}
10:05:36Clonkk[m]Never tried to use it as Push
10:07:30PMunchOkay, next question. What is the "correct" way of wrapping a low level library and then adding some abstractions
10:11:28PMunchI've seen people do this in different ways
10:12:16FromDiscord<haxscramper> Depends on the library of course, but I often start with defining convenience primitives like `items/[]`, sane enum names and `initT`/`newT`
10:12:42FromDiscord<haxscramper> This is not exactly an abstraction
10:12:45PMunchI was more thinking structure
10:14:08FromDiscord<haxscramper> I don't think there is a conclusive answer to that - depends on the library too much.
10:14:47FromDiscord<haxscramper> Sometimes I write code as if I already had all abstraction primitives/ergonomics, and then implement boilerplate mapping between low-level code and high-level wrappers
10:15:30FromDiscord<haxscramper> So top-down approach if you could say. And that helps me figure out the "structure"
10:18:43Clonkk[m]<PMunch "Okay, next question. What is the"> The way I do it is try to contain all the ``importc`` to a single folder and create a higher leve lAPI above
10:19:25PMunchYeah that's what I was thinking
10:19:31Clonkk[m]For global initialization, there is a neat trick using ``proc init(x: type MyLib)``
10:21:36Clonkk[m]You can look for examples : https://github.com/Clonkk/nimjl/blob/devel/nimjl/interop.nim#L17. Otherwise, here are some wrapper of C or C++ lib / header :
10:21:36Clonkk[m] https://github.com/SciNim/flambeau, https://github.com/Clonkk/nim-cppstl, https://github.com/SciNim/nimfftw3
10:22:12Clonkk[m]The ZMQ wrapper is also a good example https://github.com/nim-lang/nim-zmq
10:30:53PMunchSo you'd call it as e.g. Julia.init()?
10:31:57PMunchI did something similar for my keyboard firmware, but that was mostly to support future extensions to boards with more than one I2C port for example (so now I have I2C.init(), but for other boards it could be I2C_1.init())
10:36:04Clonkk[m]The idea is to have exactly that ``Julia.init()`` or ``init(Julia)`` it's cleaner IMO
10:36:31PMunchDoesn't really apply here though since I don't have an init
10:37:05PMunchFor reference this is what I'm wrapping: https://github.com/gtoubassi/femtozip/blob/master/cpp/libfz/src/femtozip.h
10:40:55*lritter_ joined #nim
10:50:21*lritter_ quit (Remote host closed the connection)
10:50:59giacothis thing that testament builds next to nim file and you can't change this is making me revert to unittest
10:56:43giacoI feel that testament is fit for the compiler project and is not made to bend to other projects
10:57:13giacojust consider that if you set --outdir switch, it wont work
11:02:14ForumUpdaterBotNew thread by Alexeypetrushin: How to make HttpServer more robust against too many connection opened?, see https://forum.nim-lang.org/t/7929
11:22:50PMunchHmm, a range check in my code generates invalid C code
11:22:52PMunchVery strange
11:27:30PMunchThe openarray version of buildModel
11:27:48PMunchWorks with -d:danger because it removes the range check
11:28:18PMunchThis is the exact error: http://ix.io/3lPY
11:28:56FromDiscord<zidsal> @giaco testament is great for testing that your macro produces a compile error (if you are expecting it to) I've yet to find another way to write that kind of test
11:54:07*xet7 quit (Read error: Connection reset by peer)
11:59:21PMunchCan I disable certain checks for parts of the code?
12:00:58FromDiscord<Stuffe> what do these brackets mean? <seq[string]>
12:01:09FromDiscord<Stuffe> im getting an error with <seq[string]> vs seq[string]
12:02:45Amun_RaPMunch: you can f.e. {.push checks: off.} / {.pop.}
12:04:16PMunchYeah I figured it out. I was putting it inside the proc, but I had to move it outside
12:06:47*PMunch quit (Quit: leaving)
13:00:05FromDiscord<dain> is it possible to examine external files at compile-time?
13:01:09FromDiscord<dain> for example, a dataframe library that at compile time, looks at a csv file to determine the types of the columns, and then auto-generate a schema. so you don't have to write it yourself
13:03:00FromDiscord<Rika> I'm pretty sure that's possible, just not using open
13:03:09FromDiscord<Rika> You have to use static read or something I forget the name
13:03:28FromDiscord<Rika> Unless within a macro, then I believe open will work
13:14:17FromDiscord<zidsal> @dain I did exactly this with generating types from a castledb file
13:16:06FromDiscord<zidsal> @dain my prototype for this can be found here https://play.nim-lang.org/#ix=3lQA I never bothered to clean the code up but you should get the idea on how to do this
13:23:16FromDiscord<haxscramper> https://nim-lang.org/docs/system.html#staticRead%2Cstring
13:23:44*rockcavera joined #nim
13:23:55FromDiscord<dain> In reply to @zidsal "<@225449938258100225> my prototype for": neato, thanks
13:27:15*vsantana joined #nim
13:27:59FromDiscord<dain> sent a long message, see http://ix.io/3lQE
13:28:29FromDiscord<dain> e.g. say you had a big file but you can just do the processing on it a line at a time
13:29:24FromDiscord<dain> or just look at the first N bytes
13:30:06FromDiscord<dain> or the first N lines
13:34:46FromDiscord<haxscramper> No, I don't think there is any way to read file line-by-line at compile-time
13:35:01FromDiscord<haxscramper> Though if you are reading multi-gigabyte files at compile-time ...
13:35:44FromDiscord<dain> well more like just looking at the first thousand or so lines of a csv
13:36:40FromDiscord<haxscramper> Streams are not accessible at compile-time, but if you really want you can `head -n1000` your file or something like taht
13:36:44FromDiscord<haxscramper> (edit) "taht" => "that"
13:36:59FromDiscord<haxscramper> Or write codegen script and `exec` it at compile-time
13:37:15FromDiscord<dain> hm yeah that would make sense
13:37:17FromDiscord<haxscramper> https://nim-lang.org/docs/system.html#staticExec,string,string,string
13:37:21FromDiscord<dain> just use staticexec
13:38:31FromDiscord<dain> I was reading about how the Nim REPL would have hot code reloading, is this actually implemented?
13:39:18FromDiscord<haxscramper> HCR was implemented several years go, but I don't think `inim` REPL has it, and it is not widely used anyway (HCR)
13:39:35FromDiscord<dain> what about `nim secret`
13:39:36FromDiscord<haxscramper> `nim secret` executes in VM, so it of course does not have access to HCR
13:39:38FromDiscord<dain> or is that the same
13:39:41FromDiscord<dain> o
13:41:09FromDiscord<dain> so nim isnt really usable as a live data science environment yet, like ipython or jupyter
13:41:11FromDiscord<dain> ?
13:42:03FromDiscord<haxscramper> well, I would not say it is "not usable", more like there was no explicit effort to make it work for this use case
13:42:04FromDiscord<haxscramper> https://github.com/stisa/jupyternim
13:42:51FromDiscord<haxscramper> But `nimscript` has the capability, the only thing lacking is an easy way to interface with compiled C code, though https://github.com/beef331/nimscripter can be used for that
13:43:12FromDiscord<haxscramper> So you evaluate dynamic nimscript that is powered by compiled nim code
13:44:08FromDiscord<haxscramper> Similar to python+C pair, though everything is written in one language. At least in theory this is possible, and does not require some major reengineering effort in the language implementation side
13:45:47stisaJust wanted to add that jupyternim does have some initial support for hotcodereloading, but it had a bug with printing floats that made me stop working on it for the time being
13:46:59stisaTbh I should find some time to do some maintenance on the code and see if it improved in the last few months
13:50:49FromDiscord<dain> I'll have to play around with these things then :)
14:01:36*kwilczynski quit ()
14:10:07*whitefly quit (Remote host closed the connection)
14:36:58*kwilczynski joined #nim
14:40:22*kwilczynski left #nim (#nim)
15:51:07Clonkk[m]Has anyone used Nim to create RPM / Deb package before ?
15:59:58FromDiscord<Hi02Hi> In reply to @creonico "Weird question, can I": Something like this?↵https://github.com/status-im/nim-eth-contracts
16:02:55FromDiscord<creonico> thats cool, thank you
16:06:32*Gustavo6046 joined #nim
16:08:59FromDiscord<dain> are there any benchmarks that compare nimscript to other scripting languages
16:09:03FromDiscord<dain> like bash or python or ruby or something
16:09:17FromDiscord<dain> how fast is it?
16:09:54FromDiscord<haxscramper> No, but nimscript is comparable to python in speed IIRC. VM optimization is not a main priority, so it might generally be slower than let's say python
16:09:59FromDiscord<haxscramper> In some cases
16:10:43FromDiscord<haxscramper> But it is a register-based VM for statically typed language, so it might have a speed advantage because of that, in some workloads
16:15:14Clonkk[m]If performance is an important factor, I wouldn't use Nimscript anyway. It wasn't designed for high performance computing
16:18:24*Gustavo6046_ joined #nim
16:18:31*Gustavo6046 quit (Ping timeout: 260 seconds)
16:20:30*Gustavo6046_ is now known as Gustavo6046
16:27:21*fredrikhr joined #nim
16:50:18*vicfred joined #nim
16:58:08FromDiscord<jtiai> I'm using fusion/btreetables. If I know one position in table can I get like 10 previous and 10 next by some means?
17:15:49FromDiscord<exelotl> in my experience the VM has a startup time of a second or so to load the necessary parts of the standard library, which is a little painful for using it to run standalone scripts :(
17:16:21FromDiscord<exelotl> I had a setup which was: nim build (config.nims) <-> helper program <-> nim e data.nim
17:16:40FromDiscord<exelotl> where the output of running `nim e` would be piped back to the helper program
17:18:05FromDiscord<exelotl> But the execution time for `nim e` was too much.↵So I ended up instead processing `data.nim` from inside `config.nims`, marshalling the data to a csv file, and then reading the csv from the helper program.
17:19:43FromDiscord<exelotl> the savings from only having to start the VM once, far outweighed the cost of writing to a file and then reading that file back. :P
17:23:04*asdflkj quit (Ping timeout: 258 seconds)
17:25:15*asdflkj joined #nim
17:31:04*Vladar quit (Remote host closed the connection)
17:34:41*filcuc joined #nim
17:36:15*rockcavera quit (Read error: Connection reset by peer)
17:36:44*rockcavera joined #nim
17:40:27*icebattle quit (Quit: leaving)
17:43:16*icebattle joined #nim
17:48:08*PMunch joined #nim
17:48:24FromDiscord<haxscramper> It is possible to implement `nim secret` in your application too - https://github.com/haxscramper/hack/blob/master/testing/nim/compilerapi/test6.nim#L79, it does not suffer from startup costs when evaluating new code
17:50:23FromDiscord<jtiai> sent a code paste, see https://play.nim-lang.org/#ix=3lSj
17:54:13FromDiscord<haxscramper> are you sure you want to have 2^32 elements in array? Most likely this is compiler crash because of that
17:54:22FromDiscord<haxscramper> That wasn't turned into proper error message
17:54:23*al1ranger joined #nim
17:55:29*al1ranger quit (Client Quit)
17:57:36FromDiscord<jtiai> Definitely 🙂
18:02:16*filcuc quit (Ping timeout: 252 seconds)
18:08:58FromDiscord<neow> 2^32 elements only sounds like a few MBs
18:11:53FromDiscord<haxscramper> That is 4 GB even if it was an array of `char`
18:13:13PMunchWith a concept that names some procedures to do stuff, how can I get those procedures in a proc that takes that concept to pass them as callbacks?
18:17:36FromDiscord<jtiai> I just need 64k entries.
18:18:56FromDiscord<jtiai> Actually.... I need only 21...
18:22:43FromDiscord<jtiai> Now back to my previous question. Given that I know only one key in btreetable (Table[uint16, string]) how I can get 10 previous and 10 next keys?
18:32:26FromDiscord<haxscramper> https://nim-lang.github.io/fusion/src/fusion/btreetables.html#valuesFrom.i%2CTable%5BA%2CB%5D%2CA for 10 next. 10 previous is not exposed
18:36:06FromDiscord<haxscramper> There is also a https://nim-lang.org/docs/heapqueue.html, but I don't exactly remember whether it fully sorts its values or only ensures `that a[0] is always its smallest element.`
18:36:40FromDiscord<haxscramper> Though it is probably not applicable in your use case anyway
18:37:29FromDiscord<haxscramper> But iteration from btreetables is implemented using 'cursor' that traverses the table in one direction - `next()`, so I doubt it is possible to get "10 previous"
18:37:59FromDiscord<jtiai> is there way to get index of key?
18:38:23FromDiscord<jtiai> since my keys are like " 1 3 6 10 22 32 33 34 40 50"...
18:40:54FromDiscord<haxscramper> No, ordered maps don't usually support getting index of a key as it is an internal implementation detail
18:41:14FromDiscord<haxscramper> What are you trying to do?
18:42:11FromDiscord<jtiai> print out part of the table from key X so that I around X key also 10 keys to both directions are printed.
18:42:50FromDiscord<jtiai> given above example of keys if my X = 32 and I want 2 around it I need list of keys which is "10 22 32 33 34"
18:45:13PMunchfemtozip shared header compression library wrapper: https://github.com/pmunch/femtozip
18:55:41*Gustavo6046 quit (Ping timeout: 240 seconds)
18:59:00*Gustavo6046 joined #nim
19:01:34*laincat joined #nim
19:06:48FromDiscord<mlokis> nim provides reflection only for objects, em i right
19:07:24FromDiscord<haxscramper> depends on what do you mean by "reflection". `items` works for objects
19:07:24FromDiscord<mlokis> i mean objects that extend rootObj
19:07:36FromDiscord<haxscramper> (edit) "`items`" => "`fields`"
19:07:56FromDiscord<haxscramper> You mean runtime RTTI?
19:08:05FromDiscord<haxscramper> (edit) "runtime" => "runtime,"
19:08:22FromDiscord<mlokis> well, i only know java and golang reflection
19:08:34FromDiscord<haxscramper> most of nim's reflection is compile-time
19:08:58FromDiscord<haxscramper> like you can get full structure of the type definition only from type name and implement all logic at compile-time in macros
19:09:01FromDiscord<ElegantBeef> Yea we use macros to get type information to expand at compile time
19:09:28FromDiscord<ElegantBeef> We dont really need runtime reflection since we have the macros that tell us everything we need
19:09:59FromDiscord<mlokis> so you can access types structure at compile time, recursivly?
19:10:09FromDiscord<ElegantBeef> Parents of parents of parents?
19:10:27FromDiscord<ElegantBeef> https://forum.nim-lang.org/t/7853#49914
19:10:29FromDiscord<mlokis> i mean if object embeds object, can you find out what fields it has
19:11:03FromDiscord<ElegantBeef> Yes you should be able to since the field types should be symbols
19:12:06*laincat left #nim (#nim)
19:12:47FromDiscord<mlokis> because in rust you only know structure of current struct, witch is also really annoying. In go on the other hand you detect everything on runtime and it is very slow
19:13:09FromDiscord<ElegantBeef> Modification of the code on that forum post
19:13:12FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=3lTa
19:13:38*laincat joined #nim
19:14:16FromDiscord<mlokis> nim is owerpowered. i made macro in 100 lines that allows me to write components like in react
19:14:21FromDiscord<ElegantBeef> Yep
19:14:29FromDiscord<ElegantBeef> Procedural macros are nice
19:14:45FromDiscord<ElegantBeef> Atleast i think that's what these are called
19:15:08FromDiscord<mlokis> i love them, this is the lib btw https://github.com/jakubDoka/niml
19:15:11FromDiscord<haxscramper> Yeah, they called procedural
19:15:33FromDiscord<mlokis> have you ever tried procedural macros in rust
19:15:43FromDiscord<mlokis> biggest pain in the ass
19:15:43FromDiscord<ElegantBeef> I've never tried rust
19:16:00FromDiscord<ElegantBeef> Ah this is like karax but it generates the html statically
19:16:00FromDiscord<mlokis> you have to make separate project to define maycro
19:16:12FromDiscord<mlokis> and all you get is string
19:16:49FromDiscord<ElegantBeef> So it's your version of https://github.com/juancarlospaco/nim-html-dsl
19:17:15FromDiscord<haxscramper> fusion/matching was partially inspired by rust's macros, though only adapted good parts
19:17:30FromDiscord<mlokis> In reply to @ElegantBeef "So it's your version": i find that one very inflexible
19:17:38FromDiscord<haxscramper> And I would say there were not so many of them ergonomics-wise
19:17:49FromDiscord<haxscramper> https://veykril.github.io/tlborm/patterns/push-down-acc.html
19:18:06FromDiscord<ElegantBeef> Is it forced that macros are all called with `!` in rust or is that just convention?
19:18:12FromDiscord<haxscramper> forced
19:18:43FromDiscord<ElegantBeef> imagine if nim forced `macro` be appended to all names of macros, would be "fun"
19:18:54FromDiscord<mlokis> you know how painfull it is to develop macros in rust, even getting the output or printing what you are working with is dificult
19:19:00FromDiscord<haxscramper> Though techically rust macros are more powerful as they operate on tokens, so I suppose you can write more complex DSL, at least if you want to risk your sanity
19:19:15FromDiscord<ElegantBeef> Well you can do the same thing just using raw strings in Nim
19:19:23FromDiscord<haxscramper> But this looks ugly
19:19:32FromDiscord<ElegantBeef> Shhhh
19:19:36FromDiscord<ElegantBeef> Hide that under the rug
19:19:53FromDiscord<mlokis> nim syntax is flexible enough
19:20:11FromDiscord<haxscramper> In reply to @mlokis "you have to make": You are talking about procedural macros in rust (IIRC there are two types - `macro_rules!` and ones that are basically compiler plugins)?
19:21:00FromDiscord<mlokis> i em talking about proc macro not a macro, macro in rust is more like a template with annoying syntax
19:22:31FromDiscord<ElegantBeef> mlokis you pushed your .vscode folder
19:22:41FromDiscord<mlokis> idk why but since i found out about nim i stopped looking for good language, already found best one
19:23:57FromDiscord<ElegantBeef> I still need to try hax's pattern matching for macros, too fixed in my ways 😄
19:24:39FromDiscord<haxscramper> Actually I don't use it all the time either
19:25:00FromDiscord<haxscramper> More like I don't use it at all, only for small macros that simple enough
19:25:25FromDiscord<haxscramper> Because in the end everything still comes down to 400-line switch on ast kind
19:25:48FromDiscord<haxscramper> But it is so much better for smaller use cases
19:26:20FromDiscord<ElegantBeef> Think it's mostly i've never used pattern matching, so just avoid it until i really feel the need
19:26:24FromDiscord<mlokis> I em now making a website and it cannot be easier, no need to use react or html, just nim js and css
19:26:42FromDiscord<ElegantBeef> why did you say js? 😛
19:27:13FromDiscord<ElegantBeef> Where is our DSL for css?!
19:27:26FromDiscord<mlokis> i em kind of use to it
19:27:57FromDiscord<mlokis> i think css is simple enough, i also dont want to recompile when designing
19:28:19FromDiscord<ElegantBeef> I am just joking about the css, though why you're using js is odd
19:28:40FromDiscord<mlokis> thats disadvantage of nim for now, it recompiles whole codebase
19:29:12FromDiscord<mlokis> 111000 lines of code for nothing
19:29:21FromDiscord<mlokis> because i changed a string
19:29:22FromDiscord<ajusa> yeah, it can be kind of slow to compile
19:29:38FromDiscord<ajusa> hopefully the upcoming incremental compilation will fix that
19:29:40FromDiscord<mlokis> but when we get incremental it will speed up
19:29:57*filcuc joined #nim
19:31:21FromDiscord<mlokis> fortunately nim compiler is not as slow as rusts, (building project for 5 minutes lol)
19:31:47FromDiscord<ElegantBeef> I'm a simple man it takes less than 10 seconds for all my projects and i'm happy
19:32:08FromDiscord<ElegantBeef> Now doing compiler work, that's a bit tedious takes like 30 seconds for a build 😄
19:32:09FromDiscord<mlokis> nim compiler is super fast actually
19:32:22FromDiscord<mlokis> when you look at language features, oh god
19:32:24PMunchYeah that's one of the big benefits
19:32:41PMunchBuilding a C++ project is always a pain :P
19:32:52FromDiscord<mlokis> i tried to compile 1000000 of print stmt
19:33:09PMunchAnd Nim being able to target the same things but building super fast is really nice
19:33:10FromDiscord<mlokis> and nim got it down in few minutes
19:33:28PMunchHehe, I'm not even going to mention the abuse I've put the compiler through :P
19:33:53FromDiscord<mlokis> go compiler famous for its speed could not compile 1000k lines, it crashed because of lack of memory
19:33:56FromDiscord<ElegantBeef> Pmunch i spent like a week working on a PR for stronger type inference, i think i harmed it more
19:34:12FromDiscord<ElegantBeef> In the end the PR failed the CI
19:34:16FromDiscord<ElegantBeef> So.... take that!
19:34:32PMunchI meant the stuff I have done to the already built compiler
19:34:41FromDiscord<ElegantBeef> Ah
19:34:52PMunchI actually haven't done much to the actual compiler
19:35:20FromDiscord<ElegantBeef> Me either, it's done more to me than I to it
19:35:52FromDiscord<mlokis> isnt like lot of things in nim built in macros?
19:36:32FromDiscord<ElegantBeef> In the compiler? Not really
19:36:49PMunchLo of libraries though
19:37:07FromDiscord<ElegantBeef> Yea macros give you a 0 cost abstraction to lower level logic easily
19:37:14FromDiscord<haxscramper> In reply to @mlokis "go compiler famous for": I've seen at least two compiles that don't free memory by design, because that's "faster"
19:37:17FromDiscord<mlokis> i mean system package, well thats more about operators
19:37:42FromDiscord<ElegantBeef> There are rather few macros imported by default if any
19:37:59FromDiscord<mlokis> In reply to @haxscramper "I've seen at least": not thats because go compiler is written in go and go has gc
19:38:21FromDiscord<ElegantBeef> Nim is written in Nim and Nim has GC
19:38:35FromDiscord<mlokis> but nim gc is not thread safe
19:38:37FromDiscord<haxscramper> Go GC is optimized for different workloads?
19:39:01FromDiscord<haxscramper> so it does not perform as good for compiler that operates on very complex, deeply nested and interlinked data structures
19:39:15FromDiscord<haxscramper> At least that's my theory,
19:39:30FromDiscord<mlokis> well i just passed file full of print statements
19:40:30FromDiscord<haxscramper> Someone compiled 18million-argument functions
19:40:38FromDiscord<haxscramper> Or something like that
19:40:41FromDiscord<ElegantBeef> Yea i did something similar, replicated the vlang compile time benchmark using a macro, and the actually issue was gcc, with it it'd take minutes before gave up, so moved to tcc and took only 22seconds
19:40:51FromDiscord<ElegantBeef> That someone was pmunch i believe
19:41:06FromDiscord<haxscramper> In reply to @PMunch "Been running for 147h": the legend
19:41:08FromDiscord<ElegantBeef> Or he was doing something dumb like that then killed it after a few weeks
19:41:41ForumUpdaterBotNew Nimble package! hypixel - The Hypixel API, in Nim., see https://github.com/Knaque/hypixel-nim
19:41:44PMunchHaha, yes that was me :P
19:41:44FromDiscord<mlokis> vlang is discusting language
19:42:19*xet7 joined #nim
19:42:59FromDiscord<mlokis> compiles 1000k lines in a second, in witch dimension does the author live
19:43:11FromDiscord<ElegantBeef> In reply to @mlokis "vlang is discusting language": I dont disagree, just was doing the benchmark to see their results
19:43:25FromDiscord<ElegantBeef> My favourite part is they do vlang vs C, vlang uses tcc C uses gcc
19:43:41FromDiscord<mlokis> whats tcc
19:44:02FromDiscord<mlokis> just simple desc
19:44:08FromDiscord<haxscramper> very fast C compiler
19:44:23FromDiscord<haxscramper> Does not produce really optimized binary but can give you millisecond compile times
19:44:46FromDiscord<haxscramper> you can compile nim with it too `nim c --cc:tcc`, and get around `200ms` compilation time
19:44:55FromDiscord<mlokis> sounds good for degugging
19:44:56FromDiscord<haxscramper> for simple code of course, but still pretty fast
19:45:13FromDiscord<ElegantBeef> It's one major use case is using C as a scripting langauge
19:45:30FromDiscord<mlokis> language that can be interpreted and compiled would be nice
19:45:37FromDiscord<haxscramper> Yes, `tcc` can run binary directly from memory, without storing it on disk etc
19:45:50FromDiscord<mlokis> thats lisp but lisp is shit
19:45:57FromDiscord<haxscramper> `nim run` does that IIRC?
19:46:22FromDiscord<mlokis> i mean interpret like python
19:46:24FromDiscord<ElegantBeef> Looks at nim's VM
19:46:46FromDiscord<ElegantBeef> Who's going to be the one that profiles it and makes it faster
19:47:31FromDiscord<haxscramper> I think someone mentioned one of the main bottlenecks is that it operates on PNode trees and packed AST somehow should make it faster
19:48:11FromDiscord<haxscramper> Not sure if it is really someone said though, maybe it was different thing
19:50:11FromDiscord<mlokis> i recon that intel c compiler produces fastest executables, did you know that? (i once was wery curious)
19:55:11*laincat quit (Quit: Leaving)
19:55:41*xet7 quit (Quit: Leaving)
19:55:46*laincat joined #nim
19:56:47*krux02 joined #nim
19:57:14*xet7 joined #nim
20:08:55PMunchHmm, do we have a ring buffer implementation for strings anywhere?
20:10:18PMunchBasically I want to add strings to a buffer, and then be able to get a length and access random strings by an index in the range 0..<length
20:11:29*narimiran quit (Ping timeout: 268 seconds)
20:28:27*PMunch quit (Quit: leaving)
20:36:12FromDiscord<ajusa> is there any way to choose which version of a nimble package to use when compiling a program? Is there like a `nimble switch` command or something similar?
20:39:09*leorize quit (Ping timeout: 240 seconds)
20:41:15*leorize joined #nim
20:52:01*fredrikhr quit (Quit: Client Disconnecting)
20:54:50FromDiscord<jtiai> My emulator is progressing... https://media.discordapp.net/attachments/371759389889003532/839606084964843550/unknown.png
20:55:17FromDiscord<jtiai> Just if I knew why SDL2_ttf renders font a bit bad way...
21:04:45*leorize quit (Ping timeout: 240 seconds)
21:21:57*thomasross joined #nim
21:22:12*leorize joined #nim
21:23:16*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
21:57:11*filcuc quit (Ping timeout: 246 seconds)
22:00:38*xet7 quit (Remote host closed the connection)
22:35:33*Gustavo6046 quit (Ping timeout: 250 seconds)
22:36:45*oddp joined #nim
22:41:30FromDiscord<Hi02Hi> In reply to @mlokis "idk why but since": thats happened to a lot of us, welcome to the club
22:48:12*Gustavo6046 joined #nim
23:09:58*clyybber quit (Remote host closed the connection)
23:30:37FromDiscord<retkid> In reply to @ForumUpdaterBot "New Nimble package! hypixel": Is that needed often enough for a nim wrapper
23:32:42FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/839645809795399693/image0.png
23:33:01FromDiscord<retkid> Assuming this isn’t going i in their portfolio
23:33:51FromDiscord<retkid> Also the fact that it’s not a wrapper raises so many more questions
23:35:25FromDiscord<retkid> This just reeks of pure undiluted programmer anger from hours of trial and error...
23:35:51FromDiscord<retkid> I want to find the person that made this
23:37:14FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/839646954186735616/image0.png
23:40:37FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/839647806477565962/image0.png
23:41:04FromDiscord<retkid> Should probably use elfi and make it more readable
23:42:19FromDiscord<retkid> You could also use a table to make this a lot cleaner
23:46:02FromDiscord<retkid> let rank = table[player(“rank”).getstr]
23:47:35FromDiscord<retkid> (edit) "table[player(“rank”).getstr]" => "table[player{“rank”}.getstr]"
23:47:55FromDiscord<ElegantBeef> Why do you want to find them
23:48:26FromDiscord<retkid> I have questions
23:48:42FromDiscord<ElegantBeef> Sometimes some packages only make me ask questions aswell
23:49:44FromDiscord<retkid> I wanna PR this stuff, but my computer is broken and I have no money to fix it
23:51:22FromDiscord<retkid> Typing my PR on mobile
23:51:33FromDiscord<retkid> Lol
23:51:46FromDiscord<ElegantBeef> I still want to talk to the dev of this https://github.com/j-a-s-d/xam just to see why they do what they dol
23:51:48FromDiscord<ElegantBeef> (edit) "dol" => "do"
23:53:02FromDiscord<retkid> I don’t like thus g
23:53:15FromDiscord<retkid> (edit) "thus g" => "this"
23:54:50FromDiscord<retkid> One of the good parts of programming is being accountable for your mistakes and eventually understanding you’re entire project from line 1 to line 10000
23:55:36FromDiscord<retkid> It makes me feel really good when I fuck up, and the only person to blame is myself
23:55:51FromDiscord<retkid> Unless you have a sh
23:56:09FromDiscord<retkid> (edit) "sh" => "shitty library"
23:59:51ForumUpdaterBotNew thread by Xioren: How to http post nested data?, see https://forum.nim-lang.org/t/7930