00:13:24 | * | seni_ joined #nim |
00:15:29 | * | seni quit (Ping timeout: 248 seconds) |
00:17:43 | AlexMax | Got a question. I have four sequences of different types of tuples, and two of those tuples need to refer to specific other tuples in the other sequences |
00:18:11 | AlexMax | And some of the references need to be optional |
00:19:23 | AlexMax | I was originally going to have the references be of type ptr, but I realized that maybe that isn't such a good idea |
00:20:38 | AlexMax | in C++, an std::vector can invalidate references to individual elements if the vector is grown past its reserved capacity, and I'm assuming sequences do something similar? |
00:26:23 | * | maskedlua15 joined #nim |
00:29:31 | * | maskedlua15 quit (Remote host closed the connection) |
00:38:28 | AlexMax | I found something weird with assigning to tuples in a sequence |
00:38:57 | AlexMax | Syntax that I thought ought to work...doesn't |
00:39:00 | AlexMax | https://paste.ee/p/0z14s |
00:39:36 | AlexMax | I can populate a tuple in an array or sequence with a pointer, but I can't populate it with a nil |
00:39:53 | AlexMax | Why? |
00:53:03 | * | vosper quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
00:53:11 | * | francisl quit (Quit: francisl) |
00:56:05 | * | vosper joined #nim |
01:02:17 | * | vosper quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
01:05:15 | * | francisl joined #nim |
01:05:57 | * | cspar quit (Ping timeout: 240 seconds) |
01:05:59 | * | vosper joined #nim |
01:07:46 | * | mentifis20 joined #nim |
01:09:01 | * | mentifis20 quit (Remote host closed the connection) |
01:09:24 | * | wildlander quit (Quit: Konversation terminated!) |
01:15:19 | * | cspar joined #nim |
01:26:51 | * | vosper quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
01:41:12 | * | Shinobi joined #nim |
01:42:04 | * | Shinobi quit (Remote host closed the connection) |
02:01:34 | FromGitter | <gogolxdong> which to use when gc:regions deprecated? |
02:32:06 | * | dddddd quit (Remote host closed the connection) |
02:48:14 | AlexMax | Ooo, found another oddity |
02:51:34 | AlexMax | If the tuple member is not nil |
02:51:47 | AlexMax | var side_c: SideWithNotNill = (sector: secp) |
02:52:38 | AlexMax | wait, that...sorta makes sense I guess? secp isn't not nil |
02:52:54 | AlexMax | Thanks, not nil! |
02:53:01 | AlexMax | from preventing me from making a terrible mistake |
02:53:05 | AlexMax | for |
02:56:34 | AlexMax | Actually I'm going to need to think about that part of the type system to see if it makes sense or not....in any case, my original confusion about nil still stands |
02:59:18 | zacharycarter[m] | is there any strong reason atm not to use the default GC? I keep hearing about destructors and RTTI patterns but I'm a bit confused as to where things are at presently on devel |
03:01:29 | * | vosper joined #nim |
03:04:15 | * | Sargun_ quit (Changing host) |
03:04:15 | * | Sargun_ joined #nim |
03:04:19 | * | Sargun_ is now known as Sargun |
03:10:30 | zacharycarter[m] | Varriount: Are you around? |
03:10:55 | zacharycarter[m] | @Varriount - maybe that works? |
03:14:59 | AlexMax | ooo! |
03:15:08 | AlexMax | cast[ptr int](nil) |
03:15:20 | AlexMax | I'm not invoking black magick here am I? |
03:15:38 | * | vosper quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
03:16:42 | * | vosper joined #nim |
03:16:53 | cow_2001 | what are some gamedev libs for nimlang? i see this https://github.com/VPashkov/awesome-nim#game-development |
03:17:07 | zacharycarter[m] | what do you want to do? |
03:17:09 | AlexMax | I suppose that allows me to pass a typed nil to a tuple in a seq constructor |
03:17:35 | AlexMax | But I'm still not sure why Nim is smart enough to figure out the type of the nil outside the seq constuctor |
03:17:39 | zacharycarter[m] | there's nimgame |
03:17:43 | zacharycarter[m] | and then that's about it - but there's a lot of example game code out there |
03:17:52 | AlexMax | seems like a weird inconsistency |
03:19:00 | AlexMax | ...maybe casting the nil isn't the best thing to be doing, since the nim docs say it circumvents the type system |
03:19:14 | zacharycarter[m] | haha |
03:19:33 | zacharycarter[m] | probably why it works |
03:20:19 | zacharycarter[m] | um - so is it possible to have a binary package with nim that also acts as a library? |
03:20:36 | zacharycarter[m] | I've done the opposite - have a library that includes a binary |
03:20:54 | zacharycarter[m] | but never had a binary that also includes a library |
03:21:09 | AlexMax | But I'm not sure how to express a typed nil literal |
03:21:28 | zacharycarter[m] | I'm expecting the user to clone my project - and then create a folder in it and reference modules in my project |
03:21:34 | zacharycarter[m] | but I don't want them to have to use relative imports |
03:21:59 | AlexMax | I'm not even sure what 123'u32 does |
03:22:07 | AlexMax | ' is ungoogleable |
03:22:21 | zacharycarter[m] | I think I found the docs for that one time one sec |
03:22:26 | AlexMax | but it looks to me like a literal type annotation |
03:22:47 | AlexMax | ah, found it |
03:22:49 | AlexMax | https://nim-lang.org/docs/manual.html#lexical-analysis-numerical-constants |
03:22:50 | zacharycarter[m] | AlexMax: it is but I think it's also omitable |
03:22:56 | zacharycarter[m] | in that situation |
03:22:59 | zacharycarter[m] | I think you can also do |
03:23:02 | zacharycarter[m] | `123u32` |
03:23:16 | cow_2001 | hmm |
03:23:16 | zacharycarter[m] | AlexMax: do you know about play.nim-lang.org? |
03:23:32 | AlexMax | In any case, it doesn't seem like it applies to nil literals |
03:23:43 | AlexMax | No I don't |
03:23:49 | zacharycarter[m] | now you do |
03:24:44 | * | stefanos82 joined #nim |
03:29:55 | AlexMax | zacharycarter[m]: master or 0.18? |
03:29:59 | * | vosper quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
03:30:29 | zacharycarter[m] | I don't know when the last time I updated this thing was lemme see |
03:30:42 | zacharycarter[m] | I want to put up a new version where you can pull down a version of Nim at your choosing |
03:30:52 | zacharycarter[m] | but I have a lot of work to do on this thing - including writing a new web framework for it |
03:30:58 | AlexMax | the error... |
03:31:00 | zacharycarter[m] | for the frontend I mean |
03:31:02 | AlexMax | seems....kinda truncated? |
03:31:06 | AlexMax | in.nim(24, 31) Error: type mismatch: got but expected 'array[0..0, Side]' |
03:31:18 | zacharycarter[m] | it probably is |
03:31:49 | zacharycarter[m] | it's 0.18.0 |
03:31:58 | zacharycarter[m] | !eval echo NimVersion |
03:32:01 | NimBot | 0.18.0 |
03:32:19 | zacharycarter[m] | I forget how this works |
03:32:23 | zacharycarter[m] | !echo NimVersion |
03:32:40 | AlexMax | ohn noooooooooooooooooo |
03:32:47 | AlexMax | zacharycarter[m]: you naughty naughty boy |
03:33:00 | AlexMax | you're not escaping your HTML |
03:33:02 | zacharycarter[m] | ? |
03:33:21 | zacharycarter[m] | on the playground website? |
03:33:25 | AlexMax | huh.nim(24, 31) Error: type mismatch: got <array[0..0, tuple[sector: nil]]> but expected 'array[0..0, Side]' |
03:33:25 | zacharycarter[m] | or where? |
03:33:33 | AlexMax | that's the _actual_ error |
03:33:52 | AlexMax | the browser is interpreting the unescaped < as the beginning of an HTML tag |
03:34:10 | AlexMax | which is why the type is missing from the error output |
03:34:14 | zacharycarter[m] | are you typing this into the editor? |
03:34:16 | AlexMax | Yeah, from the playground website |
03:34:22 | AlexMax | Take this |
03:34:23 | AlexMax | https://paste.ee/p/0z14s |
03:34:32 | AlexMax | Paste it into the playground |
03:34:41 | AlexMax | check the error you get it |
03:34:55 | * | zacharycarter[m] sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/rylszoSIXoTQtzDsgaOwBXkl > |
03:35:34 | AlexMax | Yep, see how there's two spaces between "got" and "but" |
03:35:41 | zacharycarter[m] | `in.nim(24, 31) Error: type mismatch: got but expected 'array[0..0, Side]'` |
03:35:55 | zacharycarter[m] | yes so it got nothing |
03:36:08 | AlexMax | no, this is what the error is actually supposed to say |
03:36:13 | AlexMax | huh.nim(24, 31) Error: type mismatch: got <array[0..0, tuple[sector: nil]]> but expected 'array[0..0, Side]' |
03:36:30 | zacharycarter[m] | in 0.18.0? |
03:36:34 | AlexMax | Yes sir |
03:36:50 | leorize | /urlselect |
03:36:55 | leorize | oops |
03:37:00 | AlexMax | Your browser interprets "<array[0..0, tuple[sector: nil]]>" as an malformed HTML tag |
03:37:10 | AlexMax | So nothing shows up in its place |
03:37:13 | zacharycarter[m] | Im not surprised - there are existing issues with the playground |
03:37:57 | zacharycarter[m] | https://github.com/zacharycarter/nim-playground-deprecated |
03:38:44 | zacharycarter[m] | actually |
03:38:46 | zacharycarter[m] | the bug is probably in |
03:38:59 | AlexMax | Anytime unescaped HTML can be written into the page that is controlled by a user, it's a potential security issue |
03:39:22 | AlexMax | Surely nim has an html escaping function |
03:39:23 | zacharycarter[m] | https://github.com/zacharycarter/nim-playground-frontend/blob/master/src/app.nim#L64-L82 |
03:39:29 | zacharycarter[m] | it does |
03:39:38 | zacharycarter[m] | I'm pretty sure dom pointed this out to me |
03:39:39 | zacharycarter[m] | one sec |
03:40:10 | zacharycarter[m] | but erm |
03:40:14 | zacharycarter[m] | probably should take this to PMs |
03:40:35 | * | endragor joined #nim |
03:52:04 | * | meti4 joined #nim |
03:56:47 | * | meti4 quit (Remote host closed the connection) |
04:00:26 | * | vivus quit (Quit: Leaving) |
04:09:32 | * | seni_ quit (Remote host closed the connection) |
04:20:28 | * | vosper joined #nim |
04:22:32 | * | francisl quit (Quit: francisl) |
04:28:06 | * | vosper quit (Quit: Textual IRC Client: www.textualapp.com) |
05:04:50 | * | th3bmw joined #nim |
05:06:30 | * | th3bmw quit (Remote host closed the connection) |
05:15:01 | * | nsf joined #nim |
05:38:16 | * | miran joined #nim |
05:44:42 | * | iooner13 joined #nim |
05:46:02 | * | iooner13 quit (Remote host closed the connection) |
05:49:00 | * | cspar quit (Ping timeout: 272 seconds) |
06:10:12 | * | cspar joined #nim |
06:10:34 | * | vosper joined #nim |
06:15:35 | * | vosper quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
06:27:05 | * | vosper joined #nim |
06:48:11 | Araq | so ... travis is red, here is the log https://api.travis-ci.org/v3/job/416588542/log.txt |
06:48:19 | Araq | who can tell me where it failed? |
06:53:49 | FromGitter | <alehander42> reminds me of the legendary ERROR_SUCCESS |
06:59:32 | cow_2001 | oh there's this https://vladar4.github.io/nimgame2/ |
07:25:55 | * | ven473 quit (Read error: Connection reset by peer) |
07:26:27 | * | rdococ24 joined #nim |
07:26:42 | FromGitter | <mratsim> @cow_2001 pure Nim or wrapper counts because for wrapper you have Godot, Unreal Engine, Atomics, Urho3D. And for OpenGL UI: Imgui and Nuklear |
07:28:24 | * | rdococ24 quit (Remote host closed the connection) |
07:30:03 | cow_2001 | I am an almost 100% newbie to game development. |
07:30:27 | cow_2001 | I have been using golang's Ebiten for a little while |
07:31:18 | cow_2001 | i don't know how to link nim to outside c/c++ libs yet. is it not that hard? |
07:31:37 | cow_2001 | mratsim |
07:32:04 | cow_2001 | do i need to put an at behind your nickname? @mratsim |
07:32:28 | FromGitter | <mratsim> yeah |
07:32:30 | Tanger | cow_2001, https://gist.github.com/zacharycarter/846869eb3423e20af04dea226b65c18f#soloud |
07:32:42 | Tanger | zacharycarter does a pretty solid walkthrough |
07:33:05 | Tanger | If you have dominik96's Nim In Action, one of the sections is a complete explanation of wrapping parts of the SDL library |
07:33:25 | FromGitter | <mratsim> If you go at the bottom of this: https://nim-lang.org/features.html you have an example of how to wrap SFML in Nim |
07:33:58 | FromGitter | <mratsim> SDL is already available though nimble install sdl2. |
07:35:03 | cow_2001 | so that's why there aren't many nimlang gamedev libs. all the libs needed are easily importable from c/c++ :| |
07:36:41 | Tanger | cow_2001, No point in rebuilding the wheel if C already has an efficient and working version of the lib ;) |
07:36:59 | cow_2001 | what's the most.. uhm.. nimlangable gamedev lib, then? |
07:37:10 | FromGitter | <mratsim> A gamedev lib is a lot of work as well. But you can check the repos of fats, he has a lot of minimal game engine that he used in Ludum Dare: https://github.com/ftsf |
07:37:15 | cow_2001 | for 2d stuff |
07:37:32 | FromGitter | <mratsim> Maybe Vladar’s? I’m not really a game dev so :P |
07:38:11 | FromGitter | <mratsim> https://github.com/ftsf/nico ⏎ https://forum.nim-lang.org/t/2730 |
07:38:26 | ldlework | I made a game library, http://dadren.github.io/ |
07:38:31 | ldlework | but it has probably bitrot by now |
07:38:40 | ldlework | i made it in early nim version |
07:38:44 | cow_2001 | this is rather exciting. i never really used c/c++ libs directly before! |
07:38:47 | ldlework | but it has some cool ideas |
07:38:56 | FromGitter | <mratsim> You can also check zacharycarter’s frag and zengine but AFAIK he is working on a new one: https://github.com/zacharycarter |
07:41:16 | cow_2001 | first i need to follow through the nimlang tutorial… <_< |
07:43:04 | FromGitter | <mratsim> you can also check this one: https://narimiran.github.io/nim-basics/ |
07:44:11 | FromGitter | <mratsim> And seems like this is getting some traction: https://exercism.io/tracks/nim |
07:44:18 | cow_2001 | very nice of you all! |
07:55:00 | * | vosper quit (Quit: Textual IRC Client: www.textualapp.com) |
07:58:43 | * | PMunch joined #nim |
08:02:16 | * | yglukhov[i] joined #nim |
08:03:38 | * | gmpreussner joined #nim |
08:05:10 | * | gmpreussner_ quit (Ping timeout: 272 seconds) |
08:09:44 | * | yglukhov_ joined #nim |
08:11:12 | * | codevance[m] quit (Remote host closed the connection) |
08:11:13 | * | stisa[m] quit (Remote host closed the connection) |
08:11:13 | * | gh0st[m] quit (Read error: Connection reset by peer) |
08:11:13 | * | sendell[m] quit (Remote host closed the connection) |
08:11:14 | * | Miguelngel[m] quit (Remote host closed the connection) |
08:11:16 | * | bitstoppa[m] quit (Remote host closed the connection) |
08:11:16 | * | Demos[m] quit (Read error: Connection reset by peer) |
08:11:16 | * | yglukhov[m] quit (Remote host closed the connection) |
08:11:17 | * | pqflx3[m] quit (Read error: Connection reset by peer) |
08:11:18 | * | hitchhooker[m] quit (Read error: Connection reset by peer) |
08:11:22 | * | dyce[m] quit (Read error: Connection reset by peer) |
08:11:23 | * | endes[m] quit (Read error: Connection reset by peer) |
08:11:24 | * | SolitudeSF[m] quit (Read error: Connection reset by peer) |
08:11:27 | * | Connor[m]1 quit (Remote host closed the connection) |
08:11:28 | * | unclechu[m] quit (Remote host closed the connection) |
08:11:29 | * | GitterIntegratio quit (Remote host closed the connection) |
08:11:30 | * | toofly[m] quit (Remote host closed the connection) |
08:11:30 | * | narimiran[m] quit (Remote host closed the connection) |
08:11:30 | * | spymasterd[m] quit (Remote host closed the connection) |
08:11:31 | * | TheManiac[m] quit (Remote host closed the connection) |
08:11:31 | * | zacharycarter[m] quit (Read error: Connection reset by peer) |
08:11:31 | * | sg-james[m] quit (Remote host closed the connection) |
08:11:32 | * | petersjt014[m] quit (Remote host closed the connection) |
08:11:32 | * | xomachine[m] quit (Remote host closed the connection) |
08:11:32 | * | TheKing[m] quit (Write error: Connection reset by peer) |
08:11:32 | * | zielmicha[m] quit (Write error: Connection reset by peer) |
08:11:32 | * | macsek1911[m] quit (Write error: Connection reset by peer) |
08:11:40 | * | jaens[m] quit (Read error: Connection reset by peer) |
08:12:35 | * | yglukhov[i] quit (Ping timeout: 240 seconds) |
08:12:36 | * | yglukhov_ quit (Remote host closed the connection) |
08:16:54 | * | Yardanico quit (Ping timeout: 256 seconds) |
08:18:59 | * | hitchhooker[m] joined #nim |
08:21:12 | * | alphaseg26 joined #nim |
08:22:29 | * | alphaseg26 quit (Read error: Connection reset by peer) |
08:30:04 | * | Yardanico joined #nim |
08:31:18 | * | codevance[m] joined #nim |
08:31:18 | * | TheKing[m] joined #nim |
08:31:18 | * | yglukhov[m] joined #nim |
08:31:18 | * | dyce[m] joined #nim |
08:31:19 | * | Miguelngel[m] joined #nim |
08:31:19 | * | unclechu[m] joined #nim |
08:31:19 | * | pqflx3[m] joined #nim |
08:31:19 | * | Demos[m] joined #nim |
08:31:20 | * | bitstoppa[m] joined #nim |
08:31:20 | * | GitterIntegratio joined #nim |
08:31:20 | * | gh0st[m] joined #nim |
08:31:25 | * | sendell[m] joined #nim |
08:31:25 | * | zielmicha[m] joined #nim |
08:31:25 | * | toofly[m] joined #nim |
08:31:26 | * | endes[m] joined #nim |
08:31:26 | * | stisa[m] joined #nim |
08:31:26 | * | jaens[m] joined #nim |
08:31:26 | * | sg-james[m] joined #nim |
08:31:26 | * | narimiran[m] joined #nim |
08:31:26 | * | TheManiac[m] joined #nim |
08:31:26 | * | xomachine[m] joined #nim |
08:31:26 | * | macsek1911[m] joined #nim |
08:31:27 | * | SolitudeSF[m] joined #nim |
08:31:27 | * | petersjt014[m] joined #nim |
08:31:27 | * | zacharycarter[m] joined #nim |
08:31:27 | * | spymasterd[m] joined #nim |
08:31:27 | * | Connor[m]1 joined #nim |
08:42:48 | * | cspar quit (Ping timeout: 260 seconds) |
08:46:07 | PMunch | Taken from this it seems that all the work on error messages has paid off: https://sgoel.org/posts/nim-first-impressions/ :) |
08:46:49 | * | Pugabyte1012 joined #nim |
08:51:09 | * | Pugabyte1012 quit (Remote host closed the connection) |
08:52:02 | * | vosper joined #nim |
08:54:18 | * | vosper quit (Client Quit) |
08:56:51 | * | BitPuffin joined #nim |
08:59:09 | pigmej | hey guys after a while |
08:59:20 | pigmej | does anyone know any decent message queue lib for Nim ? |
09:03:44 | PMunch | Depends on what you need it for |
09:04:03 | pigmej | well, I need pub-sub with topics |
09:04:03 | PMunch | There are channels if you just want to communicate between threads |
09:04:10 | pigmej | no, I need multi server thingy |
09:04:22 | pigmej | no ack from client side required though |
09:04:45 | pigmej | HA is must have sadly |
09:05:04 | pigmej | but I can do HA on on devops side too, so not critical. |
09:05:30 | PMunch | Well there is a wrapper for MQTT: https://sgoel.org/posts/nim-first-impressions/ |
09:05:33 | PMunch | https://github.com/barnybug/nim-mqtt |
09:05:36 | PMunch | Woops, wrong link |
09:06:27 | pigmej | yeah but it seems to be outdated :( |
09:06:43 | PMunch | Oh it's broken? |
09:07:31 | pigmej | 3y ago last commit |
09:07:50 | pigmej | and sadly far from being complete |
09:08:09 | PMunch | There's also this: https://bitbucket.org/mahlon/nim-stomp |
09:08:54 | PMunch | This thing: https://makingspace.github.io/cittadino/ |
09:09:18 | pigmej | hmmm |
09:09:48 | PMunch | Most of these seem a bit old though.. Nothing wrong with that though if they work |
09:10:31 | * | Vladar joined #nim |
09:16:53 | pigmej | that's true, I'll check them |
09:17:17 | pigmej | maybe somehow they are still working with recent nim |
09:21:15 | * | anticrisis joined #nim |
09:22:34 | * | andries15 joined #nim |
09:25:03 | * | anticrisis quit (Remote host closed the connection) |
09:25:13 | * | andries15 quit (Remote host closed the connection) |
09:45:17 | PMunch | It's typically not a large feat to fix them if the only issues are version incompatibilities |
09:57:14 | * | erratic_ quit (Quit: this server has gone to sleep) |
10:08:04 | FromGitter | <Clyybber> u |
10:08:43 | FromGitter | <Clyybber> Sry disregard that, gitter on mobile is terrible |
10:15:21 | * | krux02 joined #nim |
10:15:33 | krux02 | hello people |
10:16:39 | krux02 | zacharycarter[m], you worked with bgfx, I can't compile it right now. But can you tell me what happens when I accidently misspell a Uniform in the cpp file? |
10:17:29 | krux02 | is it like raw OpenGL that you get no feedback at all that you misspelled the uniform |
10:23:57 | federico3 | https://nimble.directory/pkg/uibuilder nice |
10:37:14 | PMunch | federico3, oh nice |
10:41:02 | dom96 | hi guys |
10:43:24 | PMunch | Hi dom |
10:43:33 | PMunch | http://ix.io/1klt/ <- bug or feature? |
10:43:34 | * | rokups joined #nim |
10:44:03 | krux02 | feature |
10:44:09 | krux02 | a weird one indeed |
10:44:43 | PMunch | So it's intended to work like that? |
10:44:43 | krux02 | you can use it to initialize several variables with a create proc |
10:44:47 | krux02 | yes |
10:44:59 | krux02 | var a,b,c = createFooBar() |
10:45:04 | krux02 | and you have three instancing |
10:45:12 | krux02 | and three calls to createFooBar() |
10:45:16 | PMunch | I mean I like the "var x, y = 3" thing, but when it's a proc I think it should be called only once |
10:45:25 | * | Guest59138 joined #nim |
10:45:31 | PMunch | var head, tail = newNode() |
10:45:33 | krux02 | no it really is intended like it works |
10:45:55 | krux02 | yea, two new nodes |
10:45:57 | PMunch | That would then instantiate one node and set it as the head and tail of a double-linked list |
10:46:00 | krux02 | each individually allocated |
10:46:13 | krux02 | don't use double linked lists |
10:46:15 | PMunch | Hmm, I guess both ways has their pros and cons |
10:46:25 | PMunch | krux02, of course. That was just an example |
10:47:07 | krux02 | if you don't like it, then don't use this language feature |
10:47:13 | krux02 | I don't like it |
10:47:18 | krux02 | and I avoid it |
10:47:30 | krux02 | but it can be used for iota like initializers |
10:47:31 | PMunch | I like it, just didn't know it was there :P |
10:47:37 | krux02 | let a,b,c = iota() |
10:47:55 | krux02 | where iota is returns 0 then 1, 2 3 etc |
10:48:22 | krux02 | iota is an APL concept |
10:48:36 | krux02 | and it got its way into golang to avoid implementing enums |
10:49:51 | * | Guest59138 quit (Remote host closed the connection) |
10:50:12 | krux02 | iota is the greek i without the dot (ι) |
10:50:46 | PMunch | Why don't they like enums? |
10:52:12 | dom96 | Simplicity (TM) |
10:53:54 | krux02 | in fact enums in C are not much more that constants that are initialized with a continuous sequence of ints |
10:54:20 | krux02 | so I can understand that they say that this doesn't justify a language feature. |
10:55:12 | krux02 | and the names generator can be generated by a code generator. |
10:56:55 | krux02 | code generators in go can do a lot that macros do in Nim, but they are by far not as powerfull, because they are not as embedded in the build process as the macros in Nim, and they don't have the AST available, just the reflection library. |
10:58:28 | * | erratic joined #nim |
11:04:00 | * | Vladar quit (Ping timeout: 265 seconds) |
11:05:55 | * | dddddd joined #nim |
11:13:50 | * | miran quit (Ping timeout: 256 seconds) |
11:18:56 | * | Vladar joined #nim |
11:27:09 | FromGitter | <alehander42> that's one of the things that annoy me most about go |
11:27:48 | FromGitter | <alehander42> on the one hand, the language is simple, and then you have this weird ad hoc code generator substitute of a macro system |
11:35:15 | * | noonien joined #nim |
11:49:13 | * | xet7 joined #nim |
12:07:56 | * | NimBot joined #nim |
12:12:17 | AlexMax | Morning. Gonna repeat some weirdness I found last night concerning seq/array types and tuples |
12:12:20 | AlexMax | https://paste.ee/p/0z14s |
12:12:50 | AlexMax | I was able to bypass the error by casting the nil to a type, but I'm not sure why the compiler can determine the type of nil in one case and not the other |
12:13:12 | AlexMax | also, i don't know if there's some way to annotate the nil type inline |
12:14:50 | krux02 | AlexMax, you should use object, not tuple |
12:16:22 | AlexMax | Maybe? |
12:16:40 | krux02 | nil can be casteted to ptr Sector, but tuple[sector: pointer] cannot be casted to tuple[sector: ptr Sector] |
12:17:09 | krux02 | (ptr Sector)nil |
12:18:27 | krux02 | initializer lists from c++ have an advatge here |
12:18:34 | krux02 | nim does not have initializer lists |
12:18:56 | krux02 | it only has expressions that need to match the type on the left side of the assignment |
12:21:33 | krux02 | sorry I was wrong, the tuple aparently can be casted, it is the array of the tuple that doesn't work |
12:21:43 | AlexMax | Yeah, _that_ was the weirdness I found |
12:21:51 | AlexMax | The tuple worked, but the array/seq of tuple didn't |
12:22:00 | krux02 | but still you should be aware that (sector: secp) is not the same type as (sector: nil) |
12:22:33 | krux02 | the tuple thing is just a very common use cas that has been hacked to work because otherwise there would be too many complaints |
12:22:33 | AlexMax | Yeah, I figured that out - raw nil doesn't have the type of the pointer that the other one does |
12:23:22 | krux02 | raw nil isn't even of type pointer, it is it's own nilpointer type that can't be used in declarations at all. |
12:23:29 | krux02 | I am not sure if I like that. |
12:23:34 | AlexMax | Why do both tuples and objects exist if they do almost the same thing? |
12:23:35 | krux02 | (I don't like it) |
12:23:45 | krux02 | they don't do the same thing |
12:23:56 | krux02 | tuples are implicit types |
12:24:03 | AlexMax | seems like the only thing a tuple gives you that an object can't do is that you can cast from similar tuple types |
12:24:05 | krux02 | you don't need to declare them first |
12:24:21 | AlexMax | oh yeah, that too |
12:24:49 | krux02 | general rule of thumb, if you need a type declaration or want a type declaration, use object |
12:25:22 | krux02 | you don't want that every tuple of two int32 is also a Sector |
12:25:37 | krux02 | objects provide better type safety, because they are stricter |
12:28:56 | AlexMax | Should I submit a bug about this Behavior I found |
12:29:11 | AlexMax | Or is it one of those things that's unlikely to ever get fixed |
12:29:45 | krux02 | there is no bug |
12:30:00 | krux02 | this is all intended behavior, it is just a bit strange |
12:30:24 | Araq | it's "nominal" vs "structural" typing |
12:30:34 | krux02 | but it isn't much of a problem when you learned how to use Nim effectively for your advantage |
12:30:45 | Araq | from a type perspective these are vastly different concepts |
12:31:50 | FromGitter | <mratsim> structural is “if it’s resemble a duck, then OK”, nominal “If you don’t say it’s a duck, it’s not" |
12:36:19 | Araq | no regressions yet :-) |
12:36:46 | Araq | I merged araq-misc 3 hours ago, still no reported regressions :P |
12:37:18 | * | miran joined #nim |
12:39:21 | krux02 | what does araq-misc do? |
12:39:47 | krux02 | I think it is weird that it is illegal to use the nil type. |
12:39:56 | Araq | so fix it |
12:40:39 | krux02 | I thought that is was a design decision that you can't use the nil type. |
12:40:43 | Araq | start with the spec that adds a new specialized type inference rule for type annotated consts |
12:41:53 | krux02 | that is not what I mean |
12:41:59 | Araq | I'm tired of this "I feel like ..." nonsense, Nim has a spec. A terribly insufficient one, but a spec nonetheless. |
12:42:17 | krux02 | I mean ``let myvalue = nil`` is a compilation error in nim |
12:42:40 | krux02 | ``echo name(type(nil))`` prints nil, so the type of nil is nil |
12:43:00 | krux02 | but actually using the type like: ``var mynil: nil`` is illegal in nim |
12:43:05 | krux02 | that is what I mean |
12:43:20 | Araq | the type of 'nil' is actually 'type(nil)' |
12:43:34 | Araq | and not 'nil' |
12:43:49 | krux02 | the nil type is very much like the ``Unit`` type in scala, it only has a signle value, and therefore may never contain actual information. |
12:44:06 | Araq | the nil type is not 'nil', 'nil' is a value |
12:44:18 | * | Vladar quit (Ping timeout: 260 seconds) |
12:44:18 | Araq | the nil type has no name but can be accessed via 'type(nil)' |
12:44:31 | krux02 | well ``echo name(type(nil))`` prints nil |
12:44:39 | Araq | yeah, that's a bug :-) |
12:44:59 | krux02 | I think that is a bug that can be fixed. |
12:46:10 | krux02 | but still ``var mynil: type(nil)`` remains a compile error. |
12:46:31 | Araq | not every type in Nim is concrete enough for variables |
12:47:11 | Araq | if I want a language where every nonsense compiles, I know where to find C |
12:47:12 | * | Vladar joined #nim |
12:47:36 | krux02 | ``i[ptr]`` |
12:48:55 | krux02 | I think allowing the explicit nil type could be very beneficial. |
12:49:32 | krux02 | generic programming often creates non useful identifers with non useful values. |
12:50:06 | krux02 | and here it is nicer if they are just optimized away (C compiler does that already) instead of being a compile error that the macros need to take care to avoid. |
12:50:36 | Araq | yeah, I'm familiar with the argument "it needs to compile because generic code" |
12:50:37 | krux02 | but I can't name a specific use cane at the moment. |
12:51:08 | * | cryptocat1094 joined #nim |
12:51:10 | Araq | that argument becomes convincing with convincing specific examples that are not pure sophistry |
12:51:17 | krux02 | And I totally agree `let mynil = nil` is total nonsens in non generic code. |
12:51:48 | Araq | in C++ you can write 'return foo()' when foo returns 'void' because of "generic code". |
12:52:24 | Araq | still I hesitate to copy this behaviour. |
12:52:30 | krux02 | yea, but that void is much better handled in languages such as Scala. |
12:52:44 | krux02 | Scala does not have void as a concep, because void is not a type |
12:52:56 | Araq | yeah, spare me this lecture please |
12:53:12 | krux02 | so you know the Unit type? |
12:53:32 | krux02 | I mentioned it already when I was still new to Nim |
12:53:32 | Araq | yes. And I know it's different from 'void' etc etc yadda yadda |
12:53:51 | krux02 | it fixes the problems of void |
12:54:07 | krux02 | explicitly, the problem that `void` is not a type. |
12:54:20 | krux02 | and therefore needs "special treatment" everywhere. |
12:54:36 | Araq | 'void' is a type without a value, Unit is a type with a single value |
12:55:00 | krux02 | no void, is no type at all |
12:55:22 | krux02 | `Nothing` is the type without a value |
12:55:47 | krux02 | `Nothing` is like `void {.noReturn.}` |
12:57:10 | Araq | no, that's wrong, but I guess as usual, there are multiple conflicting definitions |
12:57:43 | Araq | 'noReturn' is implicit for all types in an imperative PL. |
12:57:54 | krux02 | the `Nothing` type is useful for `raise` and `quit`. So for example when you have a `case of` expression, and in the `else` branch you have a raise expression, the whole expression doesn't collapse to `void` |
12:58:00 | Araq | if I say proc (x, y: int): int it is allowed to not return at all. |
12:58:16 | krux02 | yes |
12:58:49 | Araq | types are propositions about sets of values, the void type covers the empty set. |
12:58:52 | krux02 | but noReturn doesn't mean that it is allowed to not return. It means it may not neturn at all. |
12:59:25 | Araq | and so 'void' is a perfectly fine type, no matter what you say about the control flow aspects that are not covered by the type system |
13:00:30 | krux02 | but the void type is the reason that I can't use the the case of as an expression anymore, when I use `raise` in one of the branches. |
13:01:08 | Araq | seriously, you're living in the past. Nim allows for 'raise' in case expressions |
13:01:18 | Araq | and 'void' has nothing to do with it... |
13:01:30 | krux02 | should I give you an example of what doesn't work? |
13:01:46 | krux02 | I tested it recently |
13:02:27 | * | Fridtjof joined #nim |
13:03:32 | Araq | nah, I don't give a fuck. tomorrow you'll teach me about how Jai is so nicely designed because it only supports concrete types without type theory sophistry |
13:03:39 | * | ultrabong25 joined #nim |
13:06:53 | krux02 | I never used Jai, so I don't know if it is nicely designed, but I am very interested in it. |
13:06:54 | * | Fridtjof quit (Remote host closed the connection) |
13:08:24 | * | ultrabong25 quit (Remote host closed the connection) |
13:09:15 | krux02 | Araq: sorry aparently I did live in the past |
13:09:26 | krux02 | my example does compile |
13:09:34 | krux02 | I am surprised and happy |
13:10:47 | Araq | no worries |
13:11:36 | krux02 | http://ix.io/1klY |
13:11:38 | krux02 | yay |
13:11:55 | krux02 | I know it didn't work that long ago |
13:12:03 | krux02 | or my sense of time ise really bad |
13:12:18 | Araq | it should be in 0.18 |
13:27:46 | * | francisl joined #nim |
13:29:34 | * | endragor quit (Remote host closed the connection) |
13:30:08 | * | endragor joined #nim |
13:34:29 | * | endragor quit (Ping timeout: 244 seconds) |
13:36:11 | PMunch | Hmm, the Nim playground. Is it possible to run the compile function from another web-site? |
13:37:12 | PMunch | I'm toying with the idea of a "A tour of Go" thing for Nim. But to test it I need to be able to get the compilation thing working.. |
13:37:14 | krux02 | PMunch, why don't you customize your local editor to substitute Nim playground for you? |
13:37:43 | PMunch | What do you mean? |
13:37:52 | krux02 | ok tahta is a good use case |
13:38:16 | krux02 | for example I bound a key in my emacs to open up a Nim file in the temp folder for me. |
13:38:17 | FromGitter | <alehander42> a tour of Nim would be very nice |
13:39:12 | dom96 | PMunch: yes, see how NimBot does it |
13:39:14 | FromGitter | <alehander42> but how would the repl feel work? |
13:39:39 | FromGitter | <alehander42> ah tour of go uses whole programs |
13:39:53 | krux02 | Nim has no official repl (I know the secret) |
13:40:14 | FromGitter | <alehander42> :D I know, just a lot of the "tour of x" |
13:40:19 | FromGitter | <alehander42> i've used were web repl-s |
13:40:27 | FromGitter | <alehander42> and I totally forgot the go version |
13:40:43 | FromGitter | <alehander42> i use nim secret from time to time, and i am proud |
13:40:50 | PMunch | dom96, yeah I looked at that. But that's from one server to another |
13:40:59 | PMunch | Doing it through JS is a bit trickier |
13:40:59 | FromGitter | <alehander42> inim is actually nice too |
13:41:02 | PMunch | Because of CORS |
13:41:23 | FromGitter | <alehander42> can't you host a new instance of the playground server code? |
13:42:19 | FromGitter | <alehander42> or maybe dom can give you a subdomain of nim-lang |
13:42:24 | FromGitter | <alehander42> tour.nim-lang.org |
13:42:26 | PMunch | Yeah I could.. |
13:42:39 | FromGitter | <alehander42> and than the cors wouldn't be a prob? |
13:42:44 | PMunch | tour.nim-lang.org is obviously the end goal here |
13:43:08 | FromGitter | <alehander42> well while it's in development, you'll need a local playground anyway (I guess ?) |
13:43:10 | Araq | alehander42: what did devel break? fp...? |
13:43:17 | dom96 | You could proxy it as a workaround |
13:43:18 | Araq | and on what OS to reproduce? |
13:44:14 | FromGitter | <alehander42> @Araq are you mentioning the wrong user? I haven't tried devel today :D |
13:45:01 | PMunch | dom96, oh yeah that could work |
13:45:42 | Araq | no, you said the recent GC changes introduced new crashes |
13:45:47 | FromGitter | <alehander42> aaaaah |
13:45:51 | FromGitter | <alehander42> I found out the reason! |
13:46:13 | FromGitter | <alehander42> I was doing just a single `old_nim compile new_nim` thing, and when I compiler new_nim with new_nim it all worked |
13:46:29 | FromGitter | <alehander42> that's why it worked with nimd: because i usually compile it with new_nim anyway |
13:47:02 | Araq | no idea what you're saying. everything fine now? |
13:48:02 | FromGitter | <alehander42> so sorry, my fault |
13:48:33 | FromGitter | <alehander42> well, what `koch` does is: it builds nim with the existing nim compiler, and then it does it again, right? |
13:48:46 | FromGitter | <alehander42> but I started doing just the first part, because it's 1faster |
13:49:16 | FromGitter | <alehander42> and obviously here I did hit a bug, that happens when you build the new nim version with an older nim compiler |
13:49:43 | FromGitter | <alehander42> and it doesn't happen when I build it with *itself* |
13:53:18 | * | marig joined #nim |
13:57:38 | * | marig quit (Remote host closed the connection) |
14:10:19 | Araq | you need to do a full bootstrap otherwise something weird may happen |
14:10:26 | Araq | as the internals changed quite a bit |
14:10:51 | Araq | usually it's not necessary but for the upcoming v0.19 we have so many changes... |
14:11:49 | FromGitter | <alehander42> yeah exactly |
14:11:59 | FromGitter | <alehander42> when is 0.19 expected? |
14:14:19 | Araq | tomorrow but we won't make it |
14:14:48 | FromGitter | <alehander42> oh well I expected the autumn :D |
14:14:51 | FromGitter | <alehander42> awesome |
14:15:03 | FromGitter | <alehander42> i have to try to get my js sourcemaps in for 0.20 |
14:17:17 | Araq | oh hmm ok |
14:17:26 | * | wildlander joined #nim |
14:22:13 | FromGitter | <alehander42> :D where is help most needed for the next version? |
14:24:05 | FromGitter | <kaushalmodi> @alehander42 I would think.. Documentation, improving accessibility to more folks.. like creating "A tour of Nim" idea that PMunch presented above, etc. |
14:27:26 | Araq | 0.19 is not about that polish, it's the Nim that removed 'nil' from strings and seqs, removed a couple of features, introduced others |
14:28:03 | Araq | and we expect to release 0.19.2 soon after it because of the massive amount of changes |
14:29:24 | Araq | PMunch, btw devel has case statement macros for your pattern matching experiments, but please don't add that to Options.nim, it should be a new module with experimental stuff |
14:31:39 | FromGitter | <Clyybber> What are the benefits of removing nil for strings and seqs? |
14:32:33 | PMunch | case statement macros? |
14:34:04 | Araq | Clyybber: fewer 'nil' dereference bugs, cleaner APIs |
14:34:23 | FromGitter | <Clyybber> Hmm nice |
14:34:42 | FromGitter | <data-man> @PMunch: https://gist.github.com/Araq/169d1e24b2b996d024a780ef6a4e6c09 |
14:34:46 | FromGitter | <Clyybber> and also the ability to += on empty strings i guess? |
14:35:24 | Araq | it's usually spelt 'add' but yes |
14:35:45 | FromGitter | <Clyybber> Cool! |
14:36:17 | FromGitter | <Clyybber> I guess this really plays well with the implicit result variable |
14:38:59 | FromGitter | <alehander42> @Araq is the not nil support lacking/planned to improve? i'd like to fix some issues there if there are any , i remember i had problems with it |
14:39:28 | Araq | it's now .experimental and I'm not sure it really can be fixed |
14:39:45 | Araq | the problems with e.g. Table[] are pretty severe |
14:40:18 | FromGitter | <kayabaNerve> Hmm? Table has problems or the radical 0.19 changes don't work with Table yet? |
14:40:24 | dom96 | +=? no, that would be `&=` |
14:41:05 | Araq | kayabaNerve Table has problems with types that are annotated with 'not nil' |
14:41:08 | FromGitter | <Clyybber> dom96 |
14:41:14 | FromGitter | <Clyybber> 'add' it is then |
14:41:16 | FromGitter | <Clyybber> :P |
14:41:26 | FromGitter | <kayabaNerve> Got it |
14:41:42 | FromGitter | <alehander42> @Araq only with table? or with all kinds of generic collections? |
14:41:44 | FromGitter | <alehander42> bizarre |
14:42:28 | PMunch | data-man, interesting |
14:42:37 | PMunch | Did you look at TOML 0.5.0 by the way? |
14:43:40 | * | threeFifths joined #nim |
14:44:05 | FromGitter | <kaushalmodi> `strfmt` breaks again because of the string not allowed to be nil change on devel |
14:44:07 | FromGitter | <kaushalmodi> https://github.com/kaushalmodi/strfmt/blob/master/strfmt.nim |
14:44:45 | FromGitter | <kaushalmodi> Hopefully replacing `nil` with `""` would work.. but not quite sure. How would the library distinguish between that string parameter "not being set" vs set as "" by user? |
14:44:58 | * | threeFifths quit (Killed (Sigyn (Spam is off topic on freenode.))) |
14:45:02 | FromGitter | <kayabaNerve> Use a ref string? |
14:45:05 | FromGitter | <GULPF> Option[string]? |
14:45:26 | FromGitter | <kaushalmodi> hmm.. need to look into that. Would someone be kind enough to submit a PR? |
14:45:43 | FromGitter | <alehander42> @Araq and how easy would be to improve nil type safety for ref types, e.g. to catch those cases https://github.com/nim-lang/Nim/issues/7248 |
14:46:20 | FromGitter | <alehander42> is it something that a contributor like me would be able to handle? |
14:49:11 | FromGitter | <data-man> @PMunch: Yes :) https://github.com/NimParsers/parsetoml/issues/22 |
14:49:17 | FromGitter | <kaushalmodi> @kayabaNerve I am not familiar with ref string. Or how that would solve this problem. |
14:50:33 | Araq | kaushalmodi: I actually looked into it and you need to use Option[string] for it |
14:50:50 | FromGitter | <kaushalmodi> @GULPF I have read about Options module in passing, but not yet used it. I have to yet read the blog post on that by @PMunch. If either of you have a chance, can you please provide a PR to strfmt? If not, I am tracking this in an issue in that repo to get to it at some point. |
14:51:28 | FromGitter | <kaushalmodi> Araq: That sounds like a plan. Learning the options module is on my list |
14:52:19 | Araq | alehander42: it's mostly just Table and related collections |
14:52:52 | Araq | because it uses a seq under the hood und sizes it to a power of two |
14:53:26 | Araq | and that seq has default(T) values in it, but default(T) is what does not exist for T = ref U not nil |
14:54:27 | FromGitter | <kayabaNerve> @kaushalmodi I wrote you the code for it |
14:54:41 | FromGitter | <kayabaNerve> https://gist.github.com/kayabaNerve/0dacec555afd8e216662b8df5181c42c |
14:54:42 | Araq | the table could use seq[Option[T]] instead of seq[T] but it would be quite a change |
14:55:29 | FromGitter | <kayabaNerve> I just left a comment with the output |
14:55:50 | FromGitter | <kaushalmodi> @kayabaNerve Thank you. |
14:55:54 | FromGitter | <kayabaNerve> Araq is `ref string` too low level for your taste? :P |
14:56:19 | Araq | no, it's slower than Option[string] |
14:56:38 | FromGitter | <kayabaNerve> a is not nil before new(a); a is Nil after. |
14:56:43 | FromGitter | <kayabaNerve> Really? Good to know |
14:56:58 | FromGitter | <kaushalmodi> @kayabaNerve It is using `cast`, which from reading the manual says that should not be used |
14:57:09 | Araq | and it's also wrong, just because it can be nil/None doesn't mean that you have aliasing |
14:57:26 | Araq | 'ref' is about aliasing. |
14:57:42 | FromGitter | <kaushalmodi> I'll stick with Options, as it has been on my list. |
14:58:00 | FromGitter | <kaushalmodi> It allows a var to be "tri-Boolean".. if that even makes any sense :) |
15:01:43 | krux02 | some(true), some(false), none |
15:02:18 | krux02 | for for that I think I would define an enum with three states |
15:03:12 | FromGitter | <kaushalmodi> Araq: Does this look right? https://ptpb.pw/4STK/nim |
15:03:40 | krux02 | it does |
15:03:54 | FromGitter | <kaushalmodi> I'm bugged that it's outputing: ⏎ ⏎ ```None[string] ⏎ Some("") ⏎ Some("abc")``` [https://gitter.im/nim-lang/Nim?at=5b75925aa3a93d242272add5] |
15:04:19 | FromGitter | <kaushalmodi> Can I open an issue so that `$` for options uses double-quotes for strings? |
15:04:51 | Araq | ah it's covered by PMunch's PR |
15:04:55 | krux02 | yea can create a PR to patch it |
15:05:02 | krux02 | is it? |
15:05:05 | krux02 | ok then not |
15:05:05 | Araq | which sadly does too much weird stuff :-) |
15:05:16 | krux02 | well then you have a chance again |
15:05:44 | Araq | krux02: go for it |
15:05:51 | krux02 | kaushalmodi: generally you have to use the `addQuoted` |
15:06:33 | FromGitter | <kaushalmodi> OK.. I can work on it. PMunch, are you fine with that? |
15:07:08 | FromGitter | <kaushalmodi> krux02: Thanks for that hint.. I am not sure how it would work.. but will grep for existing uses of `addQuoted` |
15:07:58 | PMunch | What is covered by by PR? |
15:08:04 | PMunch | I removed most of the weird stuff :) |
15:09:07 | FromGitter | <kaushalmodi> PMunch: OK, I will hold off on this proposed PR then |
15:09:17 | FromGitter | <GULPF> doesn't look like it was changed: https://github.com/nim-lang/Nim/pull/8358/files#r203996796 |
15:09:19 | PMunch | Oh, I don't think I did anything with the string representation of options |
15:09:47 | Araq | it's still not good enough :-) I'm sorry, but it feels like you read some blog post and tried how far Nim can pushed with this new paradigm |
15:10:03 | Araq | and that's fine, but that's nothing for the stdlib |
15:10:24 | Araq | the stdlib needs tried and battle-tested stuff |
15:10:37 | PMunch | I can see how the original PR had a bit too much stuff in it |
15:10:43 | FromGitter | <kayabaNerve> @kaushalmodi I only used cast to print the memory address. You can directly compare it to nil. Araq is right though that the value it's set to can be nil, so this kinda solves it but doesn't really. |
15:10:53 | PMunch | But the latest revision pretty much only adds .?, require, and some wrapper macros |
15:11:36 | FromGitter | <kayabaNerve> This is a stupid question I'm asking for absolute certainty. If I have a ref object A, which contains two ref object Bs, and I define the 2 Bs and the construct A, there's no copying going on there, right? |
15:11:58 | Araq | I happen to dislike .? though, 'require' feels misnamed and I don't want options.nim to be 900 lines long |
15:12:15 | PMunch | Why don't you like .? |
15:12:18 | FromGitter | <kayabaNerve> Double checking because if that does do any copying I am kinda screwed over and need to move on to raw pointers. |
15:12:22 | PMunch | It's practical |
15:12:29 | dom96 | I'm pro-`.?` |
15:12:41 | PMunch | And how is require misnamed? It requires that all the options have a value |
15:13:19 | Araq | Gulpf, ok, my bad |
15:13:35 | PMunch | And it's only some 700 odd lines, most of which is tests and documentation.. |
15:14:17 | PMunch | The require macro is only 73 lines |
15:14:29 | Araq | I can write an Option[T] in 5 lines |
15:14:47 | Araq | and everything else might not be required so could live in optionutils |
15:15:06 | Araq | and yes, I know you didn't write options.nim |
15:15:57 | Araq | but it's getting out of control |
15:16:04 | dom96 | I'm unsure about `require` |
15:16:10 | dom96 | also seems like a weird name to me |
15:16:22 | Araq | 'require' should be 'allSome' or something better |
15:16:27 | PMunch | What would you call it then? |
15:16:35 | PMunch | Hmm, I guess allSome works |
15:16:39 | Araq | the value is called 'Some' vs 'None', you want them all to be some |
15:17:03 | krux02 | https://github.com/nim-lang/Nim/pull/8659 |
15:17:18 | PMunch | I can add it to optionutils if you want |
15:18:15 | PMunch | Just seems a bit odd since string and seq is part of system and has their *utils modules to keep things like this in. But options is already a module by itself. Now options would have two modules.. |
15:19:40 | krux02 | PMunch, the options.nim file is already too bloated with crap that I would never want to use |
15:20:45 | FromGitter | <kaushalmodi> Sorry, an interjection.. If I want to set an `Option[string]` value, I always need to do `some("value")`? |
15:20:55 | Araq | yes |
15:20:56 | krux02 | with optionutils the crap is decoupled from the option type |
15:21:01 | FromGitter | <kaushalmodi> ok |
15:22:59 | Araq | and indeed, it's kinda bad that strings and seqs live in system |
15:23:19 | Araq | and I avoid sequtils already and 50% of the stuff in strutils is unnecessary |
15:23:31 | PMunch | Okay, so should I move the stuff I've added, along with the map and filter stuff that was there from before into optionutils? |
15:23:39 | PMunch | And rename require to allSome? |
15:23:45 | * | francisl quit (Quit: francisl) |
15:23:48 | Araq | fine with me |
15:23:57 | krux02 | ✔ |
15:23:59 | PMunch | I tend to use sequtils and strutils pretty much everywhere |
15:24:10 | PMunch | Well, not everywhere. But I import them a lot |
15:24:56 | * | brand05 joined #nim |
15:25:04 | krux02 | well what are you actually using |
15:25:08 | krux02 | and what did you never ues? |
15:25:41 | krux02 | I think `zip` is pretty useless, because it is not an iterator |
15:26:13 | krux02 | cycle is also useless |
15:26:28 | PMunch | Oh yeah, there is a lot of stuff in there that I don't use all the tie |
15:26:41 | PMunch | But it's nice to have so you don't have to implement your own if you need it |
15:27:41 | krux02 | the problem is that these fucntions are better to be avoided |
15:27:49 | krux02 | but still they are omnipresent |
15:28:05 | * | brand05 quit (Killed (Sigyn (Spam is off topic on freenode.))) |
15:29:18 | FromGitter | <kaushalmodi> so.. I am ending up having to add a lot of `get` and `some` to convert a nil-using code to Option[string] |
15:29:21 | FromGitter | <kaushalmodi> sounds right? |
15:29:25 | krux02 | distribute, even worse |
15:29:44 | Araq | kaushalmodi: Only one field is affected iirc |
15:30:08 | FromGitter | <kaushalmodi> there are 2 fields |
15:30:49 | FromGitter | <kaushalmodi> here's the diff so far: https://ptpb.pw/8wq-/diff |
15:30:54 | FromGitter | <kaushalmodi> not yet tested or finished |
15:31:00 | Araq | 'arysep' is the only where nil vs "" makes a difference |
15:31:10 | krux02 | one question you should also really ask yourself is, do you really need an option[string] |
15:31:19 | krux02 | isn't just string enough? |
15:31:44 | FromGitter | <kaushalmodi> see https://ptpb.pw/8wq-/diff#L-43 (I have to replace "" with some("")) |
15:31:54 | krux02 | is this nil vs "" difference really that important |
15:32:05 | Araq | 'fill' doesn't distinguish between nil and "" |
15:32:36 | FromGitter | <kaushalmodi> Araq, krux02: hmm, ok. let me try removing Option for fill |
15:32:37 | FromGitter | <kaushalmodi> thanks |
15:33:36 | FromGitter | <kaushalmodi> though, the fill refactoring was ok |
15:33:39 | PMunch | Hmm, slight issue |
15:33:44 | FromGitter | <kaushalmodi> the arysep refactoring gets a bit crazy |
15:33:55 | PMunch | The helpers use variables that are hidden in options |
15:33:57 | FromGitter | <kaushalmodi> https://ptpb.pw/8wq-/diff#L-115 |
15:34:39 | PMunch | So I need to `include` the options module |
15:35:03 | Araq | the helpers can use the accessors instead |
15:35:11 | Araq | the accessors must stay in options.nim |
15:36:59 | * | lmartin9212 joined #nim |
15:37:14 | krux02 | why dos arysep be an option[string]? |
15:39:50 | Araq | if fmt.arysep == nil: |
15:39:50 | Araq | sep = "\t" |
15:39:51 | Araq | elif fmt.arysep == "": |
15:39:53 | Araq | sep = "" |
15:39:55 | Araq | that's why. |
15:40:09 | * | lmartin9212 quit (Remote host closed the connection) |
15:40:39 | krux02 | isn't it better to initialize arysep with "\t" instead, when it is not set explicitly? |
15:41:02 | Araq | maybe but I only skim over these things :P |
15:41:58 | krux02 | I mean precision is also something that shouldn't be 0 by default |
15:45:04 | FromGitter | <kaushalmodi> krux02: I am none the wiser. Would you like to fix this in a better way without using Option? |
15:45:33 | FromGitter | <kaushalmodi> btw while refactoring, I came across this another piece using nil in strfmt: https://ptpb.pw/D6AR/nim |
15:45:53 | FromGitter | <kaushalmodi> It uses `newNilLit` and `newLit` which is new to me |
15:46:14 | Araq | result = if s == nil: newNilLit() else: newLit(s) |
15:46:16 | Araq | --> |
15:46:21 | Araq | result = newLit(s) |
15:46:53 | * | Trustable joined #nim |
15:47:00 | FromGitter | <kaushalmodi> Araq: Thanks. That was my best uneducated guess as s now won't ever be nil |
15:47:23 | krux02 | that is the point of it |
15:47:53 | krux02 | get rid of all the `if s == nil` special case handlings |
15:48:09 | Araq | I only guessed it too, but the tests will tell us and if it's not covered by tests it's an edge case nobody cares about |
15:48:43 | krux02 | I wouldn't go so far |
15:48:55 | krux02 | not everything that people care about is in the tests. |
15:49:00 | FromGitter | <kaushalmodi> ok, I ended up with this: https://github.com/kaushalmodi/strfmt/commit/8fb457c2de0995b5f7b4e4af68967b21530409bd |
15:49:13 | FromGitter | <kaushalmodi> it still fails compilation and is out of my "zone" as I don't understand macros |
15:49:24 | Araq | strfmt has extensive tests |
15:49:26 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b759d062a4b1910f5e5d852] |
15:52:19 | krux02 | don't use Opition for arysep |
15:52:52 | Araq | # literal format string, precompute the format data |
15:52:53 | krux02 | initialize arysep with "\t" in DefaultFormat |
15:53:22 | Araq | you need to adapt this code, you need to precompute the format data differently for an Option |
15:53:24 | krux02 | and whenever you would set aryformat to None, set it to "\t" instead |
15:53:24 | FromGitter | <kaushalmodi> krux02: OK, but I think this compilation error is unrelated to that? |
15:53:29 | Araq | but krux02's solution seems easier |
15:53:35 | FromGitter | <kaushalmodi> ok |
15:53:47 | FromGitter | <kaushalmodi> will try the default to `\t` suggestion |
15:53:48 | FromGitter | <kaushalmodi> thanks |
15:54:43 | Araq | and remove the 'try finally: discard' |
15:54:46 | krux02 | you might want to introduce a constant and call it default separator |
15:54:58 | krux02 | that would be more "normalized" |
15:54:59 | Araq | starting in line 766 |
15:55:04 | krux02 | but that is up to you if you want that |
15:57:34 | krux02 | line 222, you can initialize here with: ``result.arysep = DefaultFormat.arysep`` |
15:57:45 | krux02 | that is super duper normalized and very readable |
16:01:15 | FromGitter | <kaushalmodi> krux02: Your suggestion (`\t`) worked, but I didn't get your later normalization tip. |
16:01:18 | FromGitter | <kaushalmodi> Thanks! |
16:01:35 | FromGitter | <kaushalmodi> I'll commit what I have right now and revisit your optimization point later. |
16:03:26 | * | francisl joined #nim |
16:03:35 | * | PMunch quit (Quit: Leaving) |
16:04:10 | * | nsf quit (Quit: WeeChat 2.2) |
16:04:42 | krux02 | can you show your diff? |
16:06:14 | * | Vladar quit (Remote host closed the connection) |
16:06:24 | krux02 | Araq: I think its strange, there is this test that tests the string repr of Option[string], and there it is obvious that the string isn't quoted, but nothing has been done about this |
16:06:59 | Araq | $ used to not quote, now it does |
16:07:17 | Araq | previously it was consistent, than we patched it and forgot options.nim :P |
16:07:22 | FromGitter | <kaushalmodi> krux02: https://github.com/kaushalmodi/strfmt/commit/d25e175dc35098b653aec33b151b252699fe36c2 |
16:07:48 | FromGitter | <kaushalmodi> `nimble test` passes |
16:09:19 | krux02 | kaushalmodi: ``if arysep == '\t': sep = '\t' `` really? |
16:09:42 | FromGitter | <kaushalmodi> sorry :P |
16:09:49 | FromGitter | <kaushalmodi> I just wanted to get back to work |
16:11:39 | krux02 | how about: if fmt.arysep.len <= 1: sep = fmt.arysep else: ... |
16:12:07 | FromGitter | <kaushalmodi> you'd also need to handle the len==0 case separately |
16:12:11 | krux02 | well, sorry no that doesn't work |
16:12:16 | FromGitter | <kaushalmodi> it's an if..elif..else construct |
16:12:36 | FromGitter | <kaushalmodi> so what I did worked the best after trying few hasty optimization |
16:12:57 | krux02 | yes, but the "\t" case isn't a special case anymore |
16:13:27 | FromGitter | <kaushalmodi> it's the default case now |
16:13:47 | FromGitter | <kaushalmodi> so if it is already `\t`, the else: block shouldn't be entered |
16:14:03 | krux02 | I mean it will be handled by the else branch |
16:14:24 | * | Vladar joined #nim |
16:14:27 | * | Jesin quit (Remote host closed the connection) |
16:14:51 | FromGitter | <kaushalmodi> I tried removing the \t case altogether, but fails the "arrays of arrays" test |
16:14:51 | krux02 | I even think the fmt.arysep.len == 0 is the same on the else branch |
16:14:59 | FromGitter | <kaushalmodi> I did not have time to investigate it further |
16:15:27 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b75a31f988005174eea2be2] |
16:15:42 | krux02 | well year for me the code smells a lot |
16:15:45 | krux02 | but it's not my code |
16:16:33 | FromGitter | <kaushalmodi> Not mine either, but the original dev knew a lot more Nim than I do. I'm just trying to keep that library alive |
16:17:57 | krux02 | are you sure this test is correct: ``[[1, 2, 3], [4, 5, 6]].format("") == "1\t2\t3\t4\t5\t6"``? |
16:18:26 | krux02 | I don't think so |
16:18:49 | * | natrys joined #nim |
16:22:13 | FromGitter | <kaushalmodi> krux02: No idea.. that test was already there.. so was there by design I suppose? |
16:23:09 | krux02 | pleas think |
16:23:17 | * | Caraway22 joined #nim |
16:24:45 | * | Caraway22 quit (K-Lined) |
16:25:21 | * | tersec_ quit (Read error: Connection reset by peer) |
16:30:23 | FromGitter | <kaushalmodi> hmm.. yeah, empty format should have produced `$` representation of the input. |
16:30:35 | FromGitter | <kaushalmodi> This library was written before the `$` got improved |
16:31:04 | FromGitter | <kaushalmodi> Earlier `echo [1, 2, 3]` produced `"123"`. |
16:31:25 | FromGitter | <kaushalmodi> So the original strfmt probably wanted to make it better by spacing out the array elements |
16:31:31 | FromGitter | <kaushalmodi> using `\t` |
16:31:38 | miran | it produced an error, IIRC |
16:32:00 | FromGitter | <kaushalmodi> Yeah, don't remember the details |
16:32:02 | miran | you couldn't echo an array (again, IIRC) |
16:32:11 | FromGitter | <kaushalmodi> but all I know was that echo was unusable for arrays, seqs |
16:33:51 | FromGitter | <kaushalmodi> sorry, I take that back. The issue was something else |
16:34:27 | FromGitter | <kaushalmodi> I meant this issue: https://github.com/nim-lang/Nim/issues/6225 but it's a different thing |
16:35:32 | FromGitter | <kaushalmodi> So.. in Python empty `format` uses the object `__repr__`. Here the original author for some reason thought of depicting array elements as tab-separated, which isn't accurate either. |
16:35:44 | FromGitter | <kaushalmodi> I'll open an issue on my fork to track this. |
16:36:57 | FromGitter | <kaushalmodi> For anyone interested, fixing this: https://github.com/kaushalmodi/strfmt/issues/4 is up for grabs :D |
16:44:48 | * | Jesin joined #nim |
16:50:47 | FromGitter | <kaushalmodi> May be a simple options example like this is useful in the stdlib docs? https://scripter.co/notes/nim/#nil-string |
17:04:24 | * | seni joined #nim |
17:06:34 | * | cspar joined #nim |
17:06:40 | * | Trustable quit (Remote host closed the connection) |
17:09:37 | * | cryptocat1094 quit (Ping timeout: 260 seconds) |
17:11:26 | * | cryptocat1094 joined #nim |
17:12:00 | * | natrys quit (Quit: natrys) |
17:12:40 | * | hvxgr6 joined #nim |
17:14:59 | * | gamma7 joined #nim |
17:15:18 | * | Algernop15 joined #nim |
17:16:52 | * | hvxgr6 quit (Killed (Unit193 (Spam is not permitted on freenode.))) |
17:19:03 | * | Algernop15 quit (Remote host closed the connection) |
17:19:35 | * | gamma7 quit (Remote host closed the connection) |
17:22:26 | * | musician_pro joined #nim |
17:23:07 | * | musician_pro quit (Remote host closed the connection) |
17:37:33 | * | vosper joined #nim |
17:40:56 | * | cryptocat1094 quit (Quit: WeeChat 2.2) |
17:41:08 | * | cryptocat1094 joined #nim |
17:42:12 | * | johtso joined #nim |
17:42:13 | * | johtso quit (Remote host closed the connection) |
17:44:49 | * | berndj11 joined #nim |
17:44:53 | * | berndj11 quit (Remote host closed the connection) |
17:46:50 | * | Vladar quit (Remote host closed the connection) |
17:48:28 | * | francisl quit (Quit: francisl) |
18:01:49 | * | francisl joined #nim |
18:10:34 | FromGitter | <mratsim> @miran, you can echo an array since about 6 months ago |
18:10:58 | miran | i know it is doable now, but i remember it was not before |
18:12:48 | FromGitter | <kaushalmodi> @mratsim Yes, we were thinking of that time before 6 months :) |
18:13:02 | FromGitter | <kaushalmodi> the `strfmt` was created a couple of years back |
18:27:07 | stefanos82 | if I'm not mistaken, strfmt got replaced with strformat |
18:28:57 | FromGitter | <kaushalmodi> *here we go again*.. :) |
18:29:15 | FromGitter | <kaushalmodi> stefanos82: I have brief description here.. https://scripter.co/notes/nim/#strfmt |
18:30:41 | stefanos82 | so, basically strfmt is Python's str.format() whereas strformat is Python's 3.6 f-string |
18:31:32 | FromGitter | <kaushalmodi> Yes. Purists will say that that's not a correct comparison. But I see that comparison as pretty good. |
18:33:21 | stefanos82 | then strfmt and strfomat should get first merged to strformatter and then deprecate the aforementioned modules in favor of the new one |
18:36:23 | FromGitter | <mratsim> strfmt is user lib. No need to introduce yet another name/deprecation path. |
18:36:34 | FromGitter | <mratsim> we can just use strformat. |
18:37:15 | shashlick | do we have any support for forward declaration of objects? |
18:37:22 | FromGitter | <mratsim> yes |
18:37:56 | FromGitter | <mratsim> if they are declared in the same type section |
18:39:16 | FromGitter | <mratsim> if you have type declaration issues the usual way to solve it is by having a types.nim/datatypes.nim file with all types that you will use. |
18:43:11 | shashlick | uhm, that's hard when you are wrapping stuff and using nimgen to do the manipulations 😞 |
18:46:10 | * | natrys joined #nim |
18:46:38 | Araq | shashlick, {.reorder: on.} helps with wrappers |
18:50:22 | * | jxy quit (Quit: leaving) |
18:54:17 | shashlick | ya I was looking for that |
18:54:44 | shashlick | let me try - am playing with libui to see how feasible it is |
18:55:34 | * | yglukhov[i] joined #nim |
19:00:30 | shashlick | it worked! |
19:00:33 | * | yglukhov[i] quit () |
19:11:45 | * | Vladar joined #nim |
19:11:50 | shashlick | anyone seen this before: ui.nim(1, 2) Error: implementation of 'ui' expected |
19:11:58 | shashlick | line 1 is "import strutils" |
19:13:48 | * | natrys quit (Ping timeout: 256 seconds) |
19:16:33 | * | nsf joined #nim |
19:16:57 | * | francisl quit (Quit: francisl) |
19:17:52 | * | francisl joined #nim |
19:23:08 | * | rokups quit (Quit: Connection closed for inactivity) |
19:24:06 | * | HarryS22 joined #nim |
19:24:46 | * | HarryS22 quit (Remote host closed the connection) |
19:26:12 | * | natrys joined #nim |
19:43:12 | shashlick | okay totally stuck with this - any tips appreciated ^^ |
19:48:06 | thor77 | shashlick: where do you expect "ui" to come from? |
19:48:13 | thor77 | ah |
19:48:13 | thor77 | uh |
19:48:15 | thor77 | nvm |
19:49:00 | shashlick | here's a gist of ui.nim: https://gist.github.com/genotrance/eef3c4965cd1230ed3b1c884817067ca |
19:54:37 | * | S1tiSchu joined #nim |
19:56:23 | * | PMunch joined #nim |
20:04:36 | * | zachk joined #nim |
20:05:48 | zachk | can I run nim as a repl / interpreter? |
20:07:01 | * | vivus joined #nim |
20:07:10 | * | miran_ joined #nim |
20:08:27 | * | miran quit (Ping timeout: 240 seconds) |
20:09:29 | * | cryptocat10941 joined #nim |
20:09:36 | * | cryptocat10941 quit (Client Quit) |
20:10:00 | * | cryptocat10941 joined #nim |
20:10:41 | * | cryptocat1094 quit (Disconnected by services) |
20:11:09 | * | cryptocat10941 is now known as cryptocat1094 |
20:18:41 | FromGitter | <mratsim> @zachk: https://github.com/AndreiRegiani/INim |
20:20:04 | FromGitter | <zetashift> oh wow I thought that was an old non-working repl |
20:22:03 | * | francisl quit (Quit: francisl) |
20:23:07 | FromGitter | <Clyybber> Araq Can cstrings still be nil? |
20:23:40 | * | nsf quit (Quit: WeeChat 2.2) |
20:28:36 | PMunch | zachk, you can try "nim secret" :) |
20:29:53 | * | noonien quit (Quit: Connection closed for inactivity) |
20:30:29 | * | Tools21 joined #nim |
20:30:33 | PMunch | zacharycarter[m], is it possible to run a "headless" version of the playground? |
20:30:48 | PMunch | ie. just have the /compile thing but not the web-page |
20:30:52 | PMunch | Or better yet run it locally |
20:33:39 | * | Tools21 quit (Remote host closed the connection) |
20:37:05 | krux02 | Clyybber |
20:37:07 | krux02 | yes |
20:37:09 | krux02 | they can |
20:37:22 | FromGitter | <Clyybber> Ok thx |
20:37:25 | * | Vladar quit (Remote host closed the connection) |
20:37:44 | krux02 | you can see cstrings just as an alias for ptr char |
20:37:52 | Araq | shashlick, it's weird indeed |
20:41:02 | Araq | but PLEASE use c2nim's --nep1 switch |
20:41:47 | * | PMunch quit (Quit: leaving) |
20:51:26 | * | francisl joined #nim |
20:57:06 | * | cryptocat1094 quit (Quit: WeeChat 2.2) |
20:58:40 | * | miran_ quit (Ping timeout: 268 seconds) |
21:00:22 | shashlick | okay I'll try that, that will be needed anyway to keep compatibility with your work |
21:00:29 | shashlick | intention is for this to be a dropin replacement |
21:12:30 | * | seni quit (Quit: Leaving) |
21:23:35 | * | pwntus quit (Ping timeout: 240 seconds) |
21:23:55 | * | pwntus joined #nim |
21:27:42 | * | francisl quit (Quit: francisl) |
21:27:51 | * | vosper quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:30:56 | * | sparr26 joined #nim |
21:30:59 | * | Jesin quit (Remote host closed the connection) |
21:32:18 | shashlick | araq: ok, using --nep1 now but still same error if imported, if I compile ui.nim directly, it works fine |
21:33:07 | * | Jesin joined #nim |
21:38:03 | * | sparr26 quit (Ping timeout: 260 seconds) |
21:44:34 | shashlick | araq: okay, I manually fixed up the forward declarations and removed {.reorder: on.} and now the implementation error went away |
21:46:35 | shashlick | so the issue is {.reorder: on.} causing import errors - does that help in any way? |
21:55:37 | * | vosper joined #nim |
21:58:50 | Araq | sure thanks. |
21:59:01 | Araq | disappointing too, quite some testing went into this feature... |
21:59:14 | shashlick | will open a defect with a simpler example if possible |
21:59:36 | shashlick | but for now, will have to figure out how to reorder all these types in nimgen |
22:13:31 | shashlick | https://github.com/nim-lang/Nim/issues/8665 |
22:14:46 | * | BitPuffin quit (Ping timeout: 260 seconds) |
22:24:40 | * | ketas14 joined #nim |
22:25:19 | * | ketas14 quit (Remote host closed the connection) |
22:25:19 | FromGitter | <kayabaNerve> I love Nim secret for testing features/helping people on Gitter... |
22:25:26 | FromGitter | <kayabaNerve> krux02 I had a message for you the other day |
22:26:22 | FromGitter | <kayabaNerve> No idea if you got |
22:26:34 | FromGitter | <kaushalmodi> so "nim secret" is repl? |
22:26:38 | FromGitter | <kayabaNerve> @kaushalmodi Yes |
22:26:50 | FromGitter | <kayabaNerve> Damn it. krux02 was on two hours ago lol. Thought that was more recent |
22:27:10 | FromGitter | <kayabaNerve> What even is the reorder pragma? It's not in the manual... |
22:30:14 | FromGitter | <kaushalmodi> About nim secret.. wonder why it's kept secret |
22:30:27 | FromGitter | <kaushalmodi> It's in the docs but commented out.. it seems: https://github.com/nim-lang/Nim/blob/1ef32dad8090f0a6c85026a10ec362ce6c6cfe98/doc/nimc.rst#L484-L498 |
22:30:42 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b75fb12dd0b74601e19df89] |
22:31:04 | * | K0HAX17 joined #nim |
22:31:11 | FromGitter | <kayabaNerve> Because it's unstable? |
22:31:37 | * | natrys quit (Quit: natrys) |
22:31:56 | shashlick | @kabayaNerve: it allows for forward declaration of types - not in the manual yes |
22:32:03 | shashlick | been around since 0.17.2 at least |
22:32:43 | FromGitter | <kayabaNerve> Got it. Good to know. |
22:32:48 | FromGitter | <kayabaNerve> Thanks shashlick |
22:33:07 | shashlick | but doesn't work in imports 😞 |
22:33:27 | shashlick | trusting araq, it will be fixed in a day 😄 |
22:33:28 | FromGitter | <kayabaNerve> ... so like 95% of Nim code? |
22:33:29 | FromGitter | <kayabaNerve> :P |
22:34:09 | FromGitter | <kayabaNerve> Seems interesting; I trust it will be fixed; I'm surprised this wasn't found way earlier |
22:34:17 | * | K0HAX17 quit (Remote host closed the connection) |
22:35:26 | AlexMax | oh snap |
22:35:28 | AlexMax | a REPL |
22:35:33 | AlexMax | never knew that |
22:43:31 | AlexMax | Surely it's nim and not nimscript... |
22:44:17 | AlexMax | lib\impure\re.nim(104, 3) Error: undeclared identifier: 'copyMem' |
22:44:22 | AlexMax | guess it is |
22:44:24 | AlexMax | still, cool |
22:44:38 | FromGitter | <kayabaNerve> It is Nim |
22:44:56 | AlexMax | oh, then why couldn't I import re? |
22:46:33 | * | deech joined #nim |
22:47:45 | deech | Is it possible to statically introspect on an identifier and figure out if it is immutable, i.e assigned with `let`? |
22:48:02 | shashlick | @AlexMax: are you talking of `nim secret` |
22:48:55 | Araq | deech, it's possible but useless |
22:49:35 | deech | Araq: why is it useless? |
22:50:28 | AlexMax | Yes |
22:50:51 | Araq | because no known useful applications are known |
22:52:16 | shashlick | @AlexMax: then its because it is running your code in the VM so while it is nim, its a limited subset |
22:52:36 | AlexMax | oh....so the limited subset of nim that runs in the VM and nimscript are not the same thing? |
22:54:28 | Araq | they are. |
22:56:25 | AlexMax | That's what I thought |
22:57:20 | AlexMax | Is importc in nimscript an impossibility, or just incredibly hard, something for later? |
22:57:48 | Araq | I implemented it twice |
22:58:34 | Araq | it always "kinda" works but I don't need yet-another imense attack surface for my poor compiler |
22:59:39 | shashlick | https://bintray.com <= seems like a good option to store nim nightly builds |
23:02:11 | FromGitter | <kayabaNerve> Araq is nim secret nim script? |
23:02:33 | AlexMax | It must be |
23:02:35 | FromGitter | <kayabaNerve> Because that wasn't directly declared and I would like to confirm that |
23:03:19 | AlexMax | You can't import an impure library like re |
23:03:29 | Araq | yes, it is |
23:03:47 | FromGitter | <kayabaNerve> Got it. Thanks |
23:07:37 | krux02 | kayabaNerve I am back online and I got your message |
23:07:56 | FromGitter | <kayabaNerve> Great :P |
23:09:42 | AlexMax | Hrm, nim seems to take a second or two to "Process" ospaths or glm, can't figure out which |
23:09:59 | AlexMax | There's a noticable delay every time I hit compile |
23:10:38 | AlexMax | The C compiler itself seems almost lightning fast, by contrast |
23:11:59 | AlexMax | Also, wow, 0.19 is coming very soon, yay! |
23:13:48 | Araq | don't hold your breath, regressions and showstoppers are quite a few |
23:22:31 | krux02 | Araq: it is green now: https://github.com/nim-lang/Nim/pull/8659 |
23:24:58 | krux02 | yay, thank you |
23:30:04 | * | vosper quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
23:31:10 | FromGitter | <arnetheduck> @Araq @krux02 since there's now an Option type in nim, I could submit Result as well if there's interest? https://github.com/arnetheduck/nim-result/pull/1/files |
23:31:57 | * | vosper joined #nim |
23:32:11 | zachk | Error: tabulators are not allowed, what does this mean? |
23:33:33 | * | shashlick quit (Remote host closed the connection) |
23:33:40 | * | vivus quit (Quit: Leaving) |
23:35:59 | zachk | oh no tabs |
23:36:02 | zachk | :) |
23:36:18 | * | vivus joined #nim |
23:45:24 | * | krux02 quit (Remote host closed the connection) |
23:51:17 | * | zachk quit (Quit: Leaving) |
23:59:02 | * | vosper quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |