00:10:17 | FromGitter | <zetashift> @endragor I got an issue with PackedScene not showing up after connecting a signal in godot-nim. You there by any chance to have a quick look? |
00:28:52 | FromGitter | <gogolxdong> At least found Intel HD520 supports vulkan API, accroding https://askubuntu.com/questions/807857/how-to-install-intel-graphics-driver-for-using-vulkan-on-ubuntu-16-04 , do as it says, added DRI3 extension, binary works. |
00:55:12 | * | vlad1777d_ joined #nim |
01:17:48 | * | krux02 quit (Remote host closed the connection) |
02:16:03 | * | vlad1777d_ quit (Ping timeout: 252 seconds) |
02:18:02 | * | dddddd quit (Remote host closed the connection) |
02:20:50 | * | dcefram joined #nim |
02:23:47 | * | vlad1777d_ joined #nim |
02:27:30 | * | endragor joined #nim |
02:32:24 | * | enthus1ast quit (Ping timeout: 246 seconds) |
02:38:24 | * | fyber is now known as im_jeb |
02:50:45 | * | skellock quit (Quit: WeeChat 2.2) |
02:55:46 | FromGitter | <zacharycarter> @gogolxdong - I like this tweet from the bgfx guy about Vulkan |
02:55:48 | FromGitter | <zacharycarter> one sec |
02:56:23 | FromGitter | <HeadClot> Hello |
02:56:51 | FromGitter | <zacharycarter> https://twitter.com/bkaradzic/status/1056241856734945280 |
02:57:04 | FromGitter | <HeadClot> I saw that tweet |
02:57:13 | FromGitter | <zacharycarter> @HeadClot o/ |
02:57:13 | FromGitter | <HeadClot> Also hey @zacharycarter :) |
02:57:23 | FromGitter | <zacharycarter> hey bud :) |
02:57:31 | FromGitter | <HeadClot> How are you doing? |
02:57:51 | FromGitter | <zacharycarter> good thanks - well doing better recently anyway, now if I could just sell my GD house so I could quit my job haha |
02:58:10 | FromGitter | <zacharycarter> you? |
02:58:16 | FromGitter | <HeadClot> I saw you posted about that on twitter? |
02:58:31 | FromGitter | <zacharycarter> Yeah - I'm just sharing the listing on whatever little social media platform I have |
02:58:41 | FromGitter | <HeadClot> Let me retweet you real quick |
02:58:43 | FromGitter | <zacharycarter> in case - via some miracle - someone sees it that wants to buy it |
02:58:44 | FromGitter | <zacharycarter> thank you! |
02:58:50 | FromGitter | <zacharycarter> <3 |
02:59:27 | * | platoff quit (Ping timeout: 240 seconds) |
02:59:32 | FromGitter | <HeadClot> Done |
02:59:42 | FromGitter | <zacharycarter> thank you! |
02:59:53 | FromGitter | <HeadClot> Welcome |
03:00:47 | FromGitter | <HeadClot> But yeah - I am kinda excited about learning CS right now |
03:01:35 | FromGitter | <zacharycarter> that's very cool :) there are some extremely intelligent people in this community to learn from |
03:01:55 | FromGitter | <HeadClot> So how is performance with NIM? |
03:02:00 | FromGitter | <zacharycarter> the language author, lead co-contributor, and the rest of the core contributors aver very active |
03:02:07 | theelous3 | o/ |
03:02:15 | FromGitter | <HeadClot> compared to a language like C++ or C |
03:02:21 | FromGitter | <zacharycarter> Nim performance compares to C - the way Nim works is this |
03:02:28 | FromGitter | <HeadClot> ok |
03:02:57 | FromGitter | <zacharycarter> you write your code in Nim, and can easily interop with C / C++ (C more easily than C++ - mostly because of name mangling - which is a concept you'll run into later, it's a way to disambiguate symbols) |
03:03:11 | FromGitter | <zacharycarter> then, you invoke the Nim compiler, much like you'd invoke any other compiler |
03:03:42 | FromGitter | <zacharycarter> keep in mind - Python has an interpreter - Nim does too, but it's limited and you'll mostly interact directly with the Nim compiler |
03:04:02 | theelous3 | woah wat, there's a repl |
03:04:06 | FromGitter | <zacharycarter> the Nim compiler, will take your Nim source code and spit out source in the language you specify |
03:04:09 | FromGitter | <zacharycarter> a very limited repl |
03:04:15 | FromGitter | <zacharycarter> but yes there is |
03:04:22 | FromGitter | <HeadClot> So can I use Nim with Visual Studio? |
03:04:26 | FromGitter | <HeadClot> or VS Code? |
03:04:37 | FromGitter | <zacharycarter> both - but it more depends on what operating system you're using |
03:04:40 | FromGitter | <zacharycarter> because here's the fun part |
03:04:43 | FromGitter | <HeadClot> Ah ok |
03:04:50 | FromGitter | <zacharycarter> Nim compiles to whatever language you target via the compiler |
03:04:50 | FromGitter | <HeadClot> I am using Windows 10 |
03:04:55 | FromGitter | <zacharycarter> so if you say - I want to use Nim's C backend |
03:05:00 | FromGitter | <HeadClot> :O |
03:05:00 | FromGitter | <zacharycarter> the Nim compiler - is going to produce C code |
03:05:05 | FromGitter | <HeadClot> That is awesome |
03:05:09 | * | banc quit (Quit: ZNC - http://znc.in) |
03:05:21 | FromGitter | <zacharycarter> and then you invoke the C compiler, for whatever OS / architecture you're o |
03:05:22 | FromGitter | <zacharycarter> n |
03:05:29 | FromGitter | <HeadClot> Ok - That is amazing |
03:05:31 | FromGitter | <zacharycarter> this is pretty common - this is how C++ started out - C++ originally compiled to C |
03:05:53 | FromGitter | <zacharycarter> the nifty thing about Nim is - you can compile to C / C++ / Objective-C (ios) / JavaScript (NodeJS too) |
03:06:12 | FromGitter | <zacharycarter> and you can also use libraries written in those languages - with Nim |
03:06:24 | FromGitter | <HeadClot> That is really cool |
03:06:51 | FromGitter | <zacharycarter> It is - but I won't pretend it's frictionless or necessarily straightforward / easy to do |
03:06:53 | FromGitter | <HeadClot> So how would I take a node.js lib and use it with NIM? |
03:07:42 | FromGitter | <zacharycarter> well - to even do that, you're going to need to understand how Nim's FFI (foreign function interface) capabilities work |
03:07:48 | FromGitter | <HeadClot> Ok |
03:07:56 | FromGitter | <zacharycarter> because you're going to have to wrap the NodeJS `require` function |
03:08:18 | FromGitter | <zacharycarter> but essentially - you'd just use a package.json as normal, include the Node dependency via NPM or Yarn or whatever package manager you want |
03:08:35 | FromGitter | <zacharycarter> and then in your Nim code - you would wrap whatever functionality you need from the NodeJS library |
03:08:47 | FromGitter | <zacharycarter> it's really trivial once you know what you're doing |
03:08:51 | FromGitter | <HeadClot> Ok |
03:09:17 | FromGitter | <zacharycarter> for instance - I was able to port (not just wrap, but port) 90% of - https://github.com/WebReflection/hyperHTML - in a weekend |
03:09:21 | FromGitter | <zacharycarter> to Nim |
03:09:38 | FromGitter | <HeadClot> So lets say that I wanted to use node as a server for a game. Would I need to do that for each node lib that I use? |
03:09:48 | FromGitter | <zacharycarter> I also ported a lot of - https://www.raylib.com/ - to Nim (that's what zengine is) |
03:10:01 | FromGitter | <HeadClot> Oh awesome |
03:10:58 | FromGitter | <zacharycarter> theoretically yes - but Nim does have its own emerging ecosystem - so hopefully you'd be able to lean on that and less on producing bindings |
03:11:10 | FromGitter | <zacharycarter> plus - if I were to write a game server in Nim - I'd use the C backend and not the JS backend |
03:11:27 | theelous3 | in addition, servers are fun to write |
03:12:47 | FromGitter | <zacharycarter> haha well - multiplayer network programming is probably on the more difficult side of the comp-sci problem domain spectrum |
03:13:24 | FromGitter | <zacharycarter> but I like this approach very much so - https://thoughtstreams.io/glyph/your-game-doesnt-need-udp-yet/ |
03:13:24 | FromGitter | <HeadClot> I have never written a server. But I look forward to it |
03:13:33 | FromGitter | <HeadClot> :) |
03:13:59 | FromGitter | <zacharycarter> @HeadClot - https://narimiran.github.io/nim-basics/ is a great starting point IMO for learning Nim |
03:14:00 | FromGitter | <HeadClot> Or at least putting bindings for spatial OS with NIM and godot |
03:14:17 | FromGitter | <HeadClot> Thanks :) |
03:14:58 | FromGitter | <zacharycarter> sure thing! it looks like spatial OS has a C api - https://docs.improbable.io/reference/13.3/capi/introduction |
03:15:11 | FromGitter | <zacharycarter> so producing bindings to that with Nim should be a rather trivial exercise once you know what you're doing |
03:15:45 | FromGitter | <zacharycarter> maybe not - based on the codegen stuff they're describing |
03:15:49 | FromGitter | <zacharycarter> but it's without a doubt possible |
03:16:10 | FromGitter | <zacharycarter> and is probably going to be easier than in most languages with tools like c2nim / nimgen |
03:19:35 | FromGitter | <gogolxdong> @zacharycarter , none revolutionize,only better API |
03:19:57 | FromGitter | <HeadClot> Awesome! |
03:19:59 | FromGitter | <gogolxdong> no better options. |
03:20:20 | FromGitter | <zacharycarter> @gogolxdong bgfx :) |
03:20:34 | FromGitter | <zacharycarter> and I know vulkan isn't there yet - but who cares? |
03:20:39 | FromGitter | <zacharycarter> vulkan is not yet critical to any platform |
03:20:43 | FromGitter | <zacharycarter> and it will be there eventually |
03:20:44 | * | banc joined #nim |
03:21:22 | FromGitter | <zacharycarter> I think it's pretty much insane NOT to look at bgfx / gfx-rs / some sort of bridge API at this point |
03:22:04 | FromGitter | <zacharycarter> BGFX does a lot of optimization you'd have to implement yourself right out of the gate - like sort-based draw call bucketing |
03:22:42 | FromGitter | <zacharycarter> and it cleanly abstracts away a lot of concepts that are super annoying in gfx programming |
03:23:06 | FromGitter | <zacharycarter> https://bkaradzic.github.io/bgfx/bgfx.html#views - for instance |
03:23:10 | * | vlad1777d_ quit (Remote host closed the connection) |
03:23:23 | theelous3 | for arrarys, the only way to insert something is by index? |
03:23:31 | theelous3 | no .append or similar no/ |
03:23:32 | theelous3 | ? |
03:25:08 | * | vlad1777d joined #nim |
03:26:37 | FromGitter | <zacharycarter> theelous3 - there's syntactic sugar for getting at the len -1 element |
03:26:44 | FromGitter | <zacharycarter> but no - they're not resizable |
03:26:49 | FromGitter | <zacharycarter> gotta use a seq for that |
03:26:54 | theelous3 | aye |
03:27:38 | theelous3 | follow up to what you said, would len -1 not just be the last "slot" in the array rather than the farthest one in that's filled? |
03:27:48 | theelous3 | so it'd always be the same index? |
03:28:36 | theelous3 | like, if I have array[10, int] it gets initialised with 0s |
03:28:50 | theelous3 | so, I don't get the len -1 thing |
03:29:11 | * | vlad1777d quit (Excess Flood) |
03:31:08 | * | vlad1777d joined #nim |
03:31:28 | FromGitter | <zacharycarter> yess |
03:31:31 | FromGitter | <zacharycarter> you're correct |
03:32:17 | * | theelous3_ quit (Changing host) |
03:32:17 | * | theelous3_ joined #nim |
03:32:24 | theelous3_ | also, is it possible to write a comprehensiony kind of thing like: (var i: int; for x in countup(10, 100, 10): myArray[i] = x; inc(i)) |
03:32:40 | theelous3_ | where we do multiple things in each iteration |
03:32:48 | leorize | yes, not recommended, but yes |
03:33:06 | FromGitter | <zacharycarter> I believe we have list comprehension now |
03:33:13 | FromGitter | <zacharycarter> not 100% though |
03:33:31 | theelous3_ | I saw there is a comprehension lib by one of the peeps here, but not in stdlib iirc |
03:33:38 | FromGitter | <zacharycarter> https://stackoverflow.com/questions/29895918/nim-equivalent-of-pythons-list-comprehension |
03:33:44 | leorize | there's one in `sugar` |
03:33:47 | FromGitter | <zacharycarter> yeah |
03:33:54 | leorize | but usage is discouraged by the devs |
03:34:12 | FromGitter | <zacharycarter> I think we need a running list of modules like that ^ |
03:34:25 | theelous3_ | what's the nimmish way of doing what I was trying to do? |
03:34:25 | FromGitter | <zacharycarter> I never know what fringe modules to trust these days and which not to - it's understandable |
03:34:59 | FromGitter | <zacharycarter> but it's always the experimental stuff your really want to grab at - it's tough knowing what is considered stable (even relatively) and what is not, these days |
03:35:00 | FromGitter | <citycide> theelous3_: https://github.com/alehander42/comprehension is the nimble package |
03:35:22 | theelous3 | that's the one I was thinking of |
03:35:32 | FromGitter | <zacharycarter> Instead of saying idiomatic |
03:35:33 | FromGitter | <zacharycarter> let's just say |
03:35:41 | FromGitter | <zacharycarter> nimiomatic :) |
03:35:55 | FromGitter | <zacharycarter> and invent our own version of the term |
03:35:56 | theelous3 | nimatic |
03:35:59 | theelous3 | less typing |
03:36:12 | FromGitter | <zacharycarter> yeah - but peeps are used to idiomatic |
03:36:20 | FromGitter | <zacharycarter> I feel losing that syllable also loses reference |
03:36:26 | theelous3 | true |
03:36:53 | theelous3 | nimonic |
03:37:00 | FromGitter | <zacharycarter> I like that too |
03:37:07 | * | vlad1777d quit (Ping timeout: 240 seconds) |
03:37:12 | FromGitter | <citycide> nimtactic |
03:37:40 | * | craigger quit (Quit: bye) |
03:37:44 | FromGitter | <zacharycarter> I also feel like this conversation has been had ad nauseam :P |
03:37:50 | * | craigger joined #nim |
03:37:52 | theelous3 | yes probably :P |
03:38:08 | theelous3 | so, what's the nimonic way of doing this kind of comp, on an array |
03:38:28 | theelous3 | it's straight forward with a seq because we don't need inc(), but array be diff |
03:39:42 | leorize | sorry, I didn't catch the conversation before, what are you trying to do? |
03:40:14 | FromGitter | <citycide> iterating a seq is the same as an array tho |
03:40:24 | theelous3 | I guess I can just stop being lazy and not try to do something in the style of a comprehension that shouldn |
03:40:29 | theelous3 | 't be in that style |
03:40:49 | theelous3 | well, what I was doing wasn't iterating the array, I was iterating a countup to fill the array |
03:40:56 | FromGitter | <zacharycarter> I'm not sure you can :/ |
03:41:20 | FromGitter | <zacharycarter> besides doing it the way you already are |
03:41:34 | theelous3 | doesn't work that way |
03:41:35 | FromGitter | <zacharycarter> or creating a seq from your array |
03:41:40 | FromGitter | <citycide> it's probably more idiomatic in nim to do it imperatively tbh |
03:41:43 | theelous3 | cos the inc() is only called after the loop completes |
03:41:51 | FromGitter | <zacharycarter> oh yess |
03:41:57 | leorize | closure iterator anyone? |
03:42:08 | FromGitter | <zacharycarter> ^ |
03:43:18 | * | platoff joined #nim |
03:43:21 | theelous3 | beyond me for the moment |
03:43:49 | * | craigger quit (Quit: bye) |
03:44:02 | * | craigger joined #nim |
03:44:21 | FromGitter | <zacharycarter> resumable iterators that can be passed around |
03:44:27 | FromGitter | <zacharycarter> so they maintain some state |
03:44:39 | theelous3 | oh, like a coroutine |
03:44:40 | theelous3 | ? |
03:45:15 | theelous3 | idk how general that term is in this context |
03:46:11 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
03:48:48 | FromGitter | <zacharycarter> I think the closure iterator gives you the ability to decide whether you need to fill your array or not - and if not, resume afterwardss |
03:48:51 | FromGitter | <zacharycarter> so like - |
03:49:13 | FromGitter | <zacharycarter> """ ⏎ proc countTo(n: int): iterator(): int = ⏎ return iterator(): int = ⏎ ⏎ ```break``` ... [https://gitter.im/nim-lang/Nim?at=5bd68338ef4afc4f28ea6df4] |
03:49:23 | FromGitter | <zacharycarter> whoopsss |
03:49:36 | FromGitter | <zacharycarter> ''' ⏎ proc countTo(n: int): iterator(): int = ⏎ return iterator(): int = ⏎ ⏎ ```break``` ... [https://gitter.im/nim-lang/Nim?at=5bd683503844923661b48b3b] |
03:49:41 | FromGitter | <zacharycarter> omg - wtf gitter |
03:49:52 | theelous3 | lmao |
03:49:56 | leorize | it's triple ``` |
03:50:01 | theelous3 | even worse, I am on irc, so this looks insane |
03:50:12 | FromGitter | <zacharycarter> https://gist.github.com/zacharycarter/fa91e0e448945b0c8a37b5502f18e9de |
03:50:14 | theelous3 | (i checked gitter, looks insane there too!) |
03:50:28 | theelous3 | ty |
03:50:38 | FromGitter | <zacharycarter> I've been balancing getting back on twitter facebook and gitter all in the same month |
03:50:41 | FromGitter | <zacharycarter> I'm not doing so well |
03:50:48 | theelous3 | fb is trash |
03:51:00 | FromGitter | <zacharycarter> I'm just there to sell my house :P |
03:51:09 | FromGitter | <zacharycarter> and to punish everyone already there, with my house selling adverts |
03:51:11 | theelous3 | estate agent > facebook |
03:51:17 | theelous3 | :P |
03:51:25 | FromGitter | <zacharycarter> I got one of thems too - but she's too old to be on the book or the gram |
03:51:31 | FromGitter | <zacharycarter> I might need a new agent |
03:51:54 | FromGitter | <zacharycarter> or to produce some offspring to sell my house / use slang terms for me |
03:53:28 | theelous3 | line 1 of that paste in the proc return type |
03:53:39 | theelous3 | you need to specify the return type of the iterator there too? |
03:55:04 | leorize | that proc returns an iterator so... |
03:55:12 | leorize | yea this thing need a better API |
03:55:18 | leorize | IIRC Araq have one |
03:55:32 | theelous3 | looks super weird |
03:55:56 | leorize | btw, do you absolutely have to use array? |
03:56:06 | theelous3 | oh I'm just making up nonsense code to learn |
03:56:12 | theelous3 | I don't have to do anything :D |
03:56:42 | * | smt quit (Ping timeout: 252 seconds) |
03:56:46 | leorize | seq version: https://ptpb.pw/ORrP/nim |
03:58:15 | theelous3 | is that missing a sequtils. |
03:58:35 | leorize | ? |
03:58:35 | theelous3 | or does import sequtils bring all in to namespace |
03:58:46 | leorize | yes it bring all in to namespace, this is not python |
03:58:50 | theelous3 | gottcha |
03:59:18 | theelous3 | anyway, that's a lot neater :P |
03:59:58 | leorize | with a bit of macro magic you could generate an array that way as well |
04:00:21 | leorize | but then you could just use some list comprehension package :P |
04:00:42 | FromGitter | <zacharycarter> wow |
04:00:44 | FromGitter | <zacharycarter> this is amazing |
04:00:59 | FromGitter | <zacharycarter> https://twitter.com/marian42_/status/1056637654010339328v |
04:01:09 | FromGitter | <zacharycarter> gd |
04:01:16 | theelous3 | broken link? |
04:01:21 | FromGitter | <zacharycarter> why does everyone delete tweets as soon as I share them? |
04:01:33 | leorize | strip the `v` from the end of the link |
04:02:18 | FromGitter | <zacharycarter> https://twitter.com/marian42_/status/1056637654010339328 |
04:02:22 | FromGitter | <zacharycarter> ah |
04:02:49 | theelous3 | o wow, that's procedural |
04:02:50 | theelous3 | v cool |
04:02:54 | FromGitter | <zacharycarter> yeah - just realized my own typo was at fault - not the author |
04:03:03 | FromGitter | <zacharycarter> code is on github too |
04:07:59 | FromGitter | <zacharycarter> bed time for me - have a good night all :) |
04:08:25 | FromGitter | <zacharycarter> hoping for a better week than this one has been |
04:09:14 | theelous3 | nn |
04:14:52 | theelous3 | whew, 4am, same |
04:15:00 | theelous3 | thanks for help everyone and nn |
04:19:00 | * | dcefram quit (Quit: Konversation terminated!) |
04:25:19 | FromGitter | <timotheecour> big fat regression breaking every PR: https://github.com/nim-lang/Nim/issues/9551 |
04:31:21 | * | theelous3 quit (Ping timeout: 252 seconds) |
04:31:52 | * | chemist69 quit (Ping timeout: 264 seconds) |
04:33:22 | * | chemist69 joined #nim |
04:36:47 | * | ng0 quit (Ping timeout: 240 seconds) |
04:37:46 | * | ng0 joined #nim |
04:42:56 | * | darithorn quit () |
04:57:00 | * | nsf joined #nim |
05:04:28 | * | stefanos82 joined #nim |
05:07:31 | * | flaviu joined #nim |
05:11:23 | * | Tanger joined #nim |
05:19:32 | FromGitter | <kayabaNerve> How... supported is the ObjC backend? |
05:22:27 | FromGitter | <kayabaNerve> Does it mainly work off the C backend since Obj-C is a superset? |
05:25:18 | * | leorize quit (Ping timeout: 252 seconds) |
05:51:01 | * | leorize joined #nim |
05:59:09 | * | kapil____ joined #nim |
05:59:24 | * | vlad1777d joined #nim |
06:22:37 | * | flaviu quit (Remote host closed the connection) |
06:24:50 | * | d10n-work quit (Quit: Connection closed for inactivity) |
06:59:33 | * | mech422_ joined #nim |
07:01:33 | * | krux02 joined #nim |
07:03:26 | * | mech422 quit (Ping timeout: 272 seconds) |
07:03:39 | * | Vladar joined #nim |
07:31:12 | FromGitter | <xmonader> can someone check this PR for logging issue? ⏎ https://github.com/nim-lang/Nim/pull/9554 |
07:35:22 | * | theelous3_ quit (Remote host closed the connection) |
07:58:04 | FromGitter | <gogolxdong> What's the relationship between gfx and bgfx ? |
08:09:48 | * | platoff quit (Ping timeout: 246 seconds) |
08:51:23 | krux02 | gfx is just an abbreviation for graphics and bgfx is a library for graphics programming |
08:58:27 | * | leorize quit (Ping timeout: 240 seconds) |
09:12:22 | * | jjido joined #nim |
09:23:41 | * | PMunch joined #nim |
09:29:27 | FromGitter | <narimiran> hey Araq, thoughts about this: https://github.com/nim-lang/Nim/pull/9542 ? should "Nim 0.19.0 documentation" be added to the title? if so, how to automatically get the latest stable version? |
09:29:40 | * | leorize joined #nim |
09:31:18 | * | jjido quit (Ping timeout: 245 seconds) |
09:31:58 | Araq | hmm |
09:32:26 | Araq | <module_name> - Nim 0.12 |
09:32:43 | Araq | should be it, "documenation" is pointless what else would it be |
09:33:01 | Araq | or maybe <module_name> - Nim v0.12 |
09:33:07 | FromGitter | <narimiran> agreed |
09:33:18 | Araq | the version is system.NimVersion |
09:33:32 | Araq | probably needs a minor docgen extension |
09:34:52 | FromGitter | <narimiran> oh, i didn't know about `nimVersion` - hiding in the plain sight! :) |
09:36:09 | FromGitter | <narimiran> but i guess using just that would now print 0.19.1, and the documentation is for 0.19.0? or is it ok since documentation is only created when a new stable version is out? |
09:37:51 | * | floppydh joined #nim |
09:38:01 | FromGitter | <narimiran> btw, i'm still getting infinite loop when trying to do `nim doc` on some modules (and my packages)! |
09:38:29 | FromGitter | <alehander42> @citycide thanks for the PR, sorry for the delay in merging it |
09:38:37 | * | Vladar quit (Remote host closed the connection) |
09:38:44 | Araq | for now 0.19.1 is ok |
09:39:00 | * | Vladar joined #nim |
09:39:17 | Araq | we'll backport the fixes to 0.19 to create 0.19.2 and devel will become 0.20 |
09:40:07 | Araq | and also new policy: non-risky bugfixes should have 'backport' in the commit message so that the cherrypicking can be automated |
09:40:40 | Araq | we'll see if that works out in practice :-) |
09:41:50 | FromGitter | <narimiran> btw, any plans to have some kind of "embargo", like: two or three days of no new commits, and asking everybody to use the latest devel on their projects to spot any regressions, before releasing a new stable version? |
09:42:23 | FromGitter | <narimiran> it's not perfect, but maybe a bit better than just releasing stable and hoping for the best |
09:42:47 | FromGitter | <narimiran> (IIRC the last two stable releases had "oh shit, this is broke") |
09:42:58 | FromGitter | <narimiran> *broken |
09:43:42 | Araq | well if we test more nimble packages regularly out there we can fight this |
09:43:57 | * | lwiechec joined #nim |
09:44:18 | Araq | but if we say "test this beta now, it's going stable" than that's not really different from just releasing and adding a patch release soon afterwards |
09:44:37 | * | lwiechec left #nim (#nim) |
09:45:00 | Araq | the KDE devs didn't have luck with their beta releases |
09:45:37 | Araq | they didn't get enough testing and so eg. 4.1 had to be released anyway |
09:46:15 | PMunch | That reminds me that I should set up auto-build of my packages. Whenever a new stable version of Nim drops I want to ensure that my packages are up-to-date |
09:46:22 | FromGitter | <narimiran> did "adding a patch release soon afterwards" happen? ;) |
09:47:23 | * | lwiechec joined #nim |
09:48:21 | * | jjido joined #nim |
09:48:49 | Araq | narimiran: these did happen for Nim, but always were effort |
09:56:50 | FromGitter | <narimiran> added version number. now we wait for CI (and hope that travis runs at all, and appveyor doesn't raise unrelated error ;)) |
10:05:35 | * | derlafff quit (Remote host closed the connection) |
10:05:58 | Araq | so ... back to the problem |
10:06:10 | Araq | when the fuck does 'nim doc' run into endless loops? |
10:06:18 | Araq | haven't seen that one ever before |
10:08:05 | * | derlafff joined #nim |
10:10:42 | Araq | well? |
10:11:40 | FromGitter | <narimiran> i'm still trying to figure out what trips it. my guess is runnableExamples, but i have to test it some more to be sure |
10:16:48 | FromGitter | <narimiran> for example, `nim doc lib/pure/collections/sequtils.nim` works just fine (no runnable examples there), but `nim doc lib/pure/strutils.nim` is an infinite loop with 100% CPU used |
10:18:12 | * | kapil____ quit (Quit: Connection closed for inactivity) |
10:18:46 | FromGitter | <narimiran> happens both in devel and stable, linux |
10:21:34 | FromGitter | <narimiran> on the other hand, `nim doc lib/pure/algorithm.nim` works fine, and it has runnable examples! |
10:24:41 | * | krux02 quit (Remote host closed the connection) |
10:25:02 | * | krux02 joined #nim |
10:25:56 | Araq | nim doc strutils is part of the CIs and travis runs on Linux |
10:26:10 | FromGitter | <narimiran> SORRY! it is not infinite loop, it compiles each runnable example on its own. it just takes a lot of time and i've been impatient |
10:26:15 | FromGitter | <narimiran> sorry for the false alarm |
10:26:20 | Araq | yup ok |
10:26:31 | FromGitter | <alehander42> Araq, can you explain the ormin dsl a bit: https://github.com/Araq/ormin/blob/master/examples/chat/server.nim#L46 ⏎ what does `%arg` do ? what does `?userId` do? and what is `!!`? (I guess one of `%` and `?` is quoting, but what's the other?) |
10:26:36 | Araq | need to change that back to "Only as much files as required2 |
10:27:20 | FromGitter | <alehander42> (maybe `!!` converts to nim datetime / or just integer ?) |
10:27:24 | Araq | alehander42: I've never been happy with the "protocol" DSL |
10:27:38 | FromGitter | <alehander42> yeah, no, I wondered about the query dsl |
10:27:41 | Araq | but !! is for "emit SQL directly that Ormin does not understand" |
10:27:55 | Araq | so it's dangerous, hence !! |
10:27:55 | FromGitter | <narimiran> was the `nim doc` / `runnableExamples` behaviour changed between 0.18 and 0.19? because i don't remember it taking such a long time before |
10:28:00 | FromGitter | <alehander42> ha, I had somethign like that in my orm idea |
10:28:05 | FromGitter | <alehander42> exactly for DATETIME |
10:28:10 | Araq | narimiran: It changed due to a bugfix |
10:28:28 | Araq | the % is for "my data is JSON" |
10:28:32 | FromGitter | <alehander42> but i based my example on your, so problably that's why |
10:28:45 | Araq | the ? is for "my data is in native Nim types" |
10:28:55 | Araq | and that's it. |
10:29:32 | Araq | maybe with more magic % and ? can be the same |
10:29:54 | Araq | but these JSON extensions are of the category "useful, but meh" |
10:29:59 | FromGitter | <alehander42> so `%` would be like |
10:30:11 | FromGitter | <alehander42> `?arg{"stuff"}.getInt` ? |
10:31:29 | Araq | I don't remember the details :-) |
10:31:37 | Araq | -d:debugOrminDsl |
10:31:52 | Araq | to look at the results of the transformations :-) |
10:32:19 | FromGitter | <alehander42> I mean, that this is what does `%`, right (quoting the raw repr of a json value) |
10:32:22 | FromGitter | <alehander42> ok |
10:32:34 | Araq | and thanks for taking a look at it, I spent quite some time on it and like to see it picked up |
10:34:04 | FromGitter | <alehander42> yeah, I wanted to take a decision if I want to make my own orm or to somehow ormin |
10:34:10 | FromGitter | <alehander42> extend ormin* |
10:34:51 | FromGitter | <alehander42> I am starting to agree with the "generate models from schema" , as this is the only possible DRY solution |
10:36:45 | Araq | SQL also has varchar(N) and Nim has string |
10:36:45 | * | chemist69 quit (Ping timeout: 252 seconds) |
10:37:09 | Araq | so already you would need to introduce a Varchar[N] type that can then be mapped to SQL |
10:37:10 | * | chemist69 joined #nim |
10:37:12 | FromGitter | <alehander42> as it's compatible with migrations: you can have migrations (pure sql or based on some `changeTable` dsl) and make the orm generate types based on the current schema, otherwise you write in Nim models and you still have to write the field def-s again for the migrations |
10:37:41 | Araq | yup and keep in mind that a table can easily have hundreds of fields |
10:38:35 | FromGitter | <alehander42> yeah, probably the only thing further I'd want is to somehow *see* the generated types (e.g. in additional file) |
10:39:14 | Araq | well Ormin doesn't generate types |
10:39:23 | Araq | or to put it differently |
10:39:34 | Araq | the type belongs to a query, not to a table |
10:40:23 | FromGitter | <alehander42> hm, but does it somehow check if the query makes sense: I imagined that it has e.g. fieldKind info which is compared with the type of the field value |
10:41:13 | Araq | select user.name, project.name from user inner join project on user.projectId = project.id |
10:41:33 | Araq | ^ see? it doesn't work well by attaching types to tables |
10:41:57 | FromGitter | <alehander42> no, what I wondered was more like |
10:42:15 | FromGitter | <alehander42> if I pass `age=?ageVar` |
10:42:31 | Araq | IMO that's where the impedance mismatch comes from and why Ormin lacks it :P |
10:42:35 | FromGitter | <alehander42> is it statically proven |
10:42:41 | FromGitter | <alehander42> that `age` is actually a INTEGER field |
10:42:43 | FromGitter | <alehander42> if ageVar is int |
10:42:53 | Araq | yup, afair |
10:43:03 | Araq | that's done. Ormin has a type checker. |
10:43:25 | FromGitter | <alehander42> but it's a part of the query macro? while it's building the query it does its own check? |
10:44:55 | Araq | yes |
10:45:23 | Araq | it can also complete the query for you |
10:45:31 | FromGitter | <narimiran> `math` module doesn't have `epsilon` or `isAproximatelyEqual` :'( |
10:45:59 | Araq | select user.name, project.name from user inner join project # d'oh, guess the join predicate with the foreign key relation |
10:46:16 | Araq | that is my favourite misfeature of SQL, it's so stupid |
10:47:13 | Araq | well SQL is terribly designed but at least simple stuff is simple |
10:49:12 | FromGitter | <alehander42> epsilon would be useful |
10:49:28 | FromGitter | <alehander42> what do u mean by `complete` :D |
10:49:29 | * | Snircle joined #nim |
10:50:53 | FromGitter | <alehander42> hm, do databases have a way to infer the join predicate |
10:51:03 | * | shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:51:30 | FromGitter | <alehander42> they do |
10:51:40 | FromGitter | <alehander42> well I don't see the problem if there is no ambiguity |
11:17:01 | * | bitstoppa[m] quit (Ping timeout: 260 seconds) |
11:17:01 | * | AlexMax quit (Ping timeout: 260 seconds) |
11:17:36 | * | FromGitter quit (Ping timeout: 260 seconds) |
11:17:49 | * | bitstoppa[m] joined #nim |
11:17:54 | * | FromGitter joined #nim |
11:18:17 | FromGitter | <zacharycarter> https://azul.rs |
11:18:24 | FromGitter | <zacharycarter> just saw this being tweeted about on twitter |
11:19:30 | * | banc quit (Ping timeout: 246 seconds) |
11:20:02 | FromGitter | <tim-st> @narimiran can your `itertools` create this one? https://stackoverflow.com/questions/14931769/how-to-get-all-combination-of-n-binary-value/14931808#14931808 |
11:20:48 | * | nc-x joined #nim |
11:21:28 | Araq | zacharycarter, looks interesting, thanks for that |
11:21:33 | nc-x | Anyone on Windows who has time to check the nightlies? Download (64-bit and 32-bit) from here - https://ci.appveyor.com/project/Araq/nightlies/builds/19873087 |
11:21:40 | FromGitter | <zacharycarter> Araq: np! |
11:21:43 | * | banc joined #nim |
11:22:13 | * | AlexMax joined #nim |
11:22:20 | nc-x | Araq: https://github.com/nim-lang/nightlies/pull/8 Do you want me to re-add `koch docs`? Because as I said `winrelease` builds the docs as well. |
11:23:58 | shashlick | nc-x: thanks for all the c2nim fixes! |
11:24:36 | FromGitter | <narimiran> @tim-st i need to test it. i know i cut some corners here-and-there :) |
11:25:07 | * | nc-x quit (Client Quit) |
11:26:56 | FromGitter | <tim-st> @narimiran thanks := |
11:26:59 | FromGitter | <tim-st> :) |
11:27:14 | FromGitter | <tim-st> nc-x: where can I download the file for windows? |
11:27:29 | FromGitter | <zacharycarter> https://github.com/jrmuizel/wr-binding/ |
11:27:51 | FromGitter | <tim-st> the logfile says it is on: https://nim-lang.org/download/nim-0.19.1_x64.zip but this doesnt exists |
11:28:48 | FromGitter | <tim-st> ah, I see this is the url: https://ci.appveyor.com/project/Araq/nightlies/builds/19873087/job/vnbso386lejwvkp4/artifacts |
11:28:51 | * | nc-x joined #nim |
11:28:55 | nc-x | shashlick: Thank you! |
11:29:35 | * | lwiechec quit (Ping timeout: 256 seconds) |
11:29:46 | nc-x | @tim-st Open the link I gave above. There open the link for 32bit or 64bit. Then select artifact tab. |
11:30:57 | FromGitter | <tim-st> yes, I saw, the download is under artifacts, btw the log says it tries to create a windows installer is this supported one day? |
11:31:27 | * | platoff joined #nim |
11:32:23 | nc-x | IIRC there used to be a windows installer once. Now there is only a zip file. |
11:33:02 | FromGitter | <tim-st> x64 seems to work |
11:33:28 | Araq | er hmmm https://github.com/maps4print/azul/wiki/Two-way-data-binding |
11:33:43 | Araq | In this chapter you have learned: |
11:33:43 | Araq | Why the callback model is slightly more complicated than in other frameworks |
11:33:43 | Araq | Why a text input suddenly stops working if you put it on the heap instead of the stack |
11:33:43 | Araq | What to watch out for when implementing custom components |
11:33:44 | Araq | How to create heap-allocated lists of custom components and work around the current limitations |
11:33:45 | Araq | Pages 11 |
11:33:46 | Araq | Home |
11:33:47 | Araq | Installation |
11:33:49 | Araq | Getting Started |
11:33:53 | Araq | A simple counter |
11:33:55 | Araq | Styling your app with CSS |
11:33:57 | Araq | Two-way data binding |
11:33:59 | Araq | OpenGL drawing |
11:34:01 | Araq | SVG drawing |
11:34:03 | Araq | Timers, daemons, tasks and async IO |
11:34:05 | Araq | Unit testing |
11:34:07 | Araq | Clone this wiki locally |
11:34:09 | Araq | my bad, my browser cannot copy&paste |
11:34:16 | nc-x | I think making the archive self-extracting would be good enough as an Installer. It could automatically run finish.exe in the end to set up PATH as well. |
11:34:34 | Araq | nc-x, tried to do that with 7z but failed :-) |
11:35:18 | nc-x | Araq: I might give it a try in a few weeks. |
11:35:30 | FromGitter | <tim-st> should I test also sqlite? |
11:35:32 | nc-x | @tim-st Thanks for testing. |
11:35:37 | * | nc-x quit (Quit: Page closed) |
11:36:18 | Araq | "Why a text input suddenly stops working if you put it on the heap instead of the stack" |
11:36:58 | Araq | what the ...? is this problem solving or problem creating? |
11:37:33 | FromGitter | <tim-st> nc-x: x86 works too |
11:39:23 | FromGitter | <tim-st> are these available now with every appvayor test? |
11:40:42 | Araq | I'm not sure about the trigger |
11:40:59 | Araq | I used to push pointless git tags to nightlies to trigger it :-( |
11:43:26 | * | dom96_w joined #nim |
11:44:11 | FromGitter | <tim-st> here are newer sqlite version for windows: |
11:44:12 | FromGitter | <tim-st> https://www.sqlite.org/2018/sqlite-dll-win64-x64-3250200.zip |
11:44:18 | FromGitter | <tim-st> https://www.sqlite.org/2018/sqlite-tools-win32-x86-3250200.zip |
11:44:29 | FromGitter | <tim-st> this: https://www.sqlite.org/2018/sqlite-dll-win32-x86-3250200.zip |
11:44:43 | FromGitter | <zacharycarter> Araq: yeah - those limitaitons and workarounds of azul don't look like they're fun to work with at all |
11:44:51 | * | elrood joined #nim |
11:46:54 | Araq | uh oh, I have the strong desire to make Nim support "import url_here" |
11:47:54 | * | dom96_w quit (Changing host) |
11:47:54 | * | dom96_w joined #nim |
11:47:59 | FromGitter | <tim-st> yes, without it nim user packages can become a real problem: https://github.com/nim-lang/nimble/issues/574 |
11:48:08 | FromGitter | <tim-st> https://github.com/nim-lang/nimble/issues/573 |
11:48:13 | dom96_w | Araq: 0_o |
11:48:39 | dom96_w | How do other languages solve this? (Rust) |
11:50:10 | FromGitter | <narimiran> btw, @tim-st, i know why you want those combinations :) |
11:50:42 | FromGitter | <tim-st> @narimiran I solved the example from yesterday but currently only with fixed bool entries the iterator is missing :D |
11:50:57 | FromGitter | <alehander42> Araq, so I looked through ormin, the thing I don't like it that it returns anon tuples : you have to access them later as `[0]` `[2]` instead of `.id` `.name` which makes code dealing with results not readable |
11:51:20 | Araq | you can map it to your own typo too iirc |
11:51:44 | FromGitter | <alehander42> and `*` |
11:51:51 | FromGitter | <alehander42> as wait, it seems `_` does this |
11:51:54 | Araq | anon tuples is just the default |
11:53:34 | FromGitter | <tim-st> for the appveyor nightlies I think it's better to append a `_nightly` suffix to the file |
11:53:35 | * | jjido quit (Read error: Connection reset by peer) |
11:54:04 | FromGitter | <alehander42> well mapping them is a lot of boilerplate an orm is especially good at minimizing |
11:54:30 | FromGitter | <alehander42> (if you mean stuff like let t = query: .. let actual = (name: t[0], age: t[1])) |
11:56:14 | Araq | dom96_w, well convince me it's bad :-) |
11:56:35 | Araq | let (name, age) = query: ... |
11:56:52 | dom96_w | Araq: well, convince me why they're necessary |
11:56:54 | Araq | ^ that's why it produces a tuple, Nim has tuple destructuring builtin |
11:57:10 | FromGitter | <alehander42> eh ok, but why should I write select(name, age, f2, f3) |
11:57:17 | FromGitter | <alehander42> and then again let (name, age, f2..) = |
11:57:52 | Araq | because the SQL name may suck :P |
11:57:56 | FromGitter | <alehander42> on the other hand nim has tuples with keywords |
11:58:07 | FromGitter | <alehander42> well, then you can have `as` |
11:58:26 | Araq | true, I dunno, check out 'type' though |
11:58:51 | FromGitter | <alehander42> and actually how would you even pass it to select currently |
11:59:05 | FromGitter | <alehander42> select person("weird?SqlName") ? |
12:00:43 | FromGitter | <alehander42> what do you mean by `type |
12:00:55 | FromGitter | <alehander42> otherwise, the only two other things I wonder about are |
12:01:49 | FromGitter | <Clyybber> Araq How can I generate the type definition of a distinct int with "newNodeP" ? |
12:02:35 | FromGitter | <alehander42> would it be hard to get something like composable queries (they seemed useful in ecto : an elixir orm also macro-based, kinda similar dsl) ? ⏎ (at least we need a way to prepare a query with the DSL and execute it later , maybe `query:` and `prepareQuery:` or `exec:` and `query:`) |
12:04:12 | Araq | newNodeP is parser specific |
12:04:46 | FromGitter | <alehander42> and 2) maybe we can have the ormin importer be able to get a db arg directly (and dump the schema and parse it I guess), would make it easier for migration runners to invoke it |
12:06:45 | Araq | dom96_w, I'm beginning to like the simplicity |
12:07:15 | Araq | import an url, Nimble/Nim will cache the package in a project specific directory like "deps" |
12:07:41 | Araq | and to update you delete the package from deps. reproducible builds, project specific |
12:08:08 | Araq | and instead of Nimscripting my Nimble file I can use 'when defined()' in front of an import statement |
12:08:37 | Araq | or dream up of ways to staticExec() myself into a platform specific build setup |
12:08:54 | dom96_w | I think you need to sleep on this |
12:09:25 | dom96_w | In any case, I doubt there are any possible advantages it can bring that would be worth the disruption this would cause |
12:11:21 | Araq | well I'm doing anything right now, I have important bugs to fix, but I might write an RFC... |
12:12:15 | Araq | the idea feels Nim'ish to me and I sense we mostly rejected it because Go does it too and that's not good enough :-) |
12:12:34 | FromGitter | <Clyybber> Araq So can I use newNodeP to generate a `identifier = distinct cint` statement? |
12:12:45 | Araq | why would you? are you patching the parser? |
12:12:56 | FromGitter | <Clyybber> Im modifying c2nim |
12:13:00 | Araq | oh I see |
12:13:09 | Araq | well yeah, you can |
12:13:16 | FromGitter | <Clyybber> So that instead of outputting enums, it outputs statics and distinct ints |
12:13:23 | Araq | ah I love it |
12:15:43 | Araq | dom96_w, different topic: I changed my mind, the 'out' keyword needs to go |
12:16:02 | Araq | we don't need even if we introduce 'out' parameters one day thanks to Nim's flexible syntax |
12:16:27 | dom96_w | as far as I'm concerned our `var` is already an "out" parameter |
12:16:52 | dom96_w | unless you're thinking about adding something like `var` but that you need to specify `out` when calling the proc or something too |
12:17:18 | Araq | no 'var' means 'inout' |
12:17:27 | Araq | and 'out' means "must assign first" |
12:17:45 | Araq | this means that for example: |
12:17:53 | Araq | var x: ref T not nil |
12:18:11 | Araq | passToOutParam(x) # x is initialized afterwards |
12:18:23 | Araq | passToVarParam(x) # we don't know if x is initialized afterwards |
12:19:02 | dom96_w | hmmm |
12:19:10 | dom96_w | how can you even have a `ref T not nil`? |
12:19:28 | dom96_w | without initialising it immediately |
12:20:19 | Araq | well "immediately" is not well defined |
12:20:33 | FromGitter | <Clyybber> lazy |
12:20:36 | FromGitter | <Clyybber> ? |
12:20:54 | dom96_w | If you want to analyse the following statements then IMO that's too complex |
12:20:59 | dom96_w | You should make the job easier for yourself |
12:21:12 | dom96_w | and not complicate the compiler further with these inferences |
12:21:42 | Araq | it's quite simple to analyse but without 'out' the compiler would have to perform an inter-procedural analysis |
12:22:12 | Araq | and that's usually where we draw the line to keep compiletimes low |
12:25:16 | Araq | Clyybber: one definition would be "assign a not-nil value to it before you read the variable" |
12:25:56 | FromGitter | <Clyybber> Thats what I figured |
12:31:36 | dom96_w | Araq: yeah, screw that. Just get the user to give the ref a default value that isn't nil. |
12:31:51 | dom96_w | (or come up with a way to do that for them, could be handy) |
12:33:27 | Araq | I didn't make a proposal, all I did was explain why 'out' and 'var' are not the same |
12:34:05 | Araq | fowl came up with an "import by url" feature with a macro btw |
12:34:26 | FromGitter | <Clyybber> Oh, that sounds interesting |
12:34:57 | Araq | so we already have it in the language, it's not a major change in the language |
12:35:14 | Araq | but I can understand why you dislike it, ofc |
12:35:44 | FromGitter | <Clyybber> Does that macro still work in current nim? |
12:36:22 | Araq | probably it's just staticExec("curl ...") under the hood, so yeah |
12:54:17 | * | shpx joined #nim |
12:56:15 | FromDiscord_ | <Shield> @Araq can you use -export-dynamic in a nim library? I didn't have luck with it |
12:59:31 | leorize | shouldn't `--passL:'-Wl,--export-dynamic'` work? |
13:01:21 | FromDiscord_ | <Shield> I think the problem declaring a function without a body in nim |
13:02:19 | leorize | `= discard` is your friend for empty functions |
13:04:34 | FromGitter | <zacharycarter> Araq - you will like this tweet :) - https://twitter.com/KevinHoffman/status/1056881620072964096 |
13:07:21 | FromDiscord_ | <Shield> the function is imported to the library by importc, the way it works in C is that the function need to be forward declared, I'm not sure about the correct way in Nim, using discard basically gives it a body and give you an empty function instead of linking properly |
13:07:51 | * | platoff quit (Read error: Connection reset by peer) |
13:08:08 | * | platoff joined #nim |
13:08:39 | leorize | Shield: uhmmm, `proc name(param) {.importc: "name".}`? |
13:08:43 | leorize | that's all you'd need |
13:10:13 | leorize | oh, and `{.cdecl.}` |
13:12:50 | FromDiscord_ | <Shield> i keep getting "undefined reference to `hostProc' " |
13:13:20 | leorize | have you linked your program to the library that provides it? |
13:13:42 | leorize | or just use `{.dynlib: "libname.(so|dll|whatever)".}` |
13:17:11 | FromDiscord_ | <Shield> this is what I want to do https://stackoverflow.com/questions/17081131/how-can-a-shared-library-so-call-a-function-that-is-implemented-in-its-loader |
13:17:44 | FromDiscord_ | <Shield> I want the lib to call functions defined in the loader program |
13:18:33 | leorize | can I see your current .nim file? |
13:18:37 | * | platoff quit (Ping timeout: 246 seconds) |
13:19:52 | * | platoff joined #nim |
13:21:01 | leorize | oh you mean the second answer |
13:22:01 | FromDiscord_ | <Shield> yeah |
13:22:12 | leorize | tag your functions with `{.exportc.}` |
13:22:20 | leorize | so that the compiler won't mangle them |
13:22:43 | leorize | sorry `{.exportc: "name".}` |
13:23:04 | leorize | then `--export-dynamic` |
13:23:14 | leorize | in the library, use `{.importc.}` |
13:28:22 | * | endragor quit (Remote host closed the connection) |
13:29:50 | FromDiscord_ | <Shield> https://hastebin.com/cahamujifo.nim |
13:30:21 | * | platoff quit (Ping timeout: 252 seconds) |
13:30:51 | FromDiscord_ | <Shield> i keep getting "undefined reference to `hostProc' " |
13:31:03 | * | platoff joined #nim |
13:32:07 | leorize | Shield: see the comment section of that second answer |
13:36:13 | FromGitter | <tim-st> btw on windows the error messges dont look good anymore it always prints lile `..\..\..\..\..\C:\Program Files\Nim\lib\system.nim(2661, 15) Error` I'm pretty sure this is new, is it the same on linux? |
13:36:14 | FromDiscord_ | <Shield> I'm using minGW |
13:38:46 | FromDiscord_ | <Shield> to answer my own question " Windows does not support "automatic reverse dynamic linking" " |
13:38:50 | FromDiscord_ | <Shield> gg windows |
13:38:57 | * | Perkol joined #nim |
13:39:07 | leorize | also your snippet won't work since GC... |
13:40:35 | FromDiscord_ | <Shield> what about it? do I need to change GC options for a lib? |
13:40:35 | FromGitter | <narimiran> @tim-st yeah, it is the same/similar on linux, started not so long ago |
13:42:50 | leorize | Shield: IIRC you'd have to link both to libnimrtl |
13:43:00 | leorize | using `-d:useNimRtl` |
13:43:12 | FromGitter | <Clyybber> Araq How would I create a PNode that is equal to `: SomeTypeIdentifier` ? |
13:44:44 | FromGitter | <tim-st> @narimiran thanks, I think it's a bug, will have a look if there is already an issue |
13:45:10 | FromGitter | <tim-st> (or an issue at least) |
13:45:14 | FromGitter | <Clyybber> Araq Nevermind I figured it out |
13:48:24 | * | endragor joined #nim |
13:49:21 | FromDiscord_ | <Shield> thanks leorize, I intend to use shared libraries for modding and I wanted to ask how to deal with GC'd objects |
13:52:20 | leorize | Shield: https://github.com/nim-lang/Nim/tree/devel/tests/dll |
13:52:24 | leorize | those are some examples |
13:53:12 | * | endragor quit (Ping timeout: 272 seconds) |
13:55:45 | FromDiscord_ | <Shield> checking it, thanks |
13:58:17 | dom96_w | tim-st: bug report |
13:58:55 | * | platoff quit (Read error: Connection reset by peer) |
14:00:02 | * | platoff joined #nim |
14:01:25 | FromGitter | <tim-st> dom96: yes, I need to find the example code that printed this |
14:03:02 | copygirl | If I pass a block to a macro, in which a type is being used, how can I compare that against my own type? |
14:03:32 | copygirl | `when node is T0:` I doubt this would work..? |
14:04:15 | copygirl | I suppose the block might need to be typed..? But that's about as far as I can think. |
14:04:19 | shashlick | finally reading the survey results |
14:04:50 | shashlick | awesome that the full results were also shared |
14:13:39 | Araq | to export to a DLL, use {.exportc, dynlib.} |
14:15:15 | FromGitter | <narimiran> @tim-st added linux examples. now i see it is the same for devel and 0.19.0, so i guess that was not-so-recent change :/ |
14:33:57 | * | elrood quit (Quit: Leaving) |
14:40:41 | * | dddddd joined #nim |
14:42:25 | * | theelous3 joined #nim |
14:42:49 | dom96_w | Yeah, so what do you guys think about the survey results? |
14:42:56 | FromGitter | <alehander42> @copygirl `is` should work |
14:43:15 | * | Vladar quit (Remote host closed the connection) |
14:43:17 | * | dom96_w is desperate for some feedback after spending many days writing this up :) |
14:43:19 | FromGitter | <alehander42> in the generated code, if you mean to check the type of node |
14:43:22 | FromGitter | <alehander42> hmm |
14:43:39 | copygirl | It would be in the macro itself, not generated code. |
14:43:40 | * | Vladar joined #nim |
14:43:41 | FromGitter | <alehander42> @dom96 https://forum.nim-lang.org/t/4337 was quite extensive :D |
14:44:05 | FromGitter | <alehander42> @copygirl you can generate this check in your generated code, that's the approach I took in gara |
14:44:13 | dom96_w | oh yeah, I need to read that |
14:44:17 | FromGitter | <alehander42> but it might be too messy in your case |
14:44:55 | copygirl | Want to make a match macro for my Either type: `either.match(value): \n string: echo value \n int: echo $value \n else: echo "not int or string"` |
14:45:23 | Araq | dom96_w, and I need to reply ... |
14:45:32 | Araq | it's a long post but the end is so nice :-) |
14:45:35 | copygirl | either could be a `Either4[string, bool, int, float]` for example. |
14:45:46 | copygirl | dom96_w: Link? I'm curious. |
14:46:03 | dom96_w | https://nim-lang.org/blog/2018/10/27/community-survey-results-2018.html |
14:50:49 | FromGitter | <alehander42> @copygirl I think with some work gara's unpackers might be able to do it too (making it possible to use gara's match for Either) |
14:51:02 | FromGitter | <narimiran> i just read that "extensive response" and it shares lots of my views too. (so when you read it dom96_w, that is my response too :)) |
14:52:45 | FromGitter | <alehander42> anyway, for now can't you just |
14:53:01 | PMunch | Wait, did I manage to miss a community survey? :S |
14:53:04 | FromGitter | <alehander42> generate ⏎ ⏎ if isType(either, string): ⏎ let value = .. ⏎ elif .. ... [https://gitter.im/nim-lang/Nim?at=5bd71ed0bbdc0b2505bb656d] |
14:53:35 | PMunch | Oh wait, it ran long ago. So I probably responded |
14:53:40 | FromGitter | <narimiran> dom96_w, in general (and i said that in the survey): more/better documentation, tutorials, examples, blogposts is something that we (the community) should work on |
14:53:43 | FromGitter | <alehander42> and have isType being a template which can check if either has a subtype ? @copygirl |
14:53:46 | FromGitter | <tim-st> @narimiran Yes, I think it worked at 0.18.0 stable |
14:53:48 | copygirl | @alehandler42: I'll take a look at gara, too. Thanks ;) |
14:54:11 | FromGitter | <narimiran> PMunch: the results are here: https://nim-lang.org/blog/2018/10/27/community-survey-results-2018.html that's what's new |
14:54:14 | FromGitter | <alehander42> @copygirl the isType-based if/elif seems the simplest solution to me |
14:57:53 | dom96_w | hah, this person sure gives a lot of praise to Araq |
14:58:46 | PMunch | Who? |
14:59:09 | dom96_w | https://forum.nim-lang.org/t/4337 |
14:59:11 | shashlick | i kind of agree with the thesis - nim rocks but interface (editor/ide, debugger, stability, 1.0, documentation) needs work |
14:59:39 | PMunch | Oh wow, that's a long post :P |
14:59:42 | shashlick | people standing at the door because of peripheral reasons |
15:00:36 | shashlick | which is fickle but very practical |
15:00:57 | * | kapil____ joined #nim |
15:03:37 | dom96_w | Yep. VS Code isn't good enough |
15:03:52 | dom96_w | I learned not to use a debugger with Nim |
15:03:59 | dom96_w | and learned not to use autocomplete |
15:04:12 | FromGitter | <tim-st> I never used a debugger in my life. what is it? |
15:04:14 | dom96_w | This needs to be fixed, but honestly, I want the community to step in here |
15:04:15 | FromGitter | <tim-st> :D |
15:04:31 | dom96_w | We cannot possibly make sure that Sublime, VS Code, emacs, vim and whatever else has perfect Nim support |
15:05:04 | copygirl | Oh actually instead of comparing to the generic types I bet I can compare to `type(valueX)` and such. |
15:05:20 | Araq | dom96_w, actually I am trying to support Sublime, VSCode, emacs and Vim.... |
15:05:25 | PMunch | That's why I was hoping to get the language server up and running |
15:05:27 | Araq | these 4. |
15:05:33 | dom96_w | Why? |
15:05:43 | Araq | because what's the alternative? |
15:06:09 | FromGitter | <alehander42> @dom96_w I don't really agree, supporting those editors is absolutely the best shot we have for IDE right now |
15:06:18 | FromGitter | <alehander42> making a custom IDE is 20x the work |
15:06:20 | dom96_w | The alternative is: ensure VS Code works perfectly and tell people "This is the flagship example, if you can't get the same support then your editor sucks so use VS code" |
15:06:36 | PMunch | With the language server you have one thing to maintain (Nim -> language server) then the language server -> editor step is maintained by someone else |
15:06:38 | FromGitter | <alehander42> well, people are religious about their editors |
15:06:47 | FromGitter | <alehander42> you can't force them to use vs code |
15:06:55 | dom96_w | alehander42: Don't worry. I know perfectly well how much work writing an IDE is |
15:07:11 | FromGitter | <alehander42> I guess so :D |
15:07:15 | PMunch | Again, language server should help bridge the gap between editors |
15:07:26 | Araq | dom96_w, that works better if somebody spent some time in fixing the VSCode<->nimsuggest interop |
15:07:30 | FromGitter | <alehander42> and yeah, the language server is something that would help a lot, I a gree |
15:07:31 | copygirl | A *custom* editor for Nim? |
15:07:33 | FromGitter | <narimiran> +1 for language server |
15:07:43 | Araq | language server is just a buzzword |
15:07:45 | dom96_w | Araq: ... yes. |
15:07:53 | Araq | nimsuggest has a protocol, editors can learn it |
15:08:02 | dom96_w | You just said you're fixing all of these editors |
15:08:04 | Araq | and Emacs and VSCode already speak this protocol |
15:08:13 | dom96_w | And now you're saying that it would help if someone fixed VS Code? |
15:08:20 | Araq | yes. :-) |
15:08:36 | Araq | I want Nim to support these 4 editors. |
15:08:44 | PMunch | Araq, yes. But then every editor needs to re-implement the protocol. If we write Nim -> language server then we can use all the existing editor -> language server plug-ins and get the editor support "for free" |
15:08:50 | FromGitter | <alehander42> but if we have a good LSP, we wouldn't need to teach all those editors .. |
15:08:54 | PMunch | Maintain one tool, but support all the editors |
15:09:05 | Araq | I'm unwilling to write TypeScript (VSCode), Python (Vim, sublime) or Lisp (emacs) |
15:09:20 | FromGitter | <alehander42> well, that's the entire point |
15:09:31 | leorize | FYI neovim got TCP socket support now |
15:09:45 | Araq | LSP assumes that every language is like Java or C#... |
15:09:49 | FromGitter | <narimiran> "nimsuggest has a protocol, ... VSCode already speak this protocol" ...not very well ;) |
15:09:54 | Araq | have you looked into it? I have. |
15:10:07 | PMunch | Yes I have looked into it, even started implementing it |
15:10:14 | leorize | I once tried to write a nimsuggest-based highlighter plugin, but was met with some nimsuggest bug... |
15:10:18 | dom96_w | I also believe LSP is the right way to go |
15:10:29 | dom96_w | But not in the way most of you think (I'm guessing) |
15:10:46 | Araq | it's really like this: good editor integration takes effort in the langauge the editor happens to support for plugins |
15:10:49 | PMunch | How so dom96_w? |
15:11:04 | dom96_w | The LSP server should merge multiple sources of information about Nim code |
15:11:04 | Araq | for example, I also want |
15:11:10 | dom96_w | Nimsuggest is just one source |
15:11:11 | Araq | "expand this macro for me" support |
15:11:23 | Araq | how does LSP deal with it? custom extension in the protocol? |
15:11:36 | Araq | there you go, it's a Nim specific extension that every editor should learn. |
15:11:38 | dom96_w | Araq: *shrug* build the common things first |
15:11:46 | dom96_w | Stop worrying about fancy features when even the basics don't work reliably |
15:11:55 | FromGitter | <narimiran> this! |
15:12:01 | PMunch | Yeah.. |
15:12:28 | PMunch | And besides, it's probably easier to write the small editor specific LSP plug-in than to rewrite the entire editor support.. |
15:12:28 | Araq | the reason VS-Code works not well with nimsuggest is not because of the lack of LSP |
15:12:33 | shashlick | well, I guess we can all agree that the editors need more work - who is maintaining these plugins today? Are they still active and accepting PRs |
15:12:40 | FromGitter | <tim-st> @narimiran The example code crashes on 0.18.0 so an other code is needed to test it, but it's hard to find one :\ |
15:12:54 | FromDiscord_ | <Epictek> LSP is the best hope for nim autocomplete in such a niche editor such as kakoune atm |
15:13:11 | FromDiscord_ | <Shield> it seems that I can't import the module os if I use "--define:useNimRtl", why is that? |
15:13:23 | leorize | a bug perhaps? |
15:13:56 | FromDiscord_ | <Shield> I get a "Error: cannot 'importc' variable at compile time" in 0.19.0 |
15:14:06 | FromGitter | <narimiran> @tim-st you mean: it compiles? because that's what it does on my end with 0.18.0 |
15:14:26 | Araq | well you can work on LSP, or you can fix VSCode. |
15:14:59 | Araq | or you can do both of course. |
15:15:07 | Araq | I see much more value in fixing what we have though. |
15:15:41 | Araq | LSP is just a buzzword, look at it in detail and try to imagine how it would improve the Nim experience on VSCode. |
15:15:47 | FromGitter | <tim-st> @narimiran no the given code crashes on 0.18.0 windows, I tested this code (used from one issue) and saw it works on 0.19.1 but the path is wrong |
15:16:08 | FromDiscord_ | <Shield> is this some kind of sandboxing for the dlls? |
15:16:13 | leorize | Shield: please file a bug for it |
15:16:17 | Araq | I don't see any benefits, just something that works even worse because LSP doesn't know about proc vs template vs method, for example. |
15:16:21 | * | stisa[m] quit (Ping timeout: 250 seconds) |
15:16:22 | * | Miguelngel[m] quit (Ping timeout: 250 seconds) |
15:16:24 | * | toofly[m] quit (Ping timeout: 250 seconds) |
15:16:24 | * | zielmicha[m] quit (Ping timeout: 250 seconds) |
15:16:24 | * | TheManiac[m] quit (Ping timeout: 250 seconds) |
15:16:25 | * | GitterIntegratio quit (Ping timeout: 250 seconds) |
15:16:39 | FromGitter | <narimiran> @tim-st huh, it compiles just fine on linux with v0.18.0 :/ |
15:16:47 | dom96_w | Araq: LSP is just a protocol. The general idea is to commit time to this whole thing. Using LSP feels far easier because we can sort of start from scratch. |
15:16:51 | FromGitter | <tim-st> nimsuggest works quite good I saw lately the problem was the vscode nim plugin |
15:16:52 | FromDiscord_ | <Shield> i'm checking if it's intended or not since it's my first time using it |
15:16:55 | * | darithorn joined #nim |
15:16:57 | dom96_w | If I had the time I would be writing a major plugin for VS Code from scratch |
15:16:59 | FromGitter | <tim-st> the latest version works better |
15:17:00 | * | Miguelngel[m] joined #nim |
15:17:09 | FromGitter | <tim-st> @narimiran interesting :D |
15:17:32 | dom96_w | LSP would act as an agent for nimsuggest and allow users to report issues in it |
15:17:44 | dom96_w | Honestly, one of the biggest problems with nimsuggest is that reporting problems with it is a giant PITA |
15:18:25 | FromGitter | <tim-st> nimsuggest issues should be in main repo too like nimpretty |
15:18:36 | Araq | for me the biggest problem is that I'm a nimsuggest developer but not a VSCode developer |
15:18:50 | * | TheManiac[m] joined #nim |
15:18:50 | * | toofly[m] joined #nim |
15:18:55 | Araq | so I don't control the "full stack" for developing it further |
15:19:08 | * | GitterIntegratio joined #nim |
15:19:23 | * | zielmicha[m] joined #nim |
15:19:39 | Araq | your solution: keep me a nimsuggest developer but make nimsuggest speak LSP, I don't see how that helps me in any way |
15:20:00 | leorize | can't someone just make a nimsuggest -> LSP bridge? |
15:20:05 | * | stisa[m] joined #nim |
15:20:12 | Araq | zahary started on that, feel free to help him |
15:20:25 | Araq | but the protocol question is NOT the problem I'm having. |
15:22:08 | dom96_w | as far as you're concerned, you'll get reports with 1) the source code 2) the command that was passed to nimsuggest 3) (Optionally) nimsuggest's state |
15:22:08 | dom96_w | as far as you're concerned, you'll get reports with 1) the source code 2) the command that was passed to nimsuggest 3) (Optionally) nimsuggest's state |
15:22:13 | dom96_w | You don't need to worry about LSP |
15:23:04 | Araq | I also have different ideas, for example |
15:23:31 | Araq | run 'nim filldb myproject.nim' and then nimsuggest doesn't compile anything it just queries some knowledge database |
15:23:43 | FromGitter | <tim-st> @narimiran I found another prefix dotted error here: https://github.com/nim-lang/Nim/issues/9420#issue-371294002 |
15:23:50 | FromDiscord_ | <Shield> it's already reported in https://github.com/nim-lang/Nim/issues/8405 |
15:23:56 | FromGitter | <Clyybber> Araq How would I append a nkConstSection to another nkConstSection? |
15:23:59 | FromDiscord_ | <Shield> :/ |
15:24:23 | Araq | Clyybber: nkConstSection consists of nkConstDef nodes |
15:24:43 | Araq | should be easy enough to merge 2 const sections, maybe in the postprocessing step |
15:24:44 | * | couven92 quit (Quit: Client disconnecting) |
15:25:05 | FromGitter | <Clyybber> Yeah, thank you |
15:25:08 | * | nsf quit (Quit: WeeChat 2.2) |
15:25:27 | Araq | with the database idea we can just write an external Nim program that speaks LSP and queries the database for information |
15:25:41 | Araq | this way nimsuggest truely becomes independent from the compiler |
15:26:07 | FromDiscord_ | <Shield> except here it affects strformat.nim and any use of importc, how can I use normal modules then |
15:27:26 | PMunch | The development of a LSP bridge doesn't make it impossible to write custom plug-ins however. This is about support the widest range of editors with at least the basic functionality. It will allow people who are just trying Nim to get a much better impression, and if they like it they can look into getting an IDE with a custom Nim plug-in that gives them more powerful capabilities. |
15:28:02 | leorize | Shield: I think we need a mini nimrtl with only the GC |
15:30:04 | * | Perkol quit (Quit: Leaving) |
15:30:41 | * | Trustable joined #nim |
15:30:43 | FromDiscord_ | <Shield> I wanted people to use nim for modding through dlls but this problem is beyond my limited knowledge |
15:30:58 | Araq | hmm thinking further about it, I can use nimedit just to test and improve nimsuggest... |
15:33:03 | PMunch | @Shield, the last time I tried Nim -> Nim Dlls it was completely broken |
15:34:34 | Araq | it covered by the test suite... |
15:35:00 | Araq | well I'm not saying that it isn't "completely broken" but still, it's tested :P |
15:35:36 | FromGitter | <Clyybber> It can't be that broken if this https://github.com/xomachine/SteamForwarder has been built with it |
15:38:48 | theelous3 | is there a mapIt for arrays? |
15:39:20 | leorize | mapIt works on array |
15:40:09 | theelous3 | sequtils.mapIt? |
15:40:19 | theelous3 | or is there another mapIt |
15:40:24 | Araq | there is only one |
15:40:25 | leorize | yes, it works on array |
15:41:13 | theelous3 | the first param to mapIt, which is a type. This is the type of the things in the seq/array? |
15:41:37 | theelous3 | sorry, it's the return type of the expression? |
15:42:46 | theelous3 | I have a proc with side effects and return type void, trying to use map it to run it over an array, can't seem to get the types correct |
15:43:37 | PMunch | https://github.com/nim-lang/Nim/issues/6886 |
15:43:51 | PMunch | In reference to dynlib being broken |
15:45:07 | leorize | theelous3: can you give us a small snippet? |
15:45:32 | FromGitter | <alehander42> Araq, well the problem with this filldb is what happens when you change two lines in module C |
15:45:41 | FromGitter | <alehander42> do you need to run filldb again? |
15:45:56 | FromGitter | <alehander42> does it somehow get ran automatically on build? |
15:46:28 | * | theelous3_ joined #nim |
15:46:34 | theelous3_ | http://dpaste.com/05F8HG9 |
15:46:54 | theelous3_ | I know that void doesn't work here, but it's an example of what I'm trying to do |
15:47:34 | PMunch | Clybber, that isn't Nim -> Nim DLLs though, unless you have a Windows game written in Nim, in which case that might break. |
15:47:45 | PMunch | But I think it's written in a way to not actually use the GC and such |
15:47:52 | leorize | theelous3_: oh, map requires the proc to return AFAIK |
15:48:56 | Araq | alehander42, it's just some background process :P |
15:49:10 | theelous3_ | ah ok |
15:49:23 | leorize | theelous3_: in the case specified here just use a for loop :P |
15:49:29 | leorize | or return the same element out |
15:49:46 | theelous3_ | aye I'm just trying to do weird stuff to get to know it :) |
15:49:52 | theelous3_ | ty |
15:49:58 | FromGitter | <Clyybber> Araq Where does repr handle unions? |
15:50:04 | FromGitter | <Clyybber> Or fields of union objects? |
15:50:33 | Araq | it doesn't, it doesn't know they exist, it's an object with fields |
15:50:46 | leorize | theelous3_: and typically you only specify two param for *It functions |
15:50:53 | Araq | so you can every possible field value interpretation if it doesn't crash before |
15:50:59 | Araq | *can see |
15:51:27 | FromDiscord_ | <Shield> I am making a windows game in Nim which loads Nim libraries :/ |
15:52:09 | * | vlad1777d quit (Ping timeout: 246 seconds) |
15:52:23 | leorize | Shield: wait until --gc:destructors become a thing then |
15:52:40 | PMunch | Shield, well I only tried on Linux, so who knows it might work just fine on Windows |
15:52:44 | FromGitter | <Clyybber> Araq There is a small visual bug with those unions in repr |
15:53:53 | FromGitter | <Clyybber> It displays them without whitespace or any seperator in between |
15:54:39 | FromGitter | <Clyybber> So for example for TNode there is no seperation between `kind` and the conditional fields |
15:55:24 | FromGitter | <Clyybber> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bd72d6b1c100a4f290236a6] |
15:55:52 | FromGitter | <Clyybber> Where there ideally should be a seperator between `nkConstSection` and `sons` |
15:57:01 | Araq | er, the AST can be debugged much more effectively with astalgo.debug |
15:57:10 | Araq | or with renderer.renderTree |
15:57:16 | Araq | I never use repr |
15:57:21 | FromGitter | <Clyybber> Oh |
15:57:33 | FromGitter | <Clyybber> Thanks |
16:22:23 | * | elrood joined #nim |
16:25:06 | PMunch | Ouch, somehow the options module managed to make an option without a has field: http://ix.io/1qnK/ |
16:27:27 | * | david2 joined #nim |
16:27:48 | FromGitter | <Clyybber> Araq Should I acess/change the type of a PNode by accessing `sons[1]` or is there some template/builtin way to do it? |
16:31:12 | * | david2 quit (Client Quit) |
16:37:36 | PMunch | And it works with 0.18.0, so it's newly introduced.. |
16:39:29 | PMunch | I have to look into what causes this later.. |
16:39:30 | * | PMunch quit (Quit: Leaving) |
16:41:38 | * | zachk joined #nim |
16:42:20 | * | zachk quit (Changing host) |
16:42:20 | * | zachk joined #nim |
16:43:28 | * | rockcavera quit (Remote host closed the connection) |
16:45:10 | Araq | Clyybber: n[i] is the same as n.sons[i] |
16:45:20 | Araq | 'sons' is just an artifact from Pascal times |
16:46:02 | FromGitter | <Clyybber> Nice, does that work by overloading `[]`? |
16:47:24 | dom96_w | Araq: Imagine the amount of days of your life you've saved not having to type those 4 extra letters in `children` :P |
16:47:37 | FromGitter | <Clyybber> chil ? |
16:47:42 | FromGitter | <Clyybber> oh |
16:50:55 | shashlick | does defer not work in templates |
16:51:22 | Araq | dom96_w, plus the time I saved by not having to look at the more verbose word |
16:51:49 | Araq | shashlick, since it's builtin, it works |
16:52:01 | shashlick | defer gets called within template instead of the end of the proc the template is called in |
16:52:46 | * | narimiran joined #nim |
16:55:40 | shashlick | man makes no sense - defer within the if statement also runs within the if - am I not getting this right? |
16:55:43 | Araq | shashlick, well I trust your word but knowing the implementation it makes no sense |
16:56:19 | Araq | at least the "it's in a template" aspect should make no difference |
16:57:40 | shashlick | ok - so moving defer outside the if works whether in template or in proc directly |
16:57:52 | shashlick | but inside an `if` block, defer runs at the end of that block |
16:58:02 | shashlick | i suppose that's the expeceted behavior |
16:59:41 | * | adeohluwa joined #nim |
17:00:06 | * | rockcavera joined #nim |
17:01:55 | FromGitter | <Clyybber> Araq Is it intended that a IntLiteral cant get automatically converted to a `distinct int` |
17:01:59 | FromGitter | <Clyybber> ? |
17:03:48 | FromGitter | <Clyybber> I see it is, nvrmind then |
17:11:46 | * | PMunch joined #nim |
17:13:47 | narimiran | @tim-st you here? |
17:21:09 | FromGitter | <iffy> I want to define an interface for a type and then provide implementations for the procs of that type depending on the system (`when defined(macosx): the mac version`). What is the best way to do that and have the compiler enforce that every proc I expect to be implemented is implemented? |
17:21:10 | FromGitter | <iffy> concepts? |
17:32:44 | FromGitter | <iffy> or do I put all my `when defined(...)` pieces in the body of the procs? |
17:44:54 | * | krux02 quit (Remote host closed the connection) |
17:46:41 | leorize | iffy: see `os` module |
17:47:09 | leorize | it's a combination of `when defined(` with consideration for nimdoc |
17:51:15 | Araq | iffy: since it's a compiletime switch the easiest way is to put |
17:51:19 | FromGitter | <iffy> leorize: I see -- so mostly `when`s inside the body of procs. I wonder how hairy that will get for me since I'm using `emit` pragmas and using obj-c |
17:51:23 | Araq | nim check --os:windows foo.nim |
17:51:27 | Araq | nim check --os:linux foo.nim |
17:51:32 | Araq | nim check --os:macosx foo.nim |
17:51:40 | Araq | to your CI/testing and call it a day |
17:52:06 | Araq | an interface/concept is for something else |
17:53:59 | FromGitter | <iffy> oh, I didn't know about `nim check` |
17:55:25 | * | shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:57:24 | dom96_w | If it's easier you can split your code into mymodule_windows, mymodule_posix, etc |
17:57:35 | dom96_w | and just implement the same API in each for the different OS' |
17:58:07 | narimiran | is there a way to automatically convert openArray to a seq? |
17:58:25 | * | tzui joined #nim |
17:59:44 | leorize | `seq[type](openarrayhere)`? |
18:00:04 | leorize | afaik openArray is more or less a typeclass and not actually a type... |
18:00:52 | Araq | narimiran: @ operator |
18:01:25 | narimiran | Araq: once again - too easy! |
18:01:42 | narimiran | thanks! :) |
18:02:51 | * | tzui quit (Ping timeout: 256 seconds) |
18:03:08 | FromGitter | <iffy> dom96_w: I'd prefer that if there were a way to have the compiler ensure the same API was implemented. I guess if I have thorough enough tests, that would work? |
18:03:27 | dom96_w | yep |
18:03:44 | dom96_w | Like Araq said, you can just run `nim check --os:windows` |
18:03:53 | dom96_w | for each OS on your test file |
18:03:58 | dom96_w | but your test file must use your full API |
18:04:06 | FromGitter | <iffy> right, okay, that's what I thought |
18:04:17 | FromGitter | <iffy> I'm trying to see if I can be lazier :) |
18:04:17 | Araq | the problem is as soon as you use 'when' the compiler only follows one branch |
18:04:28 | Araq | and no concept or interface can help you |
18:05:09 | Araq | and following more than one branch at the same time would be a confusing experience with the module having symbols from both winapi and posix.nim at the same time... |
18:05:13 | dom96_w | You can also create a thin mymodule.nim which reimplements the API and just calls the corresponding OS-specific function |
18:05:24 | FromGitter | <iffy> I was hoping I could define all my proc... what are they called? declarations? in one file, then import implementations for those procs inside a `when` thing |
18:05:33 | dom96_w | proc getVersion() = when defined(Windows): mymodule_windows.getVersion() ... |
18:05:43 | dom96_w | That way you'll have it tested for effectively free |
18:05:47 | dom96_w | You'll need code like this anyway |
18:05:52 | Araq | you can do that but it doesn't help much with the checking aspect |
18:06:12 | Araq | osproc.nim declares the proc headers once and has multiple implementations |
18:06:36 | Araq | but again, as soon as a 'when' is involved you need to simulate the different branches |
18:06:47 | FromGitter | <iffy> and would `nim check --os:windows` check that the implementations exist for those osproc.nim headers? |
18:07:00 | Araq | certainly |
18:07:10 | FromGitter | <iffy> huh, I thought I tried importing implementations and it didn't work -- let me make sure I was trying it right |
18:07:37 | FromDiscord_ | <Shield> I wonder if having each dll deal with its own memory would work, godot-nim compiles the dlls with "-d:useRealtimeGc --threads:on", it worked fine save for some quirky behavior, but I never checked if there's a memory leak |
18:08:53 | FromDiscord_ | <Shield> wouldn't it be better if the host exposes GC functions to the libraries? |
18:09:40 | Araq | Shield: what is the host? godot? |
18:09:50 | * | couven92 joined #nim |
18:10:10 | FromDiscord_ | <Shield> a nim application |
18:10:30 | Araq | well the GC is in the nimrtl.dll to be shared across DLLs |
18:10:47 | Araq | that's comparable to how other langs do it on Windows |
18:11:03 | Araq | languages that do not have a GC but the same problems |
18:11:15 | FromGitter | <tim-st> @narimiran now^^ |
18:12:12 | FromGitter | <iffy> Araq: hmm... what am I doing wrong here? https://gist.github.com/iffy/00b4426ebeaa870c4691ebe27bb09e8b |
18:12:35 | FromGitter | <xmonader> @Araq does it make sense to flush stderr if it's buffered already? or i should call flush on the case of stdout only? https://github.com/nim-lang/Nim/pull/9554 |
18:12:46 | FromDiscord_ | <Shield> yeah but why does it block the library from using os and libraries that rely on importc |
18:13:46 | FromGitter | <tim-st> @iffy maybe the implementation for a forward declaration is expected in the same file |
18:13:55 | Araq | iffy: you use import where you should be using include |
18:14:02 | FromGitter | <iffy> ah |
18:14:46 | FromGitter | <iffy> That works great! |
18:15:02 | FromDiscord_ | <demotomohiro> This old open issue seems like solved. |
18:15:02 | FromDiscord_ | <demotomohiro> https://github.com/nim-lang/Nim/issues/3482 |
18:15:04 | FromGitter | <iffy> thank you Araq and dom96_w |
18:16:12 | Araq | xmonader: tbh I don't really remember but I do remember that stderr is buffered on Windows and unbuffered on Posix or the other way round |
18:16:35 | * | mech422__ joined #nim |
18:17:37 | FromDiscord_ | <Shield> how about you only expose gc_ref and unref and let each library have its own gc, would that break things? |
18:18:13 | Araq | that breaks every GC :-) |
18:18:21 | narimiran | @tim-st i've tried the example you have posted earlier (https://stackoverflow.com/questions/14931769/how-to-get-all-combination-of-n-binary-value/14931808#14931808) and to my surprise, it is possible to do it with itertools :) |
18:19:10 | FromGitter | <tim-st> narimiran: really? do you have an example for `iterator binaryCombinations(length: int): seq[bool]` ? |
18:19:27 | * | mech422_ quit (Ping timeout: 240 seconds) |
18:19:34 | narimiran | BUT, it is limited to only 4 "repeats", by doing `for x in (a, a, a, a)` :D |
18:20:03 | FromGitter | <tim-st> ah, because your code is static |
18:20:08 | narimiran | now i'm trying to make this version of product: `product*[T](s: openArray[T], repeat: Positive): seq[T] =` |
18:20:34 | FromDiscord_ | <Shield> i'd go for gc:none if i knew better but i guess luajit is the only viable option |
18:20:34 | FromGitter | <tim-st> nice, I think this is what I need |
18:20:48 | narimiran | currently available version is the way it is to allow openArrays of different types, yielding tuples |
18:20:53 | Araq | Shield: use gc:regions it's much better |
18:21:44 | Araq | everything allocs into a region, you can free the full region. soon to be patched to be a real GC... |
18:21:53 | FromGitter | <xmonader> @Araq then it won't harm to call flush on unbuffered fd correct? |
18:22:50 | Araq | true |
18:23:23 | narimiran | @tim-st i think i'll have it quite soon, thanks to @iffy and his earlier PR |
18:25:23 | FromDiscord_ | <Shield> so ignore nimrtl and use gc:regions for each library? |
18:26:35 | FromGitter | <xmonader> Awesome can you check the PR and tell me if it makes sense to you? @Araq |
18:28:40 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
18:32:29 | * | shpx joined #nim |
18:35:02 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:40:49 | FromGitter | <tim-st> narimiran: nice, when you need help I can have a look at the code |
18:41:29 | narimiran | i just need to write some runnableExamples and update readme, and should be online soon |
18:42:04 | FromGitter | <tim-st> I think I can write an overload for static int, the static version can operate on array |
18:46:13 | PMunch | I think this has to be the strangest Nim bug I've seen in a while: http://ix.io/1qod |
18:47:10 | PMunch | Having the first block of code somehow tells the compiler to create the right code for the option type. While removing it means Nim creates a bad options structure (or doesn't know how to check it) |
18:48:26 | PMunch | This shows the output of the jsonSchema macro: http://ix.io/1qoe |
18:48:35 | * | PMunch quit (Remote host closed the connection) |
18:48:53 | * | kapil____ quit (Quit: Connection closed for inactivity) |
18:52:42 | * | macsek1911[m] quit (Ping timeout: 264 seconds) |
18:53:02 | * | macsek1911[m] joined #nim |
18:55:55 | FromDiscord_ | <Shield> i don't know how to use gc:regions and i can't find any resources on it |
18:57:29 | leorize | just pass `--gc:regions` to the compiler |
18:57:44 | leorize | I never know how it actually works tho, Araq said he was working on a blog post for it |
18:59:00 | * | kapil____ joined #nim |
19:00:51 | FromDiscord_ | <Shield> most of the procs are empty like GCref in gc_regions.nim, that implies that you need to free things on your own, i have no idea how to actually use it and how it's useful for a dll |
19:03:40 | narimiran | @tim-st a new version of https://github.com/narimiran/itertools is here — now you can do `for i in product([0, 1], repeat = 3): echo i` |
19:06:17 | * | floppydh quit (Quit: WeeChat 2.2) |
19:07:56 | FromGitter | <tim-st> narimiran: nice, thanks :) |
19:08:16 | FromGitter | <tim-st> is it also possible to operate on bool or should I just use int 0,1 ? |
19:08:39 | narimiran | you can use seqs of any type, strings, and arrays of any type |
19:09:03 | narimiran | (that's `openArray[T]` :)) |
19:10:08 | FromGitter | <tim-st> ok, I try :D |
19:10:38 | narimiran | ...and that goes to (almost) all iterators there |
19:13:45 | FromGitter | <tim-st> is the code correct? |
19:13:46 | FromGitter | <tim-st> let a = [false, true] ⏎ var s1: seq[seq[bool]] = @[] ⏎ var length = 3 ⏎ for x in product(a, length): ⏎ s1.add(x) [https://gitter.im/nim-lang/Nim?at=5bd75bea6e5a401c2ded6878] |
19:14:31 | FromDiscord_ | <Shield> according to https://forum.nim-lang.org/t/3107#19528 gc:regions indeed require to free objects manually, but what about the result variable in every proc |
19:14:55 | narimiran | @tim-st what's the problem with it? |
19:15:22 | FromGitter | <alehander42> well |
19:15:45 | FromGitter | <tim-st> for me it doesnt compile: Error: type mismatch: got <array[0..1, bool], int> |
19:15:46 | FromGitter | <rayman22201> I thought this was documented but I guess not. This template illustrates how to use gc:regions well I think: https://github.com/nim-lang/Nim/blob/27b081d1f77604ee47c886e69dbc52f53ea3741f/lib/system/gc_regions.nim#L90 |
19:15:56 | FromGitter | <rayman22201> @Shield |
19:16:07 | narimiran | i copy-pasted it and it works |
19:16:13 | FromDiscord_ | <Epictek> PMunch: hope you don't mind me asking, what's your progress on the LangServer like so far? Last time I checked there wasn't much progress. Just curious with the discussions today. :) |
19:16:29 | narimiran | do you have the latest itertools? (probably it is not yet in nimble) |
19:16:53 | narimiran | i guess `nimble install itertools@#head` might do the trick |
19:16:58 | FromGitter | <tim-st> I did `nimble install https://github.com/narimiran/itertools@#master` |
19:18:05 | FromGitter | <tim-st> narimiran: it works now :D thanks! |
19:18:18 | FromGitter | <tim-st> `@[@[false, false, false], @[false, false, true], @[false, true, false], @[false, true, true], @[true, false, false], @[true, false, true], @[true, true, false], @[true, true, true]] ⏎ ` |
19:18:39 | narimiran | glad to hear it. yup, that's the output :) |
19:19:03 | FromGitter | <tim-st> thanks for the help :) |
19:21:56 | narimiran | np, i'm glad to hear someone uses it :) |
19:22:16 | FromGitter | <tim-st> narimiran: here is the code from yesterday with your iterator: https://gist.github.com/tim-st/e8b5fa36120462d8924b67a8587a73b8 |
19:26:49 | shashlick | for anyone interested in IRC/Slack/Gitter bridging - https://github.com/nim-lang/Nim/issues/7418#issuecomment-434046369 |
19:30:27 | * | Trustable quit (Remote host closed the connection) |
19:34:39 | * | nsf joined #nim |
19:35:37 | FromDiscord_ | <Epictek> I'm confused, we already have IRC, gitter and discord. Not really sure yet another chat platform would make sense. |
19:36:06 | * | oky quit (Ping timeout: 252 seconds) |
19:37:34 | * | poopBot joined #nim |
19:38:14 | * | oky joined #nim |
19:38:15 | theelous3 | leorize: hey, I only saw this now "leorize> theelous3_: and typically you only specify two param for *It functions" |
19:38:24 | theelous3_ | it was in relation to code like: http://dpaste.com/003VSX0 |
19:39:26 | theelous3_ | can you elabourate that a bit? I only have one param for the proc, and type / proc call in the map |
19:44:43 | * | theelous3_ quit (Ping timeout: 244 seconds) |
19:45:20 | poopBot | hmm i have wierd issue i created new project to start clean form start , i did nimble init and all and when i copy pasted code i have this error "SHCnim.nim(1, 15) Error: cannot open file: oldgtk3/gtk" |
19:46:05 | poopBot | in other project it opens no problem , have smame config.nims too threads:on and clang |
19:46:28 | * | shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:50:18 | shashlick | @Epictek: Nim is everyone and people have their own chat client preferences - I'm for bridging |
19:51:21 | poopBot | i am for irc only but all people cry for discord, gitter and other craps |
19:51:29 | FromDiscord_ | <Shield> I honestly don't know if memory doesn't get released back to the os or i'm handling it wrong under gc:regions |
19:52:56 | * | shpx joined #nim |
19:57:38 | * | mech422_ joined #nim |
19:59:24 | poopBot | hmm cant get wtf is with this project in resintalled oldgtk3, even reinstalled whole gtk3genui just to be sure but it still works in one project and does not work in other |
20:00:03 | poopBot | how can it import it in 1 project and in aother it crys cannot open file: oldgtk3/gtk |
20:00:44 | * | mech422__ quit (Ping timeout: 244 seconds) |
20:05:34 | FromGitter | <tim-st> Pythons `a == b == c` would be nice to have in nim :\ |
20:08:16 | poopBot | hmm created new project same again get "cannot open file: oldgtk3/gtk" even i installed it using nimble and it works in other project np |
20:11:57 | * | NimBot joined #nim |
20:12:04 | poopBot | i dont get it, wtf is wrong |
20:15:25 | poopBot | i am moraly devasted now |
20:15:27 | poopBot | :) |
20:16:18 | poopBot | i will cone whole project to see |
20:16:32 | * | shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:17:17 | * | shpx joined #nim |
20:19:47 | FromDiscord_ | <Shield> so from what I got from gc_regions.nim, you can allocate to either the default memory region or a custom one, that way you can isolate things that you want to keep and dealloc the rest |
20:22:07 | FromDiscord_ | <Shield> the problem is, most of its functions are behind "when false", it doesn't keep track of freed chunks and doesn't reuse any memory at all, it will keep asking the os for new memory with every allocation, and giving how bad windows is, the os never claims it back |
20:24:41 | FromDiscord_ | <🐍 Aareon 🐳> How would one go about taking a `.nim` source file, passing it to the lexer, and getting back the tokens? |
20:28:21 | poopBot | i solved my issue nimble build woudet work but building with nim went to problem |
20:32:33 | Araq | poopBot: strange |
20:33:01 | Araq | Aareon: read compiler/main.nim which does that |
20:33:19 | Araq | Shield: regions have to be freed by yourself |
20:38:39 | FromGitter | <tim-st> poopBot: make sure the package is only installed once with nimble, I got the same error here https://github.com/nim-lang/nimble/issues/573 |
20:38:45 | FromDiscord_ | <Shield> it doesn't reuse memory until you use deallocAll() right? |
20:39:12 | poopBot | Araq, execting nim reads config.nims right? |
20:39:35 | poopBot | tim-st will try that too |
20:40:36 | Araq | Shield, yes |
20:40:48 | FromDiscord_ | <Shield> you free the memory like a batch instead of individual objects, but where do result variables and variables defined within functions and loops go? |
20:42:14 | Araq | these are on the stack and are freed at function exit |
20:45:21 | FromDiscord_ | <Shield> oh, correct me if i'm wrong, the correct way for using regions is deallocAll since they don't support reusing freed object memory that introduce holes right? |
20:45:34 | * | Cthalupa quit (Ping timeout: 246 seconds) |
20:47:37 | * | Cthalupa joined #nim |
20:48:03 | Araq | yup |
20:50:50 | * | shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:52:35 | FromDiscord_ | <Shield> nice, they're certainly better than manual management |
20:53:47 | * | shpx joined #nim |
20:54:47 | * | shpx quit (Client Quit) |
20:55:02 | Araq | as I said, I'm turning this into a regular GC mechanism but one without an enforced heap topology or conservative stack marking |
20:56:20 | * | nsf quit (Quit: WeeChat 2.2) |
21:03:55 | FromDiscord_ | <🐍 Aareon 🐳> Araq: Thank you 😃 |
21:07:26 | * | shpx joined #nim |
21:08:48 | * | narimiran quit (Remote host closed the connection) |
21:08:53 | * | kapil____ quit (Quit: Connection closed for inactivity) |
21:11:27 | * | mech422 joined #nim |
21:14:07 | * | mech422_ quit (Ping timeout: 240 seconds) |
21:15:00 | * | Vladar quit (Remote host closed the connection) |
21:26:07 | * | vlad1777d joined #nim |
21:28:51 | * | adeohluwa quit (Quit: Connection closed for inactivity) |
21:50:12 | copygirl | Is it possible to get the type of a `typed` NimNode? |
21:50:43 | copygirl | Not that it.. would help me. I'm just trying to figure out possible ways of doing what I want to do. |
21:52:49 | copygirl | So I have an `EitherX[T0, T1, ..]` (still working on this, yeah) and want to create a macro that allows for easy matching of the possible types and get their values with a case-like syntax: |
21:53:16 | copygirl | https://gist.github.com/copygirl/60d5446bdcfe305d70a2c17a8c199790 This code currently works but the branch indices are hardcoded. |
21:54:22 | copygirl | I somehow need to find out that an ident node `"string"` is stored in the `value0` field of the case type..? |
21:55:33 | * | timotheecour joined #nim |
21:56:18 | copygirl | I could also create a separate generic macro (assuming I can) for each either type, though not sure how convenient this would be. |
21:57:15 | copygirl | Ideally I'd have a compile-time proc that tells me the index of a type. But not sure how to compare ident with generic type..? |
21:59:46 | dom96 | getType et al. https://nim-lang.org/docs/macros.html#getType%2CNimNode |
21:59:55 | dom96 | the json `to` macro uses it |
22:00:22 | copygirl | Right, right! |
22:04:07 | * | timotheecour_ joined #nim |
22:09:56 | * | timotheecour_ quit (Quit: Page closed) |
22:10:07 | * | timotheecour quit (Quit: Page closed) |
22:14:10 | * | shpx quit (Quit: Textual IRC Client: www.textualapp.com) |
22:17:01 | * | kapil____ joined #nim |
22:22:11 | dom96 | Jesus, the amount of GitHub notifications |
22:23:14 | copygirl | Aaand.. if I have a Sym node and a Ident node.. should I be able to match them using `==`, or..? |
22:25:24 | * | Jesin quit (Remote host closed the connection) |
22:30:04 | dom96 | I think you can get the ident out of a Sym somehow |
22:30:50 | copygirl | But I want to compare the types, not the idents. |
22:30:56 | copygirl | Could be an alias in some odd case. |
22:31:39 | copygirl | Ideally I want to create a sym of the ident in the context that it's used in and see if it matches with the getType() symbol..? I hope I'm making sense. |
22:31:58 | copygirl | What does it mean if I get "cannot evaluate at compile time: branch" ? |
22:32:10 | * | hagna quit (Quit: Page closed) |
22:32:13 | copygirl | I'm inside a macro ... that's all compile time! |
22:35:42 | FromGitter | <recloser> you can't get the type with just an ident since they're untyped |
22:35:47 | FromGitter | <recloser> you need a sym for that |
22:36:03 | copygirl | Yeah but bindSym spits out that error. |
22:36:37 | FromGitter | <recloser> what's the code? |
22:37:28 | dom96 | bindSym needs a literal IIRC |
22:44:25 | * | Jesin joined #nim |
22:47:40 | * | cyraxjoe joined #nim |
22:49:22 | copygirl | Sorry I was going to update my Gist but I ran into something. |
22:49:26 | copygirl | ^^" |
22:50:27 | * | elrood quit (Ping timeout: 252 seconds) |
22:55:35 | * | stefanos82 quit (Quit: Quitting for now...) |
23:12:25 | copygirl | @recloser: https://gist.github.com/copygirl/60d5446bdcfe305d70a2c17a8c199790 |
23:12:33 | copygirl | It's.. quite a lot. |
23:12:52 | copygirl | There is a "FIXME" where I want to make improvements. |
23:14:45 | copygirl | So right now I get the type of the case node, and the ident I pass to the match, and compare them as strings (using `.repr`). |
23:15:15 | copygirl | But I probably want to turn the ident (`"string"`) to a symbol and then compare the type symbol with it. |
23:21:52 | copygirl | dom96: According to https://nim-lang.org/docs/macros.html#bindSym%2C%2CBindSymRule, `bindSym` should also be able to take a `NimNode`..? |
23:25:54 | FromGitter | <recloser> maybe that's for that experimental dynamicBindSym pragma |
23:26:40 | FromGitter | <recloser> but i don't think that would get the type from the actual macro invocation place |
23:26:46 | copygirl | Gotta upgrade to 1.19, hmm? ^^ |
23:27:30 | FromGitter | <recloser> i think it simply get the sym from the module in which the macro is defined, like regular bindsym |
23:28:15 | copygirl | That will not be useful. |
23:28:36 | copygirl | It would have to bind it from where it's called..? |
23:29:06 | * | darithorn quit () |
23:30:14 | FromGitter | <recloser> if you want to get the type of that ident at the invocation site, yeah |
23:32:45 | FromGitter | <recloser> you probably implement that type check by making a static block with assertions in it |
23:33:07 | copygirl | A static block? |
23:33:24 | * | skellock joined #nim |
23:34:10 | skellock | evenin |
23:34:51 | FromGitter | <recloser> yeah, `static: some code which will run at compile time here` |
23:38:49 | copygirl | Not sure how that would help. My macro already runs at compile time..? |
23:41:39 | FromGitter | <recloser> but you can't get the typed sym with just an ident inside your macro |
23:41:45 | FromGitter | <recloser> wait a sec |
23:43:24 | FromGitter | <recloser> https://gist.github.com/recloser/6f1ebf3ca8b1a6027e1051d3849e9261 |
23:47:31 | * | platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
23:52:03 | copygirl | Ah.. |
23:54:05 | copygirl | I'd definitely have to rewrite my code then. Wouldn't be able to use case with the checking done in the actual branches. |