00:04:30 | FromDiscord | <treeform> @demotomohiro I address your comments and PR. Thanks! |
00:06:47 | FromDiscord | <demotomohiro> @treeform Thanks! |
00:08:56 | FromDiscord | <treeform> For annoying reason i was not watching the repo so I did not see your message or pr. |
00:12:14 | * | Jesin joined #nim |
00:14:53 | FromGitter | <ynfle> Is there any way to include a folder that is outside the `srcDir` in a nimble installation |
00:15:18 | Yardanico | why would you use nimble then? |
00:15:23 | Yardanico | can't you make that folder another package? |
00:15:35 | FromGitter | <ynfle> For `public` dir in jeser |
00:15:52 | Yardanico | ah |
00:15:54 | Yardanico | you can just use .. |
00:16:04 | Yardanico | like import ../public/file.nim |
00:16:33 | FromGitter | <ynfle> Not for import, for serving html, css, js etc... |
00:18:23 | * | opal quit (Ping timeout: 240 seconds) |
00:18:57 | FromGitter | <ynfle> Is it usual to have `public` dir in `src`? Nim in Action has it in the root |
00:22:05 | FromDiscord | <willyboar> Why to use src dir? Jester app is not a library. You don't need a nimble file at all |
00:24:36 | * | vicfred quit (Quit: Leaving) |
00:25:01 | FromGitter | <ynfle> What do you mean? |
00:26:32 | * | vicfred joined #nim |
00:31:18 | leorize | there's the includeDirs seq |
00:32:39 | shashlick | Need to figure out touch for windows |
00:35:01 | * | vikfret quit (Quit: Leaving) |
00:36:12 | * | arecaceae quit (Remote host closed the connection) |
00:36:44 | * | arecaceae joined #nim |
00:37:15 | * | opal joined #nim |
00:50:39 | * | NimBot joined #nim |
00:58:34 | * | oddp quit (Ping timeout: 240 seconds) |
00:59:13 | disruptek | leorize: why? |
01:20:17 | FromGitter | <ynfle> I know, but why shouldn't I use src? |
01:21:57 | * | krux02_ quit (Remote host closed the connection) |
01:23:44 | FromGitter | <ynfle> What is the recommended directory tree for jester app? |
01:27:14 | leorize | disruptek: because it linked most of glibc into your lib |
01:27:26 | leorize | app* |
01:27:43 | leorize | @ynfle you can use whatever, really. we don't have an official guide on this |
01:27:51 | disruptek | who cares? |
01:27:58 | disruptek | does it not run for you? |
01:28:08 | leorize | and if you happen to use -march=native it probably won't run on others |
01:28:21 | disruptek | do i? |
01:28:52 | leorize | and also glibc have this thing of dynamically loading support libraries like it's nss resolvers |
01:28:55 | disruptek | looks fine to me, but maybe i have a different build. |
01:28:58 | leorize | let me see if this run on my musl system |
01:30:09 | disruptek | i think i'm going to use branches instead. feels like a more obvious approximation. |
01:30:39 | disruptek | if you want to make it better, fork it and do so. |
01:30:48 | leorize | branches doesn't sound bad |
01:31:06 | leorize | the only better thing I'd do is to strap something on that'd autobuild git-nim for you :P |
01:31:23 | disruptek | go for it. |
01:31:27 | leorize | @ynfle if you're in doubt, look at nimforum |
01:31:30 | leorize | !repo nimforum |
01:31:30 | disbot | https://github.com/nim-lang/nimforum -- 9nimforum: 11Lightweight alternative to Discourse written in Nim 15 477⭐ 43🍴 7& 2 more... |
01:32:03 | leorize | disruptek: I have other things to do atm :P |
01:32:49 | disruptek | this it's /not/ something you'd do. 😉 |
01:34:53 | Avatarfighter | Hello everyone :D |
01:35:01 | disruptek | sup fighter |
01:35:07 | leorize | o/ |
01:35:36 | Avatarfighter | disruptek and leorize are you guys working on anything as interesting as usual? |
01:35:49 | Avatarfighter | as per usual* |
01:37:11 | leorize | I was working on nightlies :P |
01:37:34 | Avatarfighter | oh my :P |
01:38:27 | disruptek | ~gitnim is https://gitnim.com/ -- choosenim for choosey nimions |
01:38:28 | disbot | gitnim: 11https://gitnim.com/ -- choosenim for choosey nimions |
01:42:45 | FromDiscord | <Skaruts> if A imports B.foo |
01:42:49 | FromDiscord | <Skaruts> and C imports/exports A |
01:42:52 | FromDiscord | <Skaruts> when D imports C |
01:42:54 | FromDiscord | <Skaruts> will D have access to B.foo? |
01:48:29 | shashlick | no |
01:49:16 | shashlick | you need to export B.foo in A for that |
01:53:14 | * | chemist69_ joined #nim |
01:54:10 | shashlick | @leorize onto your nightlies - where do i find them |
01:54:25 | leorize[m] | !repo alaviss/nightlies |
01:54:25 | disruptek | https://github.com/alaviss/nightlies/releases |
01:54:26 | disbot | no results 😢 |
01:54:31 | disruptek | it's a fork. |
01:54:55 | disruptek | do you have a 1.0 for us? |
01:55:00 | shashlick | should I test 1.2.0 or devel |
01:55:48 | disruptek | both; they both work and both need testing. |
01:56:00 | * | chemist69 quit (Ping timeout: 256 seconds) |
01:56:53 | shashlick | you need to fix the filenames else choosenim won't work with nightlies anymore |
01:58:42 | leorize[m] | wait am I not using the same file names as normal nightlies? |
02:00:09 | shashlick | i think just windows |
02:00:45 | shashlick | even linux |
02:00:50 | leorize[m] | ah so you also have this -windows part |
02:01:29 | shashlick | we will have to fix choosenim for osx regardlesof |
02:01:29 | leorize | you gotta be kidding me with your naming scheme... |
02:01:57 | shashlick | what's so bad |
02:01:59 | leorize | currently I'm using `-hostOS_hostCPU` suffix |
02:02:16 | FromDiscord | <Elegant Beef> How many chat clients do you us leorize |
02:02:20 | FromDiscord | <Elegant Beef> use* |
02:02:21 | leorize | simple and can be supported by everyone |
02:03:12 | leorize | I can replace hostCPU with <arch> in a target triplet as well, again, easy to support |
02:03:28 | leorize | well I'll make it work with the usual name |
02:03:35 | leorize | just got to add some translation to map it |
02:04:01 | leorize | @Beef I only use two |
02:04:03 | shashlick | well can't change the past |
02:04:18 | FromDiscord | <Elegant Beef> Why did you switch inbetween messages? |
02:04:35 | leorize | phone/computer |
02:04:58 | FromDiscord | <Elegant Beef> Ah |
02:05:07 | leorize | shashlick: well I need a standardized naming scheme to stick to |
02:05:19 | FromDiscord | <Elegant Beef> I was imagining you having two open CLI clients and swapping between them for no real reason 😛 |
02:05:30 | leorize | so _x{32,64} for x86, and the <arch> in triplet for everything else? |
02:06:07 | leorize[m] | actually, I'm connected to my matrix on the same client as the one connected to freenode |
02:06:08 | shashlick | looks like |
02:06:21 | leorize | so I can use both at the same time without switching clients :P |
02:06:29 | shashlick | considering osx is just 1 build, can we leave the name as is? |
02:06:49 | shashlick | then we won't need any choosenim changes |
02:06:50 | disruptek | not without causing other software to special-case it. |
02:07:09 | leorize | I'm already specializing for x86, I don't want to specialize for more |
02:07:18 | shashlick | okay then maybe stick to your scheme |
02:07:43 | shashlick | we can update choosenim - existing users with older versions just won't get newer nightlies |
02:07:57 | shashlick | although i've almost completely lost interest in maintaining choosenim |
02:08:01 | leorize | I thought osx builds have been broken for awhile? |
02:08:43 | shashlick | true that |
02:08:54 | shashlick | anyway, not sure who is using these features |
02:09:16 | * | endragor joined #nim |
02:10:19 | shashlick | disruptek: the paramStr issue should be fixed now in nimterop |
02:11:31 | * | mal`` quit (Quit: Leaving) |
02:14:24 | leorize | shashlick: you even special cased it for aarch64 to be arm64... |
02:14:31 | leorize | well not too hard to deal with |
02:15:03 | leorize | wait why are your windows zips so giantic? |
02:15:23 | * | opal quit (Ping timeout: 240 seconds) |
02:20:32 | * | Tongir joined #nim |
02:21:25 | shashlick | i think i went with the dockcross naming |
02:22:35 | shashlick | https://github.com/dockcross/dockcross#cross-compilers |
02:23:12 | * | Tlanger quit (Ping timeout: 256 seconds) |
02:24:28 | leorize | later on I think we should just generate all of our build deps ourselves |
02:24:56 | * | mal`` joined #nim |
02:24:59 | disruptek | shashlick: nice, thanks. |
02:25:00 | leorize | not too hard to do, cross platform toolchain generators covered 99% of everything |
02:25:38 | leorize | github is now also a docker registry so we can upload our buildenv there as a better cache |
02:26:33 | FromGitter | <ynfle> @leorize nimforum has a different structure |
02:26:54 | leorize | well we don't have a standard structure |
02:27:00 | leorize | you can do whatever, really |
02:27:07 | leorize | as long as it makes sense |
02:27:13 | FromGitter | <ynfle> I'm using vanilla html, css & js, and I want to serve it from public |
02:27:25 | disruptek | narrator: it didn't sound like it'd make sense. |
02:27:43 | FromGitter | <ynfle> I can put public in src, but then it wouldn't serve in develop |
02:28:07 | FromGitter | <ynfle> Doesn't seem right |
02:28:38 | * | vsantana joined #nim |
02:29:12 | leorize | you do realize that... the public folder has to be next to the binary, right? |
02:29:25 | FromGitter | <ynfle> Yes |
02:29:54 | leorize | there's no way to package it that it would run standalone for every scenario unless you hardcode or allow tweaks to where the public folder it |
02:30:11 | leorize | if nimble install your package, the binary will be in ~/.nimble/bin |
02:30:34 | leorize | and I'm sure that the public folder won't follow there :P |
02:31:34 | FromGitter | <ynfle> Makes sense |
02:33:49 | * | opal joined #nim |
02:35:15 | FromGitter | <ynfle> Even if it's symlinked? |
02:36:25 | leorize[m] | disruptek, shashlick: nightlies with newer naming scheme will come after this run: https://github.com/alaviss/nightlies/actions/runs/137918994 |
02:38:06 | leorize | 15 builds running in parallel, this is why I love github actions :P |
02:39:45 | * | unknown quit (Quit: Leaving) |
02:41:29 | disruptek | !last gitnim |
02:41:30 | disbot | gitnim never seen. |
02:41:33 | disruptek | c'mon |
02:42:18 | disruptek | where's my version-1-0 release? |
02:42:22 | leorize | macosx binaries are up |
02:42:26 | leorize | they're building |
02:42:36 | leorize | these vms are dual cores (except the macs) |
02:43:00 | leorize | well linux version-1-0 is up |
02:44:34 | leorize | these are faster than I thought, 8 mins for a linux build |
02:45:31 | leorize | windows builds are slow as usual... |
02:48:20 | leorize | still have to solve #14675 before I can get nightlies to make 32 bit linux builds |
02:48:23 | disbot | https://github.com/nim-lang/Nim/issues/14675 -- 3Couldn't generate docs for 32bit Nim on Linux ; snippet at 12https://play.nim-lang.org/#ix=2pnA |
02:48:39 | leorize | or I can switch back to glibc for them, but that's just dodging the issue |
02:50:08 | disruptek | i guess i didn't realize the naming scheme would vary with nim-1.0. |
02:50:42 | leorize | I changed the naming scheme so that it'd match the official nightlies for all of them |
02:51:30 | leorize[m] | disruptek: https://github.com/alaviss/nightlies/blob/actions/build-release.sh#L138-L163 <- that's the suffix rule |
02:51:52 | * | muffindrake quit (Ping timeout: 260 seconds) |
02:52:17 | * | muffindrake1 joined #nim |
02:53:10 | disruptek | ah, thanks. |
02:53:14 | disruptek | !last leorize |
02:53:14 | disbot | leorize spoke in 12#nim 2 minutes ago 12https://irclogs.nim-lang.org/17-06-2020.html#02:50:42 |
02:54:20 | disruptek | well, gitnim already has 1.0.7, 1.2.2, 1.2.1, 1.3.5 thanks to your stuff. with versions of `git nim` built against each. |
02:54:56 | disruptek | total disk usage: 150mb |
02:56:07 | disruptek | that's small enough that i can embed it in a single lambda layer with zig. |
02:56:29 | leorize | nice |
02:57:32 | disruptek | scratch "install" took me 3.7s |
02:59:37 | disruptek | i guess i need to update it for branches, though. |
03:03:05 | shashlick | How do you link git nim to git-nim |
03:03:19 | leorize | git extension feature |
03:03:32 | shashlick | I have a git alias called Nim which bootstraps Nim for me |
03:03:46 | leorize | if a builtin git <command> can't be found, it will call git-<command> in your path |
03:04:13 | shashlick | I see |
03:04:46 | shashlick | So if he wants to improve git-nim, he needs to do it in every single branch |
03:05:03 | leorize | this is why automation trumps all :P |
03:06:09 | leorize | you can just put git-nim in a special branch, then make a github actions/azure/travis pipeline to copy it over to your other branches + generating the binaries |
03:06:36 | disruptek | yeah, but i want it to just track the branch. |
03:07:11 | disruptek | it's not a separate thing. this /is/ the thing. |
03:13:55 | shashlick | So how do you do it |
03:14:23 | disruptek | do what? |
03:18:49 | shashlick | Ensure git-nim is up to date on every branch |
03:18:58 | shashlick | If you decide to add some features |
03:19:31 | disruptek | any branch where i want those features, i pull in the commit, build the program, commit it. |
03:22:44 | shashlick | okay |
03:25:44 | * | muffindrake1 is now known as muffindrake |
03:42:13 | * | muffindrake quit (Quit: muffindrake) |
03:47:08 | * | muffindrake joined #nim |
04:00:57 | * | Vladar joined #nim |
04:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
04:06:39 | * | supakeen joined #nim |
04:12:53 | leorize | shashlick: all the buildable builds are up |
04:13:09 | leorize | well except aarch64 because generating docs for those are slow |
04:13:25 | leorize | I've merged a change to disable runnableExample when possible, should make those pop up soon |
04:15:11 | shashlick | sounds good |
04:15:23 | shashlick | still fighting nimterop cross platform nonsense |
04:15:43 | shashlick | windows file date doesn't have enough time resolution |
04:26:14 | leorize | maybe just go for forced overwrite with a warning |
04:30:48 | leorize | you can do some powershell scripting stuff |
04:30:56 | leorize | but it's just painful on windows |
04:31:38 | leorize | maybe turn toast into a cross platform support toolkit for nimterop? (with a new name ofc) |
04:37:54 | shashlick | I am now just checking if dates are exactly same - if not i overwrite |
04:37:58 | shashlick | slightly better |
04:39:26 | shashlick | is there a way for a loaded dll to call a proc from the main executable |
04:39:36 | leorize | yes |
04:39:43 | leorize | just symAddr() it from NULL |
04:40:06 | leorize | note that main must be compiled with --export-dynamic on linux |
04:40:52 | shashlick | my goal is to eventually turn all wrappers into plugins that toast compiles into a lib and executes at runtime |
04:41:01 | shashlick | instead of doing all this crazy stuff at compile time |
04:41:31 | leorize | or just compile them into normal executable with a predictable cli layout |
04:41:34 | leorize | easy to handle |
04:41:34 | shashlick | but for that i need to allow the plugin to run all these helper procs built into toast |
04:41:40 | leorize | compatiable everywhere |
04:41:48 | leorize | compatible* |
04:42:00 | shashlick | compiling the entirety of toast including tree-sitter just to wrap a lib |
04:42:22 | leorize | well you have them cached when you compile toast, no? |
04:43:06 | leorize | you can always export your helpers procs to the cli as well |
04:43:10 | shashlick | toast is only compiled once - my idea is to pull all of build and cimport into toast |
04:43:30 | shashlick | and drive it with a plugin |
04:43:56 | leorize | that's a bit too much |
04:44:08 | leorize | given the current terrible situation regarding Nim and plugins |
04:44:30 | leorize | I'd say a command line tool with good interface works better |
04:44:37 | leorize | let 3rd parties build on toast as well |
04:44:44 | leorize | hell, rename it to nimterop :P |
04:45:23 | * | dddddd quit (Ping timeout: 260 seconds) |
04:45:25 | shashlick | toast already can do a lot of stuff by itself |
04:46:28 | * | nsf joined #nim |
04:46:51 | shashlick | everything offered in the API per se is related to importing at compile time and building the library |
04:47:26 | leorize | export more? :P |
04:47:38 | shashlick | pure Nim gives a lot of power and expression instead of a command line |
04:48:03 | shashlick | or even nimgen which was a config file style |
04:49:17 | FromDiscord | <Rika> nim shell when |
04:49:24 | * | solitudesf- joined #nim |
04:49:48 | shashlick | i've had no issues with plugins with nimterop - i use markAndSweep to avoid mem issues |
04:49:58 | shashlick | and anyway it is a short running process |
04:50:06 | shashlick | arc will make things better too |
04:50:36 | shashlick | but ya, i can keep rearchitecting this but C++ is higher priority |
04:50:38 | leorize | I usually avoid dlls because they're sort of shaky grounds |
04:51:10 | shashlick | i felt that pain with feud - only boehm could handle it |
04:51:29 | shashlick | and that too broke for months when someone changed the gc code |
04:52:41 | leorize | how does julia, crystal, python handle c bindings? |
04:52:57 | shashlick | any feedback on https://github.com/nimterop/nimterop/issues/154#issuecomment-645110953 |
04:52:58 | disbot | ➥ getHeader should install binaries outside nimcache which can go away |
04:53:41 | shashlick | i think they have an easier time cause they don't have style insensitivity, enums restrictions, identifier rules and other Nim headaches |
04:54:25 | shashlick | we've worked around a lot of those things in nimterop but some things you cannot do anything about like duplicate identifiers due to style insensitivity |
04:54:30 | leorize | lol you miss an `s` in pinging me :P |
04:55:00 | shashlick | whoops |
04:55:02 | leorize | anyhow, the solution seems sensible |
04:55:18 | FromDiscord | <SeanOMik> Is there a way I could set default custom type variables? |
04:55:23 | leorize | shashlick: well they have other problems to tackle too |
04:55:49 | leorize | @SeanOMik you mean setting default fields for objects |
04:55:52 | FromDiscord | <SeanOMik> Something like this: ```nim↵CustomType= ref object↵ abc: int = 500``` |
04:55:52 | leorize | ? |
04:55:53 | FromDiscord | <SeanOMik> Yeah |
04:55:57 | leorize | nope |
04:56:01 | FromDiscord | <SeanOMik> Oh |
04:56:03 | FromDiscord | <SeanOMik> Hm |
04:56:15 | FromDiscord | <SeanOMik> Thats weird that Nim doesn't support it |
04:56:17 | leorize | for now tag the type with `{.requiresInit.}` and write an `init/new` for it |
04:56:33 | leorize | we are planning to support it but it's kinda complicated |
04:56:53 | FromDiscord | <SeanOMik> Well I dont want it to requrieInit |
04:57:00 | FromDiscord | <SeanOMik> I'll just have to check if its nil |
04:58:21 | FromDiscord | <SeanOMik> Thanks |
04:58:40 | leorize | shashlick: tbh I think it's easier if you just make it so that wrappers generate a binary based on toast |
04:58:51 | leorize | how slow is it to compile toast? |
05:01:13 | shashlick | around 30 seconds to a minute on travis depending on OS |
05:01:30 | shashlick | i pull in parts of the compiler |
05:02:15 | leorize | given that `nim c -r` now have super aggressive caching, you should be fine with building a framework for writing bindings generator from nimterop |
05:03:06 | leorize | the best way to leverage Nim's power is to use Nim :P |
05:03:23 | shashlick | why aren't you on board with the plugin idea? even with arc coming |
05:03:24 | leorize | if nimscript won't cut it then we just gotta use the real thing :P |
05:03:36 | leorize | because plugins are a pain |
05:04:16 | leorize | nimrtl is still a hit and miss |
05:04:31 | leorize | and you can't share memory without using nimrtl, even with arc |
05:04:47 | leorize | the allocator main state has to be stored somewhere |
05:05:22 | shashlick | like i said, i haven't had any issues with mark and sweep |
05:05:39 | shashlick | but will welcome your review of cPlugin within toast |
05:06:18 | leorize | and also you'll never run out of hook points to add tbh |
05:06:48 | shashlick | true that |
05:06:51 | shashlick | https://github.com/nimterop/nimterop/blob/master/nimterop/getters.nim#L440 |
05:07:08 | shashlick | that's where i compile and load the cPlugin code passed into toast as a file |
05:07:20 | shashlick | you can see the procs I load and find how they are used |
05:07:49 | shashlick | of course, toast is calling the dll procs, not the other way around like i was asking |
05:09:35 | leorize | well you can see the complexity yourself |
05:09:47 | leorize | you have to do a ton of dance to get the config |
05:10:30 | leorize | then more dance to build a plugin |
05:10:42 | shashlick | i thought i did some of this stuff in the plugin system i made out of feud |
05:10:50 | shashlick | but don't remember now |
05:11:35 | leorize | plugin systems are just inherently complicated |
05:12:36 | leorize | even more so with the current state of Nim |
05:13:33 | shashlick | I wish folks tried out plugins and had some feedback - I don't have a use for it right now |
05:13:57 | shashlick | Gave up on feud - too big a project to build |
05:14:30 | leorize | you only have a few hooking points and not the ones that advanced people are interested into |
05:14:56 | * | narimiran joined #nim |
05:15:12 | leorize | for example, if I wanted to wrap Qt I need access to the AST itself to turn Qt's signals into code via my custom generator |
05:16:34 | leorize | this is not something that you can easily provide hooking points for |
05:16:45 | shashlick | Bed time |
05:16:50 | shashlick | Will catch up tomorrow |
05:16:56 | leorize | sure, g'night o/ |
05:36:01 | * | kenran joined #nim |
05:37:27 | * | vicfred quit (Quit: Leaving) |
05:44:18 | * | vikfret joined #nim |
05:44:43 | * | opal quit (Ping timeout: 240 seconds) |
05:50:45 | * | vicfred joined #nim |
05:53:46 | FromDiscord | <SeanOMik> I would convert an integer to a cushort like: ```nim↵var num: int = 9499↵var shrt = cushort(num)↵``` Correct? |
05:54:53 | FromDiscord | <Rika> think so yeah |
05:54:57 | FromDiscord | <SeanOMik> Hm |
05:55:05 | FromDiscord | <SeanOMik> Its getting `0` |
05:55:15 | * | gangstacat quit (Ping timeout: 272 seconds) |
05:56:34 | FromDiscord | <Rika> huh? how? |
05:56:40 | FromDiscord | <Rika> are you sure you're printing shrt |
05:57:04 | FromDiscord | <SeanOMik> Ah okay |
05:57:09 | FromDiscord | <SeanOMik> Its actually parsing it through json |
05:57:17 | FromDiscord | <SeanOMik> And for some reason the json is actually a string |
05:57:22 | FromDiscord | <SeanOMik> So I need to fix json |
05:57:30 | FromDiscord | <SeanOMik> But there is another issue |
05:57:40 | FromDiscord | <SeanOMik> I was trying to parse a `uint64` from a string |
05:57:52 | FromDiscord | <SeanOMik> This is what I tried: ```nim↵var num: uint64↵discard parseOct(str, num, 0)↵return num``` |
05:58:04 | FromDiscord | <SeanOMik> But its not parsing the entire string as the number |
05:58:08 | FromDiscord | <SeanOMik> (edit) removed 'entire string as the' |
05:58:24 | FromDiscord | <SeanOMik> This: `648670408488255500` becomes `52` |
06:00:07 | FromDiscord | <Rika> thats not an octal number |
06:00:09 | * | opal joined #nim |
06:00:28 | FromDiscord | <SeanOMik> Oh |
06:00:37 | FromDiscord | <SeanOMik> I thought `parseOct` just parsed a large number |
06:00:46 | FromDiscord | <SeanOMik> I did actually just find `parseBiggestUInt` |
06:00:51 | FromDiscord | <SeanOMik> You think that would work? |
06:00:56 | FromDiscord | <Rika> yes |
06:01:49 | FromDiscord | <SeanOMik> Okay that worked |
06:01:52 | FromDiscord | <SeanOMik> Thanks for the help |
06:16:01 | Zevv | leorize: I kind of dropped the CPS, can't do it |
06:19:23 | * | nikita` joined #nim |
06:22:44 | * | gangstacat joined #nim |
06:22:50 | * | dom96 quit (Ping timeout: 256 seconds) |
06:25:32 | * | dom96 joined #nim |
06:25:32 | * | dom96 quit (Changing host) |
06:25:32 | * | dom96 joined #nim |
06:31:21 | * | tdc joined #nim |
06:49:00 | * | PMunch joined #nim |
07:10:35 | * | letto quit (Quit: Konversation terminated!) |
07:13:29 | * | letto joined #nim |
07:26:28 | * | narimiran quit (Quit: leaving) |
07:29:43 | * | ftsf joined #nim |
07:31:31 | * | narimiran joined #nim |
07:43:46 | * | endragor quit (Remote host closed the connection) |
07:48:11 | PMunch | Huh.. |
07:48:21 | PMunch | So appears that the standard library isn't all that big.. |
07:48:37 | PMunch | I just had a bunch of compiled files in my lib folder for some reason. |
07:48:43 | * | fredrikhr quit (Ping timeout: 258 seconds) |
07:48:56 | * | muffindrake quit (Quit: muffindrake) |
07:49:07 | Araq | PMunch, hey, we are waiting for your talk |
07:49:27 | PMunch | Sorry, I know |
07:50:12 | PMunch | Had some stuff come up yesterday so didn't get time to record it.. I'll get it to you ASAP |
07:51:41 | Araq | thanks! |
07:52:02 | Araq | so far we have 9 talks |
07:52:14 | Araq | yours and mratsim's are still missing |
07:54:31 | PMunch | I understood from narimiran that you were open for accepting more because of some cancellations? I could try to record one on how I used Nim on the Arduboy (Arduino game console). |
07:55:20 | * | muffindrake joined #nim |
07:55:24 | Araq | hmm well, 9 (or 11) talks is more than enough for a single day but we |
07:55:34 | Araq | can make it a 2 day long conference |
07:56:32 | PMunch | Oh well if you already have plenty then I'll save it for next year :) |
07:57:10 | PMunch | There's a reason why I haven't published it yet, it's super cool, but I really want to polish it up a bit. |
07:57:38 | * | endragor joined #nim |
07:59:26 | * | fredrikhr joined #nim |
07:59:42 | * | fredrikhr quit (Read error: Connection reset by peer) |
08:00:03 | * | fredrikhr joined #nim |
08:00:18 | * | muffindrake quit (Quit: muffindrake) |
08:06:18 | Araq | alright |
08:12:39 | zedeus | woo 1.2.2 |
08:12:59 | narimiran | zedeus: how did you find out this quickly? :) |
08:13:11 | zedeus | #nitter has an rss feed for nim releases hah |
08:14:33 | * | couven92 joined #nim |
08:14:45 | * | couven92 quit (Read error: Connection reset by peer) |
08:15:07 | * | couven92 joined #nim |
08:17:10 | narimiran | :) |
08:17:16 | * | fredrikhr quit (Read error: Connection reset by peer) |
08:18:43 | zedeus | we've been waiting for that openssl fix, nitter would occasionally crash from ssl double frees |
08:20:19 | * | fredrikhr joined #nim |
08:20:50 | Araq | is the fix in 1.2.2? |
08:20:54 | zedeus | yes |
08:21:00 | Araq | ah great |
08:27:52 | * | muffindrake joined #nim |
08:33:48 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
08:36:44 | * | Lord_Nightmare joined #nim |
08:56:53 | narimiran | now it is official: Nim v1.2.2 is out! https://nim-lang.org/blog/2020/06/17/version-122-released.html |
08:59:36 | * | vikfret quit (Quit: Leaving) |
09:01:42 | * | Vladar quit (Remote host closed the connection) |
09:06:04 | * | Vladar joined #nim |
09:09:03 | * | opal quit (Ping timeout: 240 seconds) |
09:09:23 | * | Vladar quit (Client Quit) |
09:09:43 | * | Vladar joined #nim |
09:10:22 | FromDiscord | <Firefell> YES !! |
09:10:37 | * | solitudesf joined #nim |
09:10:47 | Yardanico | lol :D |
09:13:25 | * | solitudesf- quit (Ping timeout: 264 seconds) |
09:14:41 | * | Vladar quit (Quit: Leaving) |
09:15:00 | FromDiscord | <Firefell> I waited doc generation fix 🙂 |
09:15:47 | * | krux02 joined #nim |
09:16:14 | * | Vladar joined #nim |
09:23:47 | * | opal joined #nim |
09:29:00 | FromDiscord | <KrispPurg> Eyyy, nice. |
09:29:53 | FromDiscord | <KrispPurg> Now I can carry on testing without Ssl nil err |
09:36:15 | * | Vladar quit (Quit: Leaving) |
09:37:58 | * | Vladar joined #nim |
09:44:59 | * | haxscramper joined #nim |
09:46:23 | * | Vladar quit (Quit: Leaving) |
09:46:47 | * | Vladar joined #nim |
10:07:12 | federico3 | https://forum.nim-lang.org/t/6434#39715 |
10:07:24 | Yardanico | federico3: yeah seems a bit of a troll :P |
10:07:28 | Yardanico | a go troll to be specific :D |
10:10:46 | FromDiscord | <Rika> 👀 how do you know theyre a go troll |
10:10:50 | Yardanico | net/http |
10:11:09 | Yardanico | that's a go stdlib package |
10:11:42 | Yardanico | they basically say "i'm used to go so I don't understand async or nim's parallelism so they're bad" |
10:12:02 | FromDiscord | <Rika> well they never elaborated why theyre bad |
10:12:15 | Yardanico | that's exactly what makes it seem like a troll post |
10:13:13 | supakeen | The asynchttpserver/httpserver thing could be better I guess? |
10:13:20 | supakeen | But who really understands async anyways :) |
10:13:53 | FromDiscord | <Rika> i'm still reading the backpressure blog post! |
10:15:10 | * | oddp joined #nim |
10:15:22 | * | abm joined #nim |
10:16:52 | * | letto quit (Ping timeout: 256 seconds) |
10:17:17 | * | vsantana quit (Quit: vsantana) |
10:18:02 | * | brainbomb joined #nim |
10:19:08 | dom96 | supakeen, the asynchttpserver/httpserver thing? |
10:20:07 | federico3 | Yardanico: he sounds quite correct |
10:21:05 | supakeen | dom96: Sorry, the asynchttpserver module in stdlib and the httpclient module in stdlib. |
10:21:12 | supakeen | Mixed up some words there :) |
10:21:14 | Yardanico | httpclient is fine IMO |
10:21:39 | dom96 | again, elaborate |
10:22:00 | dom96 | That's like saying "The Nim thing could be better, I guess?" :) |
10:22:35 | supakeen | Let me type something out. |
10:23:20 | * | vsantana joined #nim |
10:25:00 | * | mchinen joined #nim |
10:25:21 | * | leorize quit (Remote host closed the connection) |
10:25:29 | supakeen | Actually no, re-reading it all I feel like it mostly 'lacks' routing which is offered by net/http and the question is if you'd want that in stdlib. |
10:25:48 | * | leorize joined #nim |
10:25:51 | zedeus | jester and whip offers routing, it doesn't have to be in stdlib |
10:26:22 | supakeen | I can see a point for either side of that. |
10:34:49 | * | dddddd joined #nim |
10:35:27 | PMunch | Congratulations on 1.2.2 everyone! |
10:37:08 | * | skelett quit (Quit: WeeChat 2.5) |
10:37:58 | * | Trustable joined #nim |
10:40:30 | * | brainbomb1 joined #nim |
10:41:31 | * | brainbomb quit (Ping timeout: 272 seconds) |
10:42:37 | * | letto joined #nim |
10:50:33 | * | mchinen quit (Quit: Leaving) |
10:54:01 | * | bung joined #nim |
10:55:17 | bung | can I write file permission in .nimble? |
10:56:45 | bung | I checked inclFilePermissions no available in nimscript |
11:01:41 | PMunch | You can probably call chmod from a .nimble file |
11:04:56 | livcd | i hate invalid indentation errors..... |
11:05:44 | bung | hmm, I'll check how it would be in windows |
11:06:34 | PMunch | livcd, indent your code correctly then! :P |
11:06:58 | PMunch | You think the compiler likes nagging you about them? |
11:07:55 | livcd | https://forum.nim-lang.org/t/1641 this is awesome |
11:10:32 | livcd | i hate it when my monitoring is full of red alerts |
11:12:48 | krux02 | livcd, are you talking about command and conquer? |
11:12:59 | krux02 | :P |
11:15:17 | livcd | sadly no |
11:18:33 | * | solitudesf quit (Remote host closed the connection) |
11:21:28 | * | solitudesf joined #nim |
11:46:37 | FromDiscord | <willyboar> yuri's revenge |
11:54:26 | PMunch | Tiberian Sun used to be my jam |
11:56:33 | FromDiscord | <willyboar> best games ever along with age of empires II w/ conquerors expansion |
11:57:47 | PMunch | Huh, never played with that expansion |
11:57:54 | PMunch | But I played a lot of Age of Mythology |
11:57:56 | * | letto quit (Read error: Connection reset by peer) |
12:02:28 | * | Kaivo joined #nim |
12:04:06 | FromDiscord | <willyboar> I stuck with counter strike before age of mythology released |
12:04:36 | FromDiscord | <willyboar> then at 2004 i start playing football manager who was the last game i played |
12:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
12:06:35 | * | supakeen joined #nim |
12:18:07 | FromDiscord | <InventorMatt> is there a way to call an iterator one increment at a time? |
12:19:54 | FromDiscord | <Rika> what do you mean? |
12:20:13 | FromDiscord | <Rika> like an iterator object in python? |
12:20:44 | FromDiscord | <InventorMatt> yes, exactly like that |
12:21:38 | krux02 | anybody interested to be irritating to EA? |
12:21:45 | krux02 | https://github.com/electronicarts/CnC_Remastered_Collection/issues/78 |
12:21:46 | disbot | ➥ GPL violation / Wrong License |
12:21:51 | FromDiscord | <Rika> sent a code paste, see http://ix.io/2poO |
12:22:04 | krux02 | completely irrelevant to Nim though |
12:22:24 | FromDiscord | <Rika> lmao |
12:22:27 | FromDiscord | <InventorMatt> thanks, I'll try that out |
12:23:23 | FromDiscord | <Rika> sent a code paste, see http://ix.io/2poQ |
12:23:50 | FromDiscord | <Rika> of course, you can make a `next` proc that does this for you |
12:24:06 | FromDiscord | <Rika> which raises a "StopException" for you like in python when finished |
12:26:28 | FromDiscord | <InventorMatt> that seems to work. thank you for the help |
12:35:01 | * | fredrikhr quit (Ping timeout: 264 seconds) |
12:36:46 | * | bung quit (Ping timeout: 246 seconds) |
12:37:28 | * | fredrikhr joined #nim |
12:38:04 | * | couven92 quit (Read error: Connection reset by peer) |
12:38:27 | * | fredrikhr quit (Read error: Connection reset by peer) |
12:38:47 | * | fredrikhr joined #nim |
12:42:30 | * | couven92 joined #nim |
12:45:55 | * | fredrikhr quit (Ping timeout: 265 seconds) |
12:48:46 | * | NimBot joined #nim |
12:51:33 | * | letto joined #nim |
13:01:36 | * | waleee-cl joined #nim |
13:01:52 | * | bung joined #nim |
13:04:38 | disruptek | willyboar: you haven't played a game since 2004? |
13:06:14 | FromDiscord | <willyboar> for long only Football Manager |
13:06:29 | disruptek | zedeus: the client understands the significance of a url but the server does not. i'd say that's a symetry that should exist in stdlib. |
13:07:02 | disruptek | only football manager. yer blowin' my mind right now. |
13:07:08 | disruptek | i may also be high. |
13:09:45 | * | nekits quit (Quit: The Lounge - https://thelounge.chat) |
13:11:08 | * | nekits joined #nim |
13:15:27 | * | chemist69_ quit (Ping timeout: 260 seconds) |
13:15:51 | * | chemist69 joined #nim |
13:23:45 | FromDiscord | <willyboar> disruptek: I show you started new project |
13:24:13 | FromDiscord | <Rika> show? did you mean see 😛 |
13:24:28 | FromDiscord | <willyboar> saw |
13:24:38 | FromDiscord | <willyboar> you are right |
13:25:55 | FromDiscord | <willyboar> but disruptek understands me 😛 |
13:30:56 | FromDiscord | <Shucks> Meow Meow |
13:31:06 | FromDiscord | <Shucks> wops 😉 |
13:31:10 | disruptek | !last leorize |
13:31:11 | disbot | leorize joined 12#nim-news 3 hours ago and last spoke 72 days ago |
13:31:22 | * | ftsf quit (Ping timeout: 246 seconds) |
13:31:34 | disruptek | how could that possibly be correct? |
13:31:51 | FromDiscord | <willyboar> it's not |
13:31:57 | disruptek | who fucking codes this stuff? |
13:32:54 | FromDiscord | <Rika> someone |
13:33:49 | disruptek | willyboar: dude, i need your help on web stuff all the time. |
13:33:52 | disruptek | are you available? |
13:34:22 | FromDiscord | <willyboar> For you yes |
13:34:32 | disruptek | awesome, man. it's gonna be great. |
13:34:55 | disruptek | what do you think of gitnim? |
13:35:01 | disruptek | ~gitnim |
13:35:01 | disbot | gitnim: 11https://gitnim.com/ -- choosenim for choosey nimions -- disruptek |
13:35:30 | * | bolti[m] joined #nim |
13:35:53 | FromDiscord | <willyboar> First thing i thought when i see it, it was : Why disruptek don't concetrate to create github tools? |
13:37:02 | disruptek | yeah, well, it works. |
13:37:08 | disruptek | it works really well. |
13:37:35 | disruptek | it puts people near code and it puts code near people. |
13:37:50 | disruptek | it puts communication near code. |
13:37:59 | disruptek | oral history. |
13:38:29 | disruptek | you can find out the whys and whatfors with respect to this piece of nim that you're interested in. |
13:38:46 | disruptek | at any time, you can see if there have been issues with this section of code. |
13:39:01 | disruptek | you can read its origin story. |
13:39:15 | disruptek | get a chonology of what changed, who changed it, why. |
13:39:44 | disruptek | these are nice qualities to have in an ecosystem. |
13:40:03 | disruptek | git is just the mechanics of how we provide it. |
13:40:09 | disruptek | it works really well. |
13:40:38 | zedeus | does gitnim provide an easy way to compile latest devel? |
13:41:00 | disruptek | of course. |
13:41:16 | FromDiscord | <dponyatov> What environment I must provide in case of using Nim for bare metal programming for i386 or some microcotroller? |
13:41:40 | FromDiscord | <dponyatov> (edit) 'microcotroller?' => 'microcontroller?' |
13:41:47 | FromDiscord | <Rika> pass in --os:standalone and --gc:arc? |
13:41:48 | FromDiscord | <Rika> dunno |
13:41:54 | zedeus | --os:any |
13:42:42 | shashlick | disruptek: just ran git-nim - illegal instruction (core dumped) |
13:43:00 | FromDiscord | <dponyatov> Is `newlib` is a minimum must be built, or even less (only malloc part w/o io) ? |
13:43:01 | disruptek | what kinda system are you on? |
13:43:12 | shashlick | ubuntu bionic i thhink |
13:43:20 | disruptek | but arch |
13:43:24 | FromDiscord | <dponyatov> arm-none-eabi and i486-none-elf |
13:43:34 | shashlick | x86_64 |
13:43:44 | disruptek | neat. |
13:43:54 | disruptek | i love carrying on two conversations at once. |
13:44:03 | disruptek | it's awesome, right? |
13:44:24 | disruptek | you link two people up and just talk at both of them. |
13:50:31 | disruptek | shashlick: which branch? |
13:50:56 | disruptek | i recently changed the default branch to 1.0.7. |
13:53:56 | shashlick | master |
13:55:10 | shashlick | i tried all other branches too |
13:55:15 | shashlick | some don't have git-nim |
13:59:17 | * | adnan338 joined #nim |
13:59:22 | disruptek | wut |
14:02:08 | disruptek | it seems to work best on 1.0.7, but i can switch around in all of them. |
14:03:27 | disruptek | the point is, there are as many heads as there are branches. |
14:03:37 | zedeus | why 1.0.7? |
14:03:54 | disruptek | because that's stable. |
14:04:07 | zedeus | what is 1.2.2 then? |
14:04:10 | narimiran | disruptek: 1.2.2 was released today, don't know if you missed it |
14:04:23 | narimiran | zedeus: stable-improved :) |
14:04:26 | disruptek | it's already in. i didn't know when it was released. |
14:04:30 | disruptek | lol |
14:04:43 | zedeus | why not make it default? |
14:04:52 | disruptek | we'll tag 1.0.7 as stable. 1.0.7 /is/ the default. |
14:05:24 | narimiran | 1.0.6 is stable and tested, 1.0.7 is a backport-devel |
14:05:52 | narimiran | (yes, we're planning to have 1.0.8 at some point) |
14:05:57 | disruptek | if leorize gives me a 1.0.6, we'll make 1.0.6 the default. |
14:06:54 | * | notandinus quit (Ping timeout: 240 seconds) |
14:07:15 | * | notandin` joined #nim |
14:08:59 | disruptek | so i just type `git nim 1.0.7` |
14:09:09 | disruptek | `git tag -a stable` |
14:09:16 | disruptek | `git push --tags` |
14:09:51 | disruptek | done. that's our new process for adding an arbitrary release to the entire world. |
14:10:14 | * | notandin` quit (Client Quit) |
14:10:19 | * | endragor quit (Remote host closed the connection) |
14:11:49 | * | team\andinus joined #nim |
14:14:11 | FromDiscord | <Rika> huh. |
14:14:28 | FromDiscord | <Rika> why can we `from xx import xx` but not `from xx export xx` |
14:14:37 | * | bung quit (Ping timeout: 264 seconds) |
14:14:39 | FromDiscord | <lqdev> export xx.xx |
14:14:46 | FromDiscord | <Rika> ok |
14:14:52 | FromDiscord | <Rika> thats odd |
14:14:58 | disruptek | it's a fair question. |
14:15:17 | FromDiscord | <lqdev> well, export works on any symbol so you can qualify them like normal |
14:15:29 | disruptek | i personally think it's because araq hates asians. |
14:15:55 | disruptek | i'm kidding, of course. i don't know if he hates them. |
14:28:31 | FromGitter | <Vindaar> uhm, risking to be mistaken here, but... happy birthday, Araq! |
14:29:49 | narimiran | @Vindaar you're correct :) |
14:29:55 | * | couven92 quit (Read error: Connection reset by peer) |
14:29:58 | FromGitter | <Vindaar> woohooo :) |
14:30:21 | disruptek | ~araq |
14:30:21 | disbot | Araq: 11👑Andreas "What Else?" Rumpf👑 -- disruptek |
14:30:44 | * | fredrikhr joined #nim |
14:30:58 | * | fredrikhr quit (Read error: Connection reset by peer) |
14:31:20 | * | fredrikhr joined #nim |
14:32:01 | FromDiscord | <willyboar> Happy Birthday BDFL 🎂 |
14:33:03 | PMunch | Ooh, happy birthday! |
14:33:34 | FromDiscord | <willyboar> how old he is now? |
14:33:57 | disruptek | he looks like he's about 22. |
14:34:11 | FromDiscord | <willyboar> lol |
14:35:15 | stefantalpalaru | It seems I cannot `import times` in NimScript. What's the alternative for generating a timestamp there? |
14:36:27 | disruptek | shashlick: ah, i just need to figure out how to remove tags from github. |
14:36:37 | FromDiscord | <treeform> Where the tests for VC++ ran for 1.2.2? |
14:37:24 | FromDiscord | <treeform> was this blocking bug fixed? https://github.com/nim-lang/Nim/issues/14259 |
14:37:27 | disbot | ➥ VC++ winnt.h fatal error "No Target Architecture" in stdlib_io. ; snippet at 12https://play.nim-lang.org/#ix=2ppc |
14:38:06 | narimiran | i know how old is he, but don't know if i'm allowed to tell :P :D |
14:38:41 | narimiran | lets just say more than 30, less then 40 :) |
14:38:43 | shashlick | disruptek: maintaining tools that change along with nim across branches might become a big pain |
14:39:04 | shashlick | why not a use submodule for the tools |
14:39:12 | shashlick | guess that will end up with another subdir to add to path |
14:39:28 | disruptek | narimiran: i maintain criterion now. |
14:40:14 | disruptek | i'm not against a submodule system for tools and stuff, i just haven't tested it across branches. |
14:40:25 | narimiran | disruptek: oh, i had no idea. will you send a PR with the changed repo for important_packages (and fix all the deprecated stuff), or would you rather if i do it? :) |
14:40:53 | disruptek | is there a way for me to test it locally? |
14:41:15 | FromDiscord | <Rika> hbd |
14:42:35 | narimiran | disruptek: my editor highlights all deprecated warnings (e.g. with some older devel which still have those functions), or you run `nimble test` until the latest devel works |
14:43:14 | narimiran | i don't remember exactly what the problems were, but most probably `random` -> `rand` and/or `initSet` -> `initHashSet` |
14:43:19 | disruptek | okay, so you just want it to be quiet? |
14:43:32 | * | couven92 joined #nim |
14:43:32 | disruptek | i wonder if i already did this. |
14:43:34 | * | solitudesf quit (Remote host closed the connection) |
14:43:56 | * | solitudesf joined #nim |
14:44:00 | disruptek | it just has some "unused" warnings. |
14:44:24 | disruptek | this is my 0.2.0 release, fwiw. |
14:45:19 | narimiran | disruptek: now that my PR is merged it is not anymore about being quiet - it won't work with the latest devel |
14:47:47 | disruptek | i'm not sure i follow; i'm able to run criterion tests on 1.3.5 from <24hrs ago. |
14:48:03 | disruptek | or are you saying that since your pr, warnings are errors? |
14:50:07 | narimiran | my PR was merged <2hrs ago |
14:50:26 | narimiran | the deprecated functions are gone |
14:51:15 | narimiran | https://github.com/nim-lang/Nim/pull/14699 |
14:51:16 | disbot | ➥ Remove deprecated stuff from stdlib |
14:52:26 | disruptek | how deprecated could they be? they aren't emitting any deprecation warnings in criterion tests. |
14:52:38 | * | bung joined #nim |
14:54:35 | narimiran | (if my internet wasn't as spotty as currently, i would look into it; maybe later when it comes back for good) |
14:59:11 | disruptek | narimiran: looks like i fixed some deprecations, so i think we're good if you just change the url to my fork. |
14:59:19 | disruptek | !repo disruptek/criterion |
14:59:19 | disbot | no results 😢 |
14:59:27 | disruptek | er, it's that. |
14:59:38 | disruptek | it's just.. i told disbot that forks don't count. |
14:59:54 | disruptek | i guess i should make !fork a thing. |
14:59:57 | narimiran | btw, is it just on my end or github is spotty currently? |
15:00:18 | narimiran | ah, it is not just github. it is me. yay |
15:00:31 | disruptek | it's been fine for me. i am constantly blowing away my entire nim tree and restoring it with git. |
15:01:51 | FromDiscord | <Shucks> sent a code paste, see http://ix.io/2ppj |
15:02:03 | FromDiscord | <Shucks> If I define the gcc path in my project nim.cfg it will work |
15:03:14 | disruptek | because $nim is a path substitution. |
15:03:23 | disruptek | it's performed in the compiler's configuration context. |
15:04:13 | FromDiscord | <Shucks> It doesn't works if I use the full path aswell. $nim also works fine if I use it in the project config file |
15:04:51 | disruptek | oh, i thought you were trying to use it from the command-line. |
15:05:16 | disruptek | what does `nim dump` say? |
15:05:58 | * | haxscramper quit (Remote host closed the connection) |
15:06:13 | FromDiscord | <Shucks> https://paste.sh/2aN3u878#fbsTG-TvaetzhUc9L-KsnHuX |
15:07:18 | bolti[m] | Hi, I'm learning Nim and I have a question. What does {} means before an assignment in procs? for example {.async.} |
15:07:48 | disruptek | it's the syntax for a pragma. |
15:07:48 | narimiran | disruptek: we should probably also change that nimble points to your fork |
15:08:01 | * | Senny joined #nim |
15:08:16 | disruptek | narimiran: yeah. |
15:08:20 | narimiran | on it |
15:08:37 | disruptek | Shucks: they should both work from any config. |
15:09:02 | bolti[m] | disruptek: thanks |
15:09:10 | * | fredrikhr quit (Ping timeout: 260 seconds) |
15:09:38 | disruptek | Shucks: it might be that they configs are getting evaluated in unexpected order? |
15:10:11 | FromDiscord | <Shucks> ```Hint: used config file 'E:\Program Files\nim-1.2.0\config\nim.cfg' [Conf]↵Hint: used config file 'G:\Coding\Nim\Tests\dlltest\nim.cfg' [Conf]``` |
15:10:13 | * | fredrikhr joined #nim |
15:10:17 | FromDiscord | <Shucks> should use the main one first right |
15:10:31 | FromDiscord | <Shucks> oh wait |
15:10:38 | FromDiscord | <Shucks> im defining i386 in my project config |
15:11:13 | disruptek | it's kinda weird how it works; it parses and reparses like 3x. |
15:12:08 | * | lritter joined #nim |
15:13:13 | FromDiscord | <Shucks> Well I guess if I use `--cpu:i386` in the second one the nim main one doesn't defines the gcc path |
15:18:13 | * | narimiran quit (Ping timeout: 264 seconds) |
15:19:40 | * | narimiran joined #nim |
15:19:59 | * | fredrikhr quit (Read error: Connection reset by peer) |
15:20:58 | * | fredrikhr joined #nim |
15:23:26 | * | fredrikhr quit (Read error: Connection reset by peer) |
15:23:37 | * | fredrikhr joined #nim |
15:27:09 | Araq | guys, we could use a helping hand here: https://github.com/nim-lang/Nim/pull/14690 |
15:27:10 | disbot | ➥ Add an ARC test with threads in a loop |
15:27:26 | Araq | ideally on some OS 'valgrind' can pinpoint the real problem |
15:27:44 | Araq | it's a pretty simple program after all |
15:28:04 | Araq | fwiw I did check the produced code and nothing looked suspicious |
15:30:24 | disruptek | i feel like someone had this in the playground and it ran there. |
15:30:53 | disruptek | i think i remember fixing a single off-by-one range buglet in it. |
15:31:02 | disruptek | s/single/simple/ |
15:34:05 | disruptek | neat bug. |
15:35:24 | * | kenran quit (Ping timeout: 256 seconds) |
15:35:33 | disruptek | so it's a race to dealloc a pointer that isn't owned by the thread. |
15:41:26 | disruptek | is it because the main thread destroys the thread object, too? |
15:44:51 | * | couven92 quit (Read error: Connection reset by peer) |
15:45:18 | * | couven92 joined #nim |
15:46:37 | FromGitter | <alehander92> oh happy birthday guy! |
15:46:51 | * | couven92 quit (Read error: Connection reset by peer) |
15:47:15 | * | couven92 joined #nim |
15:54:02 | * | adnan338 quit (Ping timeout: 256 seconds) |
15:56:31 | * | drdee joined #nim |
16:06:34 | * | vikfret joined #nim |
16:13:37 | Yardanico | Araq: I tried finding alternatives to valgrind, found some tool called DrMemory, but it seems to output the same stuff |
16:13:37 | Yardanico | https://gist.github.com/Yardanico/9e35ff74f7bdc8b4c0a9885f178bafe7 |
16:18:40 | * | aenesidemus joined #nim |
16:19:39 | FromDiscord | <Technisha Circuit> If i get the generated C code from Nim and compile it on another machine using a different cpu architecture, will it compile? Because apparently the C code is platform and Arch specifc |
16:19:45 | Yardanico | no |
16:19:50 | Yardanico | you can prepare the C code on your machine though |
16:19:54 | Yardanico | for that other architecture |
16:19:55 | FromDiscord | <Technisha Circuit> Oh? |
16:20:05 | Yardanico | why can't you run the compiler on that platform directly btw? |
16:20:43 | Yardanico | but basically you need --genScript:on |
16:21:13 | Yardanico | of course also your platform specific CPU and os flags |
16:21:22 | Yardanico | like --os:linux --cpu:i386 or something like that |
16:27:29 | FromDiscord | <KrispPurg> Hey guys, is there a way to update an object automatically like say the old object is `Obj(name: "r", stuff: None[int])` and the new one is `Obj(name: "lol", stuff: Some(666))`? |
16:27:37 | Yardanico | wdym "update"? |
16:27:59 | Yardanico | well in async you can set callbacks and stuff |
16:28:40 | narimiran | if you're looking for ocaml/F# kind of stuff for updating, that's not possible AFAIK |
16:28:48 | narimiran | but you can do it in two steps |
16:28:53 | FromDiscord | <KrispPurg> well, for changing objects from old to new |
16:28:59 | Yardanico | just change it? |
16:29:02 | Yardanico | i don't understand sorry :P |
16:29:19 | disruptek | we use assignment for wholesale updates. |
16:29:35 | disruptek | it's like a destructuring without the expense of destructuring. |
16:32:24 | FromDiscord | <KrispPurg> so just `obj.name = "e.g."` |
16:32:29 | Yardanico | ye of course |
16:32:41 | FromDiscord | <KrispPurg> oof |
16:32:45 | Yardanico | if it's "object" with var or "object" or "ref object" with let |
16:32:50 | Yardanico | if it's "object" with let, you can't ofc |
16:32:54 | Yardanico | otherwise it's just simple assignment lol |
16:32:56 | FromDiscord | <KrispPurg> ik |
16:33:01 | disruptek | var obj = Obj(name: "r", stuff: Some(666)) |
16:33:11 | Yardanico | well yes you can also do that |
16:33:20 | Yardanico | but it might be better to just update a few fields if you have a lot of them |
16:33:20 | FromDiscord | <KrispPurg> but what if it's a long object |
16:33:23 | FromDiscord | <Rika> i dont see whats the issue |
16:33:26 | disruptek | i think you're going to love creating objects. |
16:33:31 | Yardanico | @Rika neither do i :D |
16:33:31 | disruptek | it's really a great experience. |
16:33:48 | * | vsantana quit (Quit: leaving) |
16:33:53 | FromDiscord | <KrispPurg> like UpdatedObj? |
16:33:56 | FromDiscord | <Rika> dont make long objects :PPPP |
16:34:03 | Yardanico | @KrispPurg so that's your issue? |
16:34:06 | FromDiscord | <Rika> compose your objects! |
16:34:07 | Yardanico | just update the fields and done |
16:35:30 | disruptek | we could write a macro to do partial updates. |
16:35:45 | Yardanico | we already have "with" |
16:37:39 | FromDiscord | <KrispPurg> So, when I update my guild like name for example, basically it's just the updated guild, but the members field isn't included which means that before you update the guild and you send the file with the guild object which is stringified and the file is like 7 KB, after updating it it's like 1 KB. |
16:37:50 | FromDiscord | <KrispPurg> hold on brb |
16:38:19 | shashlick | disruptek - what version of libgit2 do you use? |
16:38:20 | Yardanico | well I still don't understand, why field updating doesn't work for you? :P |
16:38:55 | zedeus | don't learn fp first, kids. |
16:39:43 | FromDiscord | <Rika> i dont think krisppurg comes from an fp language |
16:39:47 | Yardanico | yeah |
16:39:58 | zedeus | hm |
16:41:09 | FromDiscord | <KrispPurg> It does work for me but, I don't want to be that much of a hassle |
16:41:17 | Yardanico | ?? |
16:42:28 | FromDiscord | <KrispPurg> I hate having to explain this, because I am terrible at explaining tbh, but I think there's a lot to assign the fields. |
16:42:38 | FromDiscord | <KrispPurg> which would be a hassle |
16:42:41 | Yardanico | show thec ode |
16:42:46 | Yardanico | we can all read code |
16:43:06 | Yardanico | well, how you want it to look like |
16:44:07 | FromDiscord | <KrispPurg> sent a code paste, see http://ix.io/2ppJ |
16:44:40 | Yardanico | ehm |
16:44:53 | Yardanico | what object do you want to assign fields for? |
16:47:02 | FromDiscord | <KrispPurg> Guild |
16:47:11 | Yardanico | just declare it with "var" then? |
16:47:15 | Yardanico | if it's not a ref object |
16:47:33 | Yardanico | ah wait I think I might understand |
16:47:44 | Yardanico | well no, guild is a ref object |
16:47:47 | Yardanico | so it should be fine |
16:48:38 | Yardanico | you can assign to guild in this code just fine |
16:48:48 | Yardanico | I mean assign fields, not a new object |
16:48:58 | Yardanico | if you want to fully reassign it you need to declare it as "var" |
16:51:52 | * | natrys joined #nim |
16:56:03 | FromDiscord | <Skaruts> can I do `from X export Y`? |
16:56:11 | Yardanico | you can do |
16:56:15 | Yardanico | "from X import Y" |
16:56:16 | Yardanico | export Y |
16:56:21 | zedeus | deja vu |
16:56:32 | FromDiscord | <Skaruts> hmm, yea, thanks |
16:56:39 | FromDiscord | <Skaruts> didn't think of that |
16:56:42 | zedeus | https://irclogs.nim-lang.org/17-06-2020.html#14:14:28 |
16:56:57 | Yardanico | xd |
16:57:02 | FromDiscord | <Rika> lmao |
16:57:03 | FromDiscord | <Rika> hey! |
16:57:11 | FromDiscord | <Rika> dont call me out |
16:57:52 | Yardanico | ah right |
16:58:01 | Yardanico | maybe i should try to complete my unpack macro today |
16:58:16 | Yardanico | it mimics python'ss tuple unpacking (including the * specifier) and is relatively simple |
16:58:37 | Yardanico | not exactly safe though, since it's supposed to be used for seqs with runtime length |
16:58:48 | supakeen | Yardanico: Does it do my favorite `x, = T` where it unpacks a single thing and errors if there's not a single thing in the seq? |
16:59:17 | Yardanico | well you can of course do |
16:59:27 | Yardanico | myseq.unpack(x) |
16:59:32 | Yardanico | if there's less than 1 elem it'll fail of course |
16:59:54 | Yardanico | the macro allows for simple stuff like let (a, b, c) = data.unpack(3) |
17:00:07 | supakeen | Ah nice! |
17:00:08 | Yardanico | or python-like with myseq.unpack(a, b, *c, d) |
17:00:43 | Yardanico | i need to figure out the proper indexing for star expressions because right now it's a bit borked :P |
17:04:39 | FromDiscord | <Shucks> hopefully disruptek doesnt see that |
17:04:58 | FromDiscord | <Shucks> he almost killed me yesterday for being like `hey thats what I do in python` ;D |
17:05:08 | Yardanico | well i do it just for fun |
17:05:11 | Yardanico | I won't use it myself anyway :P |
17:05:17 | disruptek | i haven't decided if i'm going to kill you yet. |
17:05:21 | disruptek | the day is young. |
17:05:26 | FromDiscord | <Shucks> hehe |
17:10:01 | FromGitter | <alehander92> guys do you like menus |
17:10:10 | FromGitter | <alehander92> i am really not great at UX |
17:10:33 | FromGitter | <alehander92> and want to go back to TUI |
17:22:33 | Prestige | tui always |
17:25:01 | disruptek | shashlick: i use 1.0.1 iirc. |
17:25:08 | PMunch | @alehander92, define menus? |
17:25:27 | disruptek | shashlick: your bug was one of documentation, i think. we'll just make people build gitnim. if they can't we have real problems. |
17:25:36 | * | krux02 quit (Remote host closed the connection) |
17:25:59 | disruptek | i mean, if your compiler doesn't work, you won't be doing much nim work. |
17:32:36 | bolti[m] | Hi, why some procs don't need parentheses? like echo? |
17:32:47 | bolti[m] | * Hi, why some procs doesn't need parentheses? like echo? |
17:32:52 | Prestige | If you have no params or return type you don't need them |
17:33:04 | Yardanico | not exactly |
17:33:14 | Yardanico | bolti[m]: see https://nim-lang.org/docs/manual.html#procedures-command-invocation-syntax |
17:33:16 | zedeus | https://nim-lang.github.io/Nim/manual.html#procedures-command-invocation-syntax |
17:33:17 | Prestige | Oh i thought he meant just the declaration of the proc |
17:33:18 | zedeus | dammit |
17:33:20 | Yardanico | :D |
17:33:55 | Yardanico | bolti[m]: basically any procedure can be called without parens if it's not ambiguous |
17:34:27 | Yardanico | btw I figured why my * unpacking didn't work correctly |
17:34:34 | Yardanico | because I can't know how much values left at compile-time :P |
17:34:39 | Yardanico | so I'll use ^ |
17:35:56 | bolti[m] | Why this doesn't work? |
17:35:57 | bolti[m] | proc main = |
17:35:58 | bolti[m] | echo "Hello" |
17:35:58 | bolti[m] | main |
17:36:10 | Yardanico | because it's ambiguous |
17:36:18 | Yardanico | are you referring to proc itself or do you want to call it? |
17:36:19 | Yardanico | we don't know |
17:36:26 | Yardanico | "Function calls with no arguments still needs () to distinguish between a call and the function itself as a first class value." |
17:36:33 | bolti[m] | thanks |
17:39:04 | FromDiscord | <Technisha Circuit> In Nim can i have an empty pragma like ```nim↵proc myProcedure() {..} =↵ # Code```? |
17:39:10 | zedeus | hy |
17:39:12 | zedeus | why |
17:39:20 | FromDiscord | <Rika> why? idts |
17:39:48 | FromDiscord | <Technisha Circuit> Curiosity and oof |
17:39:51 | zedeus | wtf |
17:39:58 | Yardanico | jesus it works |
17:40:03 | FromDiscord | <Rika> what |
17:40:04 | Yardanico | bless the roof operator |
17:40:05 | FromDiscord | <Rika> holy fuck what |
17:40:06 | leorize | !eval proc foo() {.} = discard |
17:40:09 | NimBot | <no output> |
17:40:09 | FromDiscord | <Rika> ah i thought |
17:40:14 | leorize | yep it works |
17:40:15 | FromDiscord | <Rika> bruh |
17:40:22 | FromDiscord | <Rika> bruh |
17:40:23 | zedeus | well it doesn't do anything, why does it matter |
17:40:32 | Yardanico | I'm doing this https://gist.github.com/Yardanico/464c259d38d513fd9ac56a27e48e5c9d |
17:40:35 | Yardanico | and this works now :P |
17:41:38 | Yardanico | macro is not the cleanest though, but hey it works :P |
17:41:51 | zedeus | maybe you could do `unpack: (a, *c, d, f) = data` |
17:42:09 | Yardanico | well it's supposed to be used in a single line anyway, so I don't think there's a lot of difference |
17:42:13 | FromDiscord | <Technisha Circuit> Oh damn |
17:42:24 | zedeus | the syntax is much closer to regular unpacking, if you're going for that |
17:42:26 | Yardanico | now I need to make it somehow not to make copies where it's not needed |
17:42:44 | zedeus | it's also a bit more clear that you're assigning new variables |
17:43:16 | Yardanico | well maybe I'll change it, idk, it's pretty small anyway |
17:43:19 | Yardanico | @[1, 2, 3, 5, 6].unpack(g, x, _, _, z) this works too |
17:43:30 | Yardanico | maybe I should also do *_ xD |
17:43:51 | Yardanico | since python allows that |
17:43:53 | livcd | i am excited to see nim & qt |
17:44:45 | * | vsantana joined #nim |
17:45:07 | zedeus | the major blocker for me was having to ship DOtherside |
17:45:29 | leorize | oh you're using QML? |
17:45:35 | leorize | how is it in nim? |
17:45:35 | zedeus | status is |
17:45:46 | leorize | I see |
17:45:56 | zedeus | https://www.youtube.com/watch?v=AAr2lHZLNyU |
17:45:58 | zedeus | oops |
17:46:00 | zedeus | https://github.com/status-im/nim-status-client |
17:46:25 | FromDiscord | <Recruit_main707> bruh XD |
17:46:31 | FromDiscord | <Rika> someone's in vtuber hell |
17:46:32 | zedeus | you didn't see that. |
17:46:38 | Yardanico | nice song anyway |
17:46:38 | FromDiscord | <Rika> pekopekopekopekopekopeko |
17:46:39 | zedeus | my friend is, i swear |
17:46:43 | Yardanico | zedeus: its okay |
17:46:45 | Yardanico | there are weebs here too |
17:46:48 | FromDiscord | <Rika> embrace it |
17:47:15 | Yardanico | when you use nim for the first time https://www.youtube.com/watch?v=V6bTbqk_gj4 |
17:47:34 | disruptek | OHIO |
17:48:08 | FromDiscord | <Recruit_main707> this video reminds me of this girl og the body rolls song |
17:48:12 | FromDiscord | <Recruit_main707> of* |
17:50:01 | FromDiscord | <Rika> oh wow til theres a discord user in this server named `zzzig` and has a rust profile picture |
17:50:12 | Yardanico | !getdiscid zzzig |
17:50:14 | FromDiscord | zzzig#0857 has Discord UID: 707410275695067228 |
17:50:15 | Yardanico | i am ban |
17:50:24 | Yardanico | /s |
17:50:35 | Yardanico | his UID is 707410275695067228 btw |
17:51:10 | FromDiscord | <Recruit_main707> did you scroll down to the bottom of the users Rika? |
17:51:34 | FromDiscord | <Rika> yes im checking every user's pfp |
17:51:43 | FromDiscord | <Rika> if theres another user with a virtual youtuber avatar |
17:52:24 | * | couven92 quit (Read error: Connection reset by peer) |
17:52:32 | Yardanico | lol |
17:52:52 | * | couven92 joined #nim |
17:54:00 | FromDiscord | <Rika> so far so good |
17:55:21 | * | couven92 quit (Read error: Connection reset by peer) |
17:55:47 | * | couven92 joined #nim |
17:55:55 | bolti[m] | Hi, do you know good nim live coding streams? |
17:56:27 | zedeus | ~stream |
17:56:28 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) |
17:56:54 | disruptek | eh that guy's an asshole. |
17:56:59 | zedeus | yeah. |
17:57:43 | bolti[m] | mm why? |
17:57:51 | Yardanico | XDD |
17:57:58 | zedeus | he groans a lot |
17:58:29 | * | vikfret quit (Quit: Leaving) |
17:59:26 | bolti[m] | xd |
17:59:49 | zedeus | if only you knew. |
18:04:10 | * | bung quit (Quit: Lost terminal) |
18:04:34 | PMunch | Haha :P |
18:04:47 | zedeus | no really, you weren't there |
18:05:15 | Araq | disruptek, huh but with --threads:on --gc:arc we use a shared heap |
18:05:41 | * | drdee quit (Remote host closed the connection) |
18:05:50 | * | drdee joined #nim |
18:08:30 | disruptek | Araq: go eat cake; it'll keep. 😉 |
18:10:46 | leorize | shashlick: have you tested my nightlies? |
18:10:56 | disruptek | Araq: there's no destroy for it anyway, i think. |
18:11:46 | FromDiscord | <willyboar> @alehander92 I was searching you yesterday |
18:11:51 | * | opal quit (Remote host closed the connection) |
18:12:25 | FromDiscord | <willyboar> Disruptek: I will join stream later |
18:12:50 | disruptek | i'm not streaming. also, they are repaving outside my window. |
18:12:52 | Yardanico | it's not live anyway |
18:14:25 | FromDiscord | <willyboar> Zedeus tricked me |
18:15:37 | * | opal joined #nim |
18:18:25 | Yardanico | so i did it I think, the code isn't the prettiest but it kinda works :P |
18:18:26 | Yardanico | https://github.com/Yardanico/nim-snippets/blob/master/unpack_macro.nim |
18:19:42 | leorize | is this based on the unpack macro on nimble sometime ago?? |
18:20:17 | FromDiscord | <Recruit_main707> bolti: https://www.twitch.tv/codemaniacs↵this guy is coding a PSX emulator in nim and streams it |
18:20:31 | FromDiscord | <Recruit_main707> not super active though |
18:20:33 | zedeus | neat |
18:20:39 | * | dddddd quit (Ping timeout: 260 seconds) |
18:28:57 | disruptek | i would watch that. |
18:34:09 | * | kenran joined #nim |
18:36:02 | bolti[m] | Thanks |
18:36:35 | FromDiscord | <Shucks> heh? https://play.nim-lang.org/#ix=2pqi |
18:39:37 | FromDiscord | <Shucks> didn't saved my last changes: https://play.nim-lang.org/#ix=2pqk |
18:39:49 | FromDiscord | <Shucks> (edit) removed 'https://play.nim-lang.org/#ix=2pqi' |
18:39:56 | Yardanico | well, it's not hard to get compiler crashes with some invalid nim code |
18:40:01 | Yardanico | but yeah, report it on github |
18:42:14 | FromDiscord | <Shucks> What would be the valid nim code then? I need to use a optional typedesc parameter there |
18:42:58 | Yardanico | use options module then? |
18:43:17 | Yardanico | https://nim-lang.org/docs/options.html |
18:51:49 | * | Senny quit (Ping timeout: 264 seconds) |
18:56:05 | * | moerm joined #nim |
18:56:12 | moerm | Hello everyone ;) |
18:56:30 | FromDiscord | <Technisha Circuit> How do i edit json data that I've loaded? Let's say i want to change a number in the json data, how would i do that? |
18:57:13 | zedeus | https://nim-lang.github.io/Nim/json.html#%5B%5D%3D%2CJsonNode%2Cstring%2CJsonNode |
19:04:33 | FromDiscord | <Shucks> Thank you. But how would I define a none typedesc? https://play.nim-lang.org/#ix=2pqq |
19:04:39 | FromDiscord | <Technisha Circuit> Thanks :p |
19:05:01 | Yardanico | @Shucks hrm |
19:05:08 | Yardanico | well you can always make two overloaded procs instead |
19:05:13 | Yardanico | one with the typedesc argument, one without them |
19:05:28 | Yardanico | and maybe even share the implementation between them if it's similar |
19:05:55 | * | tane joined #nim |
19:06:37 | FromDiscord | <Shucks> So the compiler knows which one it has to call then? Thats fancy |
19:07:47 | Yardanico | yes of course |
19:07:56 | Yardanico | you can overload by different types, by number of arguments, etc |
19:07:59 | FromDiscord | <Rika> Typedesc is a generic tho |
19:08:04 | Yardanico | soo? |
19:08:14 | Yardanico | you can make one proc without the typedesc argument, and one with it |
19:08:27 | * | chemist69 quit (Ping timeout: 240 seconds) |
19:08:31 | FromDiscord | <Technisha Circuit> So how do i turn an int to it a jsonInt? |
19:08:35 | moerm | CU later |
19:08:38 | Yardanico | newJInt(myint) |
19:08:45 | * | moerm quit (Quit: Leaving) |
19:08:46 | FromDiscord | <Technisha Circuit> Thanks :P |
19:08:46 | * | kenran quit (Ping timeout: 246 seconds) |
19:08:49 | Yardanico | https://nim-lang.org/docs/json.html#newJInt%2CBiggestInt |
19:08:49 | FromDiscord | <Rika> Or % |
19:08:51 | Yardanico | it's literally at the top |
19:08:52 | Yardanico | yeah, or % |
19:08:53 | FromDiscord | <Rika> Right? |
19:09:21 | * | couven92 quit (Read error: Connection reset by peer) |
19:09:33 | * | chemist69 joined #nim |
19:09:42 | FromDiscord | <Technisha Circuit> So i can use `%` on any json serialisable object to get it's json representation? |
19:09:49 | * | couven92 joined #nim |
19:10:16 | Yardanico | yes |
19:10:17 | FromDiscord | <Rika> Yes |
19:10:21 | FromDiscord | <Technisha Circuit> Nice |
19:10:41 | FromDiscord | <Rika> %* for one that does objects itself |
19:10:44 | FromDiscord | <Technisha Circuit> So I'm assuming `%5` should work |
19:10:47 | FromDiscord | <Technisha Circuit> O |
19:10:49 | FromDiscord | <Rika> Yes |
19:10:55 | FromDiscord | <Technisha Circuit> Cool, thanks! |
19:11:23 | FromDiscord | <Technisha Circuit> Is this also compatible with packedjson? |
19:11:32 | zedeus | yes |
19:11:39 | FromDiscord | <Technisha Circuit> That's nice then |
19:14:59 | FromDiscord | <Recruit_main707> packedjson does not have a to() function iirc |
19:15:05 | FromDiscord | <Technisha Circuit> Oh? |
19:15:14 | FromDiscord | <Technisha Circuit> What does it use then? |
19:16:01 | FromDiscord | <lqdev> nothing |
19:16:07 | zedeus | it has % |
19:16:08 | FromDiscord | <lqdev> there's no alternative, unfortunately. |
19:16:24 | FromDiscord | <Technisha Circuit> Then how do i modify the data? |
19:16:32 | FromDiscord | <Technisha Circuit> Wait |
19:16:43 | zedeus | read carefully |
19:16:45 | FromDiscord | <Technisha Circuit> So `%` just converts them back and forth? |
19:16:57 | zedeus | % converts values to json nodes |
19:17:16 | zedeus | `to` is a macro that converts a jsonnode to some type, but you don't need that |
19:22:56 | FromDiscord | <Technisha Circuit> Oh okay |
19:24:24 | * | couven92 quit (Read error: Connection reset by peer) |
19:24:52 | * | couven92 joined #nim |
19:24:56 | FromDiscord | <Technisha Circuit> How do i remove values from a table? |
19:25:31 | zedeus | please read the manual |
19:26:03 | FromDiscord | <Technisha Circuit> Oh yeah, that's a thing :p |
19:26:34 | FromGitter | <alehander92> oii |
19:26:47 | zedeus | we need a gpt-3 bot that can answer such questions |
19:27:01 | zedeus | they showed a cool demo with wikipedia |
19:27:13 | zedeus | https://openai-assets.s3-us-west-2.amazonaws.com/API/FINAL_bread.mp4 |
19:27:23 | FromGitter | <alehander92> disruptek ah |
19:27:29 | FromGitter | <alehander92> i thought i can mumble with ya guys |
19:27:29 | disruptek | AIIIEEE |
19:27:40 | leorize | @lqdev so how are you planning your async thingy? |
19:27:55 | FromGitter | <alehander92> willyboar yeah sorry |
19:27:58 | FromGitter | <alehander92> i was a bit buys |
19:28:00 | FromGitter | <alehander92> busy |
19:29:14 | FromDiscord | <lqdev> leorize: decided to go with a lightweight dispatcher that calls all active async procs on `window.pollEvents`. |
19:29:22 | FromDiscord | <lqdev> it's that simple. |
19:29:45 | FromDiscord | <lqdev> so unfortunately code *will* result in callback hell but it's really not my fucking problem |
19:29:54 | FromDiscord | <lqdev> you shouldn't be downloading a lot of data from the GPU anyways |
19:30:55 | FromDiscord | <Technisha Circuit> I'm getting ```/data/data/com.termux/files/home/test.nim(6, 41) Error: expected type, but got: initTable(64)```with this code```nim↵import tables, asyncdispatch↵↵var x:initTable[string, proc(){.async.}]()```, why is this? |
19:31:23 | zedeus | initTable is not a type |
19:31:42 | disruptek | use = |
19:31:43 | FromDiscord | <Technisha Circuit> Oh |
19:31:48 | disruptek | ~manual |
19:31:48 | disbot | manual: 11the Nim Manual is https://nim-lang.org/docs/manual.html -- disruptek |
19:31:48 | FromDiscord | <Technisha Circuit> I'm really stupid- |
19:31:52 | zedeus | you don't need to init tables anyway. |
19:32:00 | zedeus | var x: Table[string, ...] |
19:32:06 | FromDiscord | <willyboar> Nevermind alehander92 |
19:32:33 | FromDiscord | <Technisha Circuit> Eh |
19:33:50 | FromDiscord | <Technisha Circuit> I think it'd look neater :p |
19:34:17 | zedeus | wut |
19:34:40 | zedeus | longer unnecessary code certainly isn't neater |
19:35:15 | disruptek | it is when i write it. |
19:35:25 | FromDiscord | <Technisha Circuit> Doing var x:Table[...] Is basically the same as using var x = initTable[...] |
19:35:36 | FromDiscord | <Technisha Circuit> Also, is it ```nim↵if n in myTable:↵ # Code``` to check if a value is in my code |
19:35:41 | zedeus | the former is shorter |
19:36:04 | FromDiscord | <Technisha Circuit> Eh ¯\\_(ツ)\_/¯ |
19:36:06 | zedeus | as the manual tells you, yes that's how you do it |
19:36:50 | FromDiscord | <Rika> ~~what's up with you and not reading the manual~~ |
19:36:55 | disruptek | zedeus, meet technisha. technisha, zedeus. |
19:37:05 | disruptek | mmmm'kay? |
19:37:16 | zedeus | oh this isn't the first time, buddy |
19:37:22 | FromDiscord | <Rika> (笑) |
19:37:26 | federico3 | what happened to https://github.com/nim-lang/Nim/blob/devel/doc/filters.rst ? It |
19:37:36 | federico3 | it's not listed in the manual and stdlib doc anymore |
19:37:47 | FromDiscord | <Rika> It what |
19:37:50 | FromDiscord | <Rika> Ah |
19:37:53 | FromDiscord | <Rika> Really? |
19:38:05 | federico3 | you can only find it from https://nim-lang.org/documentation.html |
19:38:05 | * | fredrikhr quit (Read error: Connection reset by peer) |
19:38:17 | * | fredrikhr joined #nim |
19:38:30 | * | fredrikhr quit (Read error: Connection reset by peer) |
19:38:52 | * | fredrikhr joined #nim |
19:39:09 | * | fredrikhr quit (Disconnected by services) |
19:39:14 | * | couven92 is now known as fredrikhr |
19:39:28 | * | couven92 joined #nim |
19:39:59 | FromDiscord | <Yardanico> A bit late, but I posted 1.2.2 announcement in #announcements |
19:40:10 | FromDiscord | <Yardanico> idk if people really check it though |
19:40:52 | federico3 | we need some better HTML DSL in stdlib tho |
19:41:13 | FromDiscord | <Yardanico> Just add karax to fusion |
19:42:22 | zedeus | +1 |
19:42:29 | * | tdc quit (Ping timeout: 258 seconds) |
19:42:44 | FromGitter | <alehander92> hmm |
19:42:51 | FromGitter | <alehander92> karax works as html generator |
19:42:53 | FromGitter | <alehander92> but is it fast |
19:42:59 | federico3 | no way |
19:43:06 | FromGitter | <alehander92> because you have VNode construction => $ convertion |
19:43:11 | FromGitter | <alehander92> instead of direct text generation |
19:43:12 | zedeus | it's quite fast, yeah |
19:43:23 | FromGitter | <alehander92> i mean, no, there are two cases |
19:43:46 | FromGitter | <alehander92> its fast for vdom, but here its about generating string html iirc |
19:43:52 | zedeus | yes. |
19:44:03 | zedeus | i use it for nitter, the time to generate full pages is less than 1 ms |
19:44:04 | FromGitter | <alehander92> and less intermediate objects should be somehow faster i guess |
19:44:21 | FromGitter | <alehander92> yeah, but i imagine it can be *faster* |
19:44:44 | FromGitter | <alehander92> probably needs profiling as everything, might be negligible for most cases |
19:44:47 | * | solitudesf quit (Ping timeout: 258 seconds) |
19:45:04 | zedeus | it is, and the flexibility it gives you is very worth it imo |
19:45:33 | leorize[m] | vnodes have advantages of being modifiable before you render them into html though |
19:45:40 | FromGitter | <alehander92> i agree, but you can have it all + no intermediate vnodes |
19:45:47 | FromGitter | <alehander92> hm, i think i rarely modify them |
19:45:51 | FromGitter | <alehander92> in my vdom code |
19:46:07 | FromGitter | <alehander92> they can be generated with if-s so i am not sure if this is important |
19:46:07 | zedeus | it's more about composability |
19:46:36 | zedeus | https://github.com/zedeus/nitter/blob/master/src/views/tweet.nim |
19:46:38 | FromGitter | <alehander92> it is possible, after all html generation |
19:46:45 | FromGitter | <alehander92> is probably much faster than dom rendering |
19:46:50 | FromGitter | <alehander92> what can you do |
19:47:26 | FromGitter | <alehander92> ok, but i dont see why does one need actual VNode here if it's on the server side |
19:47:33 | FromGitter | <alehander92> you can use the same dsl |
19:47:48 | FromGitter | <alehander92> and `VNode = string` + some internal defines if its using c backend |
19:48:46 | zedeus | type safety? i dunno |
19:48:49 | zedeus | it's plenty fast either way |
19:49:17 | FromGitter | <alehander92> sorry, its good enough surely! |
19:49:24 | FromGitter | <alehander92> i just was trying to think of cool tricks |
19:49:31 | FromGitter | <alehander92> good work on nitter |
19:49:46 | * | dddddd joined #nim |
19:52:58 | alehander92_ | hey disruptek |
19:53:38 | alehander92_ | i want to make something people didnt expect |
19:53:49 | zedeus | don't spoil it, then |
19:54:11 | alehander92_ | you're right! |
19:54:25 | alehander92_ | so then i want to do something zedeus is ok with |
19:54:34 | disruptek | good luck. |
19:54:59 | FromDiscord | <Technisha Circuit> Could i pass a module to a function? |
19:55:11 | zedeus | why? |
19:55:21 | alehander92_ | no |
19:55:30 | alehander92_ | modules dont really exist as *values* |
19:55:42 | alehander92_ | but probably you can do what you want in a different way |
19:56:19 | FromDiscord | <Technisha Circuit> Hm, okay |
19:56:25 | * | krux02 joined #nim |
19:56:32 | * | xet7 quit (Quit: Leaving) |
19:56:39 | FromDiscord | <Technisha Circuit> ~~Alot of the things which i ask if i can do will make you say why-~~ |
19:57:07 | FromDiscord | <Technisha Circuit> Is it possible to get the name of a type in Nim? |
19:57:19 | FromDiscord | <Technisha Circuit> A user-defined type specifically |
19:57:31 | zedeus | yeah because they're often rather questionable things that don't make much sense if you know the language properly |
19:57:39 | * | brainbomb1 quit (Quit: Leaving.) |
19:57:47 | FromDiscord | <Technisha Circuit> Exactly :) |
19:58:12 | zedeus | and since you refuse to read the manual.. it's gonna be a long day |
19:58:20 | zedeus | you can get type names yes, stringify the typedesc |
20:01:17 | FromDiscord | <Technisha Circuit> Oh okay, thanks :P |
20:08:21 | * | fredrikhr quit (Read error: Connection reset by peer) |
20:08:46 | * | fredrikhr joined #nim |
20:09:36 | * | fredrikhr quit (Read error: Connection reset by peer) |
20:10:01 | * | fredrikhr joined #nim |
20:11:06 | * | rayman22201_ joined #nim |
20:12:50 | * | kungtotte_ joined #nim |
20:13:30 | * | lj00nal joined #nim |
20:13:35 | * | livcd_ joined #nim |
20:13:45 | * | brainbomb joined #nim |
20:13:48 | * | Ekho- joined #nim |
20:14:13 | * | literal_ joined #nim |
20:14:16 | * | xace_ joined #nim |
20:14:36 | * | brainbomb quit (Client Quit) |
20:14:55 | * | federico3_ joined #nim |
20:15:05 | * | MightyJoe joined #nim |
20:15:08 | * | couven92 quit (Read error: Connection reset by peer) |
20:15:26 | * | couven92 joined #nim |
20:15:38 | * | couven92 quit (Read error: Connection reset by peer) |
20:16:02 | * | couven92 joined #nim |
20:17:57 | * | kenran joined #nim |
20:18:54 | * | cyraxjoe quit (*.net *.split) |
20:18:54 | * | xace quit (*.net *.split) |
20:18:54 | * | kungtotte quit (*.net *.split) |
20:18:54 | * | rayman22201 quit (*.net *.split) |
20:18:54 | * | ljoonal quit (*.net *.split) |
20:18:54 | * | wgetch quit (*.net *.split) |
20:18:54 | * | livcd quit (*.net *.split) |
20:18:54 | * | Ekho quit (*.net *.split) |
20:18:54 | * | literal quit (*.net *.split) |
20:18:54 | * | federico3 quit (*.net *.split) |
20:18:59 | * | rayman22201_ is now known as rayman22201 |
20:19:25 | * | lj00nal is now known as ljoonal |
20:19:41 | alehander92_ | this is a good way to learn too |
20:19:50 | alehander92_ | but usually |
20:19:55 | * | Ekho- is now known as Ekho |
20:20:04 | alehander92_ | you need to run some compile time code and maybe to make it produce the runtime code you actually need |
20:20:10 | alehander92_ | when you do stuff like that |
20:20:26 | alehander92_ | but it might be different in your case |
20:21:25 | * | ljoonal left #nim ("https://ljoonal.xyz?irc") |
20:24:36 | * | kenran quit (Ping timeout: 265 seconds) |
20:24:36 | * | wgetch joined #nim |
20:26:06 | * | narimiran quit (Ping timeout: 256 seconds) |
20:27:10 | * | PMunch quit (Quit: leaving) |
20:33:31 | * | nsf quit (Quit: WeeChat 2.8) |
20:35:47 | * | msmorgan quit (Ping timeout: 240 seconds) |
20:37:16 | bolti[m] | can you write your own pragmas? |
20:37:28 | FromDiscord | <Recruit_main707> yes :) |
20:37:45 | FromDiscord | <Recruit_main707> you can do really cool stuff |
20:40:34 | * | sacredfrog quit (Quit: ZNC 1.8.1 - https://znc.in) |
20:41:26 | * | xet7 joined #nim |
20:42:08 | * | sacredfrog joined #nim |
21:01:43 | bolti[m] | async pragma in what code it transforms? |
21:02:38 | leorize | the async macro can be found in the asyncmacros module if that's what you're asking |
21:04:34 | * | vsantana quit (Quit: bye) |
21:06:07 | FromDiscord | <ikrima> is there a nim trick I can employ to make it "more homoiconic"? |
21:06:49 | FromDiscord | <ikrima> sent a code paste, see http://ix.io/2prg |
21:07:11 | FromDiscord | <ikrima> and i have a macro/func/whatev, that is `cppTypes` |
21:07:25 | FromDiscord | <ikrima> i want to read the data file and have it execute said functions |
21:08:05 | FromDiscord | <ikrima> (edit) 'and i have a macro/func/whatev, that is `cppTypes` ... ' => 'and i have a macro/func/whatev, that is `cppTypes`and takes `uid/fields` as params' |
21:09:07 | leorize | what does this macro does? |
21:09:20 | leorize | you might be able to make use of type section macros |
21:09:36 | FromDiscord | <ikrima> right now i just have dispatch tables of function pointers, but it doesn't allow it to be recursive (i.e. if i want to define fields to be a macro that expands) |
21:09:49 | * | aenesidemus quit (Ping timeout: 264 seconds) |
21:10:03 | FromDiscord | <ikrima> @leorize this macro expands out to different things depending on the context |
21:10:26 | leorize | well an example of what it does would be nice |
21:10:27 | FromDiscord | <ikrima> - it expands out (using sourcecode filters) to generating a C++ struct |
21:10:48 | FromDiscord | <ikrima> - another is it generates a c++ UI::Render() function that outputs UI bindings/code |
21:11:14 | leorize | why do you have to use SCF? |
21:11:40 | FromDiscord | <ikrima> no reason other than the first thing i found |
21:12:09 | FromDiscord | <ikrima> (this is day 4 using nim, so you can assume "why did you use this?" => ans: "no good reason/what should i have done") |
21:12:27 | * | pietroppeter quit (Read error: Connection reset by peer) |
21:12:57 | leorize | so what do you mean by generating a C++ struct? generating C++ code or generating Nim code that maps to a C++ struct? |
21:13:22 | FromDiscord | <ikrima> ah, larger context is i'm using nim to write codegen/parsing |
21:13:44 | leorize | some example of input and output would be nice :P |
21:14:05 | FromDiscord | <ikrima> sure |
21:14:06 | FromDiscord | <ikrima> https://gist.github.com/ikrima/87f2bd1599c66bfc4aeed181a1981fc4 |
21:14:49 | FromGitter | <iffy> Sometimes I want to not forget to do something before I release so I use this: `template TODO(msg:untyped) = when defined(release): {.fatal: msg.}`Does anything like that already exist in stdlib? |
21:15:16 | leorize | @iffy nope :P |
21:15:21 | FromGitter | <iffy> (I use it like: `TODO "Don't forget to remove the backdoor"`) |
21:15:27 | leorize | lol |
21:15:56 | FromDiscord | <ikrima> basically, i have a custom dsl that defines kernel operators and a task graph↵- i need to generate UI for said things↵- i need to generate glue code/and execution schedules depending on the dsl + data dependencies↵- end output is C/C++ code |
21:16:14 | leorize | @ikrima I think this can be done using Nim's `type` blocks |
21:16:26 | FromDiscord | <ikrima> - this was all in C++ until last week when i got fed up with templates and now evaluating nim vs. clojure |
21:17:04 | FromDiscord | <ikrima> @leorize can you give me an example (or a link i can read)? |
21:17:11 | FromDiscord | <Recruit_main707> use `{.exportc.}` so that it keeps the same name and not a weird one |
21:17:15 | leorize | so you want this DSL to be done in Nim? |
21:17:37 | FromDiscord | <ikrima> yeah |
21:17:39 | leorize | like you want this to be written in Nim and not YAML? |
21:18:19 | FromDiscord | <ikrima> i'm not too attached to how the specific shape of the dsl (it looks very yaml like just bc i initially made everything as nim compile time macro expansions) |
21:18:32 | FromDiscord | <ikrima> i do want all the dsl processing/codegen to be in nim |
21:18:53 | FromDiscord | <ikrima> and call said functions from my C++ app |
21:18:55 | * | nikita` quit (Quit: leaving) |
21:19:01 | leorize | and how do you want the codegen to be? like generating C code embedded into the program? |
21:21:23 | FromDiscord | <ikrima> sent a code paste, see http://ix.io/2prm |
21:21:25 | leorize | well lets first make this look like Nim, give me a few moment and I'll structure this into proper Nim :P |
21:22:08 | FromDiscord | <ikrima> `datacompiler::compile` is now in C++, but that would be the thing that calls nim↵- also ofcourse we can skip it writing to the file and directly pass memory objects, but that's details |
21:24:20 | * | aenesidemus joined #nim |
21:25:37 | FromDiscord | <ikrima> sent a long message, see http://ix.io/2prq |
21:26:46 | FromDiscord | <ikrima> but ofc, i don't know what i'm doing w.r.t Nim so open to changing anything/everything (fwiw, i'm liking Nim more and more) |
21:26:56 | leorize | your idea is a bit too barebones tbh |
21:27:07 | leorize | you seem to be exposing too many implementation details in your DSL |
21:28:36 | leorize | this feels kinda like a node-based editor dsl :P |
21:28:50 | FromDiscord | <ikrima> that's exactly what it is 😛 |
21:29:24 | leorize | @lqdev ^ this should be your field of expertise |
21:29:59 | FromDiscord | <ikrima> should also clarify, the "dsl" is an internal only thing, meant to help me write the internals of the execution engine faster/easier |
21:30:27 | leorize | you'll probably have a better idea once you see a node editor written in Nim |
21:30:32 | leorize | lemme remember the name |
21:30:35 | leorize | !repo nadio |
21:30:36 | disbot | https://github.com/liquid600pgm/nadio -- 9nadio: 11Experimental digital audio workstation with a keyboard-focused user interface 15 7⭐ 0🍴 |
21:30:48 | FromDiscord | <lqdev> leorize: what is it? |
21:31:06 | FromDiscord | <lqdev> ah |
21:31:31 | FromDiscord | <lqdev> well, this isn't exactly my field of expertise |
21:31:44 | FromDiscord | <ikrima> 🙏 🙏 🙏 |
21:31:54 | FromDiscord | <ikrima> that is super helpful |
21:31:55 | FromDiscord | <lqdev> I still haven't implemented actual plugins or DSP or anything :P |
21:32:17 | FromDiscord | <lqdev> but the node editor works |
21:32:28 | FromDiscord | <lqdev> I don't use macros for it though |
21:32:33 | FromDiscord | <ikrima> haha, oh god, it's GPL'd 😛 |
21:32:49 | FromDiscord | <ikrima> i can't look at that code :/ |
21:32:53 | FromDiscord | <lqdev> don't want any corporate entity stealin' my software, you know |
21:33:05 | FromDiscord | <lqdev> is it ok if I give you explicit permission? |
21:33:07 | leorize | you certainly know more than I do to translate this weird mapping into sensible high-level stuff |
21:33:31 | FromDiscord | <ikrima> for sure (and obvi i care about it otherwise i'd just read it and not say anything) |
21:33:39 | * | natrys quit (Quit: natrys) |
21:34:03 | FromDiscord | <lqdev> idk about the details of the GPL but afaik it just doesn't permit literal copying of code |
21:34:08 | FromDiscord | <lqdev> but I'm not a lawyer |
21:34:09 | FromDiscord | <ikrima> @lqdev mmm, not sure if that works (i am working on a possibly commercial product) |
21:34:17 | FromDiscord | <lqdev> right. |
21:34:33 | FromDiscord | <ikrima> or rather, it might be productized later. i haven't decided yet (jusst being upfront) |
21:34:57 | FromDiscord | <lqdev> but just looking at code for inspiration wouldn't be a violation, no? |
21:35:17 | FromDiscord | <ikrima> ianal? |
21:35:41 | FromDiscord | <lqdev> same |
21:35:42 | FromDiscord | <ikrima> the guidance i always got was to stay away from it to be safe |
21:36:00 | leorize | it'd work if you give people actual written consent with a ton of lawyer speak |
21:36:26 | FromDiscord | <lqdev> pretty sure that GPL viral thing only really matters if you use the code *literally*, as in a library or something |
21:36:33 | leorize | and I'm sure that you can't do that so... maybe you can look at @ikrima problem and try to make sense of this? |
21:36:51 | leorize | GPL apply to "derivatives" and the idea of "derivatives" is vague as hell |
21:36:58 | * | msmorgan joined #nim |
21:37:23 | FromDiscord | <lqdev> it's probably described somewhere within the license itself, but I don't really have time to read the whole thing now |
21:37:29 | FromDiscord | <lqdev> anyways, to the point. |
21:38:01 | FromDiscord | <lqdev> I get the idea of your app, what are you trying to make into a DSL? |
21:38:11 | leorize | a lot of this code reminds me of Qt's macro mess |
21:38:40 | leorize | it appears to me that they are trying to design an interface to easily fabricate nodes |
21:39:32 | FromDiscord | <ikrima> @lqdev the "dsl" is for codegen/data transformation |
21:39:39 | FromDiscord | <lqdev> right |
21:39:54 | FromDiscord | <lqdev> so the DSL's job is to define the nodes and how they get transformed into C/C++ code? |
21:40:05 | FromDiscord | <ikrima> right |
21:40:27 | FromDiscord | <ikrima> and teh "trick" i use so i don't have to write a full blown parser is turn the "dsl keywords" into function bindings |
21:40:43 | FromDiscord | <ikrima> i bind different functions for different codegen |
21:41:00 | FromDiscord | <ikrima> ie, there's the `datatype` object |
21:41:06 | FromDiscord | <ikrima> (edit) 'object' => 'object/dsl keyword' |
21:41:24 | FromDiscord | <ikrima> i have a binding for UI generation, a binding for meta reflection generation, etc |
21:41:58 | FromDiscord | <ikrima> similarly, there's the `operatorNode` data type/keyword |
21:42:16 | FromDiscord | <ikrima> that has different functions that do different codegen, reflection, etc |
21:42:21 | leorize[m] | this is what I meant by saying that you're focusing too much on the implementation :P |
21:42:45 | FromDiscord | <ikrima> not sure what you mean by that still? |
21:43:11 | FromDiscord | <ikrima> the dsl's purpose is to help me implement? |
21:43:17 | FromDiscord | <lqdev> and you're basically trying to parse this entire DSL of yours with macros? |
21:43:18 | FromDiscord | <ikrima> none of this is for the user |
21:43:26 | FromDiscord | <ikrima> (edit) 'none' => '(none' | 'user' => 'user)' |
21:43:55 | FromDiscord | <ikrima> @lqdev yeah. and tbf, this came out of my clojure implementation and i really liked this idea |
21:44:13 | leorize | well your DSL appears to be designed to cater to your implementation, not to describe an "idea" if that make sense |
21:44:29 | leorize | but whatever works I guess :P |
21:44:31 | FromDiscord | <ikrima> but i acknowledge there's probably a better Nim way to achieve the same thing but i dont know |
21:44:53 | * | pietroppeter joined #nim |
21:45:24 | FromDiscord | <lqdev> alright, I *kind of* get the idea |
21:45:25 | leorize | well I'll try to do a barebones translation to the type construct first |
21:46:14 | FromDiscord | <ikrima> (also appreciate the patience, not pushing back against suggestions btw) |
21:46:46 | leorize | we were all in your shoe, don't worry :P |
21:47:00 | leorize | maybe after seeing some more flexible construct you'll have some more idea |
21:47:09 | FromDiscord | <ikrima> 👍 definitely |
21:47:30 | FromDiscord | <lqdev> well I wouldn't exactly try to represent this with a DSL like this, it's too rigid imo |
21:48:01 | * | NimBot joined #nim |
21:48:14 | FromDiscord | <lqdev> I'd probably implement an abstract `NodeDesc` which contains some procs like `init` etc which are supposed to process the node for you |
21:48:26 | FromDiscord | <lqdev> maybe a `genCode` proc which actually generates the appropriate code |
21:48:44 | FromDiscord | <lqdev> and give each node kind its own module |
21:49:15 | FromDiscord | <lqdev> but maybe that's just my interpretation, I'm generally against using too many DSLs for things that are meant to be done programatically (like codegen) |
21:49:42 | FromDiscord | <lqdev> you can always define some helper procs that do common repetitive tasks |
21:50:03 | FromDiscord | <lqdev> and that would probably be more idiomatic |
21:50:28 | FromDiscord | <lqdev> but sticking with your idea of the DSL, I'd start by getting a grasp of the AST Nim produces |
21:50:33 | FromDiscord | <lqdev> using `macros.dumpTree` |
21:51:32 | FromDiscord | <lqdev> then work my way from here, deferring individual nodes to procs that are meant to process individual structures in my DSL |
21:51:57 | FromDiscord | <ikrima> so over the weekend, i implemented a version of that using the nim ast nodes/macro expansion/templates |
21:52:30 | FromDiscord | <ikrima> but at the end of it, i realized that was all compile time, so not helpful for parsing different data files at runtime |
21:53:12 | FromDiscord | <ikrima> is there a way to access the Nim parsing/ast nodes at runtime? i.e. i have a function that at runtime, takes a file, and generates the nim ast? |
21:53:34 | leorize | if you import the compiler |
21:54:20 | leorize | here's my rough translation of it: https://play.nim-lang.org/#ix=2prw |
21:54:22 | FromDiscord | <ikrima> and would this be considered going deep into crazytown territory? or is this infrequently done but doesn't raise yellow flags? |
21:55:41 | leorize[m] | yea this is kinda in crazy territory |
21:56:52 | FromDiscord | <ikrima> 👍 k, i think i have enough to research more and try different approaches |
21:57:36 | FromDiscord | <ikrima> thx again for the help @lqdev & @leorize |
21:57:46 | leorize | np :) |
21:59:03 | leorize | in a way I think you're mixing too much runtime metadata into data structures, so maybe you'll want to define a clear boundary for them |
21:59:20 | * | abm quit (Quit: Leaving) |
21:59:55 | leorize | as powerful as Nim is, we generally prefer solutions built using simple components rather than macros |
22:00:43 | FromDiscord | <lqdev> exactly |
22:00:50 | FromDiscord | <lqdev> that's where my idea with procs came from |
22:02:03 | FromDiscord | <ikrima> yeah, in hindsight, my clojure approach subconsciously biased my initial nim solution approach strategy |
22:03:06 | FromDiscord | <ikrima> and nim's metaprogramming being as powerful as it is didn't put up any immediate red flags |
22:09:16 | * | tane quit (Quit: Leaving) |
22:17:33 | * | chemist69 quit (Ping timeout: 272 seconds) |
22:18:14 | * | chemist69 joined #nim |
22:18:42 | FromDiscord | <SeanOMik> Its weird that nim has cyclic includes |
22:19:52 | leorize | we do? |
22:20:41 | FromDiscord | <SeanOMik> Yeah |
22:21:20 | FromDiscord | <SeanOMik> If I have a.nim which imports b.nim which also imports a.nim |
22:21:22 | FromDiscord | <SeanOMik> I get an error |
22:21:25 | FromDiscord | <SeanOMik> Let me show it |
22:21:51 | leorize | ah we don't have them :P |
22:21:56 | leorize | atm |
22:21:57 | FromDiscord | <SeanOMik> Wdym? |
22:22:07 | leorize | we don't support cyclic imports atm |
22:22:08 | FromDiscord | <SeanOMik> Nim doesn't have cyclic includes atm? |
22:22:14 | FromDiscord | <SeanOMik> Oh okay |
22:22:16 | * | Vladar quit (Quit: Leaving) |
22:22:31 | leorize | there's a "limited" version of it but it's not really good |
22:22:48 | leorize | in general you should avoid cyclic imports in Nim |
22:23:11 | FromDiscord | <SeanOMik> Wdym by limited? |
22:23:19 | FromDiscord | <SeanOMik> I just need to import a certain type from a `nim` file |
22:23:38 | FromDiscord | <SeanOMik> So if its limited in what you can import it should be fine for my use case |
22:23:39 | leorize | https://nim-lang.org/docs/manual.html#modules |
22:23:44 | leorize | look at the example |
22:24:21 | leorize | note that this only work one way |
22:24:28 | shashlick | has anyone written nim code to compare two version strings and return the greater version |
22:24:38 | leorize | wdym greater? |
22:25:08 | shashlick | 1.2.11 > 1.2.9 |
22:25:21 | shashlick | but also able to handle 1.2.1a |
22:25:36 | leorize | I don't think anyone has written something like that |
22:26:01 | leorize | !eval echo "1.2.11" > "1.2.9" |
22:26:04 | NimBot | false |
22:26:55 | FromDiscord | <SeanOMik> Is there a way I could do something like forward declarations in C++ but for Nim? |
22:27:23 | leorize | https://nim-lang.org/docs/manual_experimental.html#package-level-objects |
22:45:43 | FromDiscord | <ikrima> another newb question, any pointers on how to "debug" compile times?↵I did something over the past week and now compiling "hello world" is 2 seconds everytime |
22:45:46 | FromDiscord | <SeanOMik> Leorize, does the object have to be in a seperate package? |
22:46:15 | FromDiscord | <SeanOMik> Because I'm doing this: ```↵type User = object``` |
22:46:31 | FromDiscord | <SeanOMik> And in another `nim` file I try to use that `User` object which has field `id` |
22:46:42 | FromDiscord | <SeanOMik> But it says that its undeclared |
22:47:13 | FromDiscord | <SeanOMik> Even though the file thats trying to use the `User` class with field of `id` has that type defined inside of it |
22:47:38 | * | Tongir quit (Remote host closed the connection) |
22:47:46 | FromDiscord | <ikrima> (edit) 'another' => '~~another' | 'times?↵I' => 'times?~~↵~~I' | 'everytime' => 'everytime~~↵n/m, vscode plugin was passing "-f"' |
22:47:59 | * | Tongir joined #nim |
22:56:04 | * | bung joined #nim |
22:58:43 | leorize | @SeanOMik can you create a small example? |
22:59:06 | FromDiscord | <SeanOMik> Yeah, I could try |
23:02:00 | FromDiscord | <SeanOMik> Okay |
23:02:08 | FromDiscord | <SeanOMik> sent a code paste, see http://ix.io/2prR |
23:02:28 | FromDiscord | <SeanOMik> I didn't write that in an ide so it may have typos or something |
23:02:55 | FromDiscord | <SeanOMik> But where it says `user.id` is where it says something like `undeclared field: 'id'` |
23:03:35 | leorize | shouldn't this getUser proc be in b.nim instead? :P |
23:03:49 | leorize | anyhow, the problem here is that these two must be in the same nimble package |
23:04:08 | FromDiscord | <SeanOMik> The same `.nim` file? |
23:04:24 | leorize | the "forward" declaration should become: PackageName.User |
23:04:55 | FromDiscord | <SeanOMik> Okay |
23:05:00 | FromDiscord | <SeanOMik> I'll keep that in mind for future |
23:05:09 | FromDiscord | <SeanOMik> But yeah, I'll just move the proc into b.nim instead |
23:05:13 | FromDiscord | <SeanOMik> That does make more since |
23:05:17 | leorize | not the same .nim file, but the same nimble package :P |
23:05:19 | FromDiscord | <SeanOMik> sense* |
23:05:39 | FromDiscord | <SeanOMik> Yeah |
23:05:41 | leorize | if you don't want to export the `id` field, just make a `proc id*(u: User): int` |
23:06:16 | FromDiscord | <SeanOMik> Well I actually do want to export the `id` field so I shouldn't have to |
23:06:20 | FromDiscord | <SeanOMik> Thanks for the help |
23:13:53 | * | Trustable quit (Remote host closed the connection) |
23:26:57 | disruptek | shashlick: plenty of code like that exists in nimph. |
23:42:03 | FromDiscord | <SeanOMik> How would I loop through a json array? |
23:42:16 | Yardanico | for x in myjson["data"].elems: |
23:42:31 | FromDiscord | <SeanOMik> And `x` is `JsonBody`? |
23:42:32 | Yardanico | actually want nvm |
23:42:37 | Yardanico | just for x in myjson["data"]: |
23:42:41 | Yardanico | x will be JsonNode of course |
23:42:45 | Yardanico | myjson is a JsonNode too |
23:42:59 | FromDiscord | <SeanOMik> Yeah I meant `JsonNode` |
23:43:01 | FromDiscord | <SeanOMik> Thanks |
23:44:53 | * | ftsf joined #nim |
23:50:27 | * | drdee quit (Quit: Leaving) |
23:51:36 | FromDiscord | <Technisha Circuit> Hey, i have a question for everyone. If i have a module and contains some functions (let's say `foo()` and `bar(this)`, in Nim i could do `foo().bar()` to pass `foo()` to `bar`, but how would i do this in Python after i use Nimpy? |
23:51:56 | Yardanico | if you mean export from nimpy to python - you can't |
23:52:01 | Yardanico | you'll have to create Python classes and stuff |
23:52:03 | Yardanico | Python doesn't have UFCS |
23:52:08 | * | couven92 quit (Read error: Connection reset by peer) |
23:52:25 | * | couven92 joined #nim |
23:52:37 | * | couven92 quit (Read error: Connection reset by peer) |
23:52:59 | * | couven92 joined #nim |
23:56:42 | skrylar[m] | hoi |
23:56:54 | FromDiscord | <Technisha Circuit> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/722963007725895745 |
23:56:55 | FromDiscord | <Technisha Circuit> Heya |
23:57:13 | Yardanico | @Technisha idk honestly, this is a nim channel :) |
23:57:17 | Yardanico | but yeah something like that I guess |
23:57:28 | * | couven92 quit (Ping timeout: 256 seconds) |
23:57:34 | Yardanico | but anyway I still wonder why are you trying to either use a JS Discord lib in nim, or nimpy, or something else, is pure nim that bad for you? :P |
23:58:10 | * | couven92 joined #nim |
23:58:41 | FromDiscord | <Technisha Circuit> Nah, just was thinking if i made a discord lib, i might aswell make it available for other languages |