00:05:30 | mipri | it's just a https://en.wikipedia.org/wiki/Space%E2%80%93time_tradeoff , because I/O syscalls are slow. |
00:08:59 | mipri | look at readFile in lib/system/io.nim . there's some overhead to get the size of the file, and then it tries to get the entire file in one read, which probably works up to sizes like 2GB, and then only costs additional reads after that |
00:09:16 | ForumUpdaterBot | New thread by Cmc: Announce: nestegg webm demuxer, dav1d av1 video decoder, opus audio decoder, and lov video player, see https://forum.nim-lang.org/t/7303 |
00:10:51 | FromDiscord | <Filipe Duarte> How to convert a variable from string to integer inputed by an user? |
00:11:06 | FromDiscord | <Recruit_main707> parseInt, from strutils |
00:11:11 | FromDiscord | <Recruit_main707> i think thats what you want |
00:11:34 | FromDiscord | <Recruit_main707> https://nim-lang.org/docs/strutils.html#parseInt%2Cstring |
00:12:05 | FromDiscord | <Filipe Duarte> Yeah! Thanks |
00:14:01 | FromDiscord | <Filipe Duarte> `echo "How many particles? "↵var n_particles = readLine(stdin).parseInt()` |
00:14:21 | FromDiscord | <Filipe Duarte> (edit) "readLine(stdin).parseInt()`" => "readLine(stdin).parseInt()`↵Worked" |
00:14:25 | FromDiscord | <ElegantBeef> That will fail if you pass a non int |
00:14:49 | FromDiscord | <Filipe Duarte> hum, so what is the best way? |
00:15:13 | mipri | it will successfully throw an exception if oyu pass a non int. |
00:16:23 | FromDiscord | <ElegantBeef> Yep, using `try except` is one way of not having the program crash on valid input |
00:16:28 | FromDiscord | <ElegantBeef> (edit) "valid" => "invalid" |
00:17:11 | FromDiscord | <ElegantBeef> another method would be to use `strscans.scanf` although could be considered sillier |
00:19:16 | FromDiscord | <Filipe Duarte> while true try except until the user inputs an integer? |
00:19:28 | * | Vladar quit (Quit: Leaving) |
00:19:41 | mipri | if that's what you want. I wouldn't want that. |
00:20:02 | mipri | I would generally use cligen and avoid interactive input altogether though. |
00:20:45 | mipri | it's really pointless to talk about this stuff before you've a specific dissastisfaction with the behavior of some code you've written. |
00:21:23 | mipri | maybe an uncaught exception from parseInt is an acceptable behavior for your program, given a non-int |
00:23:07 | * | kwilczynski quit (Ping timeout: 260 seconds) |
00:23:07 | * | fowl quit (Ping timeout: 260 seconds) |
00:24:15 | FromDiscord | <Filipe Duarte> Understand! I'm trying to do simple stuff for learning Nim, but I'm going to study what you've said .. cligen |
00:25:01 | * | fowl joined #nim |
00:25:09 | * | kwilczynski joined #nim |
01:01:36 | * | krux02 quit (Remote host closed the connection) |
01:05:45 | FromDiscord | <William_CTO> I'd like to use MongoEngine in nim as it contains all the DB logic I need for my project. How easy is it to work with python modules in nim? |
01:06:36 | FromDiscord | <ElegantBeef> Have you seen https://github.com/yglukhov/nimpy |
01:08:02 | FromDiscord | <William_CTO> I've been looking at that. I see that it relies on your python installation. Are there ways to use python code without relying on a python runtime? |
01:08:15 | FromDiscord | <ElegantBeef> Yea, write it i Nim 😄 |
01:08:19 | FromDiscord | <ElegantBeef> (edit) "i" => "in" |
01:08:31 | FromDiscord | <William_CTO> Ack |
01:08:53 | FromDiscord | <William_CTO> Was trying to avoid having to rewrite the business/db logic in nim and python |
01:09:03 | FromDiscord | <William_CTO> I'll give nimpy a try |
01:10:43 | FromDiscord | <ElegantBeef> I dont know what mangoengine does so no clue if there are any Nim alternatives |
01:11:11 | FromDiscord | <William_CTO> its a high level mongo orm for python |
01:11:12 | mipri | nimble search mongo |
01:11:24 | FromDiscord | <William_CTO> there are lower level mongo interfaces for nim |
01:11:55 | FromDiscord | <William_CTO> However mongoengine takes care of things like lazy references to other collection documents for me |
01:17:37 | * | jjido quit (Quit: Connection closed for inactivity) |
01:20:39 | * | Tanger joined #nim |
01:24:33 | * | saem_ joined #nim |
01:47:50 | disruptek | !repos mongo |
01:47:50 | disbot | https://github.com/mashingan/anonimongo -- 9anonimongo: 11Another Nim pure Mongo DB driver 15 16⭐ 5🍴 |
01:47:50 | disbot | https://github.com/nim-lang/mongo -- 9mongo: 11Wrapper for MongoDB 15 9⭐ 1🍴 |
01:47:50 | disbot | https://github.com/JohnAD/mongopool -- 9mongopool: 11A pooled library/driver for using MongoDB from a threaded application 15 8⭐ 0🍴 7& 1 more... |
01:49:09 | disruptek | i think the benefits of not having to use python outweigh the disadvantages, but it's your call. |
02:24:03 | * | vicfred quit (Quit: Leaving) |
02:39:08 | * | smitop quit (Quit: Connection closed for inactivity) |
02:56:46 | * | cyraxjoe joined #nim |
03:17:46 | * | mahlon joined #nim |
03:18:26 | * | abm quit (Read error: Connection reset by peer) |
03:19:38 | * | vicfred joined #nim |
03:20:21 | * | Tlangir joined #nim |
03:23:05 | * | Tanger quit (Ping timeout: 256 seconds) |
03:23:50 | FromDiscord | <William_CTO> Just wanted to make sure this is a valid range↵`score: range[0.0..1.0]`↵Can you use non-int types? |
03:24:02 | FromDiscord | <William_CTO> (edit) "types?" => "types?↵My code compiles and runs so I guess it works" |
03:26:03 | * | cyraxjoe quit (Quit: I'm out!) |
03:26:10 | FromDiscord | <shadow.> i mean that would be any default float type value from 0.0 to 1.0 |
03:26:50 | FromDiscord | <William_CTO> Yes, but it also limits it from going above 1 |
03:28:36 | * | cyraxjoe joined #nim |
03:30:03 | * | cyraxjoe quit (Client Quit) |
03:35:10 | * | cyraxjoe joined #nim |
03:53:35 | * | muffindrake quit (Ping timeout: 272 seconds) |
03:55:25 | * | muffindrake joined #nim |
04:03:16 | * | a_chou joined #nim |
04:03:27 | * | a_chou quit (Remote host closed the connection) |
04:05:30 | FromDiscord | <William_CTO> Erm, how do I accept an iterator of type JsonNode as a proc argument? |
04:07:13 | FromDiscord | <Rika> does the iterator have the `{.closure.}` pragma |
04:07:18 | FromDiscord | <Rika> or are you writing the proc? |
04:08:39 | FromDiscord | <William_CTO> I'm writing the proc |
04:08:40 | disruptek | i have a bad feeling about this. |
04:08:44 | * | mfx joined #nim |
04:08:45 | FromDiscord | <William_CTO> Why? |
04:09:09 | FromDiscord | <Rika> proc aa(x: iterator(a: JsonNode): ?): ? ... |
04:09:12 | FromDiscord | <Rika> does this not work? |
04:09:18 | FromDiscord | <Rika> i dont remember if it does actually |
04:09:34 | FromDiscord | <William_CTO> sent a code paste, see https://play.nim-lang.org/#ix=2KgS |
04:09:44 | FromDiscord | <ElegantBeef> I think you need a template for this |
04:10:00 | FromDiscord | <ElegantBeef> Or just use a generic proc that uses the jsonnode |
04:10:42 | * | mfx quit (Remote host closed the connection) |
04:11:08 | FromDiscord | <William_CTO> @ElegantBeef can you elaborate more? |
04:12:10 | FromDiscord | <William_CTO> My end goal is to take a JArray and call `to(JNode, T)` on each item in the JArray. Since the items proc works on JArrays, I figured this was the proper route to go down |
04:12:46 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2KgT like this |
04:14:00 | FromDiscord | <ElegantBeef> Items isnt a proc, but an iterator which is where this gets weird |
04:14:27 | FromDiscord | <William_CTO> Gosh, thank you for pulling me out of my complicated web |
04:14:49 | FromDiscord | <ElegantBeef> That fails silently if it's not an array so probably want to change that |
04:15:18 | FromDiscord | <William_CTO> I'm fairly new to Nim and haven't played with exceptions yet |
04:15:42 | FromDiscord | <ElegantBeef> It'd just return an empty seq so it's probably fine |
04:18:28 | FromDiscord | <William_CTO> How do you call this kind of function? |
04:18:40 | FromDiscord | <William_CTO> Rather how do I specify type T? |
04:19:17 | FromDiscord | <ElegantBeef> you can do `toSeq[T](jsonNode)` or `jsonNode.toSeq[: T]()` |
04:19:28 | FromDiscord | <ElegantBeef> T being your desired type obviously |
04:20:39 | FromDiscord | <William_CTO> Why is `: T` required in the second form? And where can I find documentation on this? |
04:21:17 | FromDiscord | <ElegantBeef> It's required cause without it it turns into `toSeq([]())` or something similar to that |
04:21:31 | FromDiscord | <William_CTO> Thank you for taking the time to answer my questions |
04:21:55 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/manual.html#procedures-method-call-syntax |
04:50:22 | * | Tlanger joined #nim |
04:53:11 | * | Tlangir quit (Ping timeout: 256 seconds) |
05:23:52 | * | D_ quit (Ping timeout: 260 seconds) |
05:25:14 | * | D_ joined #nim |
05:28:35 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
05:28:44 | * | njoseph joined #nim |
05:29:21 | * | njoseph quit (Client Quit) |
05:29:30 | * | njoseph joined #nim |
05:31:12 | ForumUpdaterBot | New post on r/nim by Chris3606: ARC/ORC and DLL Requirements, see https://www.reddit.com/r/nim/comments/kmvxmo/arcorc_and_dll_requirements/ |
05:34:42 | FromDiscord | <Cohjellah> Man going back to Python from Nim... It's actually kind of ugly |
05:34:51 | FromDiscord | <Cohjellah> Nim has that next level of elegance |
05:50:06 | FromDiscord | <shadow.> exactly |
05:50:18 | FromDiscord | <shadow.> static typing and lack of comprehension abuse makes it neater |
05:52:00 | FromDiscord | <ElegantBeef> Well also UFCS, proper control of import/export, and non qualified functions 😛 |
06:03:13 | FromDiscord | <shadow.> yeah that too |
06:03:38 | FromDiscord | <shadow.> as well as immutability |
06:03:47 | FromDiscord | <shadow.> shows what's important to mutate and what isnt |
06:13:44 | * | superbia joined #nim |
06:16:04 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
06:33:16 | FromDiscord | <William_CTO> I agree Nim is much better than python. I just haven’t ported over all my code yet |
06:34:14 | * | Gustavo6046 quit (Ping timeout: 264 seconds) |
06:36:17 | * | habamax joined #nim |
06:38:26 | * | D_ quit (Ping timeout: 256 seconds) |
06:40:02 | * | D_ joined #nim |
06:49:51 | * | narimiran joined #nim |
06:51:58 | FromDiscord | <CodeHz> question: since initTable is not needed since 0.20, can I use `new Table[...]` instead of `newTable[...]()` for init TableRef ? |
06:56:14 | narimiran | you can use `var a: TableRef[...]` |
06:56:28 | narimiran | probably. maybe. haven't tried it |
06:57:06 | FromDiscord | <flywind> !eval var a = new TableRef[int, int] |
06:57:08 | NimBot | Compile failed: /usercode/in.nim(1, 13) Error: undeclared identifier: 'TableRef' |
06:57:26 | FromDiscord | <ElegantBeef> forgot the import 😄 |
06:58:06 | FromDiscord | <flywind> !eval import tables; var a = new TableRef[int, int] |
06:58:09 | NimBot | <no output> |
06:58:18 | Prestige | @ElegantBeef the more I re-read this multiple interitance paper, the more lost I get on the implementation lol |
06:58:26 | FromDiscord | <ElegantBeef> that's a ref ref though? |
06:58:42 | Prestige | I might be able to make something super crude |
06:59:22 | FromDiscord | <CodeHz> it will create `ref TableRef[...]` not `TableRef[...]` ( |
06:59:34 | FromDiscord | <ElegantBeef> you seem to be able to do `new Table[T, T2]` |
06:59:36 | FromDiscord | <CodeHz> `TableRef[..] ` == `ref Table[...]` |
06:59:58 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=1CfZ atleast it seems to "work" 😄 |
07:00:05 | saem | I've already tried nim dump, no joy. Is there another way I might get what flags were set in the materialized cfg for a nim project? |
07:00:09 | FromDiscord | <CodeHz> yes, I think it seems to work |
07:00:19 | FromDiscord | <CodeHz> but I don't know if it is correct |
07:00:42 | FromDiscord | <ElegantBeef> I mean we have the more proper `newTable` procs for correctness |
07:02:32 | * | D_ quit (Quit: No Ping reply in 180 seconds.) |
07:02:38 | FromDiscord | <Rika> it is yes |
07:02:43 | FromDiscord | <Rika> its correct but not idiomatic |
07:03:36 | * | D_ joined #nim |
07:04:04 | FromDiscord | <flywind> !eval import tables; var x = new TableRef[int, int]; assert x is TableRef; assert x isnot ref TableRef |
07:04:07 | NimBot | <no output> |
07:04:47 | FromDiscord | <Rika> !eval import tables; var x = new TableRef[int, int]; echo x is TableRef |
07:04:52 | NimBot | true |
07:05:24 | FromDiscord | <CodeHz> !eval import tables; var x = new Table[int, int]; echo x is TableRef |
07:05:27 | NimBot | true |
07:05:42 | FromDiscord | <ElegantBeef> Well yea it's going to work |
07:05:53 | FromDiscord | <ElegantBeef> `ref T` is made from `new` |
07:05:55 | FromDiscord | <CodeHz> so the `ref ref X` is == r`ef X` |
07:06:05 | FromDiscord | <CodeHz> oh |
07:07:08 | FromDiscord | <CodeHz> but new X is more generic, should work for all "value type" |
07:07:37 | FromDiscord | <ElegantBeef> I mean it does work for all value types |
07:08:34 | FromDiscord | <ElegantBeef> But it's also not the wisest, since if the object has any initialisation required or is unknowingly a `ref` you now how a `ref ref` |
07:08:48 | FromDiscord | <ElegantBeef> (edit) "how" => "have" |
07:09:06 | FromDiscord | <Rika> didnt we just establish it doesnt ref ref or what |
07:09:15 | FromDiscord | <ElegantBeef> Did you read the entire message? |
07:09:32 | FromDiscord | <ElegantBeef> "unknowingly a ref" |
07:09:42 | FromDiscord | <CodeHz> https://media.discordapp.net/attachments/371759389889003532/793737559335108638/unknown.png |
07:09:54 | FromDiscord | <Rika> yeah |
07:09:56 | FromDiscord | <ElegantBeef> Oh you did prove it |
07:09:57 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=1LX8 |
07:09:58 | FromDiscord | <ElegantBeef> I misread |
07:09:59 | FromDiscord | <Rika> :facepalm1: |
07:10:07 | FromDiscord | <Rika> beef please |
07:10:25 | FromDiscord | <Rika> rarely does anyone need a double ref |
07:10:30 | FromDiscord | <ElegantBeef> I know |
07:10:56 | FromDiscord | <ElegantBeef> Either way it's not very idiomatic as it can make an object not initialised properly |
07:11:18 | FromDiscord | <CodeHz> (I think it will be reset to zeros) |
07:11:23 | FromDiscord | <ElegantBeef> Exactly |
07:11:24 | FromDiscord | <CodeHz> (edit) removed "be" |
07:11:25 | FromDiscord | <Rika> that is true |
07:11:42 | FromDiscord | <ElegantBeef> That's not always what you want |
07:11:42 | FromDiscord | <Rika> not all objects are initialized to 0s desirably |
07:13:01 | FromDiscord | <CodeHz> so if `var x: X` is fine, `var y: ref X = new X` is fine too |
07:13:12 | FromDiscord | <CodeHz> (edit) "fine," => "fine (without init)," |
07:13:18 | FromDiscord | <ElegantBeef> Yes |
07:15:58 | FromDiscord | <ElegantBeef> Not that there is any benefit to using `new` over a `newT` proc |
07:35:43 | * | leorize quit (Ping timeout: 240 seconds) |
07:36:29 | * | leorize joined #nim |
07:50:21 | * | disruptek throbs. |
07:56:08 | * | saem quit (Remote host closed the connection) |
07:56:08 | * | saem_ is now known as saem |
08:05:02 | disruptek | saem: if you want to know what's in the config, you can simply parse the config. |
08:06:33 | * | PMunch joined #nim |
08:06:56 | disruptek | why is ricin so damned expensive? |
08:08:49 | saem | disruptek: I'd have to build a tool and ship that because I can't do that in JS. |
08:09:47 | saem | Not the end of the world, just something to keep in mind |
08:11:53 | saem | The thing I really care about is can I do some basic automatic detection of how to fire up a debugger. |
08:18:32 | saem | My current tact is excising as much config as possible from the extension and having the programmer use .cfg and .nims. For now I'll just do it and then see what if any tooling fixes are required and some of it might have to be backported. |
08:20:37 | saem | That fixes one of the biggest issues intrinsic to the extension which is that the default mode is a nimsuggest process per file and annoying/poorly document project and project mapping configs. |
08:22:25 | saem | After that it goes back to nimsuggest bugs, which are partly from poorly configured nimsuggest instances and after narrowing those it's a bunch of test and fix until IC shows up. |
08:29:52 | * | Tlanger quit (Remote host closed the connection) |
08:33:45 | saem | Thanks for listening to me ted talk |
09:06:33 | * | Q-Master joined #nim |
09:07:00 | * | ^Q-Master^ quit (Read error: Connection reset by peer) |
09:07:00 | * | rockcavera quit (Read error: Connection reset by peer) |
09:07:07 | * | tiorock joined #nim |
09:07:07 | * | tiorock quit (Changing host) |
09:07:07 | * | tiorock joined #nim |
09:07:07 | * | tiorock is now known as rockcavera |
09:11:12 | * | tane joined #nim |
09:17:40 | * | nyaa85 joined #nim |
09:18:32 | * | nyaa8 quit (Read error: Connection reset by peer) |
09:18:32 | * | nyaa85 is now known as nyaa8 |
09:37:25 | * | zedeus quit (Ping timeout: 240 seconds) |
09:39:44 | * | zedeus joined #nim |
09:47:55 | FromDiscord | <mratsim> @disruptek, @zevv, my fiber connection which is down since Saturday, and was supposed to be repaired this evening will apparently be down until end of January.↵↵I've been on spotty 4G until now and I'm changing ISP but in the mean time I need to reduce my data consumption so will only ue internet in a very limited way. |
09:50:57 | FromGitter | <eagledot> @mratism hey, you active on arraymancer channel right now? |
09:51:17 | Zevv | mratsim: luckily there's still IRC in 2020 |
09:51:58 | FromGitter | <eagledot> :) |
09:52:16 | Zevv | where your bandwidth roughly equals the actual bandwidth of the information getting transferred |
09:53:03 | Zevv | wait, *end* of janauri? |
09:53:05 | Zevv | Man |
09:55:28 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
09:56:59 | * | Vladar joined #nim |
10:15:43 | * | tiorock joined #nim |
10:15:43 | * | rockcavera quit (Killed (orwell.freenode.net (Nickname regained by services))) |
10:15:43 | * | tiorock is now known as rockcavera |
10:15:43 | * | rockcavera quit (Changing host) |
10:15:43 | * | rockcavera joined #nim |
10:23:05 | ForumUpdaterBot | New thread by Cnerd: Http request using mom's JavaScript backend, see https://forum.nim-lang.org/t/7304 |
10:28:45 | * | rockcavera quit (Read error: Connection reset by peer) |
10:29:05 | ForumUpdaterBot | New thread by Jiyinyiyong: Any trick to custom varargs implementation in generated js?, see https://forum.nim-lang.org/t/7305 |
10:29:15 | * | rockcavera joined #nim |
10:34:36 | * | disbot quit (Ping timeout: 240 seconds) |
10:37:15 | * | vicfred quit (Quit: Leaving) |
10:38:02 | * | disbot joined #nim |
10:43:48 | * | Q-Master quit (Ping timeout: 260 seconds) |
10:51:04 | * | JustASlacker joined #nim |
10:51:44 | JustASlacker | happy easter |
10:52:14 | JustASlacker | is there something like a c-style static variable in nim? |
10:52:20 | JustASlacker | https://en.wikipedia.org/wiki/Static_variable |
10:52:32 | Zevv | static is ambigious in C |
10:52:47 | JustASlacker | like in the wiki article |
10:52:52 | Zevv | I assume you mean {.global.} |
10:53:04 | Zevv | https://nim-lang.github.io/Nim/manual.html#pragmas-global-pragma |
10:53:08 | FromDiscord | <Rika> const if what you mean in the wiki |
10:53:17 | FromDiscord | <Rika> or wait |
10:53:33 | JustASlacker | {.global.} looks nice |
10:53:53 | FromDiscord | <Rika> misinterpreted wiki lol |
10:53:58 | FromDiscord | <Rika> yeah its what zevv says |
10:54:10 | Oddmonger | is it really global , or just kept in the function scope ? |
10:54:23 | Zevv | It actualyl just compiles to a static in C |
10:54:32 | Oddmonger | ah nice |
10:55:11 | Zevv | https://play.nim-lang.org/#ix=2KhG |
10:55:31 | JustASlacker | very cool |
10:56:20 | JustASlacker | thanks |
11:00:20 | JustASlacker | I like the way the regex is build only once using {.global.} pragma |
11:01:03 | JustASlacker | But the regex stays the same. Wouldnt it be better to use let |
11:01:33 | JustASlacker | or does that not make sense? |
11:01:50 | Zevv | I don't know what regex you are referring to |
11:01:59 | JustASlacker | in the example you linked |
11:02:03 | JustASlacker | https://nim-lang.github.io/Nim/manual.html#pragmas-global-pragma |
11:02:23 | Zevv | ah in the manual, yes |
11:02:31 | Zevv | true, no reason for that to be a var, indeed |
11:02:45 | JustASlacker | rite, thx |
11:09:57 | FromDiscord | <TeiwazCoder> sent a code paste, see https://play.nim-lang.org/#ix=2KhJ |
11:13:09 | FromDiscord | <cybertim> sent a long message, see http://ix.io/2KhK |
11:14:43 | * | Q-Master joined #nim |
11:16:31 | JustASlacker | TeiwazCoder: https://en.wikipedia.org/wiki/Nim_%28programming_language%29#Uniform_Function_Call_Syntax |
11:16:35 | FromDiscord | <lqdev> @TeiwazCoder none |
11:16:47 | FromDiscord | <lqdev> this is called command call syntax |
11:17:01 | FromDiscord | <lqdev> https://nim-lang.org/docs/manual.html#procedures-command-invocation-syntax |
11:18:20 | FromDiscord | <TeiwazCoder> Thank you, I missed this point. |
11:19:25 | * | Q-Master quit (Ping timeout: 246 seconds) |
11:20:37 | FromDiscord | <Rika> @cybertim can we see the code? |
11:22:16 | FromDiscord | <cybertim> most basic example 😛 |
11:22:16 | FromDiscord | <cybertim> sent a long message, see http://ix.io/2KhM |
11:27:53 | FromDiscord | <Rika> theyre all being handled concurrently for me |
11:28:13 | FromDiscord | <cybertim> is it platform dependend? |
11:28:36 | FromDiscord | <Rika> how do you compile and load these pages |
11:29:18 | FromDiscord | <cybertim> nim r --define:useStdLib file.nim |
11:29:34 | FromDiscord | <Rika> same way i do it... |
11:29:41 | FromDiscord | <Rika> whats the platform you're using |
11:29:47 | FromDiscord | <cybertim> windows |
11:29:59 | FromDiscord | <Rika> not within wsl? |
11:30:26 | FromDiscord | <cybertim> no, using nim installed with scoop |
11:30:39 | FromDiscord | <Rika> let me try that |
11:33:07 | FromDiscord | <Rika> still works as expected for me |
11:33:18 | FromDiscord | <Rika> how are you loading the pages |
11:33:50 | FromDiscord | <cybertim> localhost:5000/ refreshing three tabs in the browser |
11:35:22 | FromDiscord | <cybertim> ok, thanks for testing 🙂 i found the issue, wouldn't have thought about it without someone trying this tho |
11:35:28 | FromDiscord | <Rika> you're refreshing them all at the same time right? |
11:35:49 | FromDiscord | <Rika> oh what was the issue then |
11:35:52 | FromDiscord | <cybertim> if i try edge .. it is suddenly doing it one at the time, tried firefox and indeed its concurrent! |
11:35:58 | FromDiscord | <Rika> lmao |
11:36:09 | FromDiscord | <Rika> edge is weird then |
11:36:10 | FromDiscord | <cybertim> this is really strange |
11:36:28 | FromDiscord | <Rika> is the console showing that the requests all get there at the same time but finish at different itmes? |
11:36:39 | FromDiscord | <cybertim> so days of testing different approaches and it is the webbrowser lol |
11:37:36 | FromDiscord | <cybertim> in firefox i see it being called almost the same time, but with edge a call really needs to be resolved before the next request comes in |
11:37:42 | mipri | or, it's still jester and the problem is some subtle protocol screwup that firefox is more forgiving of. |
11:37:54 | FromDiscord | <cybertim> could be.. |
11:38:32 | FromDiscord | <cybertim> asynchttpserver does the same, so its probably related to that |
11:38:39 | FromDiscord | <Rika> no, if the requests arent coming IN at the same time its not jester |
11:38:40 | mipri | I see a worse problem with apachebench against your jester example. The page content is received and then ab waits for the rest of it; connections only end when they time out |
11:39:09 | FromDiscord | <Rika> try httpbeast then |
11:39:18 | FromDiscord | <cybertim> that one doesnt work on windows 😛 |
11:39:40 | FromDiscord | <Rika> wsl |
11:42:05 | * | JustASlacker quit (Ping timeout: 240 seconds) |
11:54:02 | * | Q-Master joined #nim |
12:22:41 | FromDiscord | <CodeHz> it seems useMalloc also works for ARC , doesn't it? https://media.discordapp.net/attachments/371759389889003532/793816322965241866/unknown.png |
12:23:42 | FromDiscord | <CodeHz> https://nim-lang.org/docs/nimc.html#nim-for-embedded-systems it is so confused |
12:25:23 | FromDiscord | <Rika> its supposed to work for arc yes |
12:25:30 | FromDiscord | <Rika> not updated docs i guess |
12:27:32 | FromDiscord | <CodeHz> but what's about other type gc? |
12:27:35 | FromDiscord | <CodeHz> like ORC |
12:27:59 | mipri | if something works for arc it's going to work for orc. |
12:28:03 | FromDiscord | <Rika> orc is just arc with a cycle breaker i believe |
12:28:31 | FromDiscord | <CodeHz> no, orc will crash when used with dll( |
12:28:43 | FromDiscord | <CodeHz> because nimrtl is broken for arc/orc |
12:28:57 | FromDiscord | <CodeHz> and cycle collector need it |
12:29:00 | mipri | likewise, if something doesn't work for arc it's not going to work for orc. |
12:30:32 | FromDiscord | <CodeHz> but arc works with dll |
12:31:07 | FromDiscord | <CodeHz> since it doesn't need cycle collector( |
12:31:40 | FromDiscord | <CodeHz> (edit) "but arc works with dll ... " added " with -d:useMalloc" |
12:33:00 | FromDiscord | <CodeHz> https://github.com/geekrelief/gdnim/issues/8 |
12:33:01 | disbot | ➥ gc:ORC crashes gdnim with useMalloc |
12:35:24 | * | lum quit (Quit: Lum: Bye!) |
12:41:30 | ForumUpdaterBot | New post on r/nim by miran1: Nim in 2020: A short recap, see https://nim-lang.org/blog/2020/12/28/nim-in-2020-a-short-recap.html |
12:44:25 | * | FromDiscord quit (Remote host closed the connection) |
12:44:40 | * | FromDiscord joined #nim |
12:53:31 | FromDiscord | <CodeHz> btw, why nimble.directory not use latest version nim https://media.discordapp.net/attachments/371759389889003532/793824080867753994/unknown.png |
12:54:06 | * | saem quit (Quit: Connection closed for inactivity) |
12:54:08 | FromDiscord | <CodeHz> (edit) "btw, why nimble.directory ... not" added "does" |
12:56:38 | FromDiscord | <CodeHz> (edit) btw, why does nimble.directory not use latest version nim https://media.discordapp.net/attachments/371759389889003532/793824080867753994/unknown.png |
13:11:57 | * | lum joined #nim |
13:12:40 | * | lum quit (Client Quit) |
13:16:02 | * | lum joined #nim |
13:16:17 | Zevv | mratsim: I bet that'll be a hell of a productive month for you then |
13:19:24 | narimiran | hey Zevv! is it know that npeg doesn't play nice with `result` when used in a function? |
13:19:39 | narimiran | *known |
13:41:00 | Zevv | narimiran: hm like how |
13:41:01 | Zevv | \9 |
13:41:34 | FromDiscord | <William_CTO> Morning. |
13:41:35 | FromDiscord | <William_CTO> (edit) "Morning." => "Morning" |
13:42:07 | narimiran | Zevv: let me try to find you a small example |
13:43:36 | narimiran | Zevv: `rule <- >+Digit * ": " * (letter | choice | list) * '\n': result[parseInt($1)] = foo` |
13:44:22 | narimiran | i had do introduce a new variable, `bar`, do `bar[parseInt($1)] = foo`, and then `return bar` |
13:47:39 | * | habamax quit (Quit: leaving) |
13:48:29 | * | lritter joined #nim |
13:52:07 | FromDiscord | <himu> Hi. I am trying to run this example (second code example):↵https://nim-lang.github.io/Nim/intern.html#code-generation-for-closures-design↵Giving me errors. |
13:53:00 | * | def- quit (Quit: -) |
13:53:34 | * | Gustavo6046 joined #nim |
13:54:40 | * | def- joined #nim |
13:56:18 | * | rockcavera quit (Remote host closed the connection) |
14:02:03 | * | PMunch quit (Quit: leaving) |
14:02:45 | FromDiscord | <William_CTO> What errors @himu? |
14:03:17 | FromDiscord | <William_CTO> Also, I'd like to thank everyone for being so welcoming and gracious in this community! |
14:07:20 | FromDiscord | <himu> sent a code paste, see https://play.nim-lang.org/#ix=2KiJ |
14:07:57 | * | fanta1 joined #nim |
14:08:11 | FromDiscord | <CodeHz> I don't think it is runnable example.. |
14:08:23 | FromDiscord | <CodeHz> it is pesudocode for demo |
14:08:48 | FromDiscord | <himu> code looks perfectly fine to me TBH |
14:08:55 | FromDiscord | <himu> Can I know what's wrong? |
14:09:13 | FromDiscord | <himu> (edit) "Can I know what's wrong? ... " added "and what should I do when I encounter such a case later" |
14:09:52 | FromDiscord | <CodeHz> tuple[...] need named field |
14:10:08 | FromDiscord | <CodeHz> aka `(prc: anan, data: env)` |
14:10:19 | FromDiscord | <CodeHz> (edit) "anan," => "anon," |
14:11:52 | FromDiscord | <CodeHz> https://play.nim-lang.org/#ix=2KiO |
14:12:00 | FromDiscord | <CodeHz> and it is working version |
14:12:34 | * | superbia quit (Quit: WeeChat 3.0) |
14:12:43 | FromDiscord | <CodeHz> hmmm wait, why the `if` is needed |
14:13:31 | FromDiscord | <Rika> it is not |
14:13:54 | FromDiscord | <CodeHz> so |
14:13:59 | FromDiscord | <CodeHz> sent a code paste, see https://play.nim-lang.org/#ix=2KiP |
14:14:56 | FromDiscord | <CodeHz> (edit) "https://play.nim-lang.org/#ix=2KiP" => "https://play.nim-lang.org/#ix=2KiQ" |
14:15:33 | FromDiscord | <CodeHz> (edit) "https://play.nim-lang.org/#ix=2KiQ" => "https://paste.rs/kRq" |
14:16:02 | FromDiscord | <CodeHz> (edit) sent a code paste, see https://play.nim-lang.org/#ix=2KiS |
14:16:54 | FromDiscord | <himu> yeah. `if` is optonal. nevermind. what's `nimcall`. How many of these are there? What's the term for this BTW |
14:17:13 | FromDiscord | <himu> nimcall makes the difference it seems. |
14:17:16 | FromDiscord | <CodeHz> https://nim-lang.org/docs/manual.html#types-procedural-type |
14:17:59 | FromDiscord | <CodeHz> https://media.discordapp.net/attachments/371759389889003532/793845341069508608/unknown.png |
14:17:59 | FromDiscord | <himu> huh. great. thanks @CodeHz |
14:18:57 | FromDiscord | <William_CTO> How can I let a proc accept two different types of object as parameter? |
14:19:12 | FromDiscord | <William_CTO> I don't need to do an overload since the code is exactly the same |
14:19:28 | FromDiscord | <Rika> a: type1 or type2 |
14:19:44 | FromDiscord | <Rika> effectively the same as overloading with the same body |
14:19:45 | FromDiscord | <haxscramper> Or `T1 | T2` |
14:19:49 | FromDiscord | <William_CTO> sent a code paste, see https://play.nim-lang.org/#ix=2KiT |
14:19:54 | FromDiscord | <Rika> yes |
14:20:02 | FromDiscord | <William_CTO> That can be `p: ProfanityAction | ProfanityMarker |
14:20:04 | FromDiscord | <William_CTO> (edit) "ProfanityMarker" => "ProfanityMarker`" |
14:20:06 | FromDiscord | <Rika> yes |
14:20:08 | FromDiscord | <William_CTO> Awesome thanks! |
14:20:13 | FromDiscord | <Rika> you can also use `or` |
14:20:14 | FromDiscord | <Rika> if you wna |
14:20:15 | FromDiscord | <Rika> want |
14:20:33 | FromDiscord | <William_CTO> Gotcha |
14:21:30 | FromDiscord | <himu> these are called union types right? |
14:21:31 | FromDiscord | <William_CTO> Which is used more often/more correct as an argument?↵`category: string = ""` or `category: Option[string] = none(string)` |
14:23:50 | FromDiscord | <CodeHz> it depends |
14:24:49 | FromDiscord | <haxscramper> `T1 | T2` is a user-defined type class https://nim-lang.org/docs/manual.html#generics-type-classes |
14:26:20 | FromDiscord | <haxscramper> I would recommend going with `Option[]` since `category.isSome()` is more idiomatic wrt. to your intentions |
14:26:31 | FromDiscord | <haxscramper> E.g. if something is optional, make it an `Option` |
14:27:03 | FromDiscord | <William_CTO> 👍 |
14:27:41 | FromDiscord | <William_CTO> and in the proc I have to include `= none(T)` to make it an optional arg, correct? |
14:27:43 | FromDiscord | <himu> i missed a lot of things from the 3 part nim tutorial it seems. lol. interesting that i learnt this. i use this a lot in typescript. thanks! |
14:27:50 | FromDiscord | <CodeHz> btw nim don't have space-optimization like rust does( |
14:28:13 | FromDiscord | <haxscramper> You mean `--opt:size` for compilation? |
14:28:23 | FromDiscord | <CodeHz> so Option[something] will use more memory than plain string |
14:28:28 | FromDiscord | <CodeHz> (edit) "Option[something]" => "Option[string]" |
14:29:07 | FromDiscord | <haxscramper> SIze is `sizeof(bool)` more compared to regular string - https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/options.nim#L69 |
14:29:29 | FromDiscord | <Starlk> Nim is statically typed, right? |
14:29:34 | FromDiscord | <haxscramper> Or rust has absolutely no overhead? |
14:29:38 | FromDiscord | <CodeHz> (but since struct must be aligned |
14:29:49 | FromDiscord | <CodeHz> so if string contains a pointer |
14:30:06 | FromDiscord | <CodeHz> the Option will use 8 byte overhead in 64bit system |
14:30:11 | FromDiscord | <CodeHz> (edit) "use" => "have" |
14:30:29 | FromDiscord | <CodeHz> (edit) "so if string contains a pointer ... " added "(and it must have)" |
14:31:24 | FromDiscord | <Rika> option string will not use more space afaik |
14:31:44 | FromDiscord | <Rika> i dont see why it would |
14:31:54 | FromDiscord | <haxscramper> There is no overhead `when T is SomePointer`, but since string is a value type |
14:32:06 | FromDiscord | <CodeHz> https://play.nim-lang.org/#ix=2Kj4 |
14:32:08 | FromDiscord | <InventorMatt> @Starlk yes, Nim is statically typed |
14:32:11 | FromDiscord | <Rika> is string not handled like a pointer by options? |
14:32:13 | FromDiscord | <Starlk> Thank you |
14:32:16 | * | saem joined #nim |
14:32:17 | FromDiscord | <himu> BTW how big is this language. Nim. from the three part tutorial it seemed very straightforward. Nim has a lot and lot of features baked in. |
14:32:24 | FromDiscord | <Rika> its pretty big |
14:33:14 | FromDiscord | <CodeHz> yes, that's why I say it has 8 byte overhead( |
14:33:20 | FromDiscord | <Rika> okay |
14:34:01 | * | abm joined #nim |
14:34:49 | FromDiscord | <haxscramper> Three-part tutorial + manual covers most of the features you would need to use + there is a `std/macros` which you should also read if you want to work with macros. That's about all, though there is a lot of smaller details |
14:34:49 | FromDiscord | <CodeHz> and I don't think it is possible to create a new overload for Option[string] |
14:35:09 | FromDiscord | <CodeHz> (if you enabled nilSeqs options |
14:35:23 | FromDiscord | <haxscramper> Like https://nim-lang.org/docs/manual_experimental.html and https://github.com/nim-lang/Nim/wiki/Lesser-known-Nim-features |
14:35:23 | FromDiscord | <CodeHz> (edit) "(if" => "(even if" |
14:35:41 | FromDiscord | <CodeHz> (edit) "and I don't think it is possible to create a new overload for Option[string] ... " added "and make it smaller" |
14:36:00 | FromDiscord | <CodeHz> (edit) "smaller" => "smaller, unless choose a magic value for string(" |
14:37:53 | FromDiscord | <CodeHz> macros is good, until you got some random compile-time segfault( |
14:38:08 | FromDiscord | <CodeHz> (edit) "macros is good, until you got some random compile-time segfault( ... " added "happens in CI, but not in your machine(" |
14:38:37 | * | Q-Master quit (Ping timeout: 260 seconds) |
14:41:22 | * | spiderstew_ quit (Ping timeout: 246 seconds) |
14:42:28 | FromDiscord | <haxscramper> Though there are several other modules in stdlib that can really change the way you write things. The most prominent one is `std/sugar`, but there is more depending on who you ask |
14:47:30 | ForumUpdaterBot | New thread by Lachu: Error durning compilation: object constructor needs an object type;, see https://forum.nim-lang.org/t/7308 |
14:51:18 | * | spiderstew joined #nim |
14:51:51 | * | def- quit (Quit: -) |
14:54:02 | * | def- joined #nim |
14:54:38 | FromDiscord | <bark> does this happen often |
14:54:48 | FromDiscord | <Rika> not really |
14:55:44 | * | Q-Master joined #nim |
14:56:58 | FromDiscord | <CodeHz> About <1 %, but it will silent break some tests( |
14:57:44 | FromDiscord | <Rika> not enough that youd be better off using another language no> |
14:57:48 | FromDiscord | <Rika> ? |
14:59:15 | FromDiscord | <CodeHz> (edit) About <1 %, but it will silent break some tests(and just click re-run to fix it |
14:59:47 | * | def- quit (Quit: -) |
14:59:57 | * | def- joined #nim |
15:02:41 | FromDiscord | <Balen> sent a code paste, see https://play.nim-lang.org/#ix=2Kjn |
15:02:52 | FromDiscord | <Balen> sent a code paste, see https://play.nim-lang.org/#ix=2Kjo |
15:03:45 | * | waleee-cl joined #nim |
15:07:27 | FromDiscord | <notchris> morning @Rika |
15:08:09 | Oddmonger | i don't understand this statement: |
15:08:17 | Oddmonger | hello "hello": |
15:08:31 | Oddmonger | (and then , concatenation of two variables) |
15:08:43 | FromDiscord | <Rika> gm to you notchris |
15:09:15 | Oddmonger | it was « echo "hello": », btw |
15:09:28 | Oddmonger | i've read this in the macro section of the manual |
15:09:53 | FromDiscord | <Rika> everything after the : is passed as the last argument or so i believe? |
15:10:16 | Oddmonger | i must admit i don't understant anything in the macro section |
15:10:41 | Oddmonger | the echo thing is in «code block as argument» |
15:10:54 | Oddmonger | seriously, you can write things like this ?! but why ? |
15:11:03 | FromDiscord | <Rika> can be useful |
15:11:14 | FromDiscord | <Rika> for templates as an example |
15:11:37 | Oddmonger | ah, for parametrizing an echo ? |
15:12:09 | Oddmonger | seems a complicated way for calling echo (truc & machin) |
15:12:19 | FromDiscord | <Rika> for echo its weird |
15:12:44 | FromDiscord | <CodeHz> I think it primarily for macro and template |
15:13:14 | FromDiscord | <CodeHz> `template t(body: untyped)` |
15:13:23 | FromDiscord | <CodeHz> and pass a block as body |
15:13:46 | FromDiscord | <Balen> everything or is like one argument passed to the last argument? |
15:14:03 | FromDiscord | <Rika> i dont remember |
15:14:07 | FromDiscord | <CodeHz> Only last argument |
15:14:08 | FromDiscord | <Rika> read the manual it knows more than me |
15:14:17 | FromDiscord | <Balen> I'll try it real quick |
15:15:05 | FromDiscord | <CodeHz> And if you do need more block parameters, use `do:` (( see experiment manual |
15:15:48 | Oddmonger | well, i think i read first and understand later |
15:16:20 | FromDiscord | <CodeHz> and it also works for normal function call syntax:↵f("hello"): |
15:29:11 | FromDiscord | <CodeHz> (edit) note it also works for normal function call syntax:↵f("hello"): |
15:32:04 | Zevv | narimiran: yeah, what's "result" in this case then |
15:32:12 | Zevv | it's not *your* result |
15:39:04 | narimiran | Zevv: here's the full code: https://github.com/narimiran/AdventOfCode2020/blob/master/nim/day19.nim |
15:39:37 | narimiran | i couldn't do `result[0]` and `result[1]`, i had to use `rules` and `messages` |
15:40:59 | Zevv | your code blocks run inside an implicit proc, whoese return type is a bool indicating if the match succeeded |
15:44:26 | narimiran | aha! |
15:44:43 | narimiran | thanks for the clarification, Zevv! |
15:45:24 | Zevv | I chose not to document that because the implemenation might change |
15:45:37 | Zevv | it used to be a code block, but putting it inside a proc has some nice pro's regarding to isolation |
15:48:35 | * | def- quit (Quit: -) |
15:49:51 | * | def- joined #nim |
15:56:23 | Oddmonger | i cannot understand why this file reading is blocking: https://play.nim-lang.org/#ix=2Kjy |
16:04:47 | Oddmonger | ok recursive call (read_file == readFile , didn't remember this one) |
16:23:22 | * | rockcavera joined #nim |
16:37:51 | disruptek | the lion is the king of the jungle. |
16:43:52 | FromDiscord | <lantos> sent a code paste, see https://paste.rs/dti |
16:45:30 | FromDiscord | <Vindaar> Just do `initTable[string, MyObj]` and assign the object itself (or do you really want to have a pointer? in that case use `pointer` as the value) |
16:45:43 | mipri | ptr MyObj |
16:45:53 | FromDiscord | <Vindaar> yes, this ^ |
16:47:14 | FromGitter | <eagledot> @Vindaar hey,you active on arraymancer channel? |
16:47:28 | * | NimBot joined #nim |
16:47:35 | FromDiscord | <Vindaar> normally I am, but in the last few days haven't looked in there, sorry |
16:48:08 | FromGitter | <eagledot> Can i send you a message there now? |
16:49:23 | FromDiscord | <Vindaar> Are you Anubhav on gitter? |
16:49:28 | FromGitter | <eagledot> Yes |
16:50:08 | FromDiscord | <lantos> trying to avoid copies, if I had two tables would mean if I update one the other wouldn't update |
16:50:26 | FromDiscord | <lantos> (edit) "would" => "wouldn't this" |
16:51:43 | * | leorize quit (Ping timeout: 240 seconds) |
16:51:50 | FromDiscord | <Vindaar> a safer way to do that would be to make your object a `ref object` and then the update should update both |
16:53:10 | * | leorize joined #nim |
16:55:02 | FromDiscord | <bark> yeah, if you want to update both copies, make the "name" field ref |
16:55:38 | FromDiscord | <bark> i also provided a maybe overcomplicated example in #offtopic |
16:55:52 | * | leorize quit (Remote host closed the connection) |
16:56:02 | FromDiscord | <bark> i really overcomplicated it though, I guess the whole MyObj is not even neccessary if you have two tables |
16:59:12 | * | leorize joined #nim |
17:00:52 | jken | What is the write signature for a proc called newMatrix(size: int) that returns a Matrix[size: int |
17:01:31 | jken | I assumed `proc newMatrix(size: int): Matrix[size] =` but no dice |
17:02:02 | * | saem quit (Quit: Connection closed for inactivity) |
17:03:32 | FromDiscord | <lantos> sent a code paste, see https://play.nim-lang.org/#ix=1Vp4 |
17:03:53 | FromDiscord | <lantos> sent a code paste, see https://play.nim-lang.org/#ix=2Kkg |
17:04:17 | FromDiscord | <Rika> how the |
17:04:18 | FromDiscord | <Rika> ? |
17:04:27 | FromDiscord | <Rika> oh |
17:04:28 | FromDiscord | <Rika> misread |
17:05:03 | FromDiscord | <Rika> in this case you have to store MyObjRefs on the seq |
17:05:08 | FromDiscord | <Rika> not just MyObjs |
17:06:06 | FromDiscord | <lantos> so I'd not use the MyObj directly anymore |
17:06:13 | FromDiscord | <Anuke> Is it normal for nimPNG to allocate several megabytes of `string`s that persist even after the image is gone? Code, tested with --gc:arc https://play.nim-lang.org/#ix=2Kkh |
17:06:33 | * | saem joined #nim |
17:06:53 | FromDiscord | <Rika> that doesnt sound right |
17:07:35 | FromDiscord | <Anuke> in this case I'm loading a 12x12 image, which should take up a few KB at most |
17:08:49 | FromDiscord | <lantos> sent a code paste, see https://play.nim-lang.org/#ix=2Kki |
17:10:30 | FromDiscord | <Rika> careful that this is much slower than using regular object |
17:10:43 | FromDiscord | <Rika> maybe a magnitude or so slower |
17:10:56 | FromDiscord | <Rika> so if you care about that then yeah |
17:11:28 | FromDiscord | <Anuke> sent a long message, see http://ix.io/2Kkk |
17:12:32 | FromDiscord | <Clyybber> @Anuke Can you try with orc? |
17:13:38 | FromDiscord | <Anuke> with orc, I get ~`5.6`MB, which is the same as with --arc |
17:14:09 | FromDiscord | <Sorrow> Hello. I'd like to get some help with porting some of my Python code to Nim. Is it okay to ask here? |
17:14:55 | mipri | if you're only using MyObjRef, there's no need for MyObj. just define a `ref object` instead |
17:15:54 | FromDiscord | <lantos> yeah is gotta go fast 😎 |
17:16:47 | FromDiscord | <Anuke> Some other observations:↵- when I load the 12x12 image 1000 times in a loop, the memory usage doesn't change; it stays at 5.6 ↵- when I load a 4096x4096 image in a loop, the memory usage unpredictably jumps at certain iterations |
17:17:31 | FromDiscord | <lantos> just trying to see if i can make a lightweight dataframe. I know vindaar has a df but I don't understand it and would like to help someway |
17:17:47 | FromDiscord | <Clyybber> @Anuke Hmm, seems like without gc:arc its taking up those 5mb even before loading the image |
17:19:04 | FromDiscord | <Clyybber> oh, and isn't it 0.5mb? |
17:19:25 | FromDiscord | <Clyybber> oh, nevermind, stupid me forgot the image file :P |
17:19:35 | FromDiscord | <Anuke> when I completely skip any nimPNG code, it is 0.5mb |
17:19:51 | FromDiscord | <Anuke> but only after I call `getTotalMem()` |
17:20:51 | FromDiscord | <Anuke> I briefly skimmed the nimPNG code and couldn't find any global variables that could lead to 5.6mb usage |
17:21:09 | FromDiscord | <Anuke> (correction: any global variables at all) |
17:23:49 | ForumUpdaterBot | New thread by Treeform: DumpIncludes - See where your exe size comes from., see https://forum.nim-lang.org/t/7309 |
17:27:15 | FromDiscord | <Clyybber> @Anuke Heh, you were using getTotalMem, what you want is getOccupiedMem |
17:27:44 | FromDiscord | <Clyybber> Nim's default allocator doesn't return free memory to the OS immediately so thats why you are getting those numbers |
17:28:01 | FromGitter | <HJarausch_gitlab> How to contact Timothee Cour? I have found a nasty bug in his otherwise brilliant *iterate* macro. I'd like to discuss the issue with him. |
17:28:08 | FromDiscord | <Anuke> Oh, I see, thanks |
17:28:25 | FromDiscord | <Clyybber> HJarausch_gitlab: Just @timotheecour :) |
17:28:40 | FromDiscord | <Clyybber> on gitter |
17:28:57 | FromGitter | <HJarausch_gitlab> Does this work even he isn't online? |
17:29:20 | FromDiscord | <Clyybber> I think so |
17:29:37 | FromGitter | <HJarausch_gitlab> And what about attachments? |
17:32:28 | FromDiscord | <Rika> i'm currently in the process of making a rand lib like V's, was anyone doing the same? |
17:35:11 | FromDiscord | <lantos> are there things that could be included in the nim.random std? |
17:36:02 | FromDiscord | <Rika> uh i dont think so |
17:36:10 | FromDiscord | <shadow.> do i check platform with hostOS or when defined() |
17:36:12 | FromDiscord | <shadow.> (edit) "defined()" => "defined()?" |
17:36:29 | FromDiscord | <Rika> once i release the code it can be inched towards that code quality sure |
17:37:51 | FromDiscord | <Clyybber> HJarausch_gitlab: Not sure if gitter has attachments |
17:38:02 | FromDiscord | <shadow.> or rather what's the difference between hostOS and defined(windows/unix/etc) |
17:39:47 | * | Jesin quit (Quit: Leaving) |
17:43:03 | * | Kaivo quit (Quit: WeeChat 2.9) |
17:44:47 | FromDiscord | <Vindaar> @Rika don't know anything about V's `rand` lib, but you're aware of https://github.com/unicredit/alea ? |
17:45:25 | FromDiscord | <shadow.> if im making a parsing error type what should i inherit from |
17:46:32 | FromDiscord | <Rika> nope |
17:46:50 | FromDiscord | <Rika> damn i was beat haha |
17:47:04 | FromDiscord | <shadow.> ripp |
17:47:15 | FromDiscord | <Rika> well its kinda different still, what im doing |
17:47:46 | FromDiscord | <bark> Exception? |
17:47:56 | FromDiscord | <Rika> ah no what im doing is totally different lol |
17:48:04 | FromDiscord | <Rika> im porting many kinds of rngs |
17:48:23 | FromDiscord | <Rika> so i guess the lib im doing will aid alea |
17:48:34 | * | cyraxjoe quit (Ping timeout: 265 seconds) |
17:48:50 | FromDiscord | <shadow.> well i was thinking like |
17:48:54 | FromDiscord | <bark> wait is that UniCredit S.p.A. that large bank? |
17:48:56 | FromDiscord | <shadow.> ValueError or something idk? |
17:48:59 | FromDiscord | <bark> they doing stuff in nim? |
17:49:03 | FromDiscord | <shadow.> ig CatchableError works |
17:49:15 | FromDiscord | <Rika> valueerror exists in nim tho |
17:49:16 | FromDiscord | <Rika> doesnt it |
17:49:40 | FromDiscord | <bark> apparently it is, that's so coo |
17:49:43 | FromDiscord | <bark> (edit) "coo" => "cool" |
17:49:45 | FromDiscord | <shadow.> yeah ofc |
17:49:50 | FromDiscord | <shadow.> i was just wondering if that fit |
17:49:52 | FromDiscord | <shadow.> for this situation |
17:53:55 | * | cyraxjoe joined #nim |
17:55:12 | * | Jesin joined #nim |
17:55:24 | FromDiscord | <Rika> is there a way to check if the system's bit width is 32 or so |
17:57:04 | FromDiscord | <bark> https://media.discordapp.net/attachments/371759389889003532/793900476277587988/unknown.png |
17:57:18 | FromDiscord | <bark> 🤔 but i guess you can have 32 bit os-es on 64 bit cpu's |
17:58:19 | FromDiscord | <bark> sizeof(int) seems a bit hacky as well |
17:59:57 | FromDiscord | <Rika> yeah :KannaKMS: |
18:00:12 | FromDiscord | <Rika> fuck it ill do sizeof int |
18:00:30 | * | abm quit (Quit: Leaving) |
18:02:27 | disruptek | madlad |
18:09:10 | Zevv | bit with is messy, it's not so simply |
18:09:22 | Zevv | your ints might me 32 and your pointers 64, or the other way around |
18:10:37 | Zevv | consider sizeof(Pointer) |
18:10:58 | FromDiscord | <Rika> https://nim-lang.org/docs/system.html#int says here always size of pointer |
18:12:28 | Zevv | https://play.nim-lang.org/#ix=2KkC |
18:12:31 | Zevv | lucky you :) |
18:13:55 | FromDiscord | <Rika> 🙂 |
18:21:17 | FromDiscord | <Sorrow> sent a code paste, see https://play.nim-lang.org/#ix=2KkF |
18:21:39 | FromDiscord | <Sorrow> (edit) "https://play.nim-lang.org/#ix=2KkF" => "https://play.nim-lang.org/#ix=2KkG" |
18:22:07 | FromDiscord | <Rika> i cant help right now but i think you can find the info in the docs for `io` |
18:22:13 | FromDiscord | <Rika> io module i mean |
18:22:40 | FromDiscord | <Sorrow> Took a look earlier. Didn't really help. |
18:25:05 | FromDiscord | <Sorrow> Rats. Searching for bytes looks likes it's gonna be a pain, too. |
18:25:06 | mipri | https://play.nim-lang.org/#ix=2KkI |
18:27:24 | FromDiscord | <Sorrow> Thank you. |
18:30:54 | * | a_chou joined #nim |
18:33:38 | * | a_chou quit (Client Quit) |
18:37:46 | FromDiscord | <Sorrow> What about reading bytes at a specific offset / pos? |
18:39:29 | mipri | same thing, but read instead of write. |
18:39:46 | FromDiscord | <bark> sent a code paste, see https://play.nim-lang.org/#ix=2KkM |
18:39:49 | FromDiscord | <bark> it says there is nothing to borrow |
18:40:33 | FromDiscord | <bark> (even after the edit it still) |
18:40:39 | FromDiscord | <bark> (edit) "https://play.nim-lang.org/#ix=2KkM" => "https://play.nim-lang.org/#ix=2KkN" |
18:41:55 | mipri | what I'd do is forget about the {.borrow.} and do it manually. |
18:43:02 | FromDiscord | <bark> I suppose that works |
18:43:15 | mipri | https://nim-lang.org/docs/io.html#readChar%2CFile , https://play.nim-lang.org/#ix=2KkO |
18:52:52 | FromDiscord | <Sorrow> Thanks again. |
18:58:08 | FromDiscord | <Sorrow> Is it okay to slap a toHex(2) at the end of the readChar? |
18:58:31 | mipri | try it. |
19:03:07 | * | Arrrrrrrr joined #nim |
19:05:16 | * | vsantana joined #nim |
19:10:01 | ForumUpdaterBot | New thread by Alexeypetrushin: How to parse custom JSON serialization format?, see https://forum.nim-lang.org/t/7311 |
19:21:55 | FromDiscord | <Sorrow> Works fine. Is there anything like Py's find() by any chance? Works with bytes. |
19:22:18 | mipri | probably. what's Py's find() do? |
19:23:05 | mipri | !eval import strutils; echo "hello".find 'e' # something like this? |
19:23:08 | NimBot | 1 |
19:23:17 | FromDiscord | <Sorrow> Returns the offset of the bytes to find. |
19:25:04 | FromDiscord | <Sorrow> Have to say I'm liking the lang so far. |
19:37:13 | * | xet7_ joined #nim |
19:38:36 | * | xet7 quit (Ping timeout: 240 seconds) |
19:38:47 | disruptek | weird. |
19:49:32 | * | hnOsmium0001 joined #nim |
19:50:23 | * | superbia joined #nim |
19:50:40 | * | superbia quit (Client Quit) |
19:50:46 | saem | is it? |
19:52:47 | FromDiscord | <cybertim> hooray my first project is working now in nim, and the binary is only 500kb 🤣 the spring-java version that was deployed previously was 32MB (and you need the jvm ofcourse) and now i got it using async and threads, threads communicate through a single channel using ids and the json lib, works great |
19:53:17 | FromDiscord | <cybertim> only thing that could really need some improvement is the tooling, but i guess this will get better eventually |
19:53:19 | saem | Congrats |
19:53:33 | Prestige | That's awesome |
19:55:41 | * | lritter quit (Ping timeout: 265 seconds) |
19:56:08 | ForumUpdaterBot | New thread by Jseb: Using readFile with javascript, see https://forum.nim-lang.org/t/7312 |
19:56:30 | saem | I know how that story goes. :D |
19:59:27 | FromDiscord | <cybertim> thanks, this feels better, most stuff now is so microservice based that making such huge blobs of apps is a bit hard to maintain if you can't get into the 'guts' after trying so many alternatives, we will see how this service will keep up in prod 😛 |
20:06:14 | Prestige | not open source I'm guessing? |
20:09:32 | FromDiscord | <cybertim> it's not closed or anything but very specific, i will probably port some deno and java projects to nim as well next year that are more suited to be released on github etc |
20:09:54 | FromDiscord | <Meowz> Damn.. next year?! Oh wait.. |
20:15:32 | jken | Whats the cleanest way to write this list eval in nim? sum(2**v for v in range(8) if f_eval[v] > 0) |
20:20:57 | FromDiscord | <haxscramper> As inline expression you could probably use `toSeq(0 .. 8).filterIt(f_eval[it] > 0)` or something similar |
20:21:30 | FromDiscord | <haxscramper> Or with `std/sugar.collect` `for v in 0 .. 8: if f_eval[v] > 0: 2 v` |
20:22:23 | disruptek | surely it makes more sense to do this with bitops. |
20:22:36 | jken | oh probably |
20:22:42 | * | L[m] left #nim ("User left") |
20:26:24 | * | rockcavera quit (Remote host closed the connection) |
20:27:40 | * | Kaivo joined #nim |
20:45:51 | * | wowaname joined #nim |
20:46:09 | * | radgeRayden joined #nim |
20:46:53 | radgeRayden | dom96: hi, I was taking a look at nimble, I'm curious about how coupled to nim itself it is? I'm interested in using it for another language. |
20:47:27 | radgeRayden | would I need to make drastic source code changes, or is it generic enough that I only need to distribute it with another configuration? |
20:48:36 | * | wowaname is now known as opal |
20:52:43 | * | xet7_ is now known as xet7 |
20:57:09 | * | fanta1 quit (Quit: fanta1) |
21:05:48 | * | xet7 quit (Quit: Leaving) |
21:06:14 | * | xet7 joined #nim |
21:17:39 | * | jjido joined #nim |
21:18:37 | * | Arrrrrrrr quit (Quit: Arrrrrrrr) |
21:19:30 | Zevv | disruptek |
21:19:33 | disruptek | wut |
21:19:40 | Zevv | do I need to spend time to make tzevv work again? |
21:19:47 | disruptek | probably, yes. |
21:19:58 | Zevv | k |
21:20:10 | disruptek | or you can wait and i'll get to it after i fix taste. |
21:20:10 | * | narimiran quit (Ping timeout: 256 seconds) |
21:20:18 | disruptek | which comes after i fix nimph ci. |
21:20:47 | Zevv | I want to see my compiler messages on a compile error with testes |
21:20:48 | Zevv | how do |
21:20:55 | disruptek | --define:release |
21:21:05 | disruptek | just run testes; it does the right thing. |
21:21:27 | Zevv | i aint got no testes in my path |
21:21:37 | disruptek | freshen your testes. |
21:22:14 | * | superbia joined #nim |
21:22:17 | * | superbia quit (Client Quit) |
21:22:54 | Zevv | ah all my AST is ill formed |
21:22:58 | Zevv | how did that happen |
21:24:47 | Zevv | I forgot *all* about this stuff. |
21:24:49 | Zevv | Error: no generic parameters allowed for ref |
21:24:52 | Zevv | why tho?! |
21:26:35 | disruptek | probably something clyybber did. the guy is nuts. |
21:27:21 | Zevv | always the same |
21:29:44 | Zevv | _very_ broken |
21:29:45 | Zevv | most if it |
21:30:04 | disruptek | neat, right? |
21:31:27 | Zevv | something exit_ |
21:32:31 | disruptek | what? |
21:32:40 | Zevv | Error: implementation of 'exit_369100425' expected |
21:32:41 | Zevv | all new to me |
21:32:48 | Zevv | I never looked further then 0.0.13 |
21:33:08 | disruptek | there never /was/ further than 0.0.13. |
21:33:37 | Zevv | so those 73 commits _after_ 0.0.13 |
21:35:08 | disruptek | yes yes? |
21:35:48 | disruptek | that's typed, clyybber's work-around, rm double returns, test fixes, etc. |
21:38:47 | Zevv | sure I know |
21:38:49 | Zevv | just whining |
21:39:12 | disruptek | more typing, less whining. |
21:40:23 | ForumUpdaterBot | New thread by Alexeypetrushin: How to turn proc that uses immutable shared object into pure func?, see https://forum.nim-lang.org/t/7315 |
21:51:16 | * | rockcavera joined #nim |
21:54:25 | ForumUpdaterBot | New thread by Alexeypetrushin: Should`type` or `typedesc` be used?, see https://forum.nim-lang.org/t/7316 |
21:58:12 | * | vsantana quit (Quit: vsantana) |
22:01:04 | FromGitter | <akavel> HI! How can I write macro for something like: `css{foo: bar}`? I see jsffi does this by overloading `{}`, is that the only way? can I limit this overload to only "css" prefix somehow? |
22:04:03 | planetis[m] | just make a css macro that parses `{foo: bar}` syntax, not sure if your example is possible though |
22:04:41 | disruptek | it's possible, but unlikely to be worthwhile. |
22:06:30 | FromGitter | <akavel> worthwile does not matter here :D hobby project so unworthwhile things are the most worthwhile if they increase my joy and fun :D |
22:07:00 | FromGitter | <akavel> and the more fun I'm having the further I might get with the project :) |
22:08:18 | FromGitter | <akavel> trying to do it with simple `macro css(x: untyped) = echo x.treeRepr` unfortunately fails on `css{foo: bar}` with: "Error: undeclared identifier: '{}'" |
22:08:41 | disruptek | well, impl a macro for `{}`. it can take, i dunno, a typedesc for `css` and untyped for the args, so you can parse them yourself without quotes. |
22:09:02 | disruptek | store it in the css.nim module and export it into the code wherein it's used. |
22:09:42 | FromGitter | <akavel> is there a way to make it not collide with other `{}` macros? |
22:10:06 | disruptek | why would it? |
22:10:29 | FromDiscord | <lqdev> overload resolution would take care of it |
22:10:35 | disruptek | you could make a Css type and use that instead. |
22:10:46 | FromDiscord | <lqdev> if the first param is `type css` or whatever |
22:10:49 | FromGitter | <akavel> hmmmmmm Css type might be the thing |
22:10:59 | disruptek | i doubt it matters. |
22:11:05 | FromGitter | <akavel> ? |
22:11:12 | disruptek | i doubt a type is necessary. |
22:11:27 | FromGitter | <akavel> I mean jsffi uses typedesc: https://nim-lang.org/docs/jsffi.html#%7B%7D.m%2Ctypedesc%2Cvarargs%5Buntyped%5D |
22:11:42 | FromGitter | <akavel> so I would imagine there could be collision here, if I also used typedesc, no? |
22:12:11 | disruptek | yes. |
22:13:13 | FromGitter | <akavel> Thanks! I'll try with Css type, wonder if it'll work :P |
22:13:15 | disruptek | use `type css = distinct void`. |
22:13:26 | disruptek | use `type css* = distinct void`. |
22:14:04 | disruptek | by the time you read this, i will already have written it. |
22:14:17 | disruptek | i'm speaking to you from the future. |
22:14:32 | disruptek | it sucks here. |
22:16:39 | FromGitter | <akavel> I think I need e.g. `type Css* = distinct void` and then `var css*: Css` or something similar, no? though I'd guess void value might not compile, so maybe rather `type Css* = object` or something? |
22:17:36 | disruptek | try my version first. sigmatch should prefer it. |
22:18:37 | FromGitter | <akavel> but then how I define the macro? `{}(csstag: css, ...)`? or `{}(csstag: typedesc[css], ...)`? |
22:23:56 | FromGitter | <akavel> `typedesc[css]` seems to work, and get distinguished from the one in jsffi; cool, thanks disruptek!!! :) :) :) |
22:24:10 | disruptek | sure. |
22:24:15 | FromGitter | <akavel> and sorry for making you cry in a corner! |
22:24:46 | disruptek | my balls haven't been the same since zedeus. |
22:25:12 | FromGitter | <akavel> ? |
22:25:17 | disruptek | long story. |
22:26:03 | FromGitter | <akavel> sounds like one :) |
22:26:15 | FromDiscord | <7815> if you can't override `=` or make something explicitly uncopiable, you must trust the user not to, right?↵asking if there is some way to make something uncopiable... |
22:27:24 | FromDiscord | <haxscramper> https://nim-lang.org/docs/destructors.html#lifetimeminustracking-hooks-eqcopy-hook |
22:27:35 | FromGitter | <akavel> but you got me curious so I found this login on github and gonna look into nitter code :D |
22:27:56 | disruptek | yeah. |
22:28:25 | FromDiscord | <7815> sent a code paste, see https://paste.rs/kKl |
22:29:19 | FromGitter | <akavel> some specific files/types/...keywords you recommend to look for to get some brain damage? :) |
22:30:04 | FromDiscord | <haxscramper> trianlge of pain |
22:30:07 | disruptek | are we talking about ketamine in #nim again? |
22:30:31 | FromGitter | <akavel> is NIm a drug? |
22:30:54 | FromDiscord | <haxscramper> actually it was a "tetrahedron of pain" |
22:31:07 | disruptek | generics, macros, statics, concepts. |
22:31:36 | FromGitter | <akavel> lol |
22:31:48 | FromDiscord | <haxscramper> If you manage to combine all of them together you are guaranteed to move to the higher plane of existence immediately |
22:32:00 | FromGitter | <akavel> ahahahaha |
22:32:15 | FromDiscord | <7815> I'm sorry, but how do i specialize `=copy` for i.e. `Foo`? |
22:32:26 | FromDiscord | <7815> (edit) "I'm sorry," => "I apologize," |
22:33:03 | FromDiscord | <7815> (edit) "I apologize, but how do i specialize `=copy` ... for" added "i.e." | removed "i.e." |
22:34:19 | FromDiscord | <haxscramper> https://play.nim-lang.org/#ix=2Km1 |
22:34:40 | FromDiscord | <haxscramper> If you remove echo it will trigger `=move` instead of copy, so no compilation error |
22:35:22 | FromDiscord | <haxscramper> IIRC it works a little differently from let's say C++ when `operator=() = delete` will give you error regardless |
22:36:19 | FromDiscord | <7815> is it possible for generic types? |
22:37:12 | FromDiscord | <7815> https://play.nim-lang.org/#ix=2Km2 |
22:38:06 | FromDiscord | <haxscramper> ``proc `=copy`[T](dest: var Foo[T]; source: Foo[T]) {.error: "Foo is not copyable".}`` |
22:38:21 | FromDiscord | <juliuskiesian> how do you specify type boundaries in nim generics? for example, i want to express something like this: |
22:38:30 | FromDiscord | <juliuskiesian> sent a code paste, see https://play.nim-lang.org/#ix=2Km6 |
22:39:16 | disruptek | what's the point? |
22:39:32 | FromDiscord | <7815> I apologize, it's trivial, don't know why i seemed to have problems. |
22:39:35 | FromDiscord | <haxscramper> This is a valid code actually |
22:40:01 | FromDiscord | <haxscramper> E.g. I'm not quite following what you want to do exactly |
22:40:42 | disruptek | i think they mean to s/T: Node/T/ but i dunno. |
22:42:33 | FromDiscord | <juliuskiesian> so i have inputs and outputs of seq[T: Node] here. |
22:42:49 | FromDiscord | <juliuskiesian> there problem is how can i instantiate a Node then? |
22:43:04 | disruptek | Node() |
22:43:11 | FromDiscord | <haxscramper> Just `let node: Node[int]` or `Node[int]()` |
22:43:23 | disruptek | no, because T can only ever be a Node. |
22:43:37 | disruptek | no point to making it generic. |
22:43:42 | FromDiscord | <haxscramper> Alright, then `type Node = int | float` |
22:43:49 | FromDiscord | <juliuskiesian> T could be Add, Subtract, Multiply, Sigmoid etc. |
22:44:06 | disruptek | you just defined it as a Node, only. |
22:44:14 | FromDiscord | <haxscramper> oh |
22:45:27 | disruptek | in the fragment `T: Foo`, `T` is an alias for the typeclass `Foo`. |
22:45:29 | FromDiscord | <haxscramper> @juliuskiesian You can do `T: Add | Subtract | Multiply | Sigmoid` to constrain generic parameters |
22:45:35 | FromDiscord | <juliuskiesian> i could. but then every time i set the values of inputs or outputs, i need to do something like `cast[Node](adder)` |
22:45:48 | disruptek | nope. |
22:46:28 | FromDiscord | <juliuskiesian> sent a code paste, see https://paste.rs/1Sy |
22:46:58 | FromDiscord | <juliuskiesian> that would be quite tedious as the node subtypes grow. |
22:47:21 | disruptek | type Node[T: Operations] .... seq[T] .... type Operations = Add or Subtract or Multiple or ... |
22:47:31 | disruptek | don't use cast. |
22:47:34 | disruptek | do read this: |
22:47:36 | disruptek | ~disrupstyle |
22:47:37 | disbot | disrupstyle: 11tips for writing code that won't provoke 😠 rants 🤬 on irc: https://gist.github.com/disruptek/6d0cd6774d05adaa894db4deb646fc1d -- disruptek |
22:48:09 | disruptek | then var x = new Node[Add]() ... x.inputs = someAdds |
22:48:22 | FromDiscord | <juliuskiesian> and what if someone else writes a new node subtype? those won't work unless i change my code to include their types like `type Operations = Add or Subtract or Multiple or NewNode` |
22:48:37 | disruptek | then don't define a typeclass. |
22:48:45 | disruptek | type Node[T] ... inputs: seq[T] |
22:49:37 | disruptek | you could also use concepts, but, y'know, they are broken. |
22:49:53 | saem | nim dump -d:query_profiles foo.nims |
22:49:53 | saem | [... cut regular cfgs ...] |
22:49:53 | saem | Hint: used config file '.../vscode-nim/foo.nim.cfg' [Conf] |
22:49:53 | saem | Hint: used config file '.../vscode-nim/config.nims' [Conf] <-- is this correct, module kind beats module name match? |
22:49:53 | saem | Hint: used config file '.../vscode-nim/foo.nims' [Conf] |
22:50:22 | disruptek | apparently. |
22:50:27 | disruptek | nims is for chumps. |
22:50:33 | saem | it's surprising, which is why I ask. |
22:51:35 | saem | I'd much rather .cfg and conventions around a few build profile parameters, but I'm weird. |
22:52:00 | disruptek | i agree, but timmy is a squeaky wheel. |
22:52:35 | saem | (in his best cartman voice): god damnit timmy |
22:52:49 | disruptek | it sucks. |
22:52:58 | saem | I tried. |
22:53:09 | disruptek | A for effort. |
22:53:48 | saem | Imma cherish it forever |
22:56:56 | * | Vladar quit (Quit: Leaving) |
23:07:28 | FromDiscord | <Clyybber> Zevv: Heh, this time I don't think I fucked it up :p |
23:08:54 | * | vicfred joined #nim |
23:09:12 | FromDiscord | <Clyybber> saem: You think foo.nims should be processed before config.nims? |
23:10:33 | saem | Clyybber: maybe... it's a surprise, but I can't say whether the kind match or the module match should win. I haven't really thought through the implications, like what do people typically mean if they have all those files. |
23:11:03 | FromDiscord | <Clyybber> It goes from least specific to most specific conceptually |
23:11:07 | disruptek | i would prefer that filename trumps directory name; this seems the most obvious. |
23:11:18 | FromDiscord | <Clyybber> Yeah, but thats how it is currently, no? |
23:11:22 | disruptek | no. |
23:11:31 | saem | OK, so that's package name, then right? |
23:11:40 | saem | So kind, package, and module. |
23:11:42 | disruptek | i'd rather have foo.nim.cfg last. |
23:11:53 | FromDiscord | <Filipe Duarte> Hi, how do I pass a procedure as params of another procedure. |
23:11:58 | FromDiscord | <Clyybber> saem: What do you mean by "kind" ? |
23:12:00 | FromDiscord | <Filipe Duarte> (edit) "procedure." => "procedure?" |
23:12:18 | disruptek | proc foo(bar = proc(): int) = ... |
23:12:34 | disruptek | ie. use anonymous proc syntax. |
23:12:38 | saem | Clyybber: config.nims <-- the kind, nimscript. foo.nim.cfg <-- module name, but kind nim cfg |
23:12:46 | FromDiscord | <Clyybber> disruptek: but foo.nim.cfg is last in saems example? |
23:12:53 | FromDiscord | <Filipe Duarte> thnk |
23:13:12 | disruptek | in that case, it's right and config.nims is wrong. |
23:13:29 | FromDiscord | <Clyybber> Why would config.nims be wrong? |
23:13:47 | disruptek | because it's either ahead-of or behind a file-specific config. |
23:13:51 | saem | Because the kind match makes it more specific, but the module name match, should trump that. |
23:14:30 | FromDiscord | <Clyybber> but it does? config.nims gets processed, then foo.nims then foo.nim.cfg ? |
23:14:37 | FromDiscord | <Clyybber> What order do you expect? |
23:14:44 | disruptek | that sounds good to me. |
23:15:19 | disruptek | the output doesn't make this clear, though, does it? |
23:15:51 | FromDiscord | <Clyybber> Hint: used config file '.../vscode-nim/config.nims' [Conf]↵Hint: used config file '.../vscode-nim/foo.nims' [Conf]↵Hint: used config file '.../vscode-nim/foo.nim.cfg' [Conf] |
23:15:55 | FromDiscord | <Clyybber> seems clear? |
23:16:15 | disruptek | that's not the order that saem reported. |
23:16:32 | FromDiscord | <Clyybber> Huh, I guess the bridge reordered the messages then |
23:16:38 | saem | Yeah, it did |
23:16:49 | disruptek | aha! |
23:16:56 | FromDiscord | <Clyybber> haha, I was so confused |
23:17:40 | FromDiscord | <Clyybber> saem: Can you open an issue? |
23:17:41 | * | radgeRayden quit (Ping timeout: 268 seconds) |
23:17:43 | * | radgeRayden_ joined #nim |
23:18:16 | saem | This is the order from earliest line to latest line: 'vscode-nim/foo.nim.cfg', 'vscode-nim/config.nims', '/vscode-nim/foo.nims' |
23:18:36 | saem | Clyybber, sure in a bit. I gotta get ready for an appointment. |
23:18:54 | FromDiscord | <Clyybber> thanks! |
23:19:00 | saem | np |
23:19:10 | disruptek | iirc, the order /is/ a little subtle and the code actually collects the configs and reorders them or something before running them. or it runs them backwards. or upside-down. or some crazy shit. |
23:19:34 | FromDiscord | <ElegantBeef> Just throw a dart at the board to find the setting |
23:22:08 | disruptek | nimph's running of nimscript provokes a gc:orc bug, so... yeah, it's fun. |
23:23:30 | saem | I was asking about it because I'm writing the auto-detect projects for the vscode extension and was about to make every nimscript file a project.. .then realized someone (not naming names) wrote a whole project where people will crap out nimscript everywhere. |
23:23:55 | FromDiscord | <ElegantBeef> Hey i'm right here |
23:24:00 | saem | I said someone! |
23:24:06 | saem | :D |
23:24:12 | FromDiscord | <ElegantBeef> That someone is probably me 😛 |
23:24:18 | saem | It's definitely you |
23:24:23 | FromDiscord | <ElegantBeef> i mean the nimscript has to match a `.nim` file |
23:24:31 | FromDiscord | <ElegantBeef> Whereas mine it doesnt |
23:24:46 | FromDiscord | <ElegantBeef> you can name it dinglebopofthestarwarsep3thestartrek.nims |
23:26:10 | disruptek | i hope you have that backwards. |
23:26:30 | FromDiscord | <ElegantBeef> What do you mean? |
23:26:33 | saem | Yeah, so I think I'm going to use effectively the same heuristic that I will for .nim files for nimscript files. |
23:26:52 | disruptek | i mean `smin.kertratseht3pesrawratsehtfopobelgnid`. |
23:26:57 | FromDiscord | <ElegantBeef> Ah |
23:27:00 | FromDiscord | <ElegantBeef> Yea same shit |
23:27:16 | saem | smin is the code name for nim v3.0 |
23:27:28 | FromDiscord | <ElegantBeef> Ah i misunderstood what you were looking for saem, thought you were still looking at config formats including nimscript |
23:28:07 | FromDiscord | <ElegantBeef> Honestly cause of how you dont see the API exposed to you in my version editor tools tend to be pretty bad |
23:28:55 | saem | Oh... that too. It's all related, I spent like ~6 hours writing as much as I could on all the issues I'm seeing so I could get at the kernel of whatever I'm trying to solve. It was a lot to end up where I did. |
23:31:33 | saem | Why don't you get to see the API exposed? <-- this question might be a mistake |
23:34:17 | FromDiscord | <ElegantBeef> Well cause i store it in the programs memory so you can use it for N number of scripts(only have a single main module support atm) |
23:35:08 | FromDiscord | <ElegantBeef> So you can load a bunch of interpreters but they all have the same API, atleast atm |
23:36:10 | FromDiscord | <ElegantBeef> I could always have an api that exports the API, but that kinda is risky if you load it cause users could change it |
23:36:50 | disruptek | you think an api for your api is risky? |
23:37:00 | disruptek | just put another api on it. |
23:37:09 | FromDiscord | <ElegantBeef> Well i meant a proc, but yea |
23:37:41 | FromDiscord | <ElegantBeef> Having the nimscript glue being visible in the file that the users can edit just seems like very likely for someone to fuck it up |
23:42:57 | FromDiscord | <iWonderAboutTuatara> odd error |
23:43:01 | FromDiscord | <iWonderAboutTuatara> I'm using raylib with nim |
23:43:02 | FromDiscord | <ElegantBeef> Odd user |
23:43:09 | FromDiscord | <iWonderAboutTuatara> lmao true |
23:43:23 | FromDiscord | <iWonderAboutTuatara> `SetShaderValue voroshader, ures, addr res, UNIFORM_VEC2` gives error expression ahs no address |
23:43:37 | FromDiscord | <iWonderAboutTuatara> res is a immurable variable |
23:43:39 | FromDiscord | <iWonderAboutTuatara> unsafeaddr works |
23:43:43 | FromDiscord | <ElegantBeef> well yea |
23:43:53 | FromDiscord | <ElegantBeef> addr doesnt work on immutables |
23:43:59 | FromDiscord | <ElegantBeef> hence the "unsafe" part |
23:44:04 | FromDiscord | <iWonderAboutTuatara> oh I see |
23:44:05 | FromDiscord | <iWonderAboutTuatara> thanks |
23:44:34 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/system.html#unsafeAddr%2CT |
23:55:25 | * | Prestige quit (Quit: Prestige) |
23:59:43 | * | Prestige joined #nim |