00:03:37 | FromDiscord | <Spy653> Anyways it's been good talking to you all but I'm off to bed :) |
00:03:53 | FromDiscord | <exelotl> cya |
00:09:05 | FromDiscord | <Elegant Beef> my terminal now terminals |
00:09:05 | FromDiscord | <Elegant Beef> https://streamable.com/347l8 |
00:15:18 | disruptek | QUIT TOUCHING YOUR FACE |
00:16:48 | * | krux02_ joined #nim |
00:17:14 | * | filcuc quit (Quit: Konversation terminated!) |
00:18:39 | * | couven92 quit (Quit: Client Disconnecting) |
00:19:07 | * | krux02 quit (Ping timeout: 240 seconds) |
00:19:24 | FromDiscord | <Elegant Beef> But that's not fun |
00:19:54 | FromDiscord | <Elegant Beef> Lick the bathroom clean is the only way to live |
00:23:59 | FromDiscord | <Rika> but can it ansi code |
00:25:05 | FromDiscord | <Elegant Beef> I mean it's parsing colour codes there |
00:26:20 | leorize | I hate to say it, but your colorscheme is terrible |
00:26:40 | FromDiscord | <Elegant Beef> Thats imgui's theme |
00:26:42 | FromDiscord | <Elegant Beef> Dont blame me |
00:27:09 | FromDiscord | <Elegant Beef> Unless you mean the ansi parsed stuff |
00:27:13 | FromDiscord | <Elegant Beef> That's pretty atrocious |
00:31:07 | * | silvernode quit (Ping timeout: 265 seconds) |
00:32:06 | FromDiscord | <Elegant Beef> i did just go blue = 0,0,.5 and light = 0,0,1 |
00:32:16 | FromDiscord | <Elegant Beef> i have/had no regard to the actual colour |
00:36:35 | FromDiscord | <Rika> support all VT100 sequences then your terminal is terminaling right π |
00:36:46 | FromDiscord | <Rika> www.termsys.demon.co.uk/vtansi.htm |
00:37:05 | FromDiscord | <Rika> not the whole list but eh idk where the whole lists are |
00:37:34 | FromDiscord | <Elegant Beef> Well i mean im using imgui so it's going to be a pain to get things working |
00:37:56 | FromDiscord | <Rika> twas your choice to use that |
00:38:17 | FromDiscord | <Elegant Beef> Well the reason im using it is so i can make a terminal that isnt just text based |
00:40:03 | dadada | -f rebuilds everything, is there a way to only force the reexpansion of macros? |
00:41:47 | leorize | no |
00:41:59 | FromDiscord | <Rika> you need to recompile to re-expand |
00:42:18 | leorize | are you having problems with your macros? |
00:42:36 | leorize | as long as you change something nim should pick up and recompile only what changed |
00:42:42 | * | krux02_ quit (Remote host closed the connection) |
00:43:11 | dadada | nothing I couldn't solve, but I'm feeding random data into my macros to test them |
00:43:33 | dadada | so each time the program runs the result can be different |
00:43:49 | dadada | but I don't see the debug output of the macro unless I change something about the macros |
00:45:20 | dadada | expandMacros macro should IMO predictably output the expanded macros, but it only does when the macro is compiled |
00:46:06 | * | s4mu3lbk quit (Ping timeout: 265 seconds) |
01:00:12 | dadada | expandMacros macro should IMO predictably output the expanded macros, but it only does when the macro is compiled |
01:00:22 | dadada | sry, wrong window |
01:03:35 | FromDiscord | <Rika> lmao |
01:03:48 | FromDiscord | <Rika> did you arrowup enter? |
01:05:35 | * | gangstacat quit (Quit: Δis!) |
01:07:32 | * | gangstacat joined #nim |
01:09:02 | * | okcy joined #nim |
01:22:50 | * | okcy quit (Ping timeout: 240 seconds) |
01:23:04 | * | okcy joined #nim |
01:29:24 | FromDiscord | <flywind> \ |
01:40:48 | * | okcy quit (Ping timeout: 255 seconds) |
01:41:29 | * | NimBot joined #nim |
01:42:02 | * | okcy joined #nim |
01:55:11 | * | okcy quit (Remote host closed the connection) |
01:55:55 | * | okcy joined #nim |
02:06:49 | * | dwdv quit (Ping timeout: 265 seconds) |
02:10:04 | blackbeard420 | can you await a flowvar from spawn? |
02:10:18 | leorize | not yet |
02:10:31 | leorize | rayman22201 is working on that |
02:14:41 | blackbeard420 | whats the best way to spawn off a task and have it notify the eventloop when its done, until awaiting a flowvar is possible? |
02:28:30 | * | okcy quit (Ping timeout: 256 seconds) |
02:29:05 | * | okcy joined #nim |
02:29:22 | * | theelous3 quit (Ping timeout: 255 seconds) |
02:44:11 | * | endragor joined #nim |
02:52:06 | * | chemist69 quit (Ping timeout: 240 seconds) |
02:54:19 | * | chemist69 joined #nim |
02:56:33 | * | okcc joined #nim |
02:57:41 | rayman22201 | @blackbeard420: you need to use future and asyncevent manually. See here for an example: https://github.com/nim-lang/Nim/issues/11564#issuecomment-539317277 |
02:57:44 | disbot | β₯ asyncfile.readline blocks (and behaves differently between Linux and MacOS) ; snippet at 12https://play.nim-lang.org/#ix=2dRf |
03:02:14 | * | okcc quit (Ping timeout: 258 seconds) |
03:02:52 | * | okcc joined #nim |
03:04:39 | * | leorize quit (Quit: WeeChat 2.7.1) |
03:11:20 | * | muffindrake quit (Ping timeout: 256 seconds) |
03:13:14 | * | muffindrake joined #nim |
03:21:47 | * | dadada quit (Ping timeout: 258 seconds) |
03:23:02 | * | dadada joined #nim |
03:23:26 | * | dadada is now known as Guest71263 |
03:33:58 | * | okcc quit (Remote host closed the connection) |
03:34:36 | * | okcc joined #nim |
03:34:36 | * | rockcavera quit (Remote host closed the connection) |
03:36:02 | * | leorize joined #nim |
04:00:03 | * | okcy quit (Remote host closed the connection) |
04:00:19 | * | okcy joined #nim |
04:02:04 | * | okcc quit (Ping timeout: 255 seconds) |
04:02:16 | FromGitter | <Varriount> Reading from the console is always tricky (asynchronously moreso). Especially if you want to support Windows, since Windows represents the console as its own set of APIs |
04:19:46 | * | jholland__ quit (Quit: Connection closed for inactivity) |
04:29:09 | * | nsf joined #nim |
04:46:53 | * | hax-scramper quit (Ping timeout: 268 seconds) |
04:50:17 | * | hax-scramper joined #nim |
04:53:17 | * | hax-scramper quit (Read error: Connection reset by peer) |
04:54:01 | * | hax-scramper joined #nim |
05:15:05 | * | Guest71263 is now known as dadada |
05:15:51 | * | hax-scramper quit (Read error: Connection reset by peer) |
05:15:55 | dadada | what is this good for? the README lacks details... it's debugging macro written in nim, has anyone used it here? https://github.com/jyapayne/butterfly |
05:16:13 | * | hax-scramper joined #nim |
05:21:29 | leorize | seems old |
05:21:34 | leorize | probably no one used it |
05:36:07 | * | hax-scramper quit (Read error: Connection reset by peer) |
05:36:21 | * | hax-scramper joined #nim |
05:40:13 | * | hax-scramper quit (Read error: Connection reset by peer) |
05:40:21 | * | hax-scramper joined #nim |
05:41:12 | * | hax-scramper quit (Read error: Connection reset by peer) |
05:42:04 | * | hax-scramper joined #nim |
05:42:59 | * | hax-scramper quit (Read error: Connection reset by peer) |
05:43:13 | * | hax-scramper joined #nim |
05:49:28 | * | hax-scramper quit (Read error: Connection reset by peer) |
05:49:43 | * | hax-scramper joined #nim |
05:53:29 | * | hax-scramper quit (Read error: Connection reset by peer) |
05:53:41 | * | hax-scramper joined #nim |
05:55:06 | * | hax-scramper quit (Read error: Connection reset by peer) |
05:55:23 | * | hax-scramper joined #nim |
06:00:02 | * | silvernode joined #nim |
06:00:05 | * | hax-scramper quit (Read error: Connection reset by peer) |
06:00:21 | * | hax-scramper joined #nim |
06:00:48 | silvernode | Someone told me there was one main Lisp book that I should read and I can't remember what it was called. |
06:02:19 | * | hax-scramper quit (Read error: Connection reset by peer) |
06:02:31 | * | hax-scramper joined #nim |
06:03:07 | silvernode | I think it was called "practical common lisp" |
06:05:25 | * | hax-scramper quit (Read error: Connection reset by peer) |
06:05:36 | * | hax-scramper joined #nim |
06:09:07 | * | fanta1 joined #nim |
06:09:08 | * | hax-scramper quit (Read error: Connection reset by peer) |
06:09:24 | * | hax-scramper joined #nim |
06:10:21 | * | hax-scramper quit (Read error: Connection reset by peer) |
06:10:36 | * | hax-scramper joined #nim |
06:14:28 | * | narimiran joined #nim |
06:14:44 | * | hax-scramper quit (Read error: Connection reset by peer) |
06:16:56 | * | hax-scramper joined #nim |
06:21:27 | * | hax-scramper quit (Read error: Connection reset by peer) |
06:21:41 | * | hax-scramper joined #nim |
06:27:37 | vegai | http://www.gigamonkeys.com/book/ yep |
06:27:45 | vegai | it's convenient since it's freely available |
06:27:48 | vegai | and also pretty good |
06:31:36 | lain | new to nim, pls be gentle. trying to do a quick test of crossbuild: aarch64 target, x86_64 host. using 'nim cc --cpu=arm64 --os:standalone test.nim' produces an x86_64 elf. creating a nim.cfg that sets arm64.standalone.gcc.exe and arm64.standalone.linkerexe to "aarch64-elf-gcc" calls the correct compiler, but passes '-march=x86_64'. what am I doing wrong? |
06:32:43 | * | okcy quit (Remote host closed the connection) |
06:33:02 | * | okcy joined #nim |
06:33:48 | lain | related: is the nim.cfg file documented anywhere? I wasn't able to find anything |
06:35:33 | FromDiscord | <Elegant Beef> https://nim-lang.org/docs/nimc.html#compiler-usage-configuration-files |
06:36:06 | FromDiscord | <Elegant Beef> From my understanding it's just all your compile parameters in a neat package |
06:41:25 | lain | thanks, unfortunately that doesn't explain the contents of .cfg files :o |
06:42:56 | * | narimiran_ joined #nim |
06:43:19 | * | narimiran quit (Ping timeout: 260 seconds) |
06:44:47 | lain | taking a hint from the Nintendo Switch section of the global nim.cfg, I tried setting gcc.options.linker to "-g -march=armv8-a -mtune=cortex-a53", and this does indeed get passed to aarch64-elf-gcc .... along with -march=x86_64 >.< |
06:45:14 | lain | I wasn't able to easily find what is generating that -march=x86_64 in the linker command line |
06:48:31 | FromDiscord | <Varriount> Lain: I believe that there's a compiler switch used for the architecture |
06:49:18 | FromDiscord | <Varriount> Is there anything in the full help output from the compiler mentioning targets? |
06:50:53 | lain | Varriount: all I see is --cpu, which I am setting to --cpu:arm64 |
06:51:13 | FromDiscord | <Varriount> Hm |
06:53:38 | FromDiscord | <Varriount> Lain: How are you discovering what arguments Nim is passing to the compiler? |
06:53:56 | lain | Varriount: --listCmd |
06:55:55 | * | s4mu3lbk joined #nim |
06:57:22 | FromDiscord | <Varriount> Huh, nowhere in the repository can I find a reference for march (aside from the configuration file) or x86_64 |
06:57:30 | lain | likewise |
06:57:35 | lain | Varriount: here is the output of 'nim cc -f --cpu:arm64 --os:standalone --listCmd test.nim': https://termbin.com/ao2s |
06:58:02 | lain | that's without a custom nim.cfg for the project, so it's using gcc instead of aarch64-elf-gcc, but, the same problem applies: I'm telling it --cpu:arm64 and it's passing -march=x86-64 |
06:58:07 | lain | ah, I |
06:58:28 | lain | oops. ah, I just noticed I had been typing x86_64, but the argument it passes is in fact x86-64 (dash, not underscore, whoops!) |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:01:32 | FromDiscord | <Varriount> Can you post the custom config? |
07:03:34 | FromDiscord | <Varriount> lain: ^ |
07:04:28 | * | gmpreussner joined #nim |
07:06:29 | lain | Varriount: sorry about that. sure, here's the basic one I've been testing with: https://termbin.com/2khk |
07:06:51 | * | okcy quit (Remote host closed the connection) |
07:06:54 | lain | running the build with that file present, here is the output: https://termbin.com/6fjz |
07:07:17 | * | okcy joined #nim |
07:13:14 | FromDiscord | <Varriount> Lain: is it possible those arguments are being added by the C compiler somehow? I don't see any references in the compiler to D_FORTIFY_SOURCE either |
07:14:41 | lain | Varriount: good question. I doubt it since it's aarch64-elf-gcc ? not sure how to verify though |
07:17:23 | FromDiscord | <Varriount> Hm, I'd be interested to know where listcmd is being checked for |
07:17:46 | FromDiscord | <Varriount> Like, where in the compiler source commands are printed |
07:21:42 | lain | looks like compiler/commands.nim sets optListCmd if --listCmd is present, and that is checked in compiler/extccomp.nim |
07:22:49 | FromDiscord | <Varriount> Thanks I'm currently on my phone, so searching the compiler code is not quite straightforward |
07:23:01 | lain | :3 |
07:27:59 | FromDiscord | <Varriount> My best guess is that either the C compiler is adding arguments, or the Nim compiler is pulling them from somewhere (environment variables?) |
07:32:18 | * | Vladar joined #nim |
07:33:28 | * | PMunch joined #nim |
07:34:16 | lain | ok it looks like compiler/extccomp.nim defines compiler gcc, in that it sets compileTmpl to "-c $options $include -o $objfile $file" |
07:38:32 | lain | and it sets $options to the contents of an 'options' variable... which is... var options = cFileSpecificOptions(conf, cfile.nimname, cfile.cname.changeFileExt("").string) |
07:44:49 | PMunch | Hmm, I noticed some old wording in the deques module and starting poking around in it a bit (mostly to see if I could make it not require initialisation). And it has some weird stuff in it |
07:45:38 | PMunch | Like this for example: https://github.com/nim-lang/Nim/blob/devel/lib/pure/collections/deques.nim#L73-L76 |
07:46:11 | PMunch | `when compiles(defaultInitialSize)`, default initial size is a const set to 4, why would that not compile? |
07:47:39 | PMunch | Ooh, someone has already been poking at this in devel |
07:54:15 | PMunch | Aaah, Zevv just copied parts of the implementation from `tableimpl`. But `tableimpl` doesn't have a `defaultInitialSize` constant, it is defined in `tables` which include `tableimpl`. So that check in `tableimpl` is to see if the constant exists (should this be `when declared(defaultInitialSize)` instead?), but for `deques` it doesn't really make much sense since it's declared in the same file. |
07:55:24 | PMunch | And should it possibly warn if it isn't declared? |
07:58:02 | * | kungtotte quit (Ping timeout: 240 seconds) |
07:58:43 | Zevv | dont blame me. I proposed something completely diffeent but that got vetoed and I was told to do it like this |
07:58:58 | Zevv | "git dontblameme" |
07:59:14 | PMunch | Haha, yeah I looked at the issue |
07:59:41 | Zevv | that said; Im not sure if my original idea was any better, though :) |
07:59:51 | Zevv | but it is indeed a bit funny |
08:00:47 | Zevv | I think I ran into that again my self later but didnt realize. I tried to run tables stuff on the atmel thingy but that failed becauqse tables get initialized with 64 element or so |
08:00:50 | PMunch | Since you forced pushed your branch (shame!) I can't see what your original implementation was |
08:00:51 | Zevv | which blew up my heap |
08:00:52 | lain | ah, figured it out. at the end of the global nim.cfg it does 'gcc.options.always %= "-march=x86-64 ..."', and that seems to apply even if my project config sets gcc.options.always to something else |
08:01:27 | Zevv | PMunch: I always force push people shame me about. essential part of keeping ones reputation high |
08:01:45 | PMunch | Haha, yeah it should really be an `intdefine` so it could be passed as a compiler option |
08:01:47 | Zevv | commit+normal push for good, amend+force push for bad |
08:02:31 | PMunch | But now I can't go back to look at your implementation to see if it was better or not? |
08:02:39 | Zevv | I even got my whole company to do a hard resync once by making up some lame excuse about a new git version or something, just to get rid of emberrasing history |
08:02:39 | PMunch | s/?/! |
08:02:51 | PMunch | Hahaha :P |
08:03:06 | Zevv | did you never notice how there are no bugs reported ever in npeg? |
08:03:24 | Zevv | but about the tables, is there still a problem now in the current implementation? |
08:03:38 | PMunch | "We've always been at war with Eurasia!" |
08:03:47 | Zevv | *always* |
08:05:41 | PMunch | Oh no, I was just looking at the deques module documentation online (the one that's released for 1.0.6) and noticed that it mentioned that -d:release disabled boundschecks. Which haven't been the case for a while, so I tested to see if deques would auto-initialise, and they don't in 1.0.6. So I decided to have a peek at the code to see if anything could be done to improve it. |
08:06:09 | * | kungtotte joined #nim |
08:06:18 | PMunch | Then I noticed that it had been updated from 1.0.6 to devel and the auto-initialise thing was fixed, but the docs are still bad. So I'm fixing up the docs now |
08:08:37 | Zevv | ah good! |
08:08:47 | Zevv | yeah afaik all of the stdlib should auto init by now |
08:12:20 | PMunch | "Should" as in everything is implemented to do this, or "should" as in we should try to implement everything to do this? |
08:13:36 | FromDiscord | <Varriount> The latter |
08:16:45 | PMunch | Ah |
08:18:04 | * | lritter joined #nim |
08:18:38 | PMunch | Hmm, how do I run the tests for a module again? |
08:19:15 | FromDiscord | <Varriount> PMunch: Compile the module and run it? |
08:19:31 | FromDiscord | <Varriount> Testament might have an option too |
08:23:05 | * | dddddd quit (Ping timeout: 258 seconds) |
08:23:52 | FromDiscord | <Varriount> Hm, is it actually possible to make a data type containing references act like a sequence/string with regards to copy-on-assignment? |
08:25:24 | PMunch | Hmm, not very extensive testing of this module :P |
08:26:18 | leorize | Varriount: deepCopy()? |
08:29:39 | * | okcy quit (Remote host closed the connection) |
08:29:53 | * | okcy joined #nim |
08:31:36 | PMunch | Hmm, why isn't Nim able to cast this int over to a Natural? https://play.nim-lang.org/#ix=2dRO |
08:33:26 | Araq | Varriount: yeah via overloading of '=' |
08:33:26 | * | sammich quit (Ping timeout: 256 seconds) |
08:33:52 | PMunch | Even stranger, in this case it isn't able to convert the other int literal to an int: https://play.nim-lang.org/#ix=2dRP |
08:33:58 | Araq | https://www.twitch.tv/araq4k we're about to stream |
08:34:08 | Araq | today's topic: ARC bugfixing |
08:34:16 | * | narimiran_ is now known as narimiran |
08:35:12 | PMunch | Uhm, this is completely broken: https://play.nim-lang.org/#ix=2dRQ |
08:36:16 | * | okcy quit (Remote host closed the connection) |
08:36:36 | * | okcy joined #nim |
08:38:35 | * | sammich joined #nim |
08:38:45 | * | s4mu3lbk quit (Ping timeout: 268 seconds) |
08:40:12 | * | s4mu3lbk joined #nim |
08:40:36 | PMunch | Am I doing something wrong there? That should work right? |
08:43:44 | PMunch | Hmm, the deque module also have these: proc `[]`*[T](deq: var Deque[T], i: Natural): var T {.inline.} does that make any sense? |
08:46:02 | PMunch | I mean it doesn't really work.. https://play.nim-lang.org/#ix=2dRS |
08:52:57 | * | fanta1 quit (Quit: fanta1) |
08:54:06 | * | fanta1 joined #nim |
08:57:13 | PMunch | https://github.com/nim-lang/Nim/issues/13618 |
08:57:16 | disbot | β₯ Range types don't work with `BackwardsIndex` (and possibly others) ; snippet at 12https://play.nim-lang.org/#ix=2dRW |
08:57:54 | * | okcy quit (Remote host closed the connection) |
08:58:37 | * | s4mu3lbk quit (Ping timeout: 255 seconds) |
08:59:55 | * | okcy joined #nim |
09:01:30 | * | floppydh joined #nim |
09:02:27 | * | natrys joined #nim |
09:04:29 | * | okcy quit (Ping timeout: 258 seconds) |
09:04:52 | * | okcy joined #nim |
09:10:24 | * | solitudesf joined #nim |
09:25:00 | * | lritter quit (Ping timeout: 256 seconds) |
09:36:48 | * | rmt joined #nim |
09:39:48 | * | theelous3 joined #nim |
09:42:59 | PMunch | What does <//> mean in Nim? I see a lot of them in tables.nim before the return types.. |
09:55:56 | narimiran | `owned` |
09:56:48 | PMunch | Ah.. |
09:58:06 | FromDiscord | <Rika> ar_q said it's a relic of older nim versions |
09:58:24 | PMunch | Yeah I gathered as much |
10:02:02 | dadada | how can I execute external commands at compile time? it says it can't importc, maybe it's not possible |
10:02:28 | * | okcy quit (Remote host closed the connection) |
10:02:29 | PMunch | staticExec? |
10:02:40 | PMunch | Or are you thinking of something else? |
10:03:11 | dadada | PMunch: I want to run it in a maro |
10:03:12 | dadada | macro |
10:03:23 | PMunch | Run what? |
10:03:28 | dadada | an external program |
10:03:37 | PMunch | Yeah, then staticExec is what you want |
10:03:39 | * | okcy joined #nim |
10:04:40 | PMunch | Example: https://play.nim-lang.org/#ix=2dSi |
10:08:35 | dadada | ty PMunch ... |
10:08:36 | dadada | ! |
10:15:28 | * | rmt quit (Ping timeout: 265 seconds) |
10:16:17 | * | silvernode quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
10:22:17 | * | dwdv joined #nim |
10:31:24 | Araq | dadada, you can also try the distros.nim stdlib module |
10:39:42 | PMunch | Zevv, brushed up the deque module a bit, and made the various initialSize fields into intdefines: https://github.com/nim-lang/Nim/pull/13620 |
10:39:42 | disbot | β₯ Improve deque, tables, and set modules |
10:43:13 | FromDiscord | <Rika> deque has high but not low? |
10:52:44 | * | sealmove joined #nim |
11:02:02 | * | s4mu3lbk joined #nim |
11:06:51 | * | okcy quit (Remote host closed the connection) |
11:09:06 | sealmove | @federico3 |
11:09:24 | federico3 | huh? |
11:09:42 | blackbeard420 | oh cool thanks rayman22201 for the example! |
11:09:47 | sealmove | you are FedericoCeratto right? |
11:11:06 | sealmove | what does it take to implement "Allow running multiple test files and merging the outputs in one report and junit file" for unittest? Can you give me some pointers in the code? |
11:14:00 | federico3 | sealmove: an external test runner, I would guess, and right now there's an overlap between unittest, testament and https://github.com/FedericoCeratto/nim-testrunner |
11:14:57 | sealmove | still haven't figure out how to use testament outside of nim compiler project (if even possible) |
11:15:07 | * | marmotini_ joined #nim |
11:16:09 | sealmove | anyway, I really need this feature... what do you think is the best place to focus and implement it? |
11:16:20 | * | dwdv quit (Read error: Connection reset by peer) |
11:19:08 | Zevv | oi sealmove, did you enjoy my dump? :) |
11:20:05 | sealmove | Zevv, I didn't see, did you send a mail? |
11:20:16 | federico3 | sealmove: good question. testament is not a drop-in replacement for unittest. Unittest is not being developed. My testrunner might do what you need but it's not part of stdlib |
11:20:47 | sealmove | federico3: great then, testrunner seems good to me |
11:21:35 | * | dwdv joined #nim |
11:22:28 | sealmove | wow Zevv, what did you do? |
11:22:37 | Zevv | sealmove: yes, sunday evening |
11:22:42 | sealmove | :D |
11:22:46 | Zevv | I did http://ix.io/2dKZ to make ttp://ix.io/2dKY |
11:23:13 | Zevv | and I wish you the best of luck with all of that from here :) |
11:23:59 | sealmove | but the arrow is wrong, it should be "<-" right? |
11:24:19 | sealmove | you forgot your own syntax? :) |
11:25:26 | sealmove | awesome work! i was ready to abandon the CT idea and go back to the Scala implementation... |
11:27:33 | Zevv | I hate my own syntax with the power of a thousand suns |
11:28:06 | Zevv | my advise from this excersise is to forget all about this and go on with your life |
11:28:14 | Zevv | yaml is even a bigger mess then I expected it to be |
11:28:38 | sealmove | yeah, I think I am done. will just go to Scala where the parsing is implementing and my job is to just generate Nim code (with Scala strings, but whatever) |
11:29:06 | sealmove | implemented* |
11:30:04 | Araq | you could port your parser written in Scala to Nim |
11:30:58 | sealmove | it's not my parser :D |
11:31:31 | FromDiscord | <Rika> you could port *the parser written in Scala to Nim |
11:31:36 | FromDiscord | <Rika> π |
11:31:55 | sealmove | but we have one, NimYAML |
11:34:44 | * | sealmove quit (Quit: WeeChat 2.7.1) |
11:36:14 | federico3 | Zevv: stay away from yaml |
11:37:04 | PMunch | Rika well low is just always going to be 0 |
11:37:17 | Zevv | federico3: that is what I have been saying from day 1 |
11:37:53 | Zevv | just look at that mess. They start doing something EBNFish, and then they start to make up their own syntax along the way and then filling things not in and using custom operators and other fuzzy stuff |
11:39:58 | FromDiscord | <Recruit_main70007> https://www.youtube.com/watch?v=-9SGIB946lw |
11:39:58 | FromDiscord | <Recruit_main70007> Someone showed me this interview, really liked it Araq. |
11:39:58 | FromDiscord | <Recruit_main70007> (I paste it just in case someone else wants to watch it) |
11:42:30 | FromDiscord | <sealmove> Zevv I am sure you are enjoying their ideas |
11:42:34 | * | kungtotte quit (Quit: ZNC - https://znc.in) |
11:42:35 | FromDiscord | <sealmove> :DDD |
11:45:37 | * | kungtotte joined #nim |
11:46:23 | FromDiscord | <Rika> PMunch: i always thought that both procs should always be implemented together, i mean, seq has a low too and afaik seqs cant have non-0 start indexing |
11:49:45 | FromDiscord | <Rika> is unicode much harder (in terms of cpu time) to calculate the "visual length" of vs ascii? |
11:50:50 | PMunch | Hmm, fair point |
11:52:00 | * | rockcavera joined #nim |
11:55:46 | Araq | Rika: yes |
11:58:59 | Zevv | technically, *unicode* is not |
11:59:28 | FromDiscord | <Rika> but utf is? hm |
11:59:41 | FromDiscord | <Rika> is it not negligibly harder |
11:59:54 | Zevv | utf is a family of encodings. Utf32 is fixed length, every glyph is 32 bits so your number of characters is bytes / 4 |
12:00:09 | Zevv | utf8 is variable length so you have to iterate over all bytes to know how much glyphs are in there |
12:00:29 | Zevv | ow well I'm wrong, unicode is harder then ascii. Even with unicode a glyph is not always a position |
12:00:51 | Zevv | unicode can compose things like accents on a character |
12:10:37 | * | aeverr_ joined #nim |
12:10:44 | * | aeverr_ quit (Client Quit) |
12:10:55 | * | aeverr_ joined #nim |
12:11:10 | PMunch | Yeah, getting visual length of unicode is hard |
12:11:21 | FromDiscord | <Rika> uuuuuu |
12:11:24 | PMunch | I mean even Apple had a bug that crashes phones because of unicode stuff |
12:11:45 | FromDiscord | <Rika> they still get bugs hahaha |
12:11:57 | * | aeverr quit (Ping timeout: 265 seconds) |
12:11:58 | PMunch | However that was a division by zero in the code that tried to figure out where in a string you pressed in order to do highlighting |
12:12:02 | FromDiscord | <Rika> i should release the linenoise port now should i |
12:12:40 | FromDiscord | <Rika> is it "nim-(ported name)" or "(ported name)-nim" lol |
12:16:00 | * | okcy joined #nim |
12:22:31 | Araq | Zevv, I'm pretty sure UTF-32 is as flawed |
12:22:50 | Araq | unicode is always variable length with its combinators and stuff |
12:23:51 | FromGitter | <kaushalmodi> Rika: Not a strict convention, but while I have seen "nim" in project names, their nimble project names don't have that "nim" string in the names (because everything on nimble will be in Nim :P) |
12:24:11 | FromGitter | <kaushalmodi> so may be have the repo name "foo_nim", but have the project as just "foo" on nimble |
12:26:20 | * | aeverr_ quit (Ping timeout: 256 seconds) |
12:26:22 | * | aeverr joined #nim |
12:28:50 | FromDiscord | <Rika> project is just linenoise in nimble but i was asking for repo name yes |
12:33:43 | * | aeverr quit (Ping timeout: 255 seconds) |
12:33:45 | * | aeverr_ joined #nim |
12:33:45 | Zevv | araq: sure,that is what I said. |
12:39:26 | * | marmotini_ quit (Remote host closed the connection) |
12:40:00 | * | marmotini_ joined #nim |
12:44:28 | * | marmotini_ quit (Ping timeout: 256 seconds) |
12:44:42 | * | azed joined #nim |
12:49:03 | * | opal quit (Ping timeout: 240 seconds) |
12:51:02 | PMunch | Hmm, are you not able to use `using` with generics? |
12:55:42 | * | marmotini_ joined #nim |
13:00:13 | * | ikan-keli_ quit (Ping timeout: 268 seconds) |
13:00:20 | * | marmotini_ quit (Ping timeout: 256 seconds) |
13:00:43 | Araq | PMunch, I think it's covered by a test though |
13:00:56 | Araq | but 'using' is so under-used :-) |
13:01:13 | Araq | time to fix and use it or to deprecate it |
13:09:23 | FromDiscord | <Rika> fix and use pls |
13:10:10 | FromDiscord | <djazz> hi, is it possible to get the name of a proc? My module accepts function callbacks, and since they might be named it would be useful to log what callback is fired depending on their name. |
13:11:05 | Yardanico | https://github.com/nim-lang/Nim/issues/8212 |
13:11:07 | disbot | β₯ we need a standard way to get name of procedure ; snippet at 12https://play.nim-lang.org/#ix=25Yt |
13:12:57 | FromDiscord | <djazz> something that can be used like repr(), not current function |
13:13:31 | Yardanico | oh right, it's easy then |
13:14:21 | Yardanico | or hmm |
13:14:43 | Yardanico | I think there's a way but I forgot it :( |
13:17:08 | PMunch | Hmm, with an ordered table is there a way to go through the keys bacwards? |
13:18:23 | Yardanico | well in projects I just iterated over the table (the normal one though) to find that key (i know it's not the best but i don't know any other easy way) |
13:18:43 | FromDiscord | <Rika> prolly something to do with a macro regarding getting function name |
13:20:07 | PMunch | Something like this works: https://play.nim-lang.org/#ix=2dT6 |
13:20:13 | PMunch | For compile-time though |
13:20:55 | Yardanico | I think that's what @djazz needs |
13:21:16 | Yardanico | since you can't change function names at runtime anyway :P |
13:21:24 | PMunch | Could need a touch more checking and such though |
13:21:25 | * | s4mu3lbk quit (Read error: Connection reset by peer) |
13:22:04 | PMunch | Well he might've wanted to get the name of a registered callback for example |
13:22:40 | PMunch | But in that case you would have to store the string name along with the callback, so you would still need a macro like that |
13:22:46 | * | uvegbot quit (Ping timeout: 256 seconds) |
13:24:17 | FromDiscord | <djazz> hmm, while that works when passing the proc directly, it does not work in my proc that recieves it callback proc: Error: cannot get child of node kind: nnkNilLit |
13:24:48 | FromDiscord | <djazz> the repr looks like this for it: [Field0 = 0x55b16b31ccf8, Field1 = nil] |
13:24:59 | * | uvegbot joined #nim |
13:25:01 | Yardanico | I'll try to fix it now |
13:25:12 | FromDiscord | <Rika> use treerepr for macros π |
13:25:16 | PMunch | Wait, what are you trying to pass? djazz? |
13:25:33 | PMunch | That looks like a tuple |
13:25:56 | FromDiscord | <djazz> I'll see if I can make an example |
13:26:12 | * | alexander92 joined #nim |
13:27:08 | * | nsf quit (Quit: WeeChat 2.7) |
13:27:30 | * | s4mu3lbk joined #nim |
13:27:45 | FromDiscord | <djazz> PMunch: https://play.nim-lang.org/#ix=2dT8 |
13:30:12 | * | marmotini_ joined #nim |
13:32:15 | PMunch | Yes, as I said you would need to do something like this: https://play.nim-lang.org/#ix=2dTa |
13:34:02 | FromDiscord | <djazz> ah, I see |
13:34:54 | PMunch | Procedures don't really have the same names at runtime |
13:35:51 | PMunch | It would theoretically be possible to use the function pointer and look in the symbol table of the binary to get those names |
13:36:00 | PMunch | But you probably don't want to do that :P |
13:41:12 | FromDiscord | <djazz> thanks, it works ^^ now i just need to make unnamed procs empty strings |
13:53:02 | * | s4mu3lbk quit (Ping timeout: 256 seconds) |
14:00:35 | axion | How can I print the real time of executing a body of code N times? |
14:02:24 | PMunch | Possibly by using something like this? https://github.com/winksaville/nim-benchmark |
14:02:33 | Yardanico | PMunch: it's very old though |
14:02:44 | PMunch | I mean you can also just use the `times` module and a for loop.. |
14:03:00 | PMunch | Oh, didn't realise that was 5 years old.. |
14:04:31 | FromDiscord | <djazz> there https://play.nim-lang.org/#ix=2dTi thanks again PMunch! |
14:05:11 | * | letto joined #nim |
14:05:25 | PMunch | No problem :) |
14:06:07 | PMunch | This is the kind of stuff that's fairly simple once you've done it once or twice, but is almost impossible to google :P |
14:08:01 | PMunch | Anyone going miss any of these node kinds if I don't include them in my macroutils package? nnkNone, nnkType, nnkComesFrom, nnkDotCall, nnkHiddenCallConv, nnkVarTuple, nnkObjConstr, nnkCurlyExpr, nnkPragmaExpr, nnkCheckedFieldExpr, nnkLambda, nnkDo, nnkBind, nnkClosedSymChoice, nnkOpenSymChoice, nnkHiddenStdConv, nnkHiddenSubConv, nnkConv, nnkStaticExpr, nnkHiddenAddr, nnkHiddenDeref, nnkObjDownConv, nnkObjUpConv, nnkChckRangeF, nnkChckRange64, nnkChckRange, |
14:08:01 | PMunch | nnkStringToCString, nnkCStringToString, nnkFastAsgn, nnkImportAs, nnkPragmaBlock, nnkParForStmt, nnkStmtListExpr, nnkBlockExpr, nnkStmtListType, nnkBlockType, nnkWith, nnkWithout, nnkTupleClassTy, nnkPattern, nnkHiddenTryStmt, nnkClosure, nnkGotoState, nnkState, nnkBreakState, nnkTupleConstr |
14:08:05 | * | letto_ quit (Ping timeout: 258 seconds) |
14:09:57 | * | Hideki_ joined #nim |
14:12:37 | * | dddddd joined #nim |
14:12:42 | disruptek | uh, what? |
14:15:13 | * | s4mu3lbk joined #nim |
14:15:16 | PMunch | Huh? |
14:16:10 | Araq | nnkObjConstr is important |
14:16:20 | disruptek | what does your package do? |
14:16:33 | disruptek | all nodes are important to writing nim. that's why they are there. |
14:16:55 | PMunch | disruptek, so far it allows you to create NimNodes and access their fields more intuitively. |
14:17:01 | * | sealmove joined #nim |
14:17:07 | disruptek | well, maybe you can get away without a few... but, certainly imports. |
14:17:23 | PMunch | Well, those are the ones I haven't been able to figure out what are, or what fields they have |
14:17:26 | disruptek | curlies, pragmas, ... |
14:17:42 | disruptek | dot call is pretty critical, i think. |
14:18:24 | disruptek | lambda and do and blocks could facilitate some really interesting use. |
14:18:27 | PMunch | Araq, ah ObjConstr definitely needs to be added |
14:19:08 | PMunch | disruptek, well I have DotExpr, not sure what the difference is.. |
14:21:23 | PMunch | Doubt anyone would be creating this: https://github.com/nim-lang/Nim/blob/devel/compiler/ast.nim#L69-L71 |
14:21:40 | * | Hideki_ quit (Remote host closed the connection) |
14:21:53 | disruptek | yeah, i confused the two. |
14:22:26 | * | Hideki_ joined #nim |
14:22:44 | PMunch | Can't really create a do either |
14:22:58 | PMunch | dumpTree just reports it as a call with two StmtList parameterers |
14:23:12 | PMunch | Parameters* |
14:24:24 | PMunch | Just to be clear, I've done most of the nodes: http://ix.io/2dTn/ |
14:25:41 | disruptek | i kinda like how the vscode blame line is in the editor's statusbar. |
14:26:39 | * | azed quit (Quit: WeeChat 2.7.1) |
14:27:02 | * | Hideki_ quit (Ping timeout: 256 seconds) |
14:28:44 | * | hax-scramper quit (Ping timeout: 256 seconds) |
14:29:49 | * | hax-scramper joined #nim |
14:31:43 | * | azed joined #nim |
14:34:30 | * | endragor quit (Remote host closed the connection) |
14:35:19 | * | opal joined #nim |
14:43:17 | Araq | stupid question ahead, how do I create PRs again? |
14:43:25 | Araq | I forked the repo, pushed my change, now what? |
14:43:31 | disruptek | push to your branch. |
14:43:47 | disruptek | git will give you a github link, or visit your fork on the web. |
14:43:57 | Yardanico | Araq: https://github.com/status-im/nim-chronos/compare/master...Araq:master |
14:44:12 | Yardanico | that link is on "https://github.com/Araq/nim-chronos" under green clone button |
14:45:17 | Araq | thank you! |
14:45:26 | disruptek | what do i do with ptr types that have no sons? |
14:48:05 | Araq | these can only be typeclasses |
14:48:21 | * | drewr quit (Quit: ERC (IRC client for Emacs 26.3)) |
14:48:23 | * | Hideki_ joined #nim |
14:48:26 | Araq | in other words it's either a bug or "yet more generics" |
14:48:44 | * | Hideki_ quit (Remote host closed the connection) |
14:48:48 | disruptek | okay, i will figure them out. |
14:53:13 | * | nsf joined #nim |
14:54:45 | FromDiscord | <Kiloneie> Does anyone have a better way of doing this ? |
14:54:46 | FromDiscord | <Kiloneie> https://ibb.co/99KdsVz |
14:55:05 | FromDiscord | <Kiloneie> Seems fine for now idk, just looking for any suggestions |
14:57:59 | Araq | seems ok, in general I would focus more on stdlib operations and then explain the language features as you go along |
14:58:10 | Araq | but it's a different approach |
14:58:12 | * | Hideki_ joined #nim |
14:59:06 | FromDiscord | <Kiloneie> im making this so i don't get into the hassle i am right now where i don't really know what all i have covered by just glancing at the titles i have my my OneNote and video titles |
14:59:47 | FromDiscord | <Kiloneie> I can't afford to start teaching something when one of the components for that video is missing |
14:59:47 | FromDiscord | <djazz> If I don't want to type the full type description everywhere I want to use it, like a static string of the type, what should I do? I tried to set it as a type: MyType = proc(...)... but then it won't accept input with same signature |
15:00:11 | Yardanico | it should work, how did you specify the type? |
15:00:18 | Yardanico | also don't forget {.closure.} |
15:00:28 | FromDiscord | <djazz> `Middleware* = proc (ctx: Context, next: Next = nil): Future[void] {.closure, gcsafe.}` |
15:00:33 | FromDiscord | <flywind> use {.nimcall.} |
15:00:53 | FromDiscord | <djazz> nimcall? |
15:01:24 | FromDiscord | <djazz> anyway, i get this error: `required type for callback: Middleware but expression 'logger' is of type: proc (ctx: Context, next: Next): Future[system.void]{.gcsafe, locks: <unknown>.}` |
15:01:42 | FromDiscord | <djazz> also, = nil does nothing |
15:01:51 | FromDiscord | <djazz> so i have to use two types >_> |
15:03:56 | FromDiscord | <Kiloneie> Also @Araq yeah my goal is to cover the entire language with minimal stdlib usage and then make videos with heavy stdlib usage, something like that. |
15:04:12 | PMunch | djazz, might be because it's not a closure? |
15:04:34 | Araq | Kiloneie: what software did you use to produce the table? |
15:04:42 | Araq | I like it |
15:04:54 | FromDiscord | <Kiloneie> Xmind Zen |
15:05:03 | * | Hideki_ quit (Remote host closed the connection) |
15:05:07 | FromDiscord | <Kiloneie> Xmind 8 is a ton more feature full, but my god is it slow |
15:05:48 | * | Hideki_ joined #nim |
15:05:57 | FromDiscord | <Kiloneie> it's trial version, but i think the trial lasts like 2 years, i see 322 days left on the top and it's been on my computer for like a year, and you can easily renew that. |
15:07:13 | alexander92 | so guys |
15:07:14 | FromDiscord | <djazz> removed closure, same error |
15:07:16 | alexander92 | asserts in libs |
15:07:20 | alexander92 | what do you think |
15:07:39 | Zevv | never |
15:07:49 | alexander92 | i am putting many "this shouldnt happend => quit 1" checks in one of mine |
15:07:57 | alexander92 | but i am not sure where is the boundary |
15:08:15 | FromGitter | <xflywind> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e67ad5fd17593652b757d5e] |
15:08:27 | alexander92 | zevv but if there is a bug? just return/raise a good error ? |
15:08:43 | * | drewr joined #nim |
15:08:50 | disruptek | wut? |
15:08:56 | disruptek | assertions in libs? why not? |
15:09:19 | * | sealmove quit (Quit: WeeChat 2.7.1) |
15:09:23 | FromDiscord | <Kiloneie> This is Xmind 8 ancient mind map i made back in highschool, like 6 years ago |
15:09:24 | FromDiscord | <Kiloneie> https://ibb.co/NZrN6MJ |
15:09:28 | disruptek | an assertion isn't an error. it's an error on the part of the original developer. |
15:09:29 | alexander92 | my assertions are not exactly similar, as they are just a template bug(message: ..) which works the same way in release as in debug |
15:10:02 | * | Hideki_ quit (Ping timeout: 240 seconds) |
15:10:46 | FromGitter | <xflywind> Default proc Type is {.closure.} in Nim @djazz |
15:11:20 | alexander92 | disruptek i mean yeah stuff like "gdb action => here we didnt finish this op at all, so we're in a random place => somethings very wrong" |
15:11:26 | PMunch | Why is :tmp undeclared here: https://play.nim-lang.org/#ix=2dTG |
15:11:31 | alexander92 | i guess one can recover from many of those though |
15:11:33 | alexander92 | if given context |
15:11:34 | disruptek | i say use assert. |
15:11:37 | alexander92 | or a "reset" one |
15:13:55 | PMunch | Oh damn it.. |
15:15:52 | FromDiscord | <djazz> huh, got it working now, sorta |
15:16:23 | FromDiscord | <djazz> i had to duplicate a template, so instead of using callback: Middleware|MiddlewareSimple, i had to make one that does each |
15:16:35 | FromDiscord | <djazz> one for each* |
15:18:41 | * | clyybber joined #nim |
15:23:42 | PMunch | Yay, got it working. Another teaser for what will now be possible: http://ix.io/2dTK/nim |
15:24:02 | PMunch | That would generate code that prints out "someproc" and "hello world". |
15:26:46 | * | PMunch quit (Quit: Leaving) |
15:26:49 | * | solitudesf quit (Remote host closed the connection) |
15:28:03 | * | drewr quit (Quit: ERC (IRC client for Emacs 26.3)) |
15:28:50 | * | drewr joined #nim |
15:28:53 | * | krux02 joined #nim |
15:29:13 | alexander92 | nice |
15:31:04 | FromDiscord | <Lantos> Nice |
15:37:30 | FromDiscord | <djazz> I want the `next` parameter to be optional, here are my types: https://github.com/daniel-j/koan/blob/master/src/koan/types.nim#L35-L36 and here are is where incoming middleware callbacks arrive, and get converted from simple to normal if needed. https://github.com/daniel-j/koan/blob/master/src/koan.nim#L11-L21 |
15:39:55 | FromDiscord | <djazz> use() gets called here https://github.com/daniel-j/koan/blob/master/example.nim#L9-L15 |
15:42:48 | FromDiscord | <Rika> whats the issue? |
15:43:33 | * | solitudesf joined #nim |
15:44:30 | FromDiscord | <djazz> code duplication (: |
15:44:52 | alexander92 | web framework! nice. |
15:46:59 | FromDiscord | <Kiloneie> I said imma do 4-6 minute videos now(looks at all the stuff i gotta cover on Modules... D:) |
15:47:01 | * | Hideki_ joined #nim |
15:47:15 | FromDiscord | <djazz> thanks for the star! |
15:49:08 | FromDiscord | <djazz> stars* |
15:52:24 | * | floppydh quit (Quit: WeeChat 2.7.1) |
15:52:53 | * | marmotini_ quit (Ping timeout: 268 seconds) |
15:53:18 | * | aeverr joined #nim |
15:53:59 | * | aeverr_ quit (Ping timeout: 260 seconds) |
16:00:40 | alexander92 | no problem, interesting to look! |
16:00:46 | alexander92 | we need more framework stuff like crystal |
16:02:27 | * | s4mu3lbk quit (Ping timeout: 240 seconds) |
16:05:30 | disruptek | ~stream |
16:05:31 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
16:09:16 | * | Hideki_ quit (Ping timeout: 255 seconds) |
16:10:00 | krux02 | disruptek, visually very appealing. I can't listen though. I am currently in a library. |
16:10:05 | krux02 | and no headphones |
16:12:00 | reversem3 | does it matter what paste we use ? |
16:13:29 | krux02 | you mean like pastebin or ix.io? |
16:14:18 | FromGitter | <nothratal> what exactly should this return? β β ```x[pos ..< ^1]``` [https://gitter.im/nim-lang/Nim?at=5e67bcda47b42479253b0902] |
16:15:02 | krux02 | reversem3, nobody here tries to push you towards a spacific code pasting service, uslike the python channel :P |
16:15:15 | reversem3 | kk |
16:16:48 | krux02 | nothratal: Currently that returns a copy of that slice of the string/seq |
16:17:07 | reversem3 | indentation error http://pastebin.ws/36z85z |
16:19:30 | FromGitter | <nothratal> @krux02 but how is the range of the slice? I dont get what '..< ^1' means |
16:21:51 | krux02 | it means until the end |
16:22:17 | krux02 | ^1 basically means `x.len-1` |
16:22:22 | FromDiscord | <Rika> https://github.com/de-odex/linenoise-nim its here now, still dont know what the potential use for this is |
16:22:29 | krux02 | ^2 means `x.len-2` etc. |
16:23:02 | FromGitter | <nothratal> ...and what does ..< mean? |
16:23:07 | FromDiscord | <Rika> why use ..< then also ^1??? |
16:23:10 | krux02 | but ..< is an exclusive upper bound range |
16:23:21 | FromDiscord | <Rika> n..<m means from n to m excluding m |
16:23:31 | FromGitter | <nothratal> ahhhh! |
16:23:32 | krux02 | probably becaues the last value should be left out. |
16:23:35 | FromGitter | <nothratal> thanks alot! |
16:23:38 | FromDiscord | <Rika> then why not ..^2? |
16:23:47 | krux02 | preference |
16:23:57 | FromDiscord | <Rika> ok, thats just odd but okay |
16:24:07 | krux02 | I prefer `..<` over `..` |
16:24:26 | FromDiscord | <Rika> thats fine i just find it odd |
16:24:59 | krux02 | yea |
16:25:16 | krux02 | you will see a lot of things that seem odd when reading other peoples code. |
16:25:17 | narimiran | if it was ^2 you would find it even |
16:25:27 | FromDiscord | <Rika> anyway how's the code in the repo i sent lmao |
16:25:31 | krux02 | That is not a Nim specific thing. |
16:26:32 | krux02 | Rika if you mean linenoise |
16:26:46 | FromDiscord | <Rika> i know? i mean how's the code i translated |
16:26:51 | krux02 | linenoise is used as a C library in standard library Nim. |
16:26:53 | FromDiscord | <Rika> is it ok? |
16:26:56 | FromDiscord | <Rika> i know |
16:27:10 | FromDiscord | <Rika> my lord |
16:27:15 | krux02 | so a port might be better, but on the other hand, the C library doesn't cause any problems |
16:27:20 | FromDiscord | <Rika> you know what |
16:27:21 | FromDiscord | <Rika> never mind |
16:27:32 | FromDiscord | <Rika> i'll ask someone else |
16:27:47 | krux02 | maybe the Nim linenoise is easier to use for a node terminal application |
16:28:34 | krux02 | I am too negative to answer your questions? |
16:30:38 | FromDiscord | <Rika> i wasnt asking about the usability |
16:30:48 | FromDiscord | <Rika> i know the port is probably useless |
16:31:01 | FromDiscord | <Rika> i was asking about whether the code is a good translation |
16:31:03 | krux02 | narimiran, I just understood your joke. It took a while. |
16:31:08 | narimiran | :) |
16:31:10 | FromDiscord | <Rika> but it's prolly too difficult to do that at a glance |
16:31:26 | alexander92 | i am not sure if krux02 realizes that you actually ported linenoise itself, not wrapped it |
16:31:40 | krux02 | Rika: yea, it is a lot to look at. |
16:31:49 | alexander92 | the first assumption i would do would be the second option |
16:32:00 | alexander92 | i dont think i should use would so much in 3 words |
16:32:24 | FromDiscord | <Rika> i think it's easier to extend than the C version so maybe that's a benefit for this |
16:33:26 | krux02 | Rika: but there is one problem with linenoise in general that has nothing to do with the quality of the port of it: using `gnu readline` with `rlwrap` on an application that uses just bare bone stdin is a much better experience than any integration of `linenoise` that I've seen so far. |
16:34:13 | krux02 | alexander92, I understood that part. |
16:34:27 | FromDiscord | <Rika> i dont know of rlwrap |
16:34:38 | FromDiscord | <Rika> so i dont know what the issue is |
16:34:48 | krux02 | it is a linux package, it is universal readline integration. |
16:34:54 | krux02 | without linking it. |
16:35:13 | krux02 | you just start the application with `rlwrap program arg1 arg2 ...` |
16:35:23 | krux02 | instead of `program arg1 arg2 ...` |
16:36:06 | krux02 | But you should always consider my opinion as "linux bubble" opinion. |
16:36:16 | FromDiscord | <Rika> hmm never heard of it |
16:36:18 | FromDiscord | <Rika> interesting |
16:36:37 | krux02 | and then you have all the things that readline provides you. |
16:36:47 | krux02 | like vi emulation |
16:37:00 | krux02 | reverse serach |
16:37:01 | krux02 | etc |
16:37:39 | krux02 | smart completion doesn't exist, since that really needs true integration, but history and serach throguh history is there. |
16:38:51 | krux02 | Rika a good example to run `rlwrap` would be `nim secret` |
16:38:57 | reversem3 | indentation error http://pastebin.ws/36z85z So why is there an indentation error with version*: cstring ? |
16:39:25 | krux02 | install rlwrap and then try `nim secret` and compare the experience with `rlwrap nim secret` |
16:39:59 | krux02 | reversem3, because JsObject is not how you declare a type with fields. |
16:40:18 | krux02 | `objet` is how you declare a type |
16:40:20 | FromDiscord | <Rika> isnt it "object of JsObject" |
16:40:36 | * | clyybber quit (Quit: WeeChat 2.7.1) |
16:40:39 | reversem3 | even using jsffi ? |
16:40:44 | FromDiscord | <Rika> yes |
16:40:53 | FromDiscord | <Rika> jsffi won't change nim syntax |
16:41:26 | * | marmotini_ joined #nim |
16:41:44 | FromDiscord | <Skaruts> is there some way to exclude something from being exported when doing `export some_file`? |
16:42:42 | krux02 | Skaruts, first of all you export modules, but yes you can also export just single functions. |
16:42:47 | FromDiscord | <Rika> so like import except but for export? |
16:42:50 | alexander92 | if you use object of JsObject, do it *only* if you are aware of the dynamic-like typing consequences for values of it |
16:42:54 | FromDiscord | <Skaruts> yes, rika |
16:43:16 | FromDiscord | <Rika> krux02, i think they mean w/o listing literally everything else they want to export |
16:43:29 | Araq | hmm I'm thinking that people really do catch defects all the freaking time and --gc:arc should support it out of the box... |
16:43:50 | alexander92 | what is an example of a defect |
16:43:51 | FromDiscord | <Skaruts> yea, I want to export everything except one or two things in the file |
16:43:53 | FromDiscord | <Rika> i really want non-catchable defects though |
16:44:06 | FromDiscord | <Rika> alexander92 indexoutofbounds perhaps |
16:46:05 | * | marmotini_ quit (Read error: No route to host) |
16:46:43 | * | marmotini_ joined #nim |
16:48:01 | FromDiscord | <Skaruts> seems except works for exports, thanks @Rika |
16:49:07 | alexander92 | its very interesting how is this supposed to be defined across backends |
16:49:38 | alexander92 | e.g. in the javascript backend it seems completely normal to be able to catch/ignore such deffects in some functions imo |
16:50:08 | alexander92 | e.g. some kinds of async redraws/callbacks etc |
16:51:22 | * | gangstacat quit (Quit: Δis!) |
16:54:14 | reversem3 | isn't jsObject a ref of jsRoot ? https://nim-lang.org/docs/jsffi.html#JsObject |
16:56:14 | krux02 | Araq: How much do you dislike `when compiles` in the standard library and compiler of Nim? |
16:59:10 | * | gangstacat joined #nim |
17:00:48 | * | smitop joined #nim |
17:03:16 | * | Trustable joined #nim |
17:07:21 | * | azed quit (Quit: WeeChat 2.7.1) |
17:10:13 | lqdev[m] | is it ok to use `ref string` or `ref seq[T]` when you need to pass strings or seqs by reference? |
17:10:55 | krux02 | lqdev[m], not really |
17:11:29 | lqdev[m] | what should I use then? |
17:11:30 | krux02 | passing string/seq to a function does not copy. |
17:11:41 | lqdev[m] | but I need it to be mutable |
17:11:49 | krux02 | then do `var string` |
17:11:52 | lqdev[m] | and I can't use `var` either, because I need to store it in an object |
17:11:56 | krux02 | and `var seq[T]` |
17:12:28 | krux02 | no you want to move a seq into an object and then mutate it? |
17:12:28 | lqdev[m] | *and*, I can't pass my object as `var` because it's stored as part of a VM's stack |
17:13:05 | krux02 | well this is too abstract, I need an example to understand. |
17:14:06 | krux02 | if you are on the VM then everything is reference type anyway. |
17:14:15 | krux02 | So I ref ref string and ref seq is ok |
17:14:30 | lqdev[m] | I'm not on the NimVM |
17:14:43 | lqdev[m] | I'm talking about my own VM |
17:14:51 | krux02 | ok |
17:14:52 | lqdev[m] | I store values as objects on a stack, which is a seq |
17:15:14 | krux02 | ok |
17:15:21 | * | s4mu3lbk joined #nim |
17:15:39 | lqdev[m] | when I need to pass arguments to some Nim proc, I simply take the address of the first parameter of that proc and pass the (rather unsafe) seq slice to the Nim proc |
17:16:04 | lqdev[m] | which is fine because I can still mutate my strings and seqs |
17:16:22 | lqdev[m] | however, the problem comes when I need to mutate them from inside my language |
17:16:49 | lqdev[m] | so I thought just storing strings and seqs as `ref` would prevent any unwanted copies |
17:17:01 | lqdev[m] | and the language user could call a built-in `copy()` proc to copy them |
17:17:06 | lqdev[m] | or something similar |
17:17:31 | * | Hideki_ joined #nim |
17:18:37 | krux02 | well I guess I can't follow you here anymore. I don't know your VM. |
17:18:55 | lqdev[m] | well |
17:19:56 | lqdev[m] | my VM is stack-based, so whenever I need any variables I simply push them from another place on the stack. but that makes a copy of my Value, and also a copy of the string it contains which is not what I'd like |
17:22:18 | * | Hideki_ quit (Ping timeout: 268 seconds) |
17:23:11 | krux02 | I am also on the brink of leaving here. So I don't really have time to follow your details. But for what you are describing this sounds like maybe you need your own VmString type and VmSeq types where you have full control of the allocator and copy behavior. |
17:23:30 | krux02 | but I am not sure if that really solves the problem you are describing to me. |
17:23:58 | krux02 | Nim stings have the a slight attitude of being copied over too often. |
17:24:10 | krux02 | ok I have to go now. |
17:24:15 | * | krux02 quit (Remote host closed the connection) |
17:24:30 | lqdev[m] | bye |
17:24:47 | lqdev[m] | I'll probably come up with something that works |
17:25:36 | lqdev[m] | but I really wanted to use the built-in `string` and `seq` because then I don't have to make my own GC |
17:28:12 | * | gangstacat quit (Quit: Δis!) |
17:35:18 | * | gangstacat joined #nim |
17:38:04 | leorize | ref strings and ref seqs work |
17:38:09 | leorize | even if not too efficient |
17:39:04 | leorize | Araq: maybe let people decide what's not catchable? |
17:41:45 | * | PMunch joined #nim |
17:45:46 | * | marmotini_ quit (Remote host closed the connection) |
17:46:23 | * | marmotini_ joined #nim |
17:51:15 | * | marmotini_ quit (Ping timeout: 265 seconds) |
17:52:07 | * | Ven`` joined #nim |
17:54:01 | * | PMunch quit (Quit: leaving) |
17:55:39 | lqdev[m] | leorize: then what would be a more efficient approach? |
17:56:26 | lqdev[m] | and in what way are `ref strings` and `ref seq`s inefficient? |
17:56:55 | * | marmotini_ joined #nim |
17:58:14 | leorize | double indirection |
17:58:36 | leorize | the more efficient approach would be to make your own type, but then you don't want to do that :p |
17:58:46 | leorize | so yea, `ref` is the only way |
18:01:22 | Zevv | I wouldn't worry about the overhead of the double indirection, compared to the overhead of running your VM |
18:20:57 | * | Jesin quit (Quit: Leaving) |
18:20:58 | dwdv | Is there an rss feed for the forum or a mailing-list-like interface? |
18:21:20 | * | NimBot joined #nim |
18:22:53 | Zevv | /threadActivity.xml |
18:23:04 | Zevv | https://forum.nim-lang.org/threadActivity.xml |
18:25:00 | dwdv | Alright, that should do. Thanks a lot! |
18:25:07 | * | Jesin joined #nim |
18:25:56 | Zevv | yw |
18:27:59 | * | hax-scramper quit (Ping timeout: 258 seconds) |
18:30:28 | Araq | leorize, working on it... |
18:30:32 | * | hax-scramper joined #nim |
18:32:02 | * | dwdv quit (Ping timeout: 240 seconds) |
18:44:19 | * | solitudesf quit (Ping timeout: 260 seconds) |
18:44:34 | * | Trustable quit (Remote host closed the connection) |
18:46:49 | * | fanta1 quit (Quit: fanta1) |
18:53:17 | * | arecaceae quit (Remote host closed the connection) |
18:53:42 | * | arecaceae joined #nim |
18:55:20 | * | dwdv joined #nim |
19:04:56 | * | Hideki_ joined #nim |
19:05:37 | FromDiscord | <djazz> Streaming again, more work on Koan https://www.twitch.tv/daniel_hede ^^ |
19:06:02 | FromDiscord | <Kiloneie> Why is everyone streaming out of the sudden ? |
19:06:50 | * | al_ joined #nim |
19:06:50 | * | al_ is now known as Guest94576 |
19:09:15 | * | Hideki_ quit (Ping timeout: 240 seconds) |
19:09:18 | * | sagax quit (Read error: Connection reset by peer) |
19:09:54 | FromDiscord | <djazz> why not π |
19:10:40 | FromDiscord | <Kiloneie> Ask me to stream, i will go get a bag and put in my head :P... |
19:11:03 | FromDiscord | <Kiloneie> Even though i probably got the best upload speed on here xD... |
19:11:50 | FromDiscord | <Recruit_main70007> Thatβs good |
19:12:11 | FromDiscord | <Recruit_main70007> I might stream my rocket league Nim bot now that they closed schools |
19:14:37 | FromDiscord | <Kiloneie> Let's not talk about the most overblown crap of this decade |
19:15:00 | FromDiscord | <djazz> yeah, requested refund for RL the other day |
19:15:18 | FromDiscord | <djazz> (like they wrote in their help section heh) |
19:15:44 | FromDiscord | <Kiloneie> i meant on the closed schools and oh so many other things because of oh so dangerous micro thingy |
19:16:16 | FromDiscord | <Kiloneie> Wanna get demonitized on YT if you actually can earn money on YT ? Mention it π |
19:18:53 | * | Vladar quit (Quit: Leaving) |
19:25:13 | * | sagax joined #nim |
19:30:03 | axion | Araq: Hello. Coming from Lisp here, and I think I have a question or two for you depending on how familiar you are with CL :) |
19:30:59 | Araq | axion: ok |
19:31:00 | axion | Is there anything like CL's FLET or LABELS? |
19:31:27 | * | opal quit (Remote host closed the connection) |
19:31:41 | * | opal joined #nim |
19:32:11 | Araq | not sure, does nesting procs inside procs count? |
19:33:14 | axion | I suppose, except there is no distinction between recursive or not I suppose then. Are they only available within the outer proc's lexical environment? |
19:37:31 | * | alexander92 quit (Ping timeout: 260 seconds) |
19:44:10 | FromGitter | <zetashift> I'm getting a type mismatch error; is it not possible to do: `openarray[openarray[float]]` as a proc parameter? |
19:47:15 | FromGitter | <zetashift> nvm should've looked better in to github issues |
19:53:57 | * | marmotini_ quit (Remote host closed the connection) |
19:54:34 | * | marmotini_ joined #nim |
19:55:07 | FromDiscord | <Rika> do we have something akin to python's `svgpathtools`? |
19:56:48 | disruptek | !repos svg |
19:57:01 | disruptek | !repos svg |
19:57:02 | disbot | https://github.com/bluenote10/NimSvg -- 9NimSvg: 11Nim-based DSL allowing to generate SVG files and GIF animations. 15 55β 1π΄ |
19:57:02 | disbot | https://github.com/jiro4989/svgo -- 9svgo: 11This is svgo, a small utility to create SVG objects. 15 0β 0π΄ |
19:57:04 | disbot | https://github.com/def-/nim-rsvg -- 9nim-rsvg: 11Nim wrapper for librsvg, a Scalable Vector Graphics (SVG) rendering library 15 3β 0π΄ |
19:57:23 | FromDiscord | <Rika> just svg generation it seems |
19:57:55 | FromDiscord | <Rika> maybe thatll be my next project |
19:58:09 | lqdev[m] | what's svgpathtools? |
19:58:18 | FromDiscord | <Rika> svg parsing |
19:58:20 | FromDiscord | <Rika> well |
19:58:25 | FromDiscord | <Rika> more like generating paths |
19:58:42 | FromDiscord | <Rika> like beziers and stuff then getting the tangents and arclengths and other stuff |
19:58:50 | * | marmotini_ quit (Ping timeout: 240 seconds) |
19:59:20 | disruptek | i would probably build it on grim. |
19:59:23 | disruptek | !repo grim |
19:59:24 | disbot | https://github.com/ebran/grim -- 9grim: 11grim brings property graphs to the Nim language. Look around you: everything is a graph! 15 19β 0π΄ 7& 2 more... |
19:59:52 | FromDiscord | <Rika> what the fuck |
19:59:55 | * | alexander92 joined #nim |
19:59:57 | FromDiscord | <Rika> never heard of it but damn |
20:00:17 | FromDiscord | <Rika> ah |
20:00:23 | FromDiscord | <Rika> i dont think this is relevant dunno |
20:00:28 | FromDiscord | <Rika> oh |
20:00:35 | FromDiscord | <Rika> you mean the segmenting? okay ill look into it |
20:00:36 | FromGitter | <zetashift> So instead of the openarray[openarray[float]] thing, I do a `Matrix = seq[seq[float]]` and just make a proc `newMatrix` that gets in a seq[seq[float]] and returns a new matrix, I feel like this is kinda dumb, anyone got some tips for better approaches? |
20:04:08 | disruptek | use rust. |
20:06:54 | disruptek | ~stream |
20:06:55 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
20:06:59 | disruptek | more uhms and hmms. |
20:10:29 | * | nsf quit (Quit: WeeChat 2.7) |
20:14:18 | * | Guest94576 quit (Quit: Guest94576) |
20:14:28 | * | lritter joined #nim |
20:15:04 | lqdev[m] | @zetashift: use generics, like `Matrix[N, M: static int] = array[N, array[M, float]]`? |
20:15:27 | lqdev[m] | that'd be more efficient than using seqs |
20:24:58 | * | Ven`` quit (Read error: Connection reset by peer) |
20:31:37 | * | natrys quit (Ping timeout: 255 seconds) |
20:38:06 | * | drewr quit (Ping timeout: 240 seconds) |
20:40:14 | * | smitop quit (Quit: Connection closed for inactivity) |
20:40:32 | * | natrys joined #nim |
20:43:06 | * | krux02 joined #nim |
20:49:39 | * | narimiran quit (Ping timeout: 240 seconds) |
20:50:25 | * | lritter quit (Quit: Leaving) |
20:53:45 | * | drewr joined #nim |
20:58:28 | disruptek | Araq: depending on which module a symbol is stored from, the contents of the module will vary. so we cannot simply use the signature when caching the generated code. we have to either have a map, or hash the snippets, or duplicate symbol storage. right? |
20:59:43 | * | opal quit (Ping timeout: 240 seconds) |
21:02:51 | * | solitudesf joined #nim |
21:02:55 | * | opal joined #nim |
21:41:06 | * | solitudesf quit (Ping timeout: 256 seconds) |
21:43:10 | * | alexander92 quit (Ping timeout: 255 seconds) |
21:43:49 | dadada | need an easy to understand examples on how to write custom pragma/macros to manipulate procedures/functions |
21:44:14 | disruptek | see the macros tutorial. |
21:47:33 | dadada | disruptek: I mean sth like proc foo(i: int) string {.myCustomPragma.} = return "bar" ... |
21:48:56 | dadada | I tried to just macro myCustomPragma(args: varargs[untyped]) = return args ... but then I get Invalid expression: proc foo(i: int): string = return "bar" |
21:49:00 | disruptek | how does the macros tutorial not meet your need? |
21:49:29 | dadada | but there's nothing apparently invalid about this expression that I can see |
21:50:25 | disruptek | you don't give the pragma any args, for starters. |
21:50:53 | * | silvernode joined #nim |
21:51:07 | * | silvernode quit (Client Quit) |
21:54:54 | FromDiscord | <Rika> Don't you give the pragma a proc arg if it's to be used for procs? |
21:55:03 | disruptek | yep. |
21:55:06 | dadada | k, have to use args[0] to pass the ProcDef, and I passing the Arglist on isn't working |
21:55:16 | dadada | s/I// |
21:55:19 | disruptek | well, you have to have the macro consume some kind of ast. |
21:55:49 | dadada | but it was confusing to me, because the Invalid expression error message, had valid nim code in it |
21:56:29 | dadada | when I gave the pragma a test argument, then the invalid expression became "test", proc ... and it was easy to see what was wrong |
22:03:06 | Araq | disruptek, the hash should be fine either way, it does hash the module name etc |
22:03:25 | disruptek | it doesn't seem to be. π |
22:11:33 | * | natrys quit (Quit: natrys) |
22:18:35 | dom96 | hmmm, do threadvars behave like normal vars when --threads:on isn't supplied? |
22:23:27 | dom96 | fecking hell, they do, don't they? |
22:24:48 | disruptek | vindaar: try selecting chinese as your language. |
22:25:45 | disruptek | Araq: even proc names aren't hashed, near as i can tell. |
22:30:29 | disruptek | Araq: yay, adding the name got me much further. |
22:33:28 | FromDiscord | <djazz> stream over, thanks for watching! |
22:34:53 | dwdv | Are runnableExamples part of the regular test suite or only checked on documentation generation? Also, in case I'd like to add some basic doc example, should I go with assert-driven runnableExample or `.. code-block:: Nim`? |
22:35:04 | disruptek | part of the regular test suite. |
22:35:15 | * | alexander92 joined #nim |
22:47:23 | dwdv | Alright, that's good to know, thanks. |
22:48:13 | dwdv | Another thing: What's the since pragma/annotation used for? Is this an upcoming rust-like epochs feature? |
22:52:14 | disruptek | i dunno about rust epochs. |
22:52:17 | dom96 | ahh, such fun things happen when you've got no --threads:on but your Nim code gets run from different threads by the JVM |
22:52:29 | disruptek | .since lets you run code with varied versions of stdlib. |
22:58:38 | dwdv | Does it allow me to mix 1.x, from a third-party lib, for example, and 1.y code? |
22:58:54 | disruptek | nope. |
22:59:27 | dwdv | Okay, a shame. But thanks again for the quick response. |
22:59:55 | disruptek | it's a new feature. just designed to keep old code working with new stdlib/compiler. |
23:06:49 | * | Hideki_ joined #nim |
23:11:22 | * | Hideki_ quit (Ping timeout: 255 seconds) |
23:21:08 | dom96 | argh, why is noStackFrame not a thing anymore? |
23:21:28 | dom96 | I want a proc that won't have any stack frames, but one that isn't just an asm statement |
23:24:08 | dom96 | ahh, {.push stackTrace:off.} |
23:24:23 | dom96 | Why is this not listed in the manual? :( |
23:40:39 | dwdv | Is there more info on this experimental support mentioned here? https://github.com/nim-lang/Nim/issues/6447#issuecomment-417969002 |
23:40:40 | disbot | β₯ Case statement on tuples |
23:51:53 | lqdev[m] | dwdv: https://nim-lang.org/docs/manual_experimental.html#case-statement-macros |
23:53:51 | dwdv | Damn, missed that. Thank you! |