00:14:27 | * | Pqzcih5 quit (Remote host closed the connection) |
00:14:46 | * | Hideki_ joined #nim |
00:18:00 | opal | by default, does nim compile or transpile? i see on the homepage it can transpile to c/cxx/js |
00:22:22 | * | krux02 quit (Remote host closed the connection) |
00:35:13 | * | jjido quit (Quit: Textual IRC Client: www.textualapp.com) |
00:39:24 | stefantalpalaru | The latter. |
00:39:28 | * | Hideki_ quit (Ping timeout: 260 seconds) |
00:49:13 | nisstyre | there is no difference between "compile" and "transpile" IMHO |
00:49:26 | shashlick | It's a useless distinction |
00:49:54 | shashlick | By this definition, it is the former |
00:49:57 | shashlick | https://en.m.wikipedia.org/wiki/Source-to-source_compiler |
00:50:17 | nisstyre | Yeah, I agree |
00:50:32 | shashlick | Nim offers far more capability than c/c++ or Javascript |
00:51:36 | opal | <nisstyre> there is no difference between "compile" and "transpile" IMHO |
00:51:41 | opal | sorry to say but your opinion is wrong |
00:51:46 | opal | it isnt a "useless distinction" |
00:51:50 | opal | its a clear semantical one |
00:52:00 | opal | you nor i write LLVM intermediate bytecode |
00:52:04 | nisstyre | opal: ok the difference is not important, I will acknowledge there can be some differences (depending on your definition of a transpiler) |
00:52:21 | nisstyre | but I've never seen an agreed on definition of what "transpile" really means |
00:52:29 | nisstyre | always something about high level and low level languages |
00:52:29 | opal | my definition is the same as the accepted definition |
00:52:49 | nisstyre | but those concepts are problematic to clearly define |
00:53:30 | nisstyre | I think this is a good overview of the problem http://composition.al/blog/2017/07/30/what-do-people-mean-when-they-say-transpiler/ |
00:53:51 | shashlick | What's the purpose of your original question |
00:53:58 | opal | i wasnt interested in restarting this topic that i had not even a month ago in any case, so im glad to drop it |
00:54:00 | opal | the answer was good enough |
00:55:02 | opal | thanks stefantalpalaru |
00:55:58 | shashlick | Brilliant |
01:01:29 | * | ng0 quit (Ping timeout: 268 seconds) |
01:07:38 | * | lritter quit (Ping timeout: 258 seconds) |
01:14:18 | FromGitter | <iffy> I just finished the first version of this library for accessing the OS keyring on macOS/Windows/Linux: https://github.com/iffy/nim-keyring/ Feedback and guinea pigs welcome :) |
01:32:32 | shashlick | Very timely - I need this! |
01:40:52 | FromGitter | <gogolxdong> What does it do? |
02:11:48 | * | EastByte quit (Ping timeout: 248 seconds) |
02:14:34 | * | EastByte joined #nim |
02:18:43 | FromGitter | <deech> @iffy Looks great! Nice and simple. |
02:20:57 | FromGitter | <iffy> @gogolxdong It lets you store things in the OS keyring (like passwords). For instance, for macOS: https://support.apple.com/guide/keychain-access/what-is-keychain-access-kyca1083/mac |
02:31:11 | * | cgfuh quit (Quit: WeeChat 2.6) |
02:32:01 | * | BourneToBe joined #nim |
02:49:00 | FromGitter | <Varriount> Sadly, Windows doesn't really have an equivalent |
02:49:43 | FromGitter | <Varriount> I know it has credential management, but that API doesn't have the same security behavior as OSX or Linux |
02:54:50 | * | lmariscal06 quit (Quit: Ping timeout (120 seconds)) |
02:55:03 | * | sammich quit (Remote host closed the connection) |
02:56:02 | * | a_b_m quit (Quit: Leaving) |
02:56:04 | * | opal quit (Ping timeout: 240 seconds) |
02:56:24 | * | leorize quit (Ping timeout: 240 seconds) |
03:07:35 | FromGitter | <iffy> @Varriount What does it lack? |
03:07:53 | FromGitter | <iffy> Also, does anyone have an example of installing Nim on Windows with GitHub Actions? |
03:10:33 | * | opal joined #nim |
03:12:26 | * | lmariscal06 joined #nim |
03:13:48 | * | leorize joined #nim |
03:34:47 | * | BourneToBe quit (Quit: BourneToBe) |
03:42:09 | FromGitter | <Varriount> @iffy Primarily a way to allow a user to sent an application access to credentials |
03:43:06 | disruptek | iffy: tell me about your dbus-using pw manager. |
03:51:32 | * | muffindrake quit (Ping timeout: 252 seconds) |
03:53:46 | * | muffindrake joined #nim |
03:55:10 | * | endragor joined #nim |
04:25:29 | * | nsf joined #nim |
04:26:08 | * | BourneToBe joined #nim |
04:38:01 | * | marmotini_ joined #nim |
04:42:18 | disruptek | Zevv: maybe we should formalize your mem stats api a bit and use it elsewhere. we could build the instrumentation for golden into the compiler itself. |
04:53:08 | * | ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
05:10:01 | * | endragor_ joined #nim |
05:10:26 | * | endragor quit (Read error: Connection reset by peer) |
05:11:11 | * | oculuxe joined #nim |
05:11:40 | * | oculux quit (Ping timeout: 268 seconds) |
05:41:11 | * | NimBot joined #nim |
05:51:47 | * | BourneToBe quit (Quit: BourneToBe) |
06:15:21 | * | xet7 quit (Read error: Connection reset by peer) |
06:15:50 | * | xet7 joined #nim |
06:16:34 | Zevv | what would you need? due to lack of info I can only come up with alloc counts, not with total sizes |
06:17:51 | * | arecaceae quit (Remote host closed the connection) |
06:17:52 | Zevv | I could pass every [[dr]e]alloc() including pointers and sizes, then golden can keep track of the bookkeeping, but it is a bit of a burden and can of course not be done with any constructs that require heap memory |
06:17:56 | Zevv | because of reasons |
06:18:17 | * | arecaceae joined #nim |
06:19:24 | disruptek | i'm staggered that you don't have size info. |
06:20:36 | Zevv | didnt mean to stagger you :( |
06:21:50 | Zevv | think C malloc api level. |
06:22:55 | disruptek | maybe what we really want is some data nodes mixed into the ast; then we will consume them there. then we don't worry about api or the alloc impl. |
06:23:07 | Zevv | but like I sait earlier: the stats are there only for a handful of unit tests now. We can build that to whatever is needed, the good thing is that with te rework all allocs come through one place only now |
06:23:14 | disruptek | breadcrumbs that we can do whatever we want with. |
06:23:30 | Zevv | elaborate |
06:24:21 | disruptek | what we want is some data to get collected at runtime; we'll consume it at runtime, also. |
06:24:55 | disruptek | but the machinery to create this can be done at compile-time. |
06:25:31 | disruptek | we create nodes in the ast that are just data; they reflect some metadata that we know some tooling may want to mess with. |
06:25:50 | disruptek | then we can plug in handlers for those nodes, etc. |
06:27:06 | Zevv | all possible I guess,but the ent result you are aiming for? |
06:28:02 | disruptek | have you done any ios coding? |
06:28:13 | disruptek | objective c in apple's world, at all? |
06:28:55 | disruptek | i guess i want a live profiler. |
06:31:16 | disruptek | i think it's pretty doable. |
06:32:28 | Tanger | Huh, ptrace isn't part of the stdlib |
06:36:39 | Zevv | disruptek: I have perf on linux. profiles right into kernel space |
06:37:02 | disruptek | this is kinda what i had in mind: https://asciinema.org/a/25394 |
06:37:22 | Zevv | all this stuff we build in needs to be maintaines. d |
06:37:22 | Zevv | it needs to cooperate with otjr stuff |
06:37:27 | Zevv | it will rot andd start smelling |
06:37:42 | Zevv | typing while walkigng, sorry |
06:38:22 | disruptek | ahah. i was thinking... On The Job...Retarded? stuff... |
06:38:33 | Zevv | all of the above |
06:39:58 | disruptek | the best way to maintain it is to make it indispensable. |
06:41:10 | disruptek | we should get netflix to show up at fosdem and do a talk on their bpf stuff. |
06:41:25 | disruptek | that's something i'm super interested in. |
06:42:30 | * | xet7 quit (Read error: Connection reset by peer) |
06:42:41 | * | xet7 joined #nim |
06:43:51 | * | xet7 quit (Remote host closed the connection) |
06:44:51 | * | xet7 joined #nim |
06:48:07 | Zevv | fun but overrated |
06:48:09 | * | Jjp137 quit (Read error: Connection reset by peer) |
06:49:49 | Zevv | do you use perf? |
06:50:04 | Zevv | if not, spend a day on it, it goes deep |
06:51:20 | * | dddddd joined #nim |
06:51:48 | Zevv | built in tools are one trick ponies. you cant easily interface with those, or script them |
06:52:17 | Zevv | nice profiling ui you have there. now let me use this on me embedded headless system |
07:00:14 | * | Jjp137 joined #nim |
07:06:10 | FromGitter | <garuse> Hi all! I want to create a static binary web server that will serve big logs. However it looks like Jester does not support compression. Is there a documented way to achieve this? |
07:09:38 | Tanger | garuse: Jester doesn't support compression? In what way? As in it has no functionality to decompress files? |
07:09:53 | Tanger | Or it won't let you handle content types differently? |
07:12:48 | Zevv | My guess is that he means the jester does not allow gzip content-encodign |
07:13:46 | FromGitter | <garuse> no api to compress the pages before sending them |
07:24:58 | FromGitter | <matrixbot> `curioussav` Why not just rely on nginx for that |
07:25:21 | Zevv | It should be fairly trivial to handle that yourself, but I guess the answer would be "no, no documented way" |
07:25:51 | FromGitter | <garuse> Jester doc (README) has only very simple examples not even showing how to send custom headers |
07:27:28 | * | PMunch joined #nim |
07:29:04 | FromGitter | <garuse> also I cannot find any compression standard compression lib here https://nim-lang.org/docs/lib.html. |
07:31:00 | * | Guest44431 is now known as dadada |
07:31:19 | * | marmotini_ quit (Remote host closed the connection) |
07:31:27 | Yardanico | there's https://github.com/nim-lang/zip |
07:34:06 | PMunch | Hmm, Araq, I remember you mentioning that some work was being done to be able to use FFI during compile-time. Is this still being worked on? |
07:34:43 | dadada | Could this have a place in Nim? I just learned about it, and kind of dig it. https://en.wikipedia.org/wiki/Language_Integrated_Query |
07:35:15 | Yardanico | well, with macros or templates you can do similar stuff :) |
07:36:09 | Yardanico | or https://github.com/zero-functional/zero-functional (it implements same stuff as in sequtils like mapIt, but more efficiently if you use a lot of the calls) |
07:36:09 | PMunch | Ugh, used LINQ to actually do some SQL stuff and it was horribly inefficient.. |
07:36:22 | livcd | perf wise ? |
07:36:54 | Yardanico | https://github.com/Araq/ormin/blob/master/examples/chat/server.nim#L26 |
07:37:22 | FromGitter | <nhanb> Hi everyone! I'm (trying to) write a web based desktop app, basically a nim server serving an SPA written with karax. Is `asynchttpserver` appropriate for my use case? The docs say asynchttpserver isn't production-ready but I'm not sure if it's just performance-wise. |
07:38:16 | PMunch | livcd, yeah perf wise |
07:38:30 | PMunch | It essentially didn't do much in the way of query optimisation |
07:38:32 | Yardanico | @nhanb well, for your usecase it'll be more than enough I think |
07:38:57 | PMunch | Yeah it should be plenty fine |
07:40:15 | PMunch | Not sure what that line refers to, asynchttpserver has been used on the forums and the playground along with other sites for quite a while |
07:40:25 | FromGitter | <nhanb> Sweet, thanks @Yardanico @PMunch ! |
07:40:38 | PMunch | (although I think a lot of Jester projects have migrated to httpbeast at this point after it became the default) |
07:41:13 | PMunch | By the way, Jester might be easier to work with |
07:41:20 | FromGitter | <nhanb> Not supporting Windows is a dealbreaker for me though |
07:41:29 | livcd | yeah httpbeast does not support windows |
07:41:45 | Yardanico | can't you use jester with asynchttpserver? |
07:41:51 | dadada | PMunch: I like the idea of using the same declarative syntax for all types of queries (databases, collection of objects, networks, ...), optimization is something I wouldn't blame on the higher level syntax that LINQ offers ... it seems like it does improve code readability |
07:42:00 | PMunch | Aaah, didn't know it doesn't support windows |
07:42:11 | PMunch | Guess that's not that big an issue for most server installs |
07:42:19 | PMunch | Yardanico, yes you can |
07:42:38 | dadada | random comments on sites like stackoverflow lead me to investigate LINQ, in those comments it seems that many have grown fond of it |
07:42:59 | PMunch | dadada, oh yea I don't have anything against that kind of syntax (horrible as it might be to use, LINQ is a mess..) |
07:43:15 | Yardanico | well, I don't think it would really improve readability in Nim when you already have inline for, things like "collect" macro or can make your own DSL :) |
07:43:27 | dadada | PMunch: can you go into some details on why it is a mess? |
07:43:31 | PMunch | I spent the better part of a day trying to figure out a LINQ query that took me 10 minutes to write in SQL |
07:43:33 | FromGitter | <nhanb> Huh I didn't know you could use jester on top of asynchttpserver |
07:43:34 | dadada | I mean you started, but more :-) |
07:43:47 | Yardanico | @nhanb jester was using asynchttpserver before httpbeast was created :) |
07:43:51 | Yardanico | by default that is |
07:44:07 | dadada | PMunch: do you have that LINQ query at hand and can private message it to me? |
07:44:26 | PMunch | And by the end of the day the LINQ query for super inefficient while the SQL query was loads faster |
07:44:34 | PMunch | Hmm, maybe, just a sec |
07:47:48 | * | Vladar joined #nim |
07:48:00 | Zevv | PMunch: I believe CT FFI is functional in a PR somewhere |
07:48:22 | PMunch | Zevv, oh really? |
07:48:30 | Zevv | timotheecour iirc |
07:48:38 | Yardanico | what about https://github.com/nim-lang/Nim/pull/10150 |
07:48:40 | disbot | ➥ FFI at CT ; snippet at 12https://play.nim-lang.org/#ix=282x |
07:48:41 | PMunch | dadada, can't seem to find the LINQ query, only the SQL I ended up with |
07:49:05 | Yardanico | https://github.com/nim-lang/Nim/pull/12877 is merged too |
07:49:07 | disbot | ➥ VM: support importc var, ptr/pointer types, cast int <=> ptr/pointer ; snippet at 12https://play.nim-lang.org/#ix=282y |
07:49:09 | FromGitter | <nhanb> TIL jester picks either of the servers under the hood depending on OS, that's cool |
07:49:20 | Zevv | https://github.com/nim-lang/Nim/pull/10150 |
07:49:21 | disbot | ➥ FFI at CT ; snippet at 12https://play.nim-lang.org/#ix=282x |
07:50:34 | PMunch | nhanb, the beauty of compile-time evaluation :) |
07:54:41 | dadada | does anyone here have experience with F#? it looks like a decent language by a first glance on its syntax ... |
07:54:51 | PMunch | dadada, I guess it's partially down to me not getting used to the syntax. It's just hard to use, and read, which is never a good thing.. |
07:54:55 | Yardanico | dadada: .NET :( |
07:55:23 | PMunch | dadada, we have a company here that uses it exclusively, and people here at work have started talking about starting to use it as well |
07:55:50 | PMunch | But yeah it's .NET, which depending on your perspective is either a huge pluss, or a huge minus |
07:57:23 | PMunch | I really liked Clojure, but the fact that in runs on the JVM means it can't be used for certain things |
07:57:37 | dadada | PMunch: I saw short examples of LINQ on wikipedia and found them very readable, of course that can be deceiving |
07:58:17 | PMunch | Most short things are fine, like select five of these and do some simple stuff with it |
07:59:40 | PMunch | And to be fair, this is the query I was trying to replicate: http://ix.io/282A |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:04:11 | * | solitudesf joined #nim |
08:04:54 | * | gmpreussner joined #nim |
08:08:02 | * | dddddd quit (Ping timeout: 268 seconds) |
08:15:35 | * | jwm224 quit (Ping timeout: 272 seconds) |
08:17:28 | * | jwm224 joined #nim |
08:20:36 | FromDiscord | <citycide> dadada: I love F#. dotnet is also becoming a fantastic platform with Core. My biggest complaints were always boilerplate and ridiculously verbose configurations and those are essentially a non-issue for me now |
08:21:09 | * | dddddd joined #nim |
08:22:12 | FromDiscord | <citycide> I do wish I could compile F# to native more similarly to Nim, but that leaves things for Nim to do instead |
08:30:13 | dadada | PMunch: that was a complicated query :D the consensus on stackexchange seems to be that when you get used to LINQ, it is good, of course its unfortunate that the syntax is so close to SQL yet differently structured, it would be great if we had standards for structured queries that all followed the same left-to-right patterns, from a programmer's life perspective you continuously have to relearn the same |
08:30:19 | dadada | things, and when context switching between languages you get slowed down ... think about the lost productivity world wide over the span of decades |
08:33:53 | dadada | citycide: when glancing at F# examples it does kind of resemble Nim (and hence python) code, compiling to native would be a huge plus, who knows maybe F# will be freed from its cage one day |
08:56:22 | * | floppydh joined #nim |
09:02:40 | Araq | fwiw I like Nim's syntax better as F# departs moreso from the "traditional" expression syntax |
09:04:40 | Araq | what do you miss in Nim that F# offers? |
09:16:40 | FromGitter | <garuse> i was trying to use zip/zlib but I get this: Error: unhandled exception: zlib version mismatch! [ZlibStreamError] |
09:22:35 | PMunch | Isn't F# purely functional? |
09:24:23 | PMunch | And dadada, that's pretty much exactly what annoys me with LINQ. Granted I have only used it for database stuff (apart from a `First` here or there or similar simple things), and trying to write a LINQ query when I have the SQL solution in my head really bothers me.. |
09:42:29 | Araq | garuse: I don't know, maybe our zlib wrapper is outdated |
09:45:08 | * | oculux joined #nim |
09:45:27 | * | oculuxe quit (Ping timeout: 265 seconds) |
09:50:46 | Araq | PMunch, what software do you use for your slides? |
09:51:58 | PMunch | Normally just LibreOffice |
09:52:12 | FromGitter | <alehander92> Araq |
09:52:29 | PMunch | Although I have done some in Inkscape with the JessyInk plug-in |
09:52:31 | FromGitter | <alehander92> is there a standard format in which the cfg is emitted |
09:52:47 | FromGitter | <alehander92> like, can i easily dump the cfg for "most" functions while compiling in a file |
09:53:02 | FromGitter | <alehander92> wondering if i can add it as a view in our viewer |
09:53:35 | dadada | tried OnlyOffice the other day, it's open source as well, but using the Microsoft office document formats as a basis, the UI is very clean and easy to get ... I'd tentatively recommend at least trying it |
09:58:18 | Araq | alehander92: well we emit it as a list of instructions, asm-like |
09:58:50 | * | kahiru left #nim ("http://quassel-irc.org - Chat comfortably. Anywhere.") |
10:01:56 | FromGitter | <alehander92> but can one emit it for ~all functions |
10:04:45 | Araq | -d:toDebug=always |
10:05:11 | Araq | but it's the usual thing, if your time has no value, look at "all" the functions |
10:06:51 | FromGitter | <alehander92> i was wondering about passing that info to a ide-like tool , not to look at them manually |
10:07:30 | FromGitter | <alehander92> of course, otherwise filtering makes more sense |
10:07:41 | Araq | same thing though, better ask for specific information |
10:07:49 | FromGitter | <alehander92> and recompile each time? |
10:07:59 | Araq | rather than dumping everything to your poor IDE. |
10:08:09 | Araq | recompiles must be fast, we need IC |
10:08:28 | Araq | I'm so sick and tired of this batch processing shit |
10:09:15 | FromGitter | <alehander92> hm, it's a valid suggestion |
10:09:24 | FromGitter | <alehander92> i'd love to see IC as well |
10:09:58 | FromGitter | <alehander92> dont get me wrong, i already do something like this for ast-s, as i can use the nim parser as a lib(or plugin) |
10:10:30 | FromGitter | <alehander92> so, hm, in this case, can one hint to the compiler to stop after producing its cfg dumps |
10:11:10 | Araq | I don't want to look at the CFG in my IDE though |
10:11:18 | Araq | it's incomprehensible |
10:12:12 | Araq | currently about 3 people do understand it |
10:12:33 | Araq | so it's a feature for 3 people on the planet :P |
10:13:33 | FromGitter | <alehander92> yes, but you can see a visual graph of it :D :D |
10:13:59 | FromGitter | <alehander92> no, i agree, but sometimes i like to think of fun features |
10:14:34 | FromGitter | <alehander92> just wanted to research how feasible would that be in principle |
10:18:21 | Araq | ok, well. in principle it's really nice |
10:19:01 | Araq | visual graph of a CFG that doesn't lose information (our does lose almost everything that is not relevant for the analysis we need to do) |
10:27:47 | FromDiscord | <Tak> When a seq resizes, does it re-size the whole array into a new contiguous array or does it assign a new array and add a ptr to link between them? |
10:28:27 | FromGitter | <alehander92> Araq hm, so does the dump-ed cfg not show it |
10:28:42 | FromGitter | <alehander92> yeah it had mostly joins/forks and similar right |
10:45:10 | lqdev[m] | @Tak it allocates a new array, copies the existing data there, and frees the old array |
10:45:34 | lqdev[m] | there are no links because it would negatively impact performance |
10:46:42 | FromDiscord | <Tak> Cool thanks! |
11:18:27 | dadada | say I'd like to add support to Nim for a syntax like in the first example in https://en.wikipedia.org/wiki/Language_Integrated_Query#Language_extensions |
11:19:02 | dadada | does Nim's macro system have the flexibility for that, or would I need to meddle with Nim's core? |
11:19:32 | dadada | this is the code I mean: |
11:19:33 | dadada | var results = from c in SomeCollection where c.SomeProperty < 10 select new {c.SomeProperty, c.OtherProperty}; |
11:20:24 | lqdev[m] | dadada: pretty sure that would parse correctly |
11:22:01 | lqdev[m] | yeah, it does. mostly https://play.nim-lang.org/#ix=282Y |
11:22:16 | lqdev[m] | because `from` is a keyword |
11:22:31 | lqdev[m] | but designing such a thing is indeed possible |
11:23:14 | lqdev[m] | the hardest part would be actually parsing the query from the existing AST |
11:27:21 | * | m4r35n357 quit (Quit: Ex-Chat) |
11:38:04 | * | cgfuh joined #nim |
11:55:56 | dadada | can the code be preprocessed in a way to distinguish "... = from ..." from "from module", so you could mark the "= from" as not being the keyword |
11:57:03 | dadada | obviously I could write my own preprocessor to call before Nim, something you'd want to avoid |
12:11:43 | Araq | dadada, maybe check out Ormin's solution for this problem |
12:13:49 | FromGitter | <Vindaar> @narimiran: Ok, so I just checked the azure_pipelines file and which other packages are tested. Do I understand correctly that the only packages with dependencies we test are those that are provided by the `dlls.zip` from the nim download page? |
12:14:57 | * | Hideki_ joined #nim |
12:18:07 | * | nsf quit (Quit: WeeChat 2.7) |
12:22:42 | dadada | why can't macros call c functions? |
12:23:46 | dadada | Ormin is nice |
12:24:28 | Zevv | dadada: because macro's run at compile time, and there is no CT FFI in Nim |
12:32:25 | lqdev[m] | probably not, but `From != from` so maybe you can use PascalCase for keywords to make it compatible |
12:32:37 | lqdev[m] | or maybe even UPPERCASE to mimic SQL |
12:33:01 | PMunch | Zevv, "yet" |
12:33:12 | Zevv | Well, I was not wrong |
12:33:34 | Zevv | no one said it will even make it into the compiler afaik |
12:37:21 | * | Hideki_ quit (Remote host closed the connection) |
12:38:16 | * | Hideki_ joined #nim |
12:42:48 | * | Hideki_ quit (Ping timeout: 260 seconds) |
12:44:05 | FromGitter | <iffy> disruptek: The linux dbus-using pw manager uses the Secret Service DBUS API for storing passwords. It's what libsecret does, but without using libsecret because I couldn't figure out how to get libsecret to work. It seemed simpler to just use Dbus instead of using a library that uses Dbus. |
13:14:46 | * | gangstacat quit (Quit: Ĝis!) |
13:19:03 | * | endragor_ quit (Remote host closed the connection) |
13:22:19 | * | gangstacat joined #nim |
13:27:26 | * | Pqzcih5 joined #nim |
13:36:56 | FromDiscord | <Rika> anyone know a lib that gives a similar functionality to reactivex? |
14:01:17 | Yardanico | A guy in telegram found yet another compiler crash with config files :) |
14:01:21 | Yardanico | -d: ssl, release |
14:01:24 | Yardanico | compiler crashes |
14:01:54 | Yardanico | ah nvm, not on devel |
14:02:32 | * | nsf joined #nim |
14:05:44 | leorize | @iffy: you are the first to ever say that :P |
14:06:10 | leorize | if libsecret supports gintrospection then you might be able to get it to work with gintro |
14:17:58 | * | lritter joined #nim |
14:21:06 | FromDiscord | <Clyybber> Zevv: It made it into the compiler : ) |
14:21:21 | FromDiscord | <Clyybber> you just have to build the compiler with -d:libFFi or something like tha |
14:26:20 | Zevv | oh look at that! There is sooo many stuf happening that never makes it into the docs |
14:29:21 | * | ljoonal quit (Remote host closed the connection) |
14:31:50 | shashlick | https://stackoverflow.com/questions/59843577/go-like-parallelism-in-nim |
14:32:18 | PMunch | Rika, you should be able to wrap it if it runs on C++ |
14:32:52 | PMunch | Clyybber, oh so you can get this feature right now? Interesting! |
14:34:00 | leorize | still gated behind a flag when you build the compiler at compile-time though :P |
14:34:17 | leorize | not even the official distribution enables it, so I wouldn't count on it being available |
14:34:25 | PMunch | True, but still |
14:34:56 | * | ljoonal joined #nim |
14:35:01 | * | abm joined #nim |
14:35:22 | PMunch | Hmm, I'm spoiled by the JSON implementation in Nim.. |
14:35:41 | dadada | I had this idea how commonly seen code where you have an if-else and the code blocks are almost the same except for a small detail could be simplified with automatically provided context references similar to how Nim provides a result variable https://pastebin.com/M1dNJ08X |
14:35:57 | PMunch | I mean there are long article on how to create JSON objects in C#, and I only need a simple object with two fields.. |
14:36:29 | dadada | I know somebody else has probably thought about this before... not claiming this is genius or anything... |
14:37:18 | PMunch | I've been annoyed by that issue before, not really thought about how to solve it though |
14:39:52 | PMunch | A simple template can do something similar: https://play.nim-lang.org/#ix=283I |
14:40:07 | PMunch | The syntax might be a tad hard to read though.. |
14:43:32 | * | sagax quit (Quit: Konversation terminated!) |
14:45:30 | FromDiscord | <Rika> PMunch, i find it odd that no one has made one yet though |
14:46:10 | dadada | PMunch: I like the template solution, too |
14:47:08 | leorize | can someone on OSX check if SOCK_CLOEXEC exists? |
14:47:19 | leorize | it should be in <sys/socket.h> |
14:47:59 | dadada | PMunch: don't understand Nim enough yet, it looks like your template copies a, b by value? |
14:48:59 | dadada | in my example we needed to operate on the original it.ri it.le |
14:50:17 | leorize | https://play.nim-lang.org/#ix=283M |
14:50:22 | leorize | fixed it :P |
14:52:05 | leorize | PMunch: btw, do you think it's possible to implement project-agnostic support to nimsuggest (ie. no longer requiring project file)? |
14:52:25 | PMunch | leorize, ah indeed that is a better solution :) |
14:52:39 | PMunch | What do you mean? |
14:53:03 | leorize | basically make it so that you don't have to pass a project file into nimsuggest |
14:53:20 | leorize | I've added auto detection, though I don't know how to run multiple projects in nimsuggest :P |
14:53:25 | leorize | figured that you might know |
14:53:41 | PMunch | dadada, with leorizes modification it should now behave as you'd expect: https://play.nim-lang.org/#ix=283N |
14:54:23 | * | ptdel joined #nim |
14:55:37 | dadada | ty leorize, PMunch |
14:55:45 | PMunch | Hmm, I just rely on some sketchy logic in nimlsp to determine the project :P |
14:55:58 | PMunch | It keeps one instance for each project you have open |
14:56:27 | leorize | you can use the one provided by the compiler now :P battle tested with nim.nvim |
14:56:40 | PMunch | dadada, no problem, once you master the power of meta-programming you will see all of these things as trivially solved and be super annoyed every time you encounter them in a language that doesnt' have it :P |
14:56:56 | PMunch | Oh there is a built in way to do that now? |
14:57:28 | * | nsf quit (Quit: WeeChat 2.7) |
14:57:57 | dadada | built in way for context? |
14:58:01 | leorize | PMunch: there has always been, I just make it work on real projects :P https://github.com/nim-lang/Nim/pull/12404 |
14:58:03 | disbot | ➥ compiler/options: improve project file detection |
14:58:27 | dadada | I dig metaprogramming |
14:59:06 | dadada | still would be nice if not everyone had to invent his own withContext templates, no matter how easy it is |
14:59:16 | PMunch | dadada, nah built in way to detect the main project file of a given nim file |
14:59:42 | PMunch | dadada, yeah I feel that there is a place for all these random templates we end up writing to solve these things |
14:59:46 | PMunch | Maybe in "sugar"? |
15:00:09 | * | dddddd quit (Ping timeout: 268 seconds) |
15:00:11 | Araq | there is considerable overlap between 'withX' and destructors |
15:00:14 | * | sagax joined #nim |
15:00:19 | Araq | and we have destructors now. |
15:00:52 | PMunch | Araq, this was a different problem than what is solved with your typical `withX` template |
15:01:11 | PMunch | See dadada's initial paste: https://pastebin.com/M1dNJ08X |
15:01:29 | PMunch | Maybe `withContext` wasn't the best name for it though |
15:01:46 | dadada | where I have since discovered bad English, sry |
15:02:10 | PMunch | No worries, strikingly few here have English as their first language (myself included) |
15:02:29 | dadada | well I thought, seeing that the result-function variable is standard part of the language, that maybe we could find a notation that is similarly convenient |
15:02:35 | FromDiscord | <Rika> PMunch, reactivex only has C++ 😦 |
15:02:50 | PMunch | Rika, so? Nim compiles to C++ as well |
15:03:10 | FromDiscord | <Rika> but i dont wanna use cpp xd |
15:03:17 | dadada | not claiming that I found it, but this type of problem has irked me in many different languages, the same was true for result variables that you needed to create by hand |
15:03:29 | PMunch | Yeah, result is pretty neat |
15:03:47 | PMunch | The syntax to introduce result though is a bit less clear.. |
15:04:00 | PMunch | s/result/context |
15:04:27 | PMunch | Oh well, I'm off now, TTYL |
15:04:28 | * | PMunch quit (Quit: Leaving) |
15:05:10 | dadada | my idea was whatever is the last used variable in the one-lined if-else is automatically becoming context for the indented block within that if-else |
15:05:27 | dadada | for anyone that hasn't seen the pastebin |
15:07:38 | dadada | of course there may be code where there's the choice between more than only two contexts, so something more generalized might be great, but it should be short and easy to read for simple two-contexts cases as those will be the most common ones |
15:07:43 | shashlick | running into a tough issue - importing libcurl so it pulls in procs with CDECL |
15:08:31 | shashlick | also pulling in some curl specific code which complains that those CDECL procs conflict with the ones defined in easy.h |
15:09:34 | FromGitter | <alehander92> dadada great to think out of the box |
15:09:44 | FromGitter | <alehander92> but this particular example seems very worrying to me |
15:10:01 | FromGitter | <alehander92> very hard to conceptualize |
15:10:22 | FromGitter | <alehander92> its much easier when you hit this case to offload this snippet to a new function and use result there |
15:11:09 | dadada | alehander92: I must disagree on the much easier part, if it was that easy, people would already be doing it |
15:11:16 | FromGitter | <alehander92> imo using many well named small `func`-s is a very good idea especially if they can be easily inlined |
15:11:45 | FromGitter | <alehander92> but refactoring code into smaller functions is being done very often |
15:12:49 | dadada | alehander92: as you see from the example I've given in the pastebin, that was code from Nim's doc, and I think this kind of copy-paste programming is commonly done precisely because creating a new function everytime you hit on something like that is not commonly done, because it's not intuitive, for example, how would you name that new function? |
15:12:57 | * | dddddd joined #nim |
15:14:02 | FromGitter | <alehander92> hm, but i think i see what you mean on second read |
15:14:03 | dadada | alehander92: yes, it is a good practice and done very often, agreed, but creating small functions for things that you might only use one time in your whole codebase is still something by far not everybody is doing, see the examples that can be seen in Nim's own docs |
15:14:16 | FromGitter | <alehander92> yes, i was wrong about funcs, here you need to use a template |
15:14:23 | FromGitter | <alehander92> but what i am trying to say is |
15:14:32 | FromGitter | <alehander92> yeah, maybe in this case you can design a custom abstraction |
15:14:44 | FromGitter | <alehander92> but then you hit a slightly different situation |
15:14:52 | FromGitter | <alehander92> and then you can design a next or stronger version of this abstraction etc |
15:15:15 | FromGitter | <alehander92> while you can already do just template/func abstraction which is much more obvious to an outside programmer imo |
15:16:21 | FromGitter | <alehander92> about the name: if i knew what algo this is, probably there would be an ok name for it |
15:16:59 | FromGitter | <alehander92> but maybe you mean something else: maybe what you want is something like @timotheecour 's byRef |
15:17:00 | dadada | maybe he needs to get inside :D I see what you mean, with that sort of argument we can't innovate too much, we need to keep with expectations, instead of raising them higher |
15:17:09 | dadada | s/he/he or she/ |
15:17:19 | dadada | s/with/within/ |
15:17:38 | dadada | ty alehander92 , I'll check it out! |
15:17:42 | FromGitter | <alehander92> and `byRef a = if c > 0: it.le else: it.ri # do stuff with a now ` |
15:17:46 | FromDiscord | <Rika> hmm |
15:17:50 | FromGitter | <alehander92> which is again more general |
15:17:59 | FromGitter | <alehander92> i dont remember the syntax, and i think it was just a rfc/pr |
15:18:13 | FromDiscord | <Rika> i'll try just implementing observable/observer myself in nim |
15:18:40 | FromGitter | <alehander92> dadada, dont get me wrong, i love abstractions and writing macro dsl-s, just trying to brainstorm whats the most balanced general+simple approach |
15:19:01 | dadada | alehander92: maybe byRef could be made part of standard Nim |
15:19:39 | dadada | if it is what I think it to, it would be super handy |
15:19:40 | FromGitter | <alehander92> https://github.com/nim-lang/Nim/pull/11824 |
15:19:43 | FromGitter | <alehander92> it seems close! |
15:19:43 | disbot | ➥ [feature] ref syntax for lvalue expressions: `byRef: myref=x[1].foo[2]` ; snippet at 12https://play.nim-lang.org/#ix=283U |
15:20:38 | shashlick | Man I have a 1 in 10 chance of getting any help here, seems like I'm always working on some left field stuff with Nim |
15:22:18 | FromGitter | <alehander92> dadada yeah it seems close to your pain point to me |
15:22:39 | FromGitter | <alehander92> just didnt want to make it hard-tied to a construct like if |
15:24:43 | * | icebattle joined #nim |
15:26:08 | FromGitter | <zetashift> @shashlick you are dealing with some hard stuff :( |
15:28:13 | dadada | alehander92: one disadvantage I can see is that with byRef (now apparently byAddr) you have to define a name for your "context", which is not a big deal, but it does go against he idea of programming by convention |
15:28:45 | dadada | s/he/the |
15:29:51 | dadada | indeed it is good that you can make a special name for it, since if you have multiple layers of context, you'd need it anyway |
15:35:50 | FromGitter | <alehander92> yes, i think there is a balance |
15:36:06 | FromGitter | <alehander92> because convention comes with implicitness |
15:36:12 | FromGitter | <alehander92> which can be quickly overwhelming |
15:36:35 | FromGitter | <alehander92> you might like `using` tho |
15:36:57 | FromGitter | <alehander92> and `{this: self.}` (but i am not sure the last one survived) |
15:37:01 | dadada | my thought process is this: the solution will only be good enough if code like the one I found inside Nim's official docs changes to that new solution |
15:37:48 | dadada | which means that in 99% of all cases Nim programmers would never create such repetitive code again, because it's dead simple not to |
15:38:30 | FromGitter | <alehander92> yes, and i think byAddr is much easier to reason for it |
15:38:52 | dadada | whoever wrote the https://nim-lang.org/docs/tut2.html#generics code didn't think that there was a more idiomatic solution at the time, so he ended up with that if-else and repetition |
15:39:05 | FromGitter | <alehander92> because overally what you intend is "make the same thing but with different variables depending on stuff" |
15:39:30 | FromGitter | <alehander92> this condition might be `case` or pattern matching or `while` or something else |
15:39:46 | FromGitter | <alehander92> so its much easier to use orthogonal features |
15:41:09 | FromGitter | <alehander92> like assignment + normal flow constructs (with just making assignment a bit more general) |
15:45:08 | dadada | alehander92: byAddr could create a default variable name as well |
15:45:26 | dadada | or a variation of byAddr |
15:46:12 | FromGitter | <alehander92> but the difference is `result` exists in a function and there can be hardly other `result`-s there: all code is in mostly a single function (ok, you can probably access result in closures..which is confusing :() |
15:46:45 | dadada | if the default was context, you could still use specialContext or subContext in a byAddr or withAddr that is nestest |
15:46:48 | dadada | nestet |
15:47:50 | FromGitter | <alehander92> and how does it work with case/pattern matching/other possible conditionals |
15:51:50 | * | icebattl1 joined #nim |
15:56:09 | dadada | alehander92: https://pastebin.com/RzGXEkfH |
15:56:39 | dadada | correct me if I used byAddr wrongly |
16:04:12 | * | nsf joined #nim |
16:04:34 | dadada | alehander92: updated https://pastebin.com/5Wa6SCBU with PMunch withContext, too |
16:10:30 | FromDiscord | <Tak> Of course you have method syntax for fake a method for an object. Is there a way to bring its contents into scope so you don't have to qualify if everytime you reference a variable? i.e instead of Object.Variable just Variable |
16:10:38 | FromDiscord | <Tak> Of course you have method syntax for faking a method for an object. Is there a way to bring its contents into scope so you don't have to qualify if everytime you reference a variable? i.e instead of Object.Variable just Variable |
16:13:38 | dadada | not that I know, but interesting concept, could maybe be something analogous to PMunch's withContext, withScope ... I have no idea how to implement that or if it's possible, just wanted to let you know that I support the idea |
16:13:48 | FromGitter | <alehander92> Tak dadada yes there was |
16:13:53 | FromGitter | <alehander92> `{.this: self.}` |
16:14:02 | FromGitter | <alehander92> ahh sorry |
16:14:12 | FromGitter | <alehander92> if you want to do it not in method but when using the instance |
16:15:04 | FromGitter | <alehander92> you can use https://github.com/citycide/cascade |
16:18:06 | FromGitter | <alehander92> you can also write your own macro to do something like `bringInScope <instance>` |
16:18:24 | FromGitter | <alehander92> if you dont want to use them only in the indented block/scope of cascade |
16:19:14 | FromDiscord | <Tak> So the pragma brings it into scope for the whole procedure definition and then the cascade macro lets you make a block to reference it in code? So I can replicate the pragma but outside the proc definition? |
16:19:52 | FromGitter | <alehander92> no, sorry `{.this: self.}` is deprecated |
16:19:57 | FromGitter | <alehander92> and it was a bit different |
16:20:32 | FromGitter | <alehander92> but you can replicate something like `bringInScope <instance>` to procude just `var fieldName = instance.fieldName; var fieldName2 = .. etc` |
16:20:54 | FromDiscord | <Tak> Yeah that makes sense, and that would be 0 overhead as its all compile time right? |
16:21:40 | FromGitter | <alehander92> you can use `fieldPairs` or something like that for iteration on fields |
16:22:27 | FromGitter | <alehander92> well, keep in mind that maybe you'd want to use `byAddr` as well in such a macro actually |
16:22:39 | FromGitter | <alehander92> or to make it produce `template fieldName = instance.fieldName; etc` |
16:22:51 | FromGitter | <alehander92> otherwise yes, if its a macro/template it happens on CT |
16:23:00 | FromDiscord | <Tak> Hmm okay lots to look into, appreciate the help 🙂 thanks |
16:23:04 | FromGitter | <alehander92> the runtime cost remains the runtime cost of the *generated code* |
16:23:09 | FromGitter | <alehander92> what i mean is |
16:23:19 | FromGitter | <alehander92> imagine if you have object with field1: int = 0 |
16:23:39 | FromGitter | <alehander92> if you generate ⏎ `bringInScope a; field1 = 2` |
16:24:09 | FromGitter | <alehander92> you want this assignment to change `a.field1` thats why you need to make sure `field1` always changes the actual `a.field1` |
16:24:14 | FromGitter | <Vindaar> yeah, I'd also just use a template. Something like this: ⏎ https://play.nim-lang.org/#ix=284h |
16:24:27 | FromGitter | <alehander92> and `var field1 = a.field1` copies the variable into new location! |
16:25:01 | FromGitter | <alehander92> dadada, yes, good summary! |
16:25:26 | FromGitter | <alehander92> its a valid idea , just not my personal preference but others might like it |
16:25:55 | FromDiscord | <Tak> Yeah I see, thanks for the help guys, reminds me a bit of using RecordWildCards in Haskell to scrap some of the boiler plate, that's really the intent for me : |
16:25:57 | FromDiscord | <Tak> :p |
16:31:28 | * | Trustable joined #nim |
16:34:28 | * | EastByte quit (Quit: WeeChat 2.6) |
16:35:41 | * | EastByte joined #nim |
16:37:06 | * | narimiran joined #nim |
16:46:05 | * | abm quit (Quit: Leaving) |
16:55:53 | * | jholland__ joined #nim |
17:04:57 | * | icebattle quit (Quit: leaving) |
17:36:13 | * | dddddd quit (Ping timeout: 265 seconds) |
17:37:25 | FromGitter | <kaushalmodi> narimiran: why don't you like auto-checking examples in doc strings? :) https://github.com/nim-lang/Nim/pull/13227#issuecomment-577297160 |
17:37:27 | disbot | ➥ Fix typo and improve in code-block of 'lib/pure/parseutils.nim' |
17:38:40 | FromGitter | <kaushalmodi> ^ The runnableExamples simply needs to be put at the end of the proc doc string.. I am surprised that you are against using runnableExamples |
17:38:41 | * | bozaloshtsh_ quit (Quit: ZNC 1.7.5 - https://znc.in) |
17:39:03 | * | bozaloshtsh joined #nim |
17:39:03 | * | bozaloshtsh quit (Changing host) |
17:39:03 | * | bozaloshtsh joined #nim |
17:40:37 | * | ptdel quit (Ping timeout: 260 seconds) |
17:42:10 | narimiran | i'm not. don't put words in my mouth |
17:43:20 | leorize | note that the compiler can now test Nim code blocks |
17:43:34 | leorize | I think you need to put an annotation in the block, but it can do testing now |
17:48:05 | * | bozaloshtsh quit (Quit: ZNC 1.7.5 - https://znc.in) |
17:48:25 | * | bozaloshtsh joined #nim |
17:48:25 | * | bozaloshtsh quit (Changing host) |
17:48:25 | * | bozaloshtsh joined #nim |
17:48:53 | FromGitter | <kaushalmodi> leorize: I replied in that thread that if the doc string example is preferred, `:test:` should be added |
17:49:01 | * | dddddd joined #nim |
17:49:22 | FromGitter | <kaushalmodi> The initial PR did not do auto-checking so I was surprised that the OP was asked to revert to that version |
17:52:05 | leorize | narimiran: did you encounter any bad indents from nim.nvim? :p |
17:52:23 | leorize | I was working on the compiler the other day and spotted a few |
17:53:02 | leorize | but since you probably work with much more code than I do, I was wondering if there's any other bad indents that I haven't fixed |
18:09:52 | dadada | I added one more idea for context dependend variable use and control structures to the summary, it can be found at the bottom |
18:09:55 | dadada | https://pastebin.com/Ztdb5U3i |
18:11:14 | * | Jjp137 quit (Read error: Connection reset by peer) |
18:11:45 | dadada | alehander92: what do you think about the way? |
18:11:47 | dadada | :D |
18:12:46 | disruptek | hearts and minds, people; hearts and minds! |
18:16:00 | * | jxy quit (Quit: leaving) |
18:18:40 | leorize | dadada: please no :P |
18:18:44 | dadada | disruptek: I feel this is sarcasm and you want to ridicule me. You are insinuating that I lack either one of the two, or that I should use one of them more... (btw. I'm not really offended, I only fake being offended to troll you (and because I admit it, it doesn't make me real troll :D ) I do prefer arguments though...), ok, did you even refer to the pastebin or were you triggered something else? please take |
18:18:50 | dadada | it lightheartedly ... I'm in a chatty mood |
18:19:06 | leorize | dadada: don't worry about disruptek, he doesn't mean anything |
18:19:33 | leorize | oh wait i got trolled :P |
18:19:41 | disruptek | ~disruptek |
18:19:41 | disbot | disruptek: 11a sexy fella with magic hands. -- disruptek |
18:19:42 | disbot | disruptek: 11don't listen to him |
18:19:42 | disbot | disruptek: 11an unsafe nil deref |
18:20:20 | leorize | I don't think we got byAddr in stdlib yet |
18:20:29 | dadada | leorize: it's not like I can force you into anything :D I still prefer arguments to thumbs down like (sarcasm or not) comments |
18:20:43 | dadada | and I don't want to force you into anything either |
18:21:12 | dadada | leorize: from the github issue it looks like it's is a matter of time now |
18:23:11 | * | jxy joined #nim |
18:27:23 | * | natrys joined #nim |
18:28:19 | Zevv | sharts of kinds people, parts of blinds! |
18:30:13 | dadada | Shakespear lives! |
18:30:20 | disruptek | Zevv: headless instrumentation is a separate problem. |
18:32:59 | * | Jjp137 joined #nim |
18:41:22 | narimiran | leorize: i haven't updated nim.nvim in quite a while, sorry :) will get back to you tomorrow.... |
18:54:01 | disruptek | --experimental:compiletimeFFI |
18:58:25 | * | Yardanico quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
18:59:02 | * | Yardanico joined #nim |
19:00:38 | * | marmotini_ joined #nim |
19:07:12 | * | floppydh quit (Quit: WeeChat 2.7) |
19:18:31 | disruptek | i think nimph should just add `requires ...` statements automatically. |
19:18:58 | disruptek | then i don't have to worry about dev/test deps, etc. |
19:19:43 | dadada | skip forward to "Inline Testing" - the testing feature of Pyret looks nice https://therenegadecoder.com/code/the-coolest-programming-language-features/ |
19:25:17 | disruptek | no, i don't want to have to read tests when i'm reading impl. |
19:25:27 | * | theelous3 joined #nim |
19:59:10 | * | cron joined #nim |
20:03:26 | * | tane joined #nim |
20:04:06 | * | nsf quit (Quit: WeeChat 2.7) |
20:06:36 | * | krux02 joined #nim |
20:26:56 | * | marmotini_ quit (Remote host closed the connection) |
20:27:57 | * | marmotini_ joined #nim |
20:48:44 | * | marmotini_ quit (Read error: Connection reset by peer) |
21:02:45 | FromGitter | <kaushalmodi> dadada: In Nim , the equivalent is `runnableExamples:` |
21:03:02 | FromGitter | <kaushalmodi> It serves as "inline test" + "doc" |
21:03:37 | FromGitter | <kaushalmodi> https://github.com/kaushalmodi/elnim/blob/319abb71fccc7711c7ef858795ddb3297fa59eb9/src/elnim.nim#L30-L44 |
21:04:19 | FromGitter | <kaushalmodi> https://nim-lang.github.io/Nim/system.html#runnableExamples%2Cuntyped |
21:13:13 | * | narimiran quit (Ping timeout: 258 seconds) |
21:15:39 | * | Vladar quit (Quit: Leaving) |
21:31:53 | * | icebattl1 quit (Quit: leaving) |
21:32:16 | * | icebattle joined #nim |
21:33:25 | * | Trustable quit (Remote host closed the connection) |
21:35:29 | * | tane quit (Quit: Leaving) |
21:44:32 | FromGitter | <alehander92> dadada this is just the motto of disruptek |
21:45:00 | FromGitter | <alehander92> you shouldnt take most things here too seriously :P |
21:46:02 | FromGitter | <alehander92> `way` is interesting .. but i kinda feel like it is just a very roundabout way to define a template |
21:46:08 | FromGitter | <alehander92> anonymous template* |
21:46:18 | FromGitter | <alehander92> but i like the lang design experimentation! |
21:51:17 | * | natrys quit (Ping timeout: 268 seconds) |
22:03:43 | * | natrys joined #nim |
22:03:45 | * | natrys quit (Client Quit) |
22:13:47 | * | solitudesf quit (Remote host closed the connection) |
22:14:10 | * | solitudesf joined #nim |
22:19:44 | * | solitudesf quit (Remote host closed the connection) |
22:20:36 | * | solitudesf joined #nim |
22:24:29 | dadada | alehander92: it's impossible that any of todays languages higher level languages has implemented all the best features, there were only a couple of decades of language evolution in CompScience, just imagine what the most popular high level language in say 2500 might look like. |
22:25:58 | dadada | that's why I like those who try to push the envelope |
22:28:42 | dadada | Nim is a great fusion of many language concepts ... those AST macros will probably become a standard features of all higher level langs sooner or later, it just makes too much sense |
22:30:51 | FromDiscord | <exelotl> is there a way to make a template that I can invoke like `t(foo)` in such a way that it generates `var foo = "foo"` |
22:31:14 | FromDiscord | <exelotl> i.e. putting an identifier into a string |
22:31:28 | disruptek | astToStr? |
22:32:27 | * | ptdel joined #nim |
22:32:35 | * | ltriant joined #nim |
22:32:47 | FromGitter | <alehander92> dadada oh absolutely |
22:32:57 | FromDiscord | <exelotl> oh that works |
22:32:59 | FromGitter | <alehander92> and i like experiments, agreed that one should do more like those ! |
22:33:01 | FromDiscord | <exelotl> thx disruptek |
22:33:03 | disruptek | if you only care about the identifier name, you could just pull it out of the ast. |
22:33:46 | FromGitter | <alehander92> macros do seem to feature in some modern languages, like crystal and rust and julia |
22:33:49 | FromGitter | <alehander92> elixir |
22:34:03 | FromGitter | <alehander92> but not all of those are ast, iirc rust are mayb template-like + token ones |
22:34:03 | * | opal quit (Remote host closed the connection) |
22:34:06 | Zevv | [Q] What are the arc limitations keeping the nim compiler itself being compiled with arc? |
22:34:18 | * | opal joined #nim |
22:34:32 | FromGitter | <alehander92> but maybe more generally compile time code is getting popular (c++ zig too) |
22:35:10 | disruptek | Zevv: koch boot --gc:arc |
22:35:26 | Zevv | yeah of course, and the first one I hit is a vm cast somewhre |
22:35:30 | FromGitter | <alehander92> maybe it is shy |
22:35:39 | Zevv | just wondering if that is the tip of a huuuge iceberg |
22:35:55 | Zevv | or if the expected amount of issues is overseeable and worth fixable |
22:36:23 | disruptek | i have no idea. |
22:36:46 | disruptek | gotta walk before we run. |
22:37:43 | disruptek | where are we on the async situation? are we waiting for closure cursors or what? |
22:37:54 | Zevv | well - apart from two casts it compiles |
22:38:21 | disruptek | just comment them out; i'm sure they don't matter. |
22:38:25 | Zevv | I did |
22:38:28 | Zevv | and it runs |
22:38:30 | disruptek | 👍 |
22:38:30 | Zevv | I compiled hello world |
22:39:18 | Zevv | oh no dang, again too soon. I compiled main.nim not nim.nim :) |
22:39:22 | Zevv | lets try again |
22:39:39 | Zevv | codegen errors, woohoo |
22:39:47 | FromGitter | <alehander92> but compiler doesnt use async :P |
22:39:49 | FromGitter | <alehander92> iirc |
22:40:02 | disruptek | who is using custom tags with success? |
22:40:05 | Araq | oh interesting |
22:40:18 | Araq | I never tried the Nim compiler with --gc:arc |
22:40:32 | disruptek | also, can anyone confirm that pragma() macro /doesn't/ yield pragmas that lack arguments? |
22:40:35 | Zevv | I had to take two `slots: cast[pointer](regs),` out for it to compile |
22:40:48 | Zevv | now I get ` error: conversion to non-scalar type requested |
22:40:48 | Zevv | 5756 | colontmpD__60 = (NimStringV2)0; |
22:40:49 | Zevv | ` |
22:41:07 | Zevv | but it gets much further then I'd expect it to |
22:41:11 | FromGitter | <alehander92> disruptek hmm |
22:41:22 | FromGitter | <alehander92> what do you mean by custom tag |
22:41:25 | FromGitter | <alehander92> effect tags? |
22:41:28 | disruptek | yes. |
22:41:41 | disruptek | i want to use them but i cannot figure out how. |
22:42:22 | disruptek | and, yes, i know how to use them syntactically. |
22:43:11 | FromGitter | <alehander92> i am not sure i do |
22:43:18 | FromGitter | <alehander92> can you give an example of a usecase |
22:43:22 | disruptek | sure. |
22:43:30 | FromGitter | <alehander92> because i wanted to maybe use them |
22:43:43 | FromGitter | <alehander92> and i do for one case but i feel i dont really use them well |
22:43:49 | disruptek | i just want to bubble up the requirement that libgit is initialized so that i can do that once in a parent proc. |
22:44:29 | disruptek | i cannot seem to produce output from .effects. either. |
22:44:33 | disruptek | not sure what to expect, there. |
22:45:21 | Zevv | -std=gnu++11 \o/ |
22:46:52 | FromGitter | <alehander92> can you give a small example |
22:46:53 | FromGitter | <alehander92> disruptek |
22:46:58 | FromGitter | <alehander92> or is it a part of a big project |
22:47:18 | disruptek | !repo gittyup |
22:47:19 | disbot | https://github.com/disruptek/gittyup -- 9gittyup: 11higher-level git bindings that build upon nimgit2 15 0⭐ 0🍴 |
22:47:36 | disruptek | trying to automate `withGit` template. |
22:48:14 | disruptek | cannot seem to make a pragma macro work, either. |
22:48:31 | disruptek | batting 1000, lemme tell you. |
22:50:48 | FromDiscord | <Recruit_main_70007> is it worth it updating nim manually, or i can just wait for major release to appear in the web, will it come with the compilers needed? |
22:51:04 | FromDiscord | <Recruit_main_70007> (updating it manually that is) |
22:51:14 | disruptek | if you have to ask, don't worry about updating manually. |
22:52:52 | FromDiscord | <Recruit_main_70007> thats what i thought, are you releasing the newer version in the web soon? |
22:53:04 | disruptek | 1.0.6 should be out soon, yes. |
22:53:10 | FromDiscord | <Recruit_main_70007> cool |
22:53:24 | Araq | 1.0.6 is boring though, we're waiting for 1.2 |
22:54:03 | FromDiscord | <Recruit_main_70007> well, you have to count to 5 before reaching 10 |
22:55:03 | FromDiscord | <Recruit_main_70007> awesome job guys, dont let Nim die like Boo, all the languages i like tend to stop getting updates |
22:56:51 | * | dadada quit (Ping timeout: 240 seconds) |
22:58:38 | * | dadada joined #nim |
22:59:00 | * | dadada is now known as Guest94638 |
23:00:41 | FromGitter | <kaushalmodi> Recruit_main_70007 ⏎ ⏎ > all the languages i like tend to stop getting updates ⏎ ⏎ Then you are risky to Nim! [https://gitter.im/nim-lang/Nim?at=5e28d4183fd0cc7cfe1bca64] |
23:00:41 | * | kungtotte quit (Read error: Connection reset by peer) |
23:01:34 | * | kungtotte joined #nim |
23:03:19 | FromDiscord | <Recruit_main_70007> nah, i trust you, this is too good to die |
23:06:45 | Araq | https://github.com/nim-lang/Nim/pull/13232/files yay. |
23:06:48 | disbot | ➥ fix #9634 retry c_fgets on EINTR : debugging a nim program does not crash on `execCmdEx` / `readLine` ; snippet at 12https://play.nim-lang.org/#ix=286c |
23:06:49 | * | solitudesf quit (Ping timeout: 265 seconds) |
23:07:21 | * | dawkot joined #nim |
23:08:22 | Araq | makes me wonder what else from "Unix hater's handbook" is still relevant in 2020 |
23:20:50 | * | NimBot joined #nim |
23:21:24 | * | FromDiscord joined #nim |
23:24:32 | FromGitter | <timotheecour> @araq ya, this is one of the nastier parts of signals / global state |
23:31:18 | * | krux02 quit (Remote host closed the connection) |
23:45:56 | * | FromDiscord_ joined #nim |
23:48:01 | * | Araq quit (Ping timeout: 268 seconds) |
23:49:33 | * | FromDiscord quit (Ping timeout: 260 seconds) |
23:53:08 | FromDiscord_ | <Tak> If I have an object variant with either an int or a byte for example, is there a way I can write a function that returns either of them i.e instead of going Object.intVal or Object.byteVal, I can just go Object.getVal and it dispatches over both? I am getting an error about no defined return type |
23:53:18 | FromDiscord_ | <Tak> Or is this a macro type job? |
23:53:57 | * | Araq joined #nim |
23:54:38 | FromDiscord_ | <Tak> Perhaps via iterating over the object and taking the val part? |