00:00:04 | Yardanico | same for RBTreeNim |
00:00:33 | * | krux02__ joined #nim |
00:01:57 | * | oriba quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
00:03:08 | * | krux02_ quit (Ping timeout: 244 seconds) |
00:03:42 | * | sm2n_ joined #nim |
00:04:05 | * | sm2n quit (Read error: Connection reset by peer) |
00:04:26 | * | SenasOzys quit (Ping timeout: 256 seconds) |
00:09:13 | * | qwertfisch quit (Ping timeout: 264 seconds) |
00:09:27 | * | qwertfisch joined #nim |
00:10:35 | Guest49611 | Yardanico: are you behind nim-markdown? |
00:10:37 | * | Guest49611 is now known as dadada |
00:10:37 | Yardanico | no |
00:10:46 | Yardanico | I just tested it with ARC and found a cursor inference bug which got fixed |
00:10:54 | Yardanico | i don't have any popular nim libs :( |
00:10:55 | dadada | well, good |
00:11:00 | Yardanico | I mean I'm not the author of them |
00:11:09 | dadada | change that |
00:11:10 | dadada | ! |
00:11:36 | * | ForumUpdaterBot quit (Remote host closed the connection) |
00:11:44 | * | ForumUpdaterBot joined #nim |
00:14:11 | Yardanico | oh shoot, combparser still errors out, will need to minimize again :P |
00:22:46 | * | krux02__ quit (Remote host closed the connection) |
00:42:00 | shashlick | Y I have an arc bug as well |
00:42:12 | shashlick | Need to minimize but I know the commit |
00:44:24 | * | lritter joined #nim |
00:46:15 | * | Tongir joined #nim |
00:48:31 | * | Tlanger quit (Ping timeout: 246 seconds) |
00:52:48 | Yardanico | shashlick: I know nimble has some bugs with arc :P |
00:52:50 | Yardanico | I tried it with arc |
00:53:04 | * | NimBot joined #nim |
01:11:35 | * | apahl_ joined #nim |
01:14:55 | * | apahl quit (Ping timeout: 265 seconds) |
01:17:02 | shashlick | no, this is with nimterop |
01:17:04 | shashlick | https://github.com/nim-lang/Nim/issues/15129 |
01:17:06 | disbot | ➥ Issue with --gc:arc at compile time ; snippet at 12https://play.nim-lang.org/#ix=2sKt |
01:17:38 | Yardanico | oh I saw similar issues as well |
01:17:46 | Yardanico | in one of the package I didn't reproduce minimally yet |
01:17:53 | Yardanico | where the kind of a case object changed for some reason] |
01:19:41 | FromDiscord | <Varriount> @shashlick Is there a way to get Nimterop to pass a define to the preprocessor, when it's analyzing files? |
01:20:15 | shashlick | cDefine |
01:20:54 | shashlick | There's a toast cli param too |
01:21:06 | FromDiscord | <Varriount> `--define`? |
01:21:28 | shashlick | Ya me thinks |
01:21:41 | FromDiscord | <Varriount> It doesn't seem to actually pass anything to the preprocessor. I just see a {.define.} in the Nim code. |
01:22:15 | shashlick | @Yardanico what's interesting is that this is at compile time which makes no sense since the gc should only matter at runtime |
01:22:23 | Yardanico | well it's not the only issue like that |
01:22:30 | Yardanico | but it's not that simple I think |
01:22:53 | Yardanico | see e.g https://github.com/nim-lang/Nim/issues/15043 |
01:22:55 | disbot | ➥ [ARC] Compiler error with a closure proc in a macro ; snippet at 12https://play.nim-lang.org/#ix=2sKu |
01:23:05 | shashlick | @varriount it should get sent to getPreprocessor as well |
01:23:19 | * | maier joined #nim |
01:23:28 | shashlick | At least we know the commit |
01:23:38 | Yardanico | well that doesn't usually help a lot :P |
01:24:00 | shashlick | A little maybe ;) |
01:25:07 | Yardanico | I'm minimizing another arc crash with combparser right now (the first one got fixed) |
01:26:00 | shashlick | Ok now that that's done, back to local deps for Nimble |
01:28:32 | * | maier quit (Ping timeout: 256 seconds) |
01:31:06 | dadada | https://en.wikipedia.org/wiki/Haxe anyone tried it? |
01:31:16 | Yardanico | better ask in #nim-gamedev :) |
01:31:22 | dadada | what struck me was this "Major users of Haxe include BBC, Coca-Cola, Disney, Hasbro, Mattel, Nickelodeon, Prezi, TiVo, Toyota, and Zynga." |
01:31:41 | dadada | it would be a great for Nim to also have major users |
01:31:56 | Yardanico | but haxe has a different goal from Nim really |
01:32:34 | Yardanico | also see https://forum.nim-lang.org/t/6541 for some stuff about Haxe |
01:35:56 | leorize[m] | status is a big user :p |
01:36:20 | Yardanico | poor combparser |
01:36:21 | leorize[m] | we seem to have a rather decent userbase in China though |
01:36:38 | Yardanico | i sledgehammered combparser (to repro an arc bug) into https://gist.github.com/Yardanico/a4cee9628999e7ef1d0068e343f18350 |
01:37:42 | dadada | leorize[m]: not on the level of Coca-Cola :D |
01:39:20 | Yardanico | https://github.com/nim-lang/Nim/issues/15130 |
01:39:22 | disbot | ➥ [ARC] SIGSEGV with tuple assignment (?) ; snippet at 12https://play.nim-lang.org/#ix=2sKv |
01:39:44 | dadada | leorize[m]: are you a status employee? |
01:40:06 | leorize[m] | nope |
01:40:50 | leorize[m] | within Nim there are only a few status employee active here |
01:40:52 | leorize[m] | most notably mratsim and zah |
01:41:18 | dadada | okay, thanks for the information |
01:42:17 | dadada | I said here many times we need some major apps/libs for Nim, and the project should really focus on closing those gaps that keep users away, let them not take Nim seriously |
01:42:27 | * | thomasross joined #nim |
01:43:17 | leorize[m] | we just don't have the man power within the project to make those libraries |
01:43:18 | dadada | the language is already plenty powerful, it's really not what keeps Nim down, the project needs to focus much more on the ecosystem |
01:43:21 | leorize[m] | the majority of the man power is directed at the compiler |
01:44:36 | dadada | I know that, but the compiler isn't bad as it is, it is already pretty great, yeah, not perfect, but definitely a good compiler |
01:45:20 | dadada | it's a chicken-egg like problem, and I think the community needs to lay some eggs now, the chicken is already mature enough |
01:47:38 | FromDiscord | <Elegant Beef> Like what apps/libs are you talking about? |
01:47:44 | dadada | ie. have a vote on the forum on what library that is missing for Nim, gets the most votes, and than make it a priority for top Nim developers to make that library or a wrapper for an existing one |
01:48:22 | dadada | Elegant Beef: anything that keeps developers from actively using Nim, |
01:48:42 | leorize[m] | we actually have an issue tracker for those |
01:49:01 | dadada | I bet for everyone that looks into Nim a huge percentage likes it, but then goes on to use JS/Python/Rust/Go/Whatever just because they miss some or the other lib |
01:49:04 | leorize[m] | !repo needed-packages |
01:49:05 | disbot | https://github.com/mpcjanssen/tclstubs-nimble -- 9tclstubs-nimble: 11Nimble package needed to build tcl extenstions in Nim 15 0⭐ 0🍴 |
01:49:21 | Yardanico | lol |
01:49:26 | Yardanico | !repo nim-lang/needed-libraries |
01:49:27 | disbot | https://github.com/nim-lang/needed-libraries -- 9needed-libraries: 11This repository contains a list a needed libraries. 15 81⭐ 2🍴 |
01:49:39 | FromDiscord | <Elegant Beef> I mean my one friend that likes rust, has no interest in nim cause "It doesnt do anything new" |
01:49:53 | leorize[m] | ah yea, that |
01:50:01 | leorize[m] | our main audience right now is the science people |
01:50:44 | leorize[m] | science people loves Nim, and we got a pretty healthy ecosystem there |
01:51:41 | leorize[m] | @Beef it's not that Nim doesn't do anything new, Nim is just too new :p |
01:52:08 | FromDiscord | <Elegant Beef> No his point is that it doesnt have the ownership system basically |
01:52:16 | leorize[m] | lol |
01:52:19 | Yardanico | for many that's the advantage lol |
01:52:36 | Yardanico | and with newest ARC additions we got tons of optimizations without hurting the readability (unless you want to optimize more, lent/sink) |
01:52:37 | leorize[m] | we might have it |
01:52:38 | FromDiscord | <Elegant Beef> and "looks ugly" although he thinks rust looks clean |
01:52:42 | Yardanico | LOL |
01:52:46 | Yardanico | (#*%(*@!% |
01:53:10 | Yardanico | leorize[m]: with cursor inference we have something like "borrow checking" already :) |
01:53:18 | Yardanico | almost a quote from 4raq |
01:53:32 | leorize[m] | it's immature though |
01:53:33 | FromDiscord | <Elegant Beef> Actual quote https://media.discordapp.net/attachments/371759389889003532/738575042345959434/unknown.png |
01:53:54 | Yardanico | yeah seems like trolling for me |
01:54:00 | dadada | bung87: I see you're developing a ts2nim transpiler, that's a great idea, I hope you keep doing that! |
01:54:11 | Yardanico | leorize[m]: that's why you should help testing it :P |
01:54:27 | leorize[m] | we will only get proper ownership in Nim when it can be inferred 90% of the time :p |
01:54:41 | Yardanico | https://github.com/Yardanico/random-stuff/issues/8#issuecomment-665496206 |
01:54:41 | disbot | ➥ Nimble packages new |
01:55:27 | leorize[m] | don't worry, my upcoming library will feature arc support :p |
01:57:02 | Yardanico | btw, from nbaser author I learned that some people actually use the "converter" just if the proc acts like a "converter" (converts from one type to another), even if they don't need the implicit conversions |
01:57:04 | Yardanico | is that really true? |
01:57:12 | Yardanico | I've never seen a lib which uses "converter" keyword just because of that |
01:57:27 | Yardanico | https://github.com/D-Nice/nbaser/issues/6#issuecomment-666858708 |
01:57:28 | disbot | ➥ ARC compatibility ; snippet at 12https://play.nim-lang.org/#ix=2szV |
01:57:37 | leorize[m] | i used to do that actually |
01:57:41 | Yardanico | huh |
01:58:25 | leorize[m] | took me a while to realize that converters are an implicit thing |
02:03:55 | shashlick | @leorize - what's the conclusion on lazylib |
02:04:39 | * | muffindrake quit (Ping timeout: 272 seconds) |
02:05:51 | leorize[m] | there's only this one problem: you either go all-lazy or none |
02:06:32 | leorize[m] | it'd be nice if there is a trigger that can be used to force bind everything |
02:06:45 | * | muffindrake joined #nim |
02:06:58 | * | sm2n_ is now known as sm2n |
02:07:26 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
02:07:57 | leorize[m] | (ie. load every symbol of the library when the condition is met) |
02:10:08 | dadada | wouldn't it make sense for Nim to target TypeScript instead of JS? Since TS is a superset of JS, and can be compiled to JS anyway? One side benefit of this would be that we could then use AssemblyScript to compile the TS to WASM. https://github.com/AssemblyScript/assemblyscript |
02:10:44 | Yardanico | I don't think it's a good idea, we can target WASM with Clang's native wasm-32 target or via emscripten already |
02:10:47 | FromDiscord | <Elegant Beef> We can already got to wasm through C afaik |
02:11:02 | FromDiscord | <Elegant Beef> (edit) 'got' => 'go' |
02:11:03 | Yardanico | also AssemblyScript represents a _strict_ variant of TypeScript |
02:11:37 | dadada | Yardanico: I think they mean that everything must be typed |
02:11:45 | Yardanico | yes, and that's hard |
02:11:58 | Yardanico | how will you map pointers to TS ? :) |
02:12:02 | Yardanico | and casts between them and objects |
02:12:18 | Yardanico | I really think this wouldn't be a good idea since AssemblyScript itself is not stable |
02:12:51 | dadada | because of the version number? how else do you know? |
02:13:02 | Yardanico | because it's pretty new? |
02:13:14 | Yardanico | let's also target Zig instead of C while we're at it |
02:13:59 | dadada | what would that be helpful with? |
02:14:05 | leorize[m] | targeting TS means we will need a TS compiler |
02:14:08 | Yardanico | idk, but it's never |
02:14:10 | Yardanico | newer* |
02:14:20 | Yardanico | I don't really see advantages of targeting TS over JS really |
02:14:34 | Yardanico | we can probably generate typescript type definitions without targeting TS |
02:15:13 | FromDiscord | <Elegant Beef> Isnt the whole benefit of TS being it's statically typed, which we get for free on prebuild being nim |
02:15:25 | dadada | Yardanico: the compilation to WASM through AssemblyScript is an interesting thing ... but the point about casts you made, is something I didn't consider before |
02:15:25 | Yardanico | btw, after latest arc fixes (and maybe due to the fact that sinkInference was disabled by default for user apps and it's only enabled for stdlib now) nim compiler compiled with arc/orc can compile hello world again :P |
02:15:53 | Yardanico | even the JS made by Nim isn't 100% "statically" typed |
02:16:48 | shashlick | @leorize - i mean more in terms of the candidates change - https://github.com/genotrance/lazylib/compare/candidates |
02:16:58 | Yardanico | if there's enough interest we can instead improve https://github.com/yglukhov/wasmrt |
02:17:18 | Yardanico | https://i.imgur.com/jmKEztq.png for the compiler compiled with arc thing |
02:18:25 | FromDiscord | <Elegant Beef> @treeform using fidget right now and i'm curious if it's to be expected that you dont check if the path supplied to things like `loadFont` are absoulute/relative, cause you cant use system fonts in the current state without converting the path to relative to the dataDir |
02:19:09 | FromDiscord | <Elegant Beef> which kinda sucks when you pass an absolute path 😄 |
02:19:48 | Yardanico | btw, any additions to https://github.com/nim-lang/Nim/wiki/Nim-features-you-didn%27t-know-you-needed are welcome |
02:20:47 | FromDiscord | <treeform> @Elegant Beef systems fonts are not supported on wasm or mobile targets. |
02:20:56 | FromDiscord | <treeform> I need a special load font for them I think. |
02:21:15 | FromDiscord | <Elegant Beef> yea or a `when` wasm/mobile |
02:23:29 | FromDiscord | <Elegant Beef> Well i'll make an issue then so you can not forget 😄 |
02:37:30 | Yardanico | btw, is it safe to "cast" a seq of a distinct T to T ? |
02:37:44 | Yardanico | e.g. if you have seq[Rune] and cast it to seq[uint32] (Rune is distinct uint32) |
02:38:11 | Yardanico | sorry int32 |
02:44:38 | * | lritter quit (Ping timeout: 260 seconds) |
02:45:12 | * | lritter joined #nim |
02:52:13 | * | vicfred_ quit (Quit: Leaving) |
02:52:50 | leorize[m] | yes but why? |
02:53:14 | Yardanico | https://github.com/D-Nice/nbaser/pull/7 |
02:53:14 | disbot | ➥ fix: rm usage of repr for ARC compatibility |
02:53:19 | Yardanico | i'm asking for this, just curious :) |
02:53:56 | leorize[m] | just to be safe use distinctBase |
02:54:12 | Yardanico | "A map instead of the cast, may be considered safer, however, the cast is available and the memory layout of Runes is highly unlikely to change, so preferring that for convenience and speed. And if it were to change, I'd like to know, and the github actions should notify me in such a case." |
02:55:18 | Yardanico | huh, got this error with arc for the first time |
02:55:19 | Yardanico | "Error: system module needs: genericAssign" |
02:57:51 | Yardanico | wait what |
02:57:57 | Yardanico | why https://github.com/jiro4989/envconfig needs typeinfo module |
02:58:57 | Yardanico | oh it uses that to set object fields huh |
03:01:48 | Yardanico | well it's not hard to remove that |
03:02:30 | * | muffindrake quit (Ping timeout: 246 seconds) |
03:04:59 | * | muffindrake joined #nim |
03:24:08 | * | maier joined #nim |
03:25:13 | Yardanico | heh, in some cases deepCopy can be replaced by simple result[] = mat[] |
03:25:19 | Yardanico | just dereferenced value assignment |
03:25:24 | Yardanico | like in https://github.com/neonnnnn/nimfm |
03:25:26 | Yardanico | and then all tests pass |
03:28:01 | FromDiscord | <Zachary Carter> Sorry if I've spoken to this person before, and forgotten their handle, but is the community member who maintains - https://github.com/nimgl/vulkan - around by any chance? |
03:29:37 | * | maier quit (Ping timeout: 264 seconds) |
03:29:41 | FromDiscord | <Zachary Carter> Ah never mind. GLFW makes this extension business easy |
03:37:58 | FromDiscord | <Elegant Beef> Think they have it so they get pinged on nimgl |
03:38:02 | FromDiscord | <Elegant Beef> So congrats you pinged them 😄 |
03:38:37 | lmariscal | Yep, have no clue why nimgl/vulkan doesn't ping me |
03:40:41 | lmariscal | Zachary Carter, can I still help you with something? |
03:40:49 | Yardanico | @Zachary ^ |
03:41:38 | FromDiscord | <Zachary Carter> lmarsical: oh thanks for replying! I think I figured my issue out - I saw that the extension name enumerations weren't defined but in the example you're using strings |
03:41:50 | FromDiscord | <Zachary Carter> and I also saw that glfw helper method to retrieve all the required extensions |
03:41:57 | FromDiscord | <Zachary Carter> so I think I'm good to go! |
03:44:07 | FromDiscord | <Zachary Carter> lmariscal ^ sorry misspelled your handle |
03:44:16 | lmariscal | @Zachary , great! If you need to ping me just type nimgl (I have no mobile notifications, so only if I'm on my PC) |
03:44:27 | FromDiscord | <Zachary Carter> 👍 awesome thank you! |
03:56:50 | * | thomasross quit (Ping timeout: 256 seconds) |
04:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
04:06:44 | * | supakeen joined #nim |
04:08:39 | * | vicfred joined #nim |
04:11:17 | * | rockcavera quit (Remote host closed the connection) |
04:19:00 | * | dzamo joined #nim |
04:43:07 | FromDiscord | <Zachary Carter> lmariscal: I fixed a few errors in the code generator and added 1.2 bindings if you're interested in a PR |
04:43:14 | FromDiscord | <Zachary Carter> works with the latest Nim version as well |
04:43:32 | FromDiscord | <Zachary Carter> nimgl ^ |
04:43:36 | Yardanico | hehe |
04:43:41 | FromDiscord | <Zachary Carter> 😄 |
04:44:03 | FromDiscord | <Zachary Carter> well it's late anyway |
04:46:52 | FromDiscord | <Varriount> Hm, is there something about `extern const <name>` that is nonstandard C? |
04:53:43 | * | narimiran joined #nim |
04:53:48 | Yardanico | good morning narimiran :P |
04:54:00 | narimiran | hello |
04:54:22 | Yardanico | I saw that website PR :P |
04:54:36 | Yardanico | (no spoilers) |
04:55:14 | Yardanico | I wanted to ask - what's the tool used for generating the "Bugfixes since x.x.x" section in the blog post? |
04:55:19 | Yardanico | I mean on new version releases |
04:56:49 | narimiran | there's a script from dom i'm using |
04:56:54 | Yardanico | is it public? |
04:56:59 | * | dadada quit (Ping timeout: 240 seconds) |
04:57:01 | narimiran | don't think so |
05:06:01 | * | maier joined #nim |
05:14:07 | silvernode[m] | Good morning everyone |
05:15:20 | silvernode[m] | How did everyone's day go? |
05:15:29 | silvernode[m] | (or night) |
05:29:05 | * | dddddd quit (Ping timeout: 240 seconds) |
05:51:19 | lbart | from: |
05:51:20 | lbart | type |
05:51:20 | lbart | test[n: static[int]] = object |
05:51:20 | lbart | blah: int |
05:51:20 | lbart | var q: test[2] |
05:51:34 | Yardanico | ? |
05:51:39 | lbart | how can I get n (2 here) from q in a function? |
05:51:47 | Yardanico | one sec |
05:52:17 | lbart | (without add something like "myn: int" in test type) |
05:52:31 | Yardanico | its just a generic param so you treat it like one :) |
05:52:33 | Yardanico | https://play.nim-lang.org/#ix=2sKX |
05:52:58 | Yardanico | you can also use implicit generics for a bit less repetition |
05:53:44 | Yardanico | https://play.nim-lang.org/#ix=2sKY |
05:53:58 | Yardanico | n is also accessible on compile-time of course |
05:55:00 | lbart | oh yes, it just seemed too simple to me. |
05:55:05 | Yardanico | :P |
05:55:06 | lbart | Thank you Yardanico! |
05:55:07 | lbart | :) |
06:11:15 | * | dddddd joined #nim |
06:13:11 | * | SenasOzys joined #nim |
06:17:40 | silvernode[m] | So I got got parseopt working the way I want for the most part but I want to know how I would add extra args onto a command, so far I can check if p.key is equal to "i" and then perform an additional action with the p.next(), do I need to keep using p.next() to add more args (like "-y") or is there a way to have the entire list of args scanned until the end (how ever long that may be? https://play.nim-lang.org/#ix=2sL0 |
06:17:53 | silvernode[m] | * So I got parseopt working the way I want for the most part but I want to know how I would add extra args onto a command, so far I can check if p.key is equal to "i" and then perform an additional action with the p.next(), do I need to keep using p.next() to add more args (like "-y") or is there a way to have the entire list of args scanned until the end (how ever long that may be? https://play.nim-lang.org/#ix=2sL0 |
06:19:48 | FromDiscord | <Elegant Beef> you dont need to call pnext inside if statement |
06:19:58 | FromDiscord | <Elegant Beef> Also you really should've used the code yard provided 😄 |
06:20:55 | silvernode[m] | I pretty much did use what yard provided but with modifications in the way I thought it needed for what I am trying to do. |
06:21:26 | silvernode[m] | Again, this is meant to be a generic package manager wrapper for various package managers. Right now I am just playing around to see what works. |
06:21:48 | silvernode[m] | but I don't want to write stupid code so I figured I should have someone look at it. |
06:22:00 | FromDiscord | <Elegant Beef> Well the while loop will run to the end of time if not interupted |
06:22:29 | * | solitudesf joined #nim |
06:22:35 | FromDiscord | <Elegant Beef> so better to use the getOpt iterator↵https://nim-lang.org/docs/parseopt.html#getopt.i,OptParser |
06:23:45 | FromDiscord | <Elegant Beef> Something like this↵https://play.nim-lang.org/#ix=2sL2 |
06:24:28 | silvernode[m] | hmm, I thought I was already using that iterator but I guess not. |
06:32:30 | silvernode[m] | <FromDiscord "<Elegant Beef> Something like th"> In your example, "s" is being passed to dnf search as the search query. What I am going for is to have "s" be an alias of sorts for dnf search, with the package name (which depends on user input) being added at the end of the command. I hope I am explaining it good, sorry for any miscommunication. |
06:34:09 | FromDiscord | <Elegant Beef> Yea you can alias inside the if statement, or prompt the user to do more stuff |
06:35:54 | silvernode[m] | <FromDiscord "<Elegant Beef> Yea you can alias"> oh ok, but wasn't that what I was doing essentially in my original example? |
06:36:25 | FromDiscord | <Elegant Beef> well not cause `p.next` doesnt change anything other than p |
06:36:49 | FromDiscord | <Elegant Beef> You only tell it to move to the next arguement, the shell fires after passing in s |
06:36:57 | FromDiscord | <Elegant Beef> (edit) 'arguement,' => 'argument,' |
06:39:28 | silvernode[m] | Which key/value represents the arbitrary user input? If $key is the first argument, how do I get the next argument? when I added p.next() it seemed to change the value to whatever the second argument was which in my case is the name of the package being proccessed. |
06:39:52 | FromDiscord | <Elegant Beef> Oh i guess it did |
06:39:53 | FromDiscord | <Elegant Beef> 😄 |
06:43:57 | voltist | Anyone got any crazy ideas as to what horrible mis-handling of data I could be doing to get this weird banding in bright areas of an image: |
06:43:58 | voltist | https://imgur.com/a/iWPhvVS |
06:44:13 | FromDiscord | <Elegant Beef> I prefer the look of the the iterator so i'd probably make a FSM to control what action to do |
06:44:37 | FromDiscord | <Elegant Beef> Not functional nor really pretty but something like this ↵https://play.nim-lang.org/#ix=2sL9 |
06:47:50 | FromDiscord | <Elegant Beef> Where is the banding voltist? |
06:48:28 | FromDiscord | <Elegant Beef> Will say it's possible the difference between values is visible due to 24bit colours |
06:48:50 | FromDiscord | <Elegant Beef> 16 million colours sounds like a lot until try to make a perfect gradient |
06:51:50 | * | Amun_Ra joined #nim |
06:51:51 | voltist | Issue is that stars should be fuzzy blobs not concentric rings. I doubt its bitdepth because each pixel value is a count of photons entering the sensor (big numbers!) |
06:53:06 | voltist | Astronomy problems ya know? |
07:02:10 | voltist | Also there are like 3000 bytes left over at the end |
07:06:14 | Zevv | voltist: It totally looks like overflowing |
07:07:07 | Zevv | it's not banding. Your stars probably get exponentially brighter to the center, so that's why the bands grow smaller at the center |
07:07:58 | Araq | last day! |
07:11:31 | Zevv | of what |
07:12:41 | * | arecacea1 quit (Remote host closed the connection) |
07:12:50 | Yardanico | Araq: you're going on holidays tomorrow? :P |
07:12:52 | Yardanico | good morning! |
07:13:06 | * | arecacea1 joined #nim |
07:13:07 | Yardanico | I reported one more cursor inference bug (found in same combparser package) :P |
07:17:12 | Araq | damn you |
07:17:15 | Yardanico | haha |
07:18:55 | Araq | I need to make cursor inference scope based btw and add more optimizations... |
07:20:31 | Araq | and then it's just another implementation of borrow checking |
07:24:27 | narimiran | Zevv: of july, of course |
07:24:50 | Zevv | ooh right. I'm also very excited about that |
07:24:52 | Zevv | \o/ |
07:25:14 | Zevv | I have not even able to tell the day of the week over the last few months |
07:25:18 | Yardanico | XD |
07:25:21 | Yardanico | me too sometimes |
07:25:31 | Yardanico | but I don't really like summer - too warm :( so glad it's august |
07:25:51 | Zevv | summer has been surprisingly bearable over here |
07:26:02 | Zevv | a few hot days in june, and scheduled for today |
07:26:10 | Yardanico | what do you mean by "hot"? |
07:26:17 | Zevv | 25+ |
07:26:21 | Yardanico | heh |
07:26:47 | Yardanico | we've had a few days with +33-35 in the end of June |
07:27:00 | Yardanico | and that's central (european) russia |
07:27:36 | * | Vladar joined #nim |
07:27:42 | Zevv | yeah, those days |
07:34:12 | Yardanico | also, recently nim compiler (compiled with arc) couldn't compile hello world, but now it can do so again |
07:36:48 | * | endragor joined #nim |
07:37:55 | * | endragor quit (Remote host closed the connection) |
07:38:28 | * | nikita` joined #nim |
07:38:28 | * | nikita` quit (Changing host) |
07:38:28 | * | nikita` joined #nim |
07:45:59 | FromDiscord | <Varriount> You all should come to some places in the US, like Arizona |
07:46:37 | FromDiscord | <Elegant Beef> Ah hell no |
07:46:48 | FromDiscord | <Elegant Beef> i dont particularly like above 20C(68F) |
07:46:52 | Yardanico | me neither |
07:47:00 | FromDiscord | <Elegant Beef> either* |
07:50:35 | FromDiscord | <Elegant Beef> Or maybe im wrong so... english is fucky |
07:51:35 | FromDiscord | <Varriount> Araq: How would I wrap an unaligned type in Nim? |
07:52:21 | Araq | with .packed? |
07:52:39 | FromDiscord | <Varriount> Will that work for a pointer type? |
07:53:43 | Araq | sure |
07:53:53 | FromDiscord | <Varriount> `const FILETIME __unaligned * pft` |
07:54:33 | Araq | well that doesn't mean anything |
07:55:15 | Araq | whether it's aligned or not depends on the allocator. no allocators are known that don't align as it would be bullshit |
08:00:08 | Yardanico | "The __unaligned modifier is not valid for the x86 platform." :D |
08:00:11 | Yardanico | from https://docs.microsoft.com/en-us/cpp/cpp/unaligned?view=vs-2019 |
08:00:42 | FromDiscord | <Varriount> But is that x86 (32 bit) or x86 (the instruction set family)? |
08:01:26 | FromDiscord | <Varriount> My bet would be the former. |
08:02:03 | FromDiscord | <Varriount> That being said, I believe the worst that comes from accessing unaligned data is a performance cost on x86-64? I don't believe you get hardware faults |
08:03:11 | FromDiscord | <Varriount> Well, I think my work with the Windows API is coming to a stopping point. Until Nimterop learns about constants, it can't really progress any further. |
08:06:05 | Araq | what do you mean, "about constants"? |
08:08:54 | FromDiscord | <Varriount> Araq: Nimterop turns something like `extern const GUID Some_GUID = {...}` into `Some_GUID* {.importc.}: GUID` |
08:09:38 | Araq | omg, I finally fixed the 'defer' bug reported years ago |
08:09:58 | Yardanico | lol |
08:10:14 | FromDiscord | <Varriount> That might be correct if you're using {.header.} to include the library source code, but it won't work for a DLL-based API |
08:10:29 | Yardanico | then it could be importc, dynlib no? |
08:10:43 | FromDiscord | <Varriount> You can't import a constant from a DLL |
08:11:06 | Yardanico | really? |
08:11:12 | Yardanico | I searched and you actually can in some cases |
08:11:31 | * | Araq wispers 'use c2nim' |
08:12:26 | Yardanico | for windows there's https://docs.microsoft.com/en-us/cpp/build/exporting-from-a-dll-using-declspec-dllexport?view=vs-2019 |
08:12:33 | Yardanico | oh I guess nim does that automatically already |
08:13:01 | Yardanico | https://iguananaut.net/blog/programming/windows-data-import.html |
08:13:47 | FromDiscord | <Varriount> Araq: c2nim can't parse the typedefs used. `typedef TAGname {...} name *pname` |
08:14:28 | FromDiscord | <Varriount> Yardanico: I don't even know how that works. As far as I know, the DLL format is only capable of referencing functions. |
08:15:04 | FromDiscord | <Varriount> I guess the compiler could generate a "getter" function whose sole purpose is to return the constant value. |
08:15:05 | Araq | so what, nimterop cannot parse other stuff. but c2nim is designed around you having to modify the source code |
08:15:41 | FromDiscord | <Varriount> Araq: I am not hand-modifying 2000+ files |
08:15:47 | Araq | and fixing c2nim's parser is easier than fixing a generic "can parse everything" treesitter |
08:16:19 | FromDiscord | <Varriount> I disagree, since Treesitter has an understandable PEG representation, rather than a hand-coded parser. |
08:17:04 | FromDiscord | <Varriount> The only problems I've had with Nimterop is the constant thing (which is not a parsing error, just a generation error) |
08:18:22 | Araq | well ok, so fix Treesitter |
08:18:32 | Araq | I'm sure shashlick won't mind |
08:19:32 | Araq | it's clear to me that C(++) can even be parsed with PEGs but hey, what do I know about parsing |
08:19:41 | Araq | *it's not clear |
08:20:37 | * | lbart_ joined #nim |
08:20:54 | * | lbart quit (Ping timeout: 256 seconds) |
08:24:59 | * | lbart_ is now known as lbart |
08:25:23 | * | lbart quit (Changing host) |
08:25:23 | * | lbart joined #nim |
08:30:13 | Araq | Yardanico, in what way does the arc compiler fail for more complex programs? |
08:30:35 | Yardanico | well I honestly only tried it on hello world and nim compiler :D |
08:30:57 | Yardanico | fails in assert in VM |
08:31:00 | Araq | 'koch boot -d:release --gc:arc' is still our milestone for 1.4 |
08:31:09 | Yardanico | Error: unhandled exception: /home/dian/Things/Nim/compiler/vm.nim(851, 14) `regs[rb].kind == rkNode` [AssertionDefect] |
08:31:26 | Yardanico | maybe related to the object variant issue |
08:32:00 | Yardanico | in another package I had a similar crash with ARC where the kind of the node was somehow different from refc |
08:32:05 | Yardanico | https://github.com/rosado/edn.nim but didn't minimize yet |
08:32:42 | Yardanico | seems like currently even similer programs fail with same assert |
08:32:51 | Yardanico | I mean when the compiler is compiled with arc |
08:36:03 | Zevv | Varriount: what was your problem? |
08:38:49 | dv^_^ | is marshal faster than json? |
08:38:52 | Yardanico | no |
08:38:56 | Yardanico | and don't use it pls |
08:39:12 | Yardanico | it requires RTTI :) |
08:39:25 | Yardanico | take a look at json.to and %* in jsonm |
08:39:29 | Yardanico | or https://github.com/disruptek/frosty for binary serialization |
08:39:51 | Yardanico | also https://github.com/status-im/nim-json-serialization (based on https://github.com/status-im/nim-serialization ) |
08:41:48 | Araq | yeah, please don't use marshal.nim |
08:41:57 | dv^_^ | ok |
08:43:11 | Yardanico | frosty + snappy (both pure-nim) is a nice solution for efficient packing/unpacking of Nim types |
08:43:20 | Yardanico | frosty for serialization + snappy for compression |
08:43:28 | Yardanico | nitter uses that scheme |
08:43:44 | Yardanico | for storing the cache |
08:44:49 | dv^_^ | i have some arrays, one with 300k ints i want to serialize, but json seems to be a bit slow |
08:44:58 | Yardanico | yeah try frosty |
08:45:11 | Yardanico | but the size might be bigger since, well, it's all aligned and stuff |
08:45:21 | Yardanico | so that's why I recommended frosty + snappy |
08:45:27 | Yardanico | we also have protobuf/msgpack if that's your cup of tea |
08:45:34 | Zevv | msgpack4nim |
08:45:36 | Zevv | it's pretty ok |
08:45:37 | Araq | yeah these are good choices |
08:45:37 | FromDiscord | <Varriount> Zevv: My problem with Nimterop? |
08:45:47 | Zevv | no with your bands in the image |
08:45:54 | Zevv | oh dam that was voltist |
08:45:55 | Zevv | not you |
08:46:03 | Zevv | voltist: what was your problem? :) |
08:46:08 | Zevv | All these 'v' names confuse me |
08:46:10 | dv^_^ | ok, thanks for the suggestions |
08:46:11 | Zevv | said the 'z' name |
08:46:21 | Yardanico | how about me |
08:46:25 | FromDiscord | <Varriount> Zevv: Well, you got the first letter right, at least |
08:46:42 | narimiran | (and the last) |
08:46:52 | FromDiscord | <Varriount> Yardanico: what's frosty? |
08:47:00 | Yardanico | I just sent the link above :) |
08:47:08 | Yardanico | https://github.com/disruptek/frosty |
08:47:18 | voltist | Zevv: Oh hey just saw all that. Yeah it was overflowing pretty bad earlier; I 'fixed' that but am obviously still left with some |
08:47:25 | Zevv | Yes You, You Youthly Yardanico, Yonder |
08:47:37 | voltist | How big are nim's ints again? |
08:47:42 | Zevv | |<------->| |
08:47:43 | Zevv | that big |
08:47:46 | Yardanico | "int" is arch-dependent |
08:47:52 | FromDiscord | <Varriount> Size of a pointer |
08:47:56 | Araq | usually 8 bytes these days |
08:48:05 | narimiran | nim ints - growers, not showers |
08:48:10 | Yardanico | lol |
08:48:16 | FromDiscord | <Rika> lol |
08:48:33 | Zevv | But why are bools still not 125 millibytes |
08:48:36 | Zevv | such a waste |
08:48:40 | Yardanico | exactly |
08:48:50 | Yardanico | who needs alignment? sounds useless |
08:49:07 | narimiran | oh, it is Funny Friday, innit? |
08:49:16 | Zevv | Wait until I get the beer out in a few hours |
08:49:18 | Yardanico | last day of July |
08:49:19 | FromDiscord | <Rika> ITS FRIDAY?!?! |
08:49:22 | Yardanico | yes :) |
08:49:34 | Yardanico | welcome to August starting tomorrow |
08:49:39 | narimiran | IT'S FUNNY??? |
08:49:46 | Zevv | just gettin' started |
08:50:05 | Zevv | do we have any Nim jokes yet? |
08:50:08 | Zevv | Lisp has jokes |
08:50:10 | Zevv | perl does |
08:51:30 | voltist | Ah that will be my problem. Guess I'll have to always use int64 since thats the maximum size of FITS pixels |
08:52:56 | Zevv | just normalize that stuff. put it in a histogram, throw out the lower and upper 3% and you're good to go |
08:54:33 | voltist | But my precious photon counts! :) |
08:55:48 | Zevv | nah, it's just stochastics anyway |
08:56:06 | Araq | casual friday here, no ties but cigars |
08:57:00 | voltist | Yeah I've taken to saying "thats, notionally, how many photons hit that spot on the sensor" |
08:57:27 | Zevv | can't tell. Some photons might hit, but only when you're not looking |
08:57:34 | Zevv | might hit *two* |
08:57:38 | Zevv | I ment to say |
08:59:02 | voltist | Hmm working in uint64s doesn't seem to fix the problem despite the data only being 16bit |
09:00:07 | * | watzon quit (Quit: Idle for 30+ days) |
09:00:16 | * | wontruefree[m] left #nim ("Kicked by @appservice-irc:matrix.org : Idle for 30+ days") |
09:02:01 | Zevv | you're not programming by accident are you |
09:03:10 | Zevv | poke'n-hope |
09:12:04 | * | nikita` quit (Ping timeout: 256 seconds) |
09:13:04 | * | abm joined #nim |
09:13:20 | voltist | @Zevv There may be a hint of that :) |
09:14:33 | voltist | Pretty naive of me to impliment a FITS reader in pure nim, but I just don't like wrapping things |
09:14:41 | Zevv | that's how I do macro programming. I just pick a proc from the macros module that has 'getType' in its name, and try them all until something sensible comes out |
09:14:57 | Zevv | getTypeInst. getType. getTypeImpl. I don't care, I love'em all |
09:15:40 | Zevv | well, having a proper native lib would be cool I guess. |
09:15:42 | * | lritter quit (Quit: Leaving) |
09:15:52 | Zevv | the NimSci people would love that stuff |
09:17:34 | * | andrew_ joined #nim |
09:17:54 | Oddmonger | is it possible to have procedures in a defined type ? |
09:17:58 | Yardanico | yes |
09:18:06 | Yardanico | if you mean store references to them |
09:18:14 | Oddmonger | ah |
09:18:15 | Yardanico | not like "class methods" or something |
09:18:25 | Oddmonger | yes no members obviously |
09:18:30 | Yardanico | wdym then? |
09:18:41 | Oddmonger | i mean , i cannot do: |
09:18:52 | Oddmonger | type foo = object |
09:19:05 | Oddmonger | bar:proc( a:int) = … |
09:19:21 | Yardanico | no, in nim procs aren't really bound to specific objects |
09:19:30 | Yardanico | it's just that with UFCS you can call them as methods :) |
09:19:32 | Oddmonger | but i could do: |
09:19:48 | * | andrew_ quit (Client Quit) |
09:19:56 | Oddmonger | mBar:ref bar |
09:19:58 | Oddmonger | ? |
09:20:07 | Yardanico | you could make vtables, yes |
09:20:08 | * | andrew_ joined #nim |
09:20:18 | Yardanico | wait what happened |
09:20:24 | Yardanico | narimiran: are you updating the website? |
09:20:39 | Yardanico | https://nim-lang.org/docs/lib.html is 404 |
09:20:45 | Yardanico | and all module docs :P |
09:20:56 | narimiran | Yardanico: not me, but one other unnamed guy, you know him |
09:21:07 | Yardanico | 🤔 |
09:21:14 | Yardanico | okay |
09:21:28 | Araq | I'm screwing things up |
09:21:40 | alehander92 | making things go round |
09:21:41 | Yardanico | Oddmonger: https://github.com/nim-lang/Nim/tree/devel/lib/pure/streams.nim#L109 |
09:21:50 | alehander92 | haskell is a bit tiring man |
09:21:51 | Yardanico | that's an example of something like an interface in nim :) |
09:22:04 | alehander92 | let me look at some non lazy normal IO |
09:22:26 | Oddmonger | thank you Yardanico |
09:22:37 | Yardanico | most of the pragmas won't really be needed for you though |
09:22:46 | alehander92 | `echo 0` |
09:22:49 | Yardanico | {.nimcall.} means that the proc should have the nim calling convention (it shouldn't be a closure) |
09:22:50 | alehander92 | ah so simple |
09:25:23 | voltist | Zevv: Yeah I think they would. I'll try to get it working first though... |
09:26:00 | Araq | 404s are gone |
09:26:07 | Araq | and 1.2.6 is a thing now |
09:26:11 | Yardanico | version numbers changed 👀 |
09:27:06 | Araq | though we should have named it 1.2.8 IMO |
09:27:19 | Araq | so that we have 1.0.8 and 1.2.8, that would be easier to remember |
09:27:56 | Yardanico | blog post today? |
09:28:16 | supakeen | 👀 |
09:28:32 | narimiran | Yardanico: blog post in next 2 minutes |
09:28:36 | Yardanico | hehehe |
09:30:15 | narimiran | Yardanico: refresh your browser ;) |
09:30:26 | Yardanico | woohoo |
09:30:45 | narimiran | also, can some choosenim user please confirm that `choosenim 1.0.8` works as intended? |
09:31:35 | FromDiscord | <Elegant Beef> https://media.discordapp.net/attachments/371759389889003532/738690309701238794/unknown.png |
09:32:03 | * | supakeen dances |
09:32:08 | FromDiscord | <Varriount> narimiran: where's the post? |
09:32:13 | supakeen | https://nim-lang.org/blog/2020/07/30/versions-126-and-108-released.html |
09:32:13 | Yardanico | already out |
09:32:28 | Yardanico | @Varriount don't you remember that nim has a website? :P |
09:32:53 | narimiran | ...and twitter, forum, reddit posts are coming soon(ish) |
09:33:03 | Yardanico | i posted in discord and telegram |
09:34:31 | supakeen | When does the physical notification come by? |
09:34:37 | supakeen | I'm expecting a knock on my door any moment. |
09:34:52 | narimiran | Yardanico: i'll use your telegram post for forum :) |
09:34:56 | Yardanico | lol |
09:34:57 | Yardanico | okay |
09:38:04 | ForumUpdaterBot | New thread by Miran: Nim 1.2.6 and Nim 1.0.8 are out!, see https://forum.nim-lang.org/t/6625 |
09:38:24 | FromDiscord | <Rika> when's 1.0 gonna stop being patched? |
09:38:44 | Yardanico | hrm |
09:40:57 | Oddmonger | reading the blog entry, i've seen «nim-gdb», and searching how to use it, i've found this, interesting and complete (even mention TUI): https://internet-of-tomohiro.netlify.app/nim/gdb.en.html |
09:41:34 | Yardanico | you can use it with vscode as well |
09:42:01 | Oddmonger | yes but that means leaving nvim :') |
09:48:28 | Araq | Rika: not sure. until 2022 maybe |
09:49:33 | FromDiscord | <Rika> ah i see, okay |
09:51:14 | FromDiscord | <Varriount> narimiran: you manage the backports, right? |
09:51:26 | narimiran | right |
09:52:23 | FromDiscord | <Varriount> Narimiran: Thanks for doing that, you been doing a great job |
09:53:16 | narimiran | :blushing: |
09:56:35 | shashlick | I agree, hard work |
09:56:55 | shashlick | Especially since it goes as far back as 1.0.x |
10:08:55 | narimiran | yeah, 1.0.x backports are getting harder by day |
10:10:12 | Oddmonger | are there people here doing the exercism's nim path ? |
10:10:43 | Oddmonger | i'm stuck with « allergies » and it seems there's an error in their unittest |
10:12:21 | Oddmonger | well it must come from my own module… i will do a post on the forum |
10:14:27 | voltist | Zevv: Here's that broken FITS reader https://gist.github.com/dizzyliam/e6c3b95c1871f36b4c4451edb502be66 |
10:14:28 | * | dddddd_ joined #nim |
10:14:37 | * | dddddd quit (Ping timeout: 264 seconds) |
10:14:55 | * | dddddd_ is now known as dddddd |
10:17:15 | planetis[m] | hi, I am using CacheTable from macrocache, but it lacks hasKey proc. I tried ``cache[key].kind == nnkNone`` but it errors with "cannot evaluate at compile time: cache". am I doing something wrong? |
10:17:46 | * | james[m]1 joined #nim |
10:18:33 | planetis[m] | i think its caused bc ``let key = node.repr``... investigating |
10:20:14 | planetis[m] | i tried ``let key = node.strVal``, still doesn't work |
10:20:43 | FromDiscord | <dom96> +1 on what Varriount said. The backports are awesome and they instill confidence in people to adopt Nim for their production apps 🙂 |
10:20:59 | FromDiscord | <dom96> So thank you narimiran! |
10:21:43 | narimiran | come on guys, i can't take three consecutive praises! please stop :) |
10:21:56 | supakeen | YOU WILL TAKE THE PRAISE |
10:21:58 | * | supakeen adds more |
10:22:11 | * | andrew_ quit (Ping timeout: 240 seconds) |
10:22:22 | * | narimiran rage quits |
10:22:29 | FromDiscord | <dom96> let's all get t-shirts made that say "praise narimiran" 😄 |
10:22:33 | FromDiscord | <lqdev> me.praise(narimiran) |
10:22:47 | supakeen | Recent conference I was at that went online did the whole volunteer applause on the stream + a soundboard and I felt so awk waving at my webcam. |
10:25:15 | voltist | My squeaky desk chair has the power to stop any video conference conversation since my microphone's cable wont let it go above my desk |
10:27:10 | supakeen | By the way, I was wondering if the last example on this page is correct: https://nim-lang.org/docs/filters.html it seems all the other examples set `result = ""` except the last :) |
10:27:20 | planetis[m] | i figured it out, needed const, now I am getting ``Error: key does not exist: ...`` |
10:28:03 | FromDiscord | <lqdev> supakeen: not setting `result = ""` is fine |
10:28:28 | supakeen | That's what I felt as well, the inconsistency just made me wonder. |
10:28:52 | FromDiscord | <lqdev> the inconsistency is because of old versions (before 0.19) which had nilable strings and seqs |
10:30:03 | supakeen | Thank you. |
10:30:04 | planetis[m] | and ``Error: key already exists: ...``, Now I'm wondering if it's technicaly possible we can get a hasKey proc, instead of compiletime errors. |
10:34:25 | * | narimiran quit (Ping timeout: 240 seconds) |
10:36:01 | voltist | You know something is seriously wrong when `if x > y: x = y` makes x greater |
10:36:16 | Yardanico | floats? |
10:36:26 | voltist | Unsigned ints |
10:37:41 | voltist | Wait no I'm mistaken |
10:37:45 | voltist | Reading numbers wrong |
10:38:07 | voltist | Don't worry, the universe is still logical and induction still works :) |
10:39:40 | * | andrew joined #nim |
10:41:08 | * | vqrs quit (Ping timeout: 256 seconds) |
10:43:36 | * | vqrs joined #nim |
10:44:24 | FromDiscord | <kodkuce> if i plan to have fixed number PlayerSlots, so will just create example a seq and add to it 100 PlayerSlots types, so for unused, should i use Options or add field empty:bool , i think empty is better right? |
10:44:51 | Yardanico | you can just remember how many player slots you're using currently |
10:45:17 | Yardanico | but of course allocate fixed number of PlayerSlots |
10:46:49 | FromDiscord | <kodkuce> ye but example i have to iterate ower slots to get next empty slot i need to check if its empty or Options isNone, i think adding 1 fild empty is more efficient that using Options right |
10:47:05 | Yardanico | well |
10:47:09 | Yardanico | is your PlayerSlots a ref type? |
10:47:16 | Yardanico | I mean the one you're trying to add to a seq |
10:47:27 | Yardanico | if it's a ref type, then Option[PlayerSlots] will not bring any overhead |
10:47:37 | Yardanico | options module uses nil vs initialized for ref types so it's really zero-cost |
10:48:11 | Yardanico | you can see that here - https://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/options.nim#L69 |
10:49:08 | Yardanico | options module is really simple :) |
10:50:50 | FromDiscord | <kodkuce> yep am using ref type, so hmm then perfomace wise its better to use Options even tough its kinda pointless cuz i will probably not have any memory size issue for this dumb game :), and would porbbaly waste prefomace niling it cuz i can reuse same ref obj↵Q2: how can i just remmeber, if i have @[ p1, p2, p3] and what use int to remmeber or just seq.lengh, if p2 disconects i would have empty slot 2 |
10:51:36 | Yardanico | well with option types you would just check .ifSome, etc |
10:52:30 | Yardanico | if val.isSome() |
10:52:37 | Yardanico | otherwise you can have your own bool of course if you want |
10:52:41 | FromDiscord | <kodkuce> and this way will just check if val.empty 🙂 |
10:52:50 | Yardanico | well you can just check some field in your type |
10:53:04 | Yardanico | actually wait |
10:53:08 | Yardanico | why won't you just use "nil" ? |
10:53:11 | FromDiscord | <kodkuce> sorry obj.empty |
10:53:29 | Yardanico | to "empty" the object just data[idx ] = nil |
10:53:39 | Yardanico | to check if "empty", data[idx] == nil |
10:53:46 | FromDiscord | <kodkuce> i can but after some brain work i think i wont nil anything cuz i can reuse those PlayerObj |
10:53:56 | Yardanico | well okay then |
10:54:06 | Yardanico | do what do you think is the best for your game :) |
10:54:11 | FromDiscord | <kodkuce> 🙂 |
10:54:34 | FromDiscord | <kodkuce> ty for helping me use my brain 🙂 |
10:55:03 | FromDiscord | <kodkuce> 90% of issues i solve by asking question and while asking figuring out problem myself in brain xD |
10:55:11 | Yardanico | then ask yourself :) |
10:56:54 | FromDiscord | <kodkuce> tough 1 question is there some sorcut 1 liner to instalize seq of 50 refobjects pcons :seq[Players] = @[Player(empty:true) x 50] or soemthing like this |
10:57:11 | Yardanico | https://nim-lang.org/docs/algorithm.html#fill%2CopenArray%5BT%5D%2CT |
10:57:26 | Yardanico | although it might do not what you want to do |
10:57:47 | Yardanico | I think with .fill all 50 refs will point to same object :) |
10:57:54 | Yardanico | I mean they'll be the same |
11:00:16 | FromDiscord | <Rika> sequtils.repeat? |
11:02:20 | FromDiscord | <kodkuce> will try |
11:02:21 | FromDiscord | <kodkuce> ty |
11:20:41 | * | nikita` joined #nim |
11:31:56 | * | NimBot joined #nim |
11:54:35 | * | dddddd quit (Ping timeout: 240 seconds) |
11:58:49 | Oddmonger | as named parameter in function call is done with equal (like foo(a=42) ), then what is : foo(a:42) ? |
11:59:05 | Yardanico | second one is object construction syntax |
11:59:15 | Yardanico | MyType(field1: 5, field2: "hello") |
11:59:23 | Oddmonger | ah ok, thank you |
11:59:26 | Yardanico | also of course it can be in a custom macro/etc |
12:02:18 | * | rockcavera joined #nim |
12:04:02 | * | dulsi_ joined #nim |
12:04:18 | * | dddddd joined #nim |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.8) |
12:06:28 | * | dulsi quit (Ping timeout: 246 seconds) |
12:06:46 | * | supakeen joined #nim |
12:38:13 | Oddmonger | trying to play with function pointers… https://play.nim-lang.org/#ix=2sMq |
12:38:30 | Yardanico | no need for "ref" |
12:38:47 | Yardanico | also no, not like that :) |
12:39:39 | Yardanico | Oddmonger: something like https://play.nim-lang.org/#ix=2sMr |
12:39:41 | Oddmonger | well, nim in action should be in my mailbox monday :) |
12:39:48 | Yardanico | also I included the Allergies itself as well |
12:39:50 | Yardanico | as one of the types |
12:40:01 | Yardanico | you can of course then write shorthandfs |
12:40:03 | Yardanico | shorthands* |
12:40:07 | Yardanico | so you don' |
12:40:12 | Yardanico | t have to do a.call(a, args) |
12:41:21 | Oddmonger | it needs a self ? |
12:41:25 | Yardanico | of course? |
12:41:30 | Yardanico | it's not some special magic |
12:41:35 | Yardanico | it's just an ordinary proc pointer |
12:41:36 | Yardanico | in an object |
12:41:47 | Yardanico | same as in the streams module |
12:41:57 | Oddmonger | well in C i would do (*fx)() |
12:42:05 | Yardanico | well you can do the same without self here |
12:42:10 | Yardanico | but I included here just in case |
12:42:15 | Prestige | Seems odd to me that let foo: array[4, uint] = [0, 0, 0, 0] assumes the 0's are ints and not uints. Is there a way to not have to explicitly convert them all? |
12:42:25 | Yardanico | wdym? |
12:42:28 | Yardanico | ah well |
12:42:41 | Yardanico | !eval let foo = [0'u, 0, 0, 0]; echo typeof(foo) |
12:42:43 | NimBot | array[0..3, uint] |
12:42:52 | FromDiscord | <lqdev> or better yet |
12:42:57 | Yardanico | !eval let foo = [0u, 0, 0, 0]; echo typeof(foo) |
12:43:00 | NimBot | array[0..3, uint] |
12:43:02 | FromDiscord | <lqdev> !eval let foo = [uint 0, 0, 0, 0]; echo(typeof(foo) |
12:43:04 | NimBot | Compile failed: /usercode/in.nim(1, 46) Error: expected: ')', but got: '[EOF]' |
12:43:07 | Yardanico | xd |
12:43:09 | FromDiscord | <lqdev> shit |
12:43:10 | FromDiscord | <lqdev> !eval let foo = [uint 0, 0, 0, 0]; echo(typeof(foo)) |
12:43:13 | NimBot | array[0..3, uint] |
12:43:17 | FromDiscord | <lqdev> like that. |
12:43:31 | FromDiscord | <lqdev> note that this isn't special syntax |
12:43:49 | Yardanico | yes - https://nim-lang.org/docs/manual.html#lexical-analysis-numerical-constants |
12:43:52 | Yardanico | these are type suffixes |
12:44:01 | Yardanico | !echo 0B0_10001110100_0000101001000111101011101111111011000101001101001001'f64 |
12:44:05 | FromDiscord | <lqdev> i was talking about [uint 0, 0, 0] |
12:44:08 | Yardanico | !eval echo 0B0_10001110100_0000101001000111101011101111111011000101001101001001'f64 |
12:44:11 | NimBot | 1.7282561e+35 |
12:44:36 | FromDiscord | <lqdev> [uint 0, 0, 0, 0] == [uint(0), 0, 0, 0] |
12:44:47 | Yardanico | well I would prefer the shorter 'u :P |
12:44:57 | FromDiscord | <lqdev> it looks odd next to the regular zeroes |
12:45:04 | * | dadada joined #nim |
12:45:12 | Yardanico | 0'u - not so odd :) |
12:45:16 | Prestige | hmm neat |
12:45:28 | * | dadada is now known as Guest3543 |
12:48:19 | FromDiscord | <Rika> 0 isnt odd tho its even xd |
12:48:30 | Yardanico | 4HEad LOOOOOOOOOOOOOOL |
12:48:33 | FromDiscord | <Rika> or is it :thonk: |
12:52:08 | * | waleee-cl joined #nim |
12:57:34 | * | james[m]1 left #nim ("User left") |
13:02:01 | * | vicfred quit (Quit: Leaving) |
13:11:50 | * | Guest3543 is now known as dadada |
13:13:29 | * | dulsi_ is now known as dulsi |
13:21:26 | * | mbuchel joined #nim |
13:24:20 | mbuchel | did anyone get an error which has no line number and having a (???0) |
13:24:27 | Yardanico | not "(???0)" for sure |
13:24:45 | Yardanico | can you paste full stack trace? |
13:27:22 | mbuchel | ➜ nim c -r tmp |
13:27:25 | mbuchel | Hint: used config file '/home/mbuchel/.choosenim/toolchains/nim-1.2.0/config/nim.cfg' |
13:27:27 | mbuchel | Hint: system [Processing] |
13:27:29 | mbuchel | Hint: widestrs [Processing] |
13:27:31 | mbuchel | Hint: io [Processing] |
13:27:31 | Yardanico | not here :) better to use a paste service |
13:27:33 | mbuchel | Hint: tmp [Processing] |
13:27:35 | mbuchel | Hint: options [Processing] |
13:27:37 | mbuchel | Hint: typetraits [Processing] |
13:27:37 | Yardanico | ix.io or paste.rs or any others |
13:27:39 | mbuchel | Hint: macros [Processing] |
13:27:41 | mbuchel | Hint: sets [Processing] |
13:27:43 | mbuchel | Hint: hashes [Processing] |
13:27:43 | Yardanico | ohno |
13:27:45 | mbuchel | Hint: math [Processing] |
13:27:47 | mbuchel | Hint: bitops [Processing] |
13:27:49 | mbuchel | ???(0, 0) Error: identifier expected, but found '"allowOfflineTxForUnknownId"' |
13:27:51 | mbuchel | which one? |
13:28:16 | Yardanico | I think this ??? one might be something related to the lexer/parser |
13:28:37 | Yardanico | you can see all places where you have allowOfflineTxForUnknownId |
13:28:53 | Yardanico | and share these lines or try to modify them so it doesn't error :) |
13:30:45 | Yardanico | ah wait |
13:30:49 | Yardanico | mbuchel: ??? is for the filename |
13:30:54 | Yardanico | are you using stdin or something like that? |
13:31:02 | mbuchel | filename is tmp.nim |
13:31:24 | Yardanico | https://github.com/nim-lang/Nim/blob/devel/compiler/msgs.nim#L610 |
13:32:04 | mbuchel | http://ix.io/2sMy |
13:32:10 | mbuchel | this is the stack trace |
13:32:15 | Yardanico | well you already posted it in IRC :) |
13:32:35 | Yardanico | it's just that it's generally not preferred to post anything like code or stack traces with more than 3 lines in IRC |
13:32:40 | Yardanico | and instead use any paste service |
13:32:53 | mbuchel | http://ix.io/2sMz/nim |
13:32:57 | mbuchel | this is the code |
13:33:07 | mbuchel | i have it as tmp.nim |
13:33:16 | mbuchel | and run it as nim c -r tmp |
13:33:29 | Yardanico | oh well yeah it's fieldPairs acting up |
13:33:54 | Yardanico | it's easy to fix |
13:34:20 | Yardanico | mbuchel: https://play.nim-lang.org/#ix=2sMA |
13:34:23 | Yardanico | fieldPairs is not a "real" iterator |
13:34:26 | Yardanico | it unrolls the whole loop |
13:34:41 | Yardanico | also see the docs https://nim-lang.org/docs/iterators.html#fieldPairs.i%2CS%2CT |
13:34:47 | mbuchel | thank you |
13:34:48 | Yardanico | "The current implementation also has a bug that affects symbol binding in the loop body." which is probably what you hit |
13:35:05 | Yardanico | basically it tries to replace the "key" field name in object construction with the string |
13:35:20 | Yardanico | so it was making something like KeyValue("allowOfflineTxForUnknownId": "allowOfflineTxForUnknownId" |
13:35:41 | mbuchel | that explains why if i change the name of key to keyName it works |
13:35:42 | mbuchel | thank you |
13:35:49 | Yardanico | yes, I changed it in my example as well |
13:37:43 | mbuchel | works now thank you |
13:41:21 | Araq | lol that's so old stuff |
13:41:27 | Araq | somebody should fix it... |
13:46:23 | * | vicfred joined #nim |
13:48:02 | * | andrew quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
13:54:03 | * | krux02 joined #nim |
14:07:57 | FromDiscord | <Ricky Spanish> sent a long message, see http://ix.io/2sMF |
14:08:36 | Yardanico | right now I don't think so, it's not really possible. You either fully disable the GC for everything, or use a specific GC for your whole app |
14:08:54 | Yardanico | But Nim's default GC isn't that bad really, it's quite performant, and there's a lot of work being done on ARC/ORC |
14:09:11 | Yardanico | You can already try out ARC in Nim 1.2.x , but for best experience it's better to use current devel or wait for 1.4 :) |
14:09:41 | FromDiscord | <Rika> I think the gc isn't going to impact performance enough to be concerning |
14:09:55 | Yardanico | Yeah, Nim's GC is barely noticeable most of the time |
14:10:07 | Yardanico | and with ARC there are move semantics (destructors, etc) with plain old reference counting |
14:10:20 | Yardanico | ORC is ARC + cycle collector (for dealing with cycles which can't be done with purely refcounting) |
14:10:27 | FromDiscord | <Rika> People need to realize that not all gcs are absolutely horrible... |
14:10:45 | FromDiscord | <lqdev> ↑ this |
14:11:10 | Araq | problem is that "GC" doesn't say which algorithm |
14:11:56 | Araq | and algorithms matter so much that the term is meaningless |
14:13:09 | FromDiscord | <Rika> that is true... |
14:18:22 | FromDiscord | <Rika> anyway i suggest not fiddling with the gc first, then if it is indeed slowing down your program too much, refactor and switch to gc:none or gc:arc |
14:18:23 | FromDiscord | <Ricky Spanish> my problem isnt directly with gc, as i said i use go, daily actually and its gc is actually pretty good performance also but i intend to do some game devleopment and usually its advised to not use gc for that type of development |
14:18:37 | Yardanico | nim's GC is fine for this :) |
14:18:40 | FromDiscord | <Kiloneie> Is there a post about the different GC algorithms, their pros/cons differences ? |
14:18:44 | Yardanico | the default GC can run in a soft realtime mode |
14:18:46 | FromDiscord | <Rika> yes, but premature optimization is really a time sucker |
14:18:55 | Yardanico | and with ARC you don't have any "pauses" at all |
14:18:57 | FromDiscord | <Kiloneie> Default GC is great for games |
14:18:59 | Yardanico | it's simple refcounting |
14:19:02 | FromDiscord | <Kiloneie> you can tune it anyways |
14:20:17 | FromDiscord | <Ricky Spanish> ok im convinced im gonna give this a try, since really i was looking for an alternative to rust and c++ my usual offenders but the time investment in developing a base project in those languages is just too high imo so i was hoping nim will be more in line with my goals for fast development and minimal/optionally no gc impact |
14:20:31 | FromDiscord | <Ricky Spanish> the only other requirment i guess i have is, is it possible to self-host the package manager? |
14:21:05 | Yardanico | wdym by that? |
14:21:17 | FromDiscord | <Kiloneie> For game dev, look up nico/nimgame for 2D |
14:21:23 | FromDiscord | <Ricky Spanish> host a local server, assuming it behaves like nuget or cargo |
14:21:29 | Yardanico | it doesn't :) |
14:21:37 | Yardanico | nimble is more-or-less decentralized |
14:21:46 | Yardanico | you can always provide it with your own packages.json and stuff |
14:22:06 | Yardanico | it doesn't have any vendor lock-in, the package DB is just a json file pointing to repos |
14:22:28 | FromDiscord | <Rika> the repo has to have a valid nimble file though, right? |
14:22:36 | Yardanico | "yes" |
14:22:57 | Yardanico | look what I'm digging |
14:22:57 | Yardanico | https://news.ycombinator.com/item?id=606892 |
14:23:35 | Yardanico | https://www.reddit.com/r/programming/comments/eub63/nimrod_programming_language/ |
14:25:36 | FromDiscord | <Ricky Spanish> ok thanks @Yardanico this is hopefully what iv been waiting for |
14:25:52 | Yardanico | It's in https://github.com/nim-lang/packages/ |
14:26:02 | Oddmonger | ok i think i have understood: https://play.nim-lang.org/#ix=2sMK |
14:26:17 | Yardanico | you don't need method here though |
14:26:21 | Yardanico | you need it when you have inheritance |
14:26:41 | Yardanico | https://forum.dlang.org/thread/[email protected] |
14:29:33 | Oddmonger | ah yes with proc it's ok too |
14:29:47 | Oddmonger | early bindings vs late, but no need of vtable here it seems |
14:29:55 | Yardanico | methods are runtime-dispatch |
14:29:58 | Yardanico | procs are static dispatch |
14:30:03 | Yardanico | http://www.99-bottles-of-beer.net/language-nimrod-2245.html hehe |
14:30:24 | Yardanico | that code runs without changes in latest devel btw :) |
14:30:27 | Oddmonger | i've been puzzled by the implicit parameter |
14:30:31 | Yardanico | which one? |
14:30:51 | Yardanico | there are no implicit parameters I know of |
14:30:54 | Oddmonger | a.isAllergic(…) # a is passed as 1st param |
14:31:08 | Yardanico | yes, it's method call syntax/UFCS |
14:31:17 | Yardanico | https://nim-lang.org/docs/manual.html#procedures-method-call-syntax |
14:31:34 | Oddmonger | yes read already, but i cannot put that in my mind |
14:31:57 | Yardanico | well it's pretty easy once you start using it :) |
14:31:58 | Oddmonger | a.foo -> « a is a struct » /o\ |
14:32:13 | Oddmonger | so foo must be in struct |
14:32:28 | Oddmonger | that's why i wanted to put function declaration in the type |
14:32:34 | Yardanico | well I didn't really do any C so it was easy for me to understand UFCS :) |
14:33:05 | Oddmonger | i think it would be the same for java, c# … :) |
14:33:22 | Yardanico | well there you need classes and stuff |
14:33:24 | Oddmonger | even Lua (this time, a is a table though) |
14:33:35 | Yardanico | but really only Nim and D have the UFCS feature |
14:33:41 | Yardanico | (maybe some smaller languages as well, idk) |
14:34:03 | FromDiscord | <Rika> i came from python and i had no issue understanding UFCS |
14:35:06 | Oddmonger | in Lua, we have the ':' for that |
14:35:21 | Oddmonger | a:foo() <=> a.foo(a) |
14:35:29 | Oddmonger | mhh not the same in fact |
14:35:41 | Oddmonger | as foo needs to be defined in a |
14:35:47 | Oddmonger | forget it |
14:35:51 | disruptek | if you're trying to "convert" between languages, you're already doing it wrong. |
14:35:57 | * | onokatio joined #nim |
14:36:23 | Oddmonger | i don't try to convert, i'm lost in the middle of the battlefield of syntactic sugars |
14:36:26 | Yardanico | http://web.archive.org/web/20100405011853/http://force7.de:80/heimdall/viewforum.php?f=2 wow |
14:37:34 | * | onokatio left #nim (#nim) |
14:37:56 | * | tane joined #nim |
14:38:20 | Oddmonger | dig more to reach Algol :þ |
14:38:42 | FromDiscord | <Rika> "is the go language a menace to nimrod" |
14:38:54 | FromDiscord | <Rika> that made me laugh a bit |
14:39:12 | Araq | Yardanico, gosh, keep the dead dead |
14:39:19 | Yardanico | I am curious :P |
14:39:25 | Yardanico | found the force7.de but can't find 0.6.0 |
14:39:36 | Yardanico | also web.archive.org has almost no saved pages of force7.de :( |
14:39:45 | Araq | thank god |
14:39:49 | Yardanico | lol |
14:40:08 | disruptek | Zevv: what else? |
14:40:17 | Yardanico | oh wait found this http://web.archive.org/web/20110323044248/http://force7.de/nimrod/index.html |
14:40:20 | Yardanico | but 2011 :( |
14:40:23 | FromDiscord | <dom96> Araq: do you still have the db for the old forum? |
14:40:33 | Araq | no |
14:40:36 | FromDiscord | <dom96> I see my first thread in that old forum "Socket question" |
14:40:43 | FromDiscord | <dom96> but the actual thread isn't saved :/ |
14:41:09 | Yardanico | wait dom |
14:41:11 | Yardanico | I found this link from you |
14:41:17 | FromDiscord | <Kiloneie> The roots of the language i see |
14:41:28 | FromDiscord | <Kiloneie> just a bit after i started my Game Maker journey |
14:41:37 | Yardanico | oh https://gitter.im/nim-lang/Nim?at=5b09df3ca7abc8692ee859a6 |
14:41:38 | Oddmonger | i want the link for the Go menace |
14:41:41 | FromDiscord | <dom96> Too bad we didn't import the DB into the NimForum |
14:41:44 | Yardanico | dom was asking the same |
14:42:08 | FromDiscord | <Kiloneie> i love such topics, language flame wars and all xD |
14:42:20 | Yardanico | oh nice |
14:42:23 | Yardanico | changelogs for older versions http://web.archive.org/web/20110719021638/http://force7.de/nimrod/news.html |
14:43:03 | FromDiscord | <dom96> lol parseopt all the way from 2008 |
14:43:17 | Yardanico | ethexor.com huh |
14:43:45 | Yardanico | lol https://searchcode.com/codesearch/view/40158075/ |
14:43:56 | FromDiscord | <Kiloneie> When was the nim-lang website made ? |
14:44:01 | Yardanico | 2008 |
14:44:05 | Yardanico | it seems |
14:44:08 | FromDiscord | <Kiloneie> oh yeez |
14:44:12 | Yardanico | http://web.archive.org/web/20110719021638/http://force7.de/nimrod/news.html this one |
14:44:43 | Yardanico | "For quickest feedback, join our IRC channel: irc://freenode/nimrod" |
14:44:58 | Araq | Yardanico, iirc the friend of mine kept buying new URLs |
14:45:05 | Zevv | disruptek: not much |
14:45:06 | Zevv | too hot |
14:45:22 | Araq | with lovely names |
14:45:24 | Yardanico | heh |
14:45:27 | Yardanico | http://web.archive.org/web/20110719021606/http://force7.de/nimrod/question.html |
14:45:29 | Yardanico | -d:quick huh |
14:45:36 | Zevv | I made a lifting poc and lost it |
14:45:40 | Zevv | but it was not hard |
14:45:44 | Yardanico | oh right -d:quick is still here lol |
14:45:46 | Araq | wait what? you lost it? |
14:45:58 | Yardanico | Zevv: are you repeating your mistakes? |
14:46:06 | Zevv | nah it was another kind of stupid |
14:46:08 | Yardanico | like yesterday when you almost lost your firefox stuff |
14:46:19 | Zevv | I was not planning to do stuff, so I was just editing something in my /tmp |
14:46:26 | Zevv | my laptop has a typical uptime of 3 to 6 months |
14:46:31 | Yardanico | jesus |
14:46:41 | Yardanico | my PC only has an uptime of 10 days now |
14:46:47 | Yardanico | but I usually reboot from time to time for kernel updates |
14:47:15 | FromDiscord | <Kiloneie> electricity bill must be juicy |
14:47:24 | Yardanico | I pay fixed rates |
14:47:29 | * | outtabwz joined #nim |
14:47:36 | FromDiscord | <Kiloneie> that's lucky... |
14:47:43 | Zevv | but my power brick was broken so I ran out of juice |
14:47:44 | Yardanico | that's pretty common in Russia |
14:47:51 | Zevv | tadaaa second frig-up of the day |
14:47:57 | Zevv | anyway it was trivial stuff. |
14:47:58 | Araq | any recommendations for my new laptop? |
14:48:03 | Zevv | Oh I posted an ix, didn't I, of an earlier version |
14:48:06 | FromDiscord | <Kiloneie> lol then you can run servers for no change in bill |
14:48:12 | FromDiscord | <Kiloneie> Ryzen |
14:48:17 | Yardanico | yes |
14:48:17 | FromDiscord | <Kiloneie> make sure it's amd 😛 |
14:48:23 | Yardanico | my current CPU is Ryzen 7 3700X |
14:48:29 | FromDiscord | <dom96> #AmdHype |
14:48:41 | FromDiscord | <dom96> If you buy Intel we will murder you |
14:48:50 | Yardanico | uhh, what CPU does 4raq have? :P |
14:48:51 | FromDiscord | <Kiloneie> yep, i got 2700x, beauty D: |
14:48:55 | Zevv | Araq: don't know what you like. I've been sticking to Dell for 15 years and never sorry for it |
14:49:10 | Araq | is Ryzen even good for laptops |
14:49:18 | Yardanico | newest ones - yeah |
14:49:19 | FromDiscord | <Kiloneie> rekt intel in every way |
14:49:21 | Araq | I thought it's been designed mostly for PCs |
14:49:23 | Yardanico | they're really competetive |
14:49:30 | FromDiscord | <Kiloneie> 4000 series destroys it ieven in singlecore and power consumption |
14:49:31 | Yardanico | they have special APUs |
14:49:36 | FromDiscord | <Kiloneie> intel is dead in laptops |
14:49:40 | FromDiscord | <dom96> they've just release laptop variants AFAIK |
14:49:59 | shashlick | Remind me next time not to buy a very portable laptop |
14:50:22 | shashlick | Audio is crap, fans running all the time, running hot |
14:50:36 | shashlick | Of course I have a browser and vscode open |
14:51:17 | Zevv | I've been doing the same thing for the last decades: always buy a 2yo second hand computer that was top of the bill model when it came out. |
14:51:37 | Zevv | costs about 1/4th and you know what you get. |
14:52:30 | shashlick | Like with cars eh |
14:52:39 | Zevv | just like with cars I guess |
14:52:52 | Araq | hmm now I want a new one, yesterday |
14:53:01 | FromDiscord | <Kiloneie> well amd stuff is really cheap new too now |
14:53:02 | FromDiscord | <Ricky Spanish> yeh im in that same situation, these days i just have a simple text editor and mostly compile on azure to avoid burning my legs off |
14:53:22 | FromDiscord | <Kiloneie> amd's integrated graphics are also really good, can do some light gaming on them |
14:54:38 | shashlick | May be it is time to fix the text editor situation |
14:55:05 | FromDiscord | <Kiloneie> try geizhals araq for cheapest websites |
14:57:29 | dadada | I wonder if anyone has applied machine learning to source to source translations or generating wrappers from sources yet ... it seems like it should be possible given the right datasets to train a network to do something like translating Ruby code to Nim code. I mean, it is likely to make mistakes, but given the very impressive results machine learning (or deep learning) has showed elsewhere, why shouldn't it |
14:57:35 | dadada | be possible? One would need a very big database of accurate training data, and I assume a lot of processing power for the training. Am I wrong here? |
14:57:35 | Yardanico | yes, facebook did |
14:57:56 | Yardanico | facebook transcoder |
14:59:04 | Araq | who can review https://github.com/nim-lang/Nim/pull/15120/files ? it's beyond my capabilities |
14:59:05 | disbot | ➥ net: allow close() to ignore SSL failures due to disconnections |
14:59:12 | Yardanico | LOL, FPC can't compile original (from 2008) nimrod compiler code because of an internal error (regression, seems like they fixed it but it's not yet in a stable release) |
14:59:43 | Araq | Yardanico, please... focus on ARC. the future is more interesting than the past |
14:59:59 | dadada | Yardanico: ah right, hopefully there's more to follow |
15:00:03 | * | Vladar quit (Quit: Leaving) |
15:00:06 | Yardanico | well I reported most of the issues :P |
15:00:24 | Araq | you can also fix them, I know you read every patch of mine |
15:06:16 | Yardanico | okay, I can try |
15:06:49 | * | nikita` quit (Ping timeout: 264 seconds) |
15:06:55 | dadada | "In the TransCoder paper, the Facebook AI Research team notes that they intend to release the "code and pretrained models," but have not done so at this time.In the TransCoder paper, the Facebook AI Research team notes that they intend to release the "code and pretrained models," but have not done so at this time." |
15:07:25 | dadada | I hope they will... this could get pretty interesting |
15:08:14 | dadada | also, I wonder if this could be applied to wrappers ... ie. nimterop generates wrappers from C sources, so we have the C sources as training data, and also the nimterop generated wrappers as more training data (expected results) |
15:08:42 | dadada | would be interesting to see if something like that could be just as good as nimterop, when basically trained by nimterop |
15:09:07 | dadada | of course you will ask, why would I want that, when I could just use nimterop, answer is: I'm just curious |
15:09:42 | Araq | well I have all the answers: It won't work. ;-) |
15:09:42 | shashlick | Frankly if an AI can do this I'll be happy, can work on something else |
15:10:19 | Araq | the lexing rules of the different languages alone are hard to learn from examples alone |
15:10:43 | Araq | and without tokenization you will operate on the wrong layer all the time |
15:10:56 | dadada | Araq: can't tell if you're serious... please expand on it, because I've followed "two minute papers" channel on youtube, and machine learning has done things that appear almost more impressive, are you an expert in that field? |
15:11:26 | Araq | no, it was my major subject at university, but I'm not an expert |
15:11:57 | Araq | you'll get results but they won't be as good as the existing tools |
15:12:29 | dadada | hmm, facebook's tool beat some of the existing tools ... TransCoder "significantly" outperformed both, scoring 74.8% and 68.7% on C++-to-Java and Java-to-Python respectively, compared to 61% and 38.3% for commercial solutions. |
15:12:30 | FromDiscord | <dom96> My take on this is that AIs can produce good results most of the time, but when they produce bad results they often do it in very subtle ways that are hard to detect. You don't want that in source code. |
15:12:35 | FromDiscord | <Rika> at least until we get to even more massive models and need an insane amount of training data |
15:14:28 | dadada | making wrappers from C code should be easier than translating from python to Java, it would only need to learn what to look for in C code, and then need to generate wrappers for that, which is pretty repetitive... I bet this would work, just a question of (like Rika says) insane amount of training data |
15:14:34 | * | maier quit (Ping timeout: 260 seconds) |
15:14:42 | Yardanico | Araq: if a variable is "assigned" to a cursor is it a cursor itself? |
15:14:43 | Yardanico | "lvalue = __cursor[0]" |
15:14:57 | dadada | but no expert here either, my opinion is just that someone should try this |
15:15:52 | * | nikita` joined #nim |
15:16:36 | Araq | Yardanico, depends on the lvalue |
15:16:46 | Araq | but it's dangerous :-) |
15:16:50 | Yardanico | it's just a var: string |
15:16:52 | FromDiscord | <Ricky Spanish> usually the data sets they train on tend to be imperfect too which seems ignored in lots of academic papers making a presupposition that the code its learning from actually is bug-free/correct or even just straight up makes sense, garbage-in garbage-out, my ai will generate the best garbage |
15:17:03 | disruptek | Zevv: the lifting and stuff is irrelevant. |
15:18:07 | * | Kaivo quit (Ping timeout: 256 seconds) |
15:18:15 | Yardanico | I'm trying to do something with https://github.com/nim-lang/Nim/issues/15130, and so far (if I'm reading it correct), it seems like there's a "cursor tuple" created named "__cursor", and then one of its values is assigned to lvalue, but then lvalue is sink'd into result.value and lresult is destroyed |
15:18:16 | disbot | ➥ [ARC] SIGSEGV with tuple assignment caused by cursor inference ; snippet at 12https://play.nim-lang.org/#ix=2sKv |
15:18:28 | Yardanico | but "let __cursor = (lresult.value, ";")" |
15:20:15 | * | Kaivo joined #nim |
15:21:18 | Yardanico | yeah, it's a double free with -d:useMalloc |
15:21:49 | dadada | some videos from the two minute papers channel: https://www.youtube.com/watch?v=Lu56xVlZ40M https://www.youtube.com/watch?v=atcKO15YVD8 https://www.youtube.com/watch?v=2Bw5f4vYL98 https://www.youtube.com/watch?v=ihYsJpibNRU https://www.youtube.com/watch?v=3UZzu4UQLcI https://www.youtube.com/watch?v=MrIbQ0pIFOg https://www.youtube.com/watch?v=wg3upHE8qJw ... and all of this while we're (hopefully) |
15:21:55 | dadada | far from another AI winter |
15:22:10 | outtabwz | which pastebin does #nim prefer? |
15:22:23 | Yardanico | ix.io :P |
15:22:28 | Yardanico | but really any, but please prefer ones without JS :) |
15:22:31 | Yardanico | not like pastebin.com |
15:22:52 | outtabwz | ix.io is http-only though |
15:23:13 | Yardanico | well use https://play.nim-lang.org/ , it uses ix.io internally :)( |
15:23:56 | outtabwz | doesn't play.nim-lang.org require js? |
15:24:06 | Yardanico | yes, but it's an exception :) |
15:24:17 | Yardanico | but really use any paste service |
15:24:25 | Yardanico | just one without ads and too much js or other bloatware |
15:24:39 | outtabwz | how about this? paste.call-cc.org |
15:24:47 | outtabwz | it's the chicken scheme bin |
15:25:08 | Yardanico | sure |
15:25:18 | disruptek | if it takes 10 lines of convo to paste a 5 line file, you may as well just paste the file. |
15:26:35 | outtabwz | https://paste.call-cc.org/paste?id=9ff05fcaaa7641e7c13a37b5f397bec62b12ceaa |
15:26:43 | disruptek | Zevv: why doesn't my program work? |
15:27:00 | outtabwz | just wondering why let can't span lines |
15:27:03 | Yardanico | outtabwz: it can |
15:27:17 | outtabwz | but nim hates this code |
15:27:17 | Yardanico | it's just that it has to be "let \newline a = b \newline c = d" etc |
15:27:24 | Yardanico | well because this isn't how you would write it |
15:27:34 | Yardanico | if you write it this way, nim assumes you have a single let statement on first line |
15:27:41 | Yardanico | so second and third lines are invalid syntax |
15:27:44 | outtabwz | ah |
15:27:48 | outtabwz | lemme try that |
15:28:01 | Yardanico | also btw string is optional here :) you don't have to specify types for "let" |
15:29:09 | outtabwz | It works now! Thank you Yardanico |
15:29:45 | outtabwz | I understand type annotations are optional when assignment is done within declaration. |
15:29:52 | Yardanico | yes :) |
15:30:30 | outtabwz | For now I prefer to specify type annotations, at least until I'm more familiar with nim. |
15:32:37 | disruptek | if i change one character in this file, i get 2.8 million lines of compiler errors. |
15:33:00 | disruptek | 142mb of error messages. |
15:34:00 | disruptek | i've never been so wrong. |
15:34:27 | Araq | varriount will like this. I'm about to rename 'recNode' to 'n' |
15:34:52 | disruptek | yay, all n, all the time. |
15:35:05 | FromDiscord | <Rika> someone just annotated your paste, outtabwz. lol |
15:35:11 | FromDiscord | <Rika> "Maybe use CHICKEN instead?" |
15:35:48 | Yardanico | meh |
15:36:07 | alehander92 | dadada i really think rule-based systems are a better fit for lang translation |
15:36:10 | alehander92 | but i might be wrong |
15:36:31 | alehander92 | like, it's a cool to thing to ponder probably |
15:37:48 | dadada | alehander92: I think given the right data the network learns the rules, kind of like a child learns the mother's language without having been told the rules |
15:38:10 | alehander92 | buut .. human languages are much different compared to prog langs |
15:38:13 | dadada | and you're usually best in your native language inspite of not having learned it "by the rules" |
15:38:34 | Araq | children don't learn programming by listening to their parents |
15:38:34 | dadada | alehander92: I know that, the comparison is still valid |
15:38:50 | alehander92 | interesting thing is that very smart autocomplete basically gets close to that problem |
15:39:10 | alehander92 | Araq they can tho :D |
15:40:01 | outtabwz | Rika: I am taking a break from scheme right now. I've been messing with dlang, powershell, and nim |
15:41:55 | disruptek | Araq: what do your kids know of programming? |
15:42:52 | Araq | they know it sucks and they should learn how to cook instead |
15:43:11 | alehander92 | so `koch` was a dream of a new future |
15:44:23 | Yardanico | haha |
15:45:57 | alehander92 | one day we wake up and see the stdlib replaced with cake recipes |
15:46:35 | FromDiscord | <Rika> outtabwz: ah no i was just quoting the "annotation" someone did on your paste |
15:48:22 | Zevv | disruptek: because it's broken? |
15:49:02 | disruptek | i will ignore ctor for now i guess. |
15:49:09 | Zevv | /tmp/dis.nim(91, 9) Error: expression 'c ... @[n, succ(n, 1)]' has no type (or is ambiguous) |
15:49:26 | disruptek | well duh. |
15:49:38 | Zevv | right duh. but it doesn't work |
15:49:58 | disruptek | i think concepts + generics break the compiler's brain. |
15:49:59 | Zevv | must admit I didn't look at it after that. Stuff suddenly happened |
15:52:12 | Araq | you should really write a compiler plugin instead of a macro for this |
15:52:34 | Araq | then you have all the modelling power you need without the weird stuff |
15:52:51 | disruptek | thing is, i don't think we have any real modelling problems. |
15:53:00 | disruptek | i don't think we need to do lifting, for example. |
15:53:06 | Zevv | what |
15:53:10 | Zevv | did you smoke |
15:53:22 | disruptek | no, i never smoke. |
15:53:34 | Zevv | maybe you should explain more stuff |
15:53:34 | disruptek | i value my lungs too highly. |
15:53:42 | Zevv | instead of dropping deep one liners every now and then |
15:53:51 | disruptek | well, why do we need lifting? |
15:54:05 | disruptek | i never understood it. |
15:54:09 | alehander92 | dude lifting |
15:54:16 | alehander92 | reminds me to haskell, thanks |
15:54:17 | Zevv | locals go on the stack. There Can Be No Stack |
15:54:25 | alehander92 | going back to task |
15:54:26 | Zevv | prove me wrong |
15:54:38 | disruptek | why don't you just call a proc with your locals? |
15:55:03 | Zevv | what is 'your proc' |
15:55:17 | disruptek | it's my future stack. |
15:56:05 | disruptek | let's not kid ourselves; we always have a stack. |
15:56:25 | Yardanico | but what if you want to sent a continuation over a network? :) |
15:56:30 | Zevv | Yardanico: shut up |
15:56:34 | disruptek | what if i do? |
15:56:36 | Yardanico | XD |
15:56:48 | * | Trustable joined #nim |
15:56:56 | Zevv | disruptek: show me practical stuff, no theoritical musings |
15:57:10 | disruptek | what's impractical about the last code? |
15:57:23 | disruptek | i mean, aside from the fact that it doesn't compile. |
15:57:27 | Zevv | you force me to writemy code CPS |
15:57:35 | Zevv | which is exactly what I *don't* want |
15:57:43 | disruptek | but i can rewrite your code now. |
15:57:54 | Zevv | right. Rewrite this: (one moment) |
15:57:55 | FromDiscord | <tomck> Does nim have 'slices' like rust? I want to write a proc which takes a borrowed list of items, but sometimes that list of items should be a single local value - so i don't want to take a `seq[T]`, since that will allocate & copy the value, instead I want to take a 'slice' (e.g. a pointer to an item and a length, in this case 1) |
15:58:15 | Araq | tomck: use openArray[T] |
15:58:35 | Zevv | disruptek: https://play.nim-lang.org/#ix=2sN6 where does 'i' live |
15:58:36 | FromDiscord | <tomck> does that have the same semantics as a rust 'slice'? |
15:58:41 | Zevv | becasue I really lost you |
15:58:43 | * | opal quit (Remote host closed the connection) |
15:58:51 | FromDiscord | <tomck> (i.e. a pointer + length) |
15:58:52 | disruptek | Zevv: i is on the stack. |
15:58:57 | Zevv | right |
15:59:09 | Zevv | you're going somewhere. Just go there, explain me |
15:59:14 | disruptek | inside the while, it gets passed to a new whiling(i: int) proc. |
16:00:00 | * | opal joined #nim |
16:00:36 | Zevv | Yes but I want to call this in one second |
16:00:40 | Zevv | where does it live in the mean time? |
16:01:20 | Zevv | first it was on the stack. After the second it has to be passed to whileing(i: int) |
16:01:27 | Zevv | but where does it go inbetween? |
16:01:39 | disruptek | it's not our problem. that can be handled by user code. |
16:01:46 | Zevv | what |
16:01:49 | disruptek | ie. we can rewrite it if you want, it doesn't matter to me. |
16:01:58 | disruptek | the point is that inputs arrive from proc params. |
16:02:18 | Zevv | sure, one way or the other. Your approach was to put it on an env, or you can pass it into your proc |
16:02:37 | Zevv | but the storing of that stuff in the mean time is kind of the essence of what this needs to do for me |
16:02:43 | Zevv | I don't want to do the plumbing |
16:02:53 | disruptek | i get that. |
16:03:00 | Zevv | The rewriting was good. You just use the data "in place", where it lives. |
16:03:10 | Zevv | If you go passing it in and out of procs, you're agian copying your data around |
16:03:19 | Zevv | *from* the continuation *into* the stack |
16:03:27 | Zevv | that's plain stupid |
16:03:49 | disruptek | i'm not convinced it matters in an arc world. |
16:04:14 | Zevv | no dude, it's just not right. Arguments are passed on the stack in C |
16:04:17 | Zevv | *C* |
16:04:30 | disruptek | i know, but they have to enter the env anyway. |
16:04:31 | Zevv | you might get away with one or two trivial things getting passed by registers |
16:04:42 | disruptek | who cares if they enter from inside a proc or at the proc boundary? |
16:05:01 | Zevv | It matters where the stuff lives, and you don't want to go copying it around for nothing |
16:05:10 | Zevv | your approach with the envs was solid |
16:05:23 | Zevv | and I swear my approach with the little helper templates was solid |
16:05:35 | Zevv | you don't rewrite, Nim just uses the templates for finding the data from the env |
16:05:38 | Zevv | keep that stuff |
16:05:50 | disruptek | it's okay, but it's not correct. |
16:05:58 | Zevv | your env could be somewhat *better* by reusing these locs, just like a normal stack would |
16:06:15 | Zevv | yesterday I made a 50 line thingy that did this. It creates an env with the proper types into an object |
16:06:27 | Zevv | with typed it's much easier |
16:07:00 | disruptek | well, i don't want to impl rectangle fitting, really. |
16:07:40 | Zevv | I know you can psas everything in by args, but you still need a place to stash stuff as long as it's not running |
16:07:50 | disruptek | yes, i'm fine with that. |
16:07:58 | disruptek | but that happens on the result. not the input. |
16:08:32 | disruptek | the only time stashing occurs is /after/ we've already returned from the proc. |
16:09:04 | Zevv | yeah, so you stash. You save this stash for a second until your timer expiers. How do you get this stuff from your stash into the next function? |
16:09:19 | disruptek | i don't care. |
16:09:27 | disruptek | the stash is input to the next proc. |
16:10:04 | Zevv | No the stash is something in memory, it has a size and a location and you can save it to disk for all you like. The call is a function with a number typed arguments |
16:10:11 | Zevv | number /of/ typed arguments |
16:10:20 | Zevv | you need to take the stuff out of the stash, and put it in a function call |
16:10:32 | disruptek | no. |
16:10:32 | Zevv | effectively copying it to the stack, unless you make your function take vars |
16:10:34 | Zevv | yes |
16:10:47 | FromDiscord | <Recruit_main707> can you make an object have default fields, no right? |
16:10:56 | disruptek | fn(s: stash; x: int; y: string) |
16:11:15 | Zevv | Who will call this fn, and where will it get x and y from? |
16:11:46 | disruptek | c.grow(23, "and he") |
16:11:53 | * | Vladar joined #nim |
16:12:02 | Zevv | Who will call this fn, and where will it get x and y from? |
16:12:13 | Zevv | x and y are in the stash, right |
16:12:17 | disruptek | no. |
16:12:29 | Zevv | duuude |
16:12:36 | disruptek | x and y are new inputs. |
16:12:52 | disruptek | fn(c: stash; x: int; y: string) |
16:12:57 | disruptek | c.grow(23, "and he") |
16:13:26 | Zevv | Really, I can't follow you. Write that stuff down. |
16:13:30 | disruptek | so they are on the stack, just as if we `var x = 23`. |
16:13:33 | Zevv | sorry, I'm trying hard |
16:13:55 | disruptek | okay. |
16:14:15 | Zevv | either you are dead wrong, or you are seven steps ahead of me |
16:14:16 | FromDiscord | <Rika> @tomck i'm sure this is an absolutely dumb idea, but my idea is to make an object with an arr: UncheckedArray and a length: int. perhaps wait for someone with a better idea though |
16:14:18 | Zevv | can't tell which |
16:15:01 | disruptek | me neither. |
16:16:17 | FromDiscord | <tomck> @Rika what's the difference between that & openarray? is openarray just a special way to pass params? |
16:16:19 | Zevv | we need a four six packs, a white board and two baseball bats |
16:16:42 | disruptek | i have a 4' whiteboard in my 24' rv. |
16:16:56 | Zevv | we can just use the outside |
16:17:04 | disruptek | good point. |
16:17:31 | alehander92 | this is some violent |
16:17:33 | alehander92 | lang design |
16:17:41 | Zevv | it's efficient. I've used it before. |
16:17:47 | alehander92 | dont like it |
16:17:58 | Zevv | it beats scrum |
16:18:02 | alehander92 | don't hit me zevv! |
16:18:54 | FromDiscord | <Yardanico> Good night :) I hope tomorrow my sleep schedule will be more or less fixed |
16:19:04 | Zevv | Yardanico: what time is it over there? |
16:19:18 | FromDiscord | <Yardanico> 19:19 |
16:19:22 | Zevv | don't do it |
16:19:24 | FromDiscord | <Yardanico> I woke up on 3 AM |
16:19:27 | Zevv | wait two hours |
16:19:31 | FromDiscord | <Yardanico> I'll try |
16:20:07 | Zevv | anyway, i'm gonne have my dinner and think about stuff a bit more |
16:20:21 | Zevv | in the end I don't care about all the CPS stuff, but I do care about being right |
16:25:01 | shashlick | what's the best way to gitignore binaries on linux |
16:25:23 | disruptek | Zevv: lol |
16:25:52 | FromDiscord | <tomck> Can i map an iterator? |
16:26:02 | FromDiscord | <tomck> (without allocating by converting to a seq) |
16:26:38 | FromDiscord | <tomck> i'm using this library too, but it doesn't seem to support iterators (which seems weird) https://github.com/zero-functional/zero-functional |
16:26:48 | FromDiscord | <tomck> is there any reason you can't map an iterator, or could I write my own macro for it? |
16:27:02 | FromDiscord | <tomck> (edit) 'macro' => 'template' |
16:27:23 | disruptek | you can, of course. |
16:27:24 | FromDiscord | <Rika> Because not all iterators exist in run time |
16:28:33 | disruptek | i got rid of my 3 million lines of compiler errors. |
16:28:48 | disruptek | now the code just segfaults the compiler. |
16:29:20 | * | audiofile joined #nim |
16:34:17 | FromGitter | <bung87> dadada it's now waiting issues, no idea how far it goes |
16:34:34 | FromDiscord | <brainproxy> sent a code paste, see https://play.nim-lang.org/#ix=2sNo |
16:34:55 | dadada | bung87: keep banging at it, and it will go pretty far I assume |
16:35:18 | FromDiscord | <Rika> @brainproxy what's the code? |
16:36:04 | FromDiscord | <Yardanico> Using GC_ref and GC_unref manually can result in all sorts of things including crashes like that |
16:36:49 | * | zacts joined #nim |
16:37:03 | FromGitter | <bung87> maybe I'll change my mind, currently its not primary task on my list |
16:37:06 | FromDiscord | <Recruit_main707> whats the `interface` keyword for? |
16:37:12 | FromDiscord | <Yardanico> It's unused |
16:37:15 | FromDiscord | <Yardanico> Reserved* |
16:37:21 | FromDiscord | <brainproxy> sent a code paste, see https://play.nim-lang.org/#ix=2sNq |
16:37:34 | FromDiscord | <Yardanico> well yeah because a const is just a const |
16:37:43 | FromDiscord | <Yardanico> It's substituted directly |
16:37:45 | FromDiscord | <brainproxy> (edit) 'https://play.nim-lang.org/#ix=2sNq' => 'https://play.nim-lang.org/#ix=2sNr' |
16:38:18 | FromDiscord | <Rika> Make another proc that takes in a static string and remove the ref and unref |
16:38:22 | FromDiscord | <Yardanico> Also I don't think you need to do the GC_ref and unref here |
16:38:33 | FromDiscord | <brainproxy> maybe not, learning/experimenting |
16:38:47 | FromDiscord | <Yardanico> But yeah, as Rika said |
16:39:08 | FromDiscord | <Yardanico> You can create a static[string] overload specifically for literals/constants |
16:41:11 | FromDiscord | <brainproxy> can you give a tip on the overload? (I'm not sure how I do that) |
16:41:34 | FromDiscord | <Yardanico> proc foo*(message: static[string])... |
16:41:51 | FromDiscord | <Yardanico> But really, really just don't use gcref and gcunref in this case, it'll be even worse with ARC |
16:41:51 | * | Trustable quit (Remote host closed the connection) |
16:42:09 | FromDiscord | <Yardanico> Since ARC optimizes constant string literals to be static even if they're defined with let |
16:42:32 | * | jken joined #nim |
16:42:47 | FromDiscord | <Yardanico> Only if it's safe to do so of course |
16:42:49 | jken | Anyone have a complete assimp wrapper working in nim? |
16:43:53 | FromDiscord | <Clyybber> IIRC there was one on nimble |
16:43:54 | FromDiscord | <Clyybber> but its old |
16:44:05 | jken | Yeah that is the one I am using now |
16:44:17 | jken | Its missing some methods and I am new to wrapping C libs in nim |
16:44:26 | FromDiscord | <Clyybber> jken: You can try just running c2nim on assimp |
16:45:54 | jken | time to learn@! |
16:46:35 | FromDiscord | <brainproxy> @Yardanico thanks for the help! |
16:50:36 | lbart | Nim 1.2.6 available on FreeBSD |
16:51:05 | lbart | (1.2.4 was updated yesterday :p) |
16:51:09 | FromDiscord | <Rika> That was quick |
16:56:02 | jken | Should I be looking at c2nim or nimgen? |
16:56:34 | shashlick | someone already did one of those |
16:56:55 | FromDiscord | <Clyybber> jken: c2nim |
16:57:26 | FromDiscord | <Clyybber> nimterop is the one that succeeded nimgen |
16:57:36 | FromDiscord | <Clyybber> But c2nim is appropriate for this task I think |
16:57:42 | jken | oaky, thanks! |
16:58:45 | * | superbia2 joined #nim |
16:59:52 | FromDiscord | <vieru> hi |
17:00:02 | FromDiscord | <vieru> anyone using winim ? |
17:00:28 | Zevv | disruptek: your plan holds to pass in vars by the proc, as long as you make these all 'var' |
17:01:25 | * | superbia1 quit (Ping timeout: 240 seconds) |
17:01:26 | lbart | euantor: I'll try to update OpenBSD nim ports tommorrow |
17:01:27 | Zevv | your proc is `proc foo(c: C, i: int, j: int)`, and we can generate continuators that do `c.fn(c, c.i, c.j)`. That'll be zero copy |
17:01:32 | Zevv | no wrong |
17:01:37 | FromDiscord | <Recruit_main707> > anyone using winim ?↵@vieru yes |
17:01:40 | Zevv | `proc foo(c: C, i: var int, j: var int)` |
17:02:05 | FromDiscord | <vieru> i need help using CryptUnprotectData |
17:02:17 | FromDiscord | <vieru> can you help me ? |
17:02:29 | FromDiscord | <Recruit_main707> maybe |
17:02:32 | FromDiscord | <Recruit_main707> try asking |
17:02:34 | Zevv | the good thing is that `i` and `j` will actually still be mutated in your env, so after thet continuator, everythingis in place |
17:02:39 | Zevv | it is quit charming |
17:03:00 | disruptek | now apologize. |
17:03:17 | Zevv | no man. You had not thought of all that |
17:03:23 | Zevv | You made me do that |
17:03:36 | FromDiscord | <vieru> ok so im just trying to get all my passwords from chrome's the login data file |
17:03:43 | FromDiscord | <vieru> do you know what im talking about ? |
17:04:09 | supakeen | 👀 |
17:04:48 | Zevv | disruptek: the good thing is it keeps the split-up procs simpler, so easier to debug and reason about. |
17:05:26 | FromDiscord | <vieru> sent a code paste, see https://play.nim-lang.org/#ix=2sNz |
17:05:50 | Zevv | only thing is *new* locals introduced in a split-proc. You either let them live on the stack a bit and tthen somehow transfer them into the env. |
17:06:14 | Zevv | Or - better I think - you introduce them in their env and pass them in as if it was an argument. |
17:06:21 | Zevv | and remove the original declaration or initialization |
17:06:27 | FromDiscord | <Recruit_main707> to begin with, those cast[ptr BYTE] are wrong i think |
17:06:34 | disruptek | it doesn't matter; arc will handle it. we only worry as a point of optimization. |
17:06:59 | Zevv | I don't see how arc will help there |
17:07:13 | Oddmonger | one last question and then after i heat.die() : is it possible to get the keys of a table, when you know the value or should i reverse the table (with a macro maybe ?) |
17:07:14 | disruptek | arc can sink them into the env as necessary. |
17:07:22 | FromDiscord | <vieru> i thought so but i don't know better |
17:07:32 | Zevv | disruptek: well, I'd be interested to see how that works |
17:08:10 | shashlick | jken: are you okay wrapping the C api |
17:08:13 | FromDiscord | <Ricky Spanish> Is there a way to get an ast from nim for development of language tools or just use llvm? |
17:08:24 | euantor | lbart: awesome, thanks! I’m currently trying to work on looking into some issues on FreeBSD that seems related to thread local storage emulation |
17:08:37 | jken | shashlick, no idea |
17:09:10 | shashlick | well, what sample code do you intend starting with |
17:09:32 | jken | my goal is to wrap assimp |
17:09:37 | jken | which I now realize is actually c++ |
17:10:37 | * | maier joined #nim |
17:11:30 | shashlick | there is a c API |
17:12:10 | FromDiscord | <Clyybber> Zevv, disruptek: What if a continuation creates a new variable? Where does it end up? |
17:12:31 | FromDiscord | <vieru> @Recruit_main707 you still here ? |
17:12:38 | Zevv | that's what I tried to explain in the previous lines |
17:13:05 | Zevv | - either it normally introdruces it and uses it on the stack (var i = 3) and we move it into the environemnt for the next proc explicitly |
17:13:12 | disruptek | every continuation is a composition of other continuations. |
17:13:31 | shashlick | jken: here's what I got with nimterop for assimp/cimport.h |
17:13:35 | shashlick | http://ix.io/2sNA/nim |
17:13:37 | disruptek | you can sink it into the continuation, or not; your choice. |
17:13:39 | shashlick | command line I called is at the top |
17:13:43 | Zevv | - or we *know* it will introduce it, and we put it in the env already, and pass that into the proc as a `var i: int`. Replace `var i = 3` with `i = 3` |
17:14:08 | Zevv | disruptek is seven steams ahead of me, so I have no clue what he is talking abount |
17:14:13 | jken | shashlick, ill take a look |
17:14:21 | FromDiscord | <Clyybber> every disruptek is a composition of other disrupteks |
17:14:23 | jken | this is all new to me |
17:14:43 | disruptek | look at it this way: the identity continuation is the continuation with a nil fn. |
17:14:48 | FromDiscord | <Recruit_main707> @vieru yes, sorry, do you have any errors? |
17:15:00 | shashlick | okay, I"ll suggest getting familiar with assimp and how exactly you want to use it and then see if what you need is covered by the C api |
17:15:25 | * | maier quit (Ping timeout: 240 seconds) |
17:16:05 | FromDiscord | <vieru> @Recruit_main707 nope, no errors, just GetLastError returns 13 and CryptUnprotectData returns 0 |
17:18:14 | FromDiscord | <vieru> here's the output |
17:18:24 | FromDiscord | <vieru> sent a code paste, see https://play.nim-lang.org/#ix=2sNB |
17:18:28 | jken | shashlick, the reason the existing wrapper on nimble isn't working for me its its missing GetTextureCount and GetTexture |
17:19:30 | FromDiscord | <Recruit_main707> what should `cbData` be? whats its type? |
17:20:22 | FromDiscord | <vieru> ok so `pbData` its `ptr BYTE` and `cbData` should be the number of bytes for `pbData` |
17:20:51 | FromDiscord | <vieru> a `DWORD` |
17:21:04 | FromDiscord | <vieru> https://docs.microsoft.com/en-us/previous-versions/windows/desktop/legacy/aa381414(v=vs.85) |
17:21:23 | FromDiscord | <vieru> >cbData↵>A DWORD variable that contains the count, in bytes, of data. |
17:22:46 | shashlick | jken: let me take a look |
17:23:14 | FromDiscord | <vieru> here's the code im trying to replicate https://github.com/dlartsev/code.snippets/blob/3ae2ec2f56a5a03c1fde8765949147e61362e495/passwd.winapi.c |
17:23:19 | FromDiscord | <vieru> line 26 |
17:24:06 | FromDiscord | <Recruit_main707> ok, try using cstring rather than string |
17:24:23 | FromDiscord | <vieru> where ? |
17:25:27 | FromDiscord | <Recruit_main707> gimme a sec |
17:26:14 | FromDiscord | <vieru> w8 imma send you the login data file |
17:26:58 | * | superbia2 is now known as superbia |
17:27:05 | FromDiscord | <vieru> here's the file |
17:27:07 | FromDiscord | <vieru> https://anonfiles.com/N2q1x2J2o0/Login_Data |
17:33:43 | FromDiscord | <Recruit_main707> @vieru i dont know what should `talloc` temporary alloc? what will it do, free the memory once the function finishes? |
17:33:57 | FromDiscord | <Recruit_main707> what is* |
17:35:26 | FromDiscord | <vieru> idk man for now i just want CryptUnprotectData to work, ill care for memory leaks n that sort of stuff later |
17:35:35 | FromDiscord | <vieru> here's another c snippet |
17:35:55 | FromDiscord | <vieru> sent a code paste, see https://play.nim-lang.org/#ix=2sNF |
17:36:35 | FromDiscord | <Recruit_main707> https://play.nim-lang.org/#ix=2sNG↵this is how that code would be transpiled (the first part) |
17:36:40 | FromDiscord | <vieru> idk that much c↵and nim im learning |
17:36:56 | FromDiscord | <vieru> one sec↵> https://play.nim-lang.org/#ix=2sNG↵> this is how that code would be transpiled (the first part)↵@Recruit_main707 |
17:37:49 | FromDiscord | <Recruit_main707> forgot to increase dwBlobSize, you need to add that in the loop |
17:38:52 | FromDiscord | <vieru> ok but how to i implement that in my code |
17:39:16 | FromDiscord | <vieru> i want to get the encrypted data from login data file |
17:39:31 | FromDiscord | <vieru> and the only way is using `db_sqlite` |
17:39:51 | FromDiscord | <vieru> sent a code paste, see https://play.nim-lang.org/#ix=2sNJ |
17:40:18 | FromDiscord | <vieru> echoing data[2]↵```nim↵echo datadb[2]↵``` |
17:40:23 | FromDiscord | <Recruit_main707> you want that indataIn.pbData right? |
17:40:29 | FromDiscord | <vieru> yeah |
17:40:41 | FromDiscord | <vieru> > echoing data[2]↵> ```nim↵> echo datadb[2]↵> ``` |
17:42:09 | FromDiscord | <Recruit_main707> i have had problems using strings and cstrings with binary data in the past, but (assuming `getAllRows` returns a string) `inData.pbData = cast[ptr BYTE](datadb.cstring)` |
17:42:17 | FromDiscord | <Recruit_main707> try that |
17:42:27 | FromDiscord | <vieru> w8 imma try it rn |
17:44:10 | Araq | it doesn't point to a byte. it points to an array of bytes |
17:44:56 | Araq | C ruined the foundation of a type system |
17:45:15 | FromDiscord | <vieru> sent a code paste, see https://play.nim-lang.org/#ix=2sNM |
17:45:45 | Zevv | disruptek: you here? |
17:46:07 | FromDiscord | <vieru> this just means it doesn't work |
17:46:15 | FromDiscord | <Recruit_main707> > it doesn't point to a byte. it points to an array of bytes↵Araq, `BYTE is byte*` then? |
17:46:39 | * | Jesin quit (Quit: Leaving) |
17:46:41 | Araq | cast[ptr UncheckedArray[BYTE]](...) |
17:46:42 | FromDiscord | <vieru> BYTE is uint8 |
17:47:22 | FromDiscord | <Recruit_main707> werent arrays in c just that, a pointer to the first element? |
17:47:54 | Araq | no, but no matter what C does, write idiomatic Nim code please |
17:48:16 | FromDiscord | <Recruit_main707> ok |
17:49:12 | FromDiscord | <vieru> i replaced that cast with what araq sent |
17:49:22 | FromDiscord | <vieru> and ive got i type error |
17:49:27 | FromDiscord | <vieru> (edit) 'i' => 'a' |
17:50:46 | FromDiscord | <vieru> https://hastebin.com/womupimana.py |
17:50:51 | FromDiscord | <vieru> here's the code |
17:50:58 | FromDiscord | <Recruit_main707> maybe winim didnt make sure wether each function was expecting an array or just a pointer to T, i guess you will have to leave it like that.↵↵brb, try not initialising `dataOut.pbData` yourself, and try printing it |
17:50:59 | FromDiscord | <vieru> line 31 |
17:51:13 | * | Jesin joined #nim |
17:52:20 | FromDiscord | <vieru> here's winim's definition of CryptUnprotectData↵```nim↵proc CryptUnprotectData*(pDataIn: ptr DATA_BLOB, ppszDataDescr: ptr LPWSTR, pOptionalEntropy: ptr DATA_BLOB, pvReserved: PVOID, pPromptStruct: ptr CRYPTPROTECT_PROMPTSTRUCT, dwFlags: DWORD, pDataOut: ptr DATA_BLOB): WINBOOL {.winapi, stdcall, dynlib: "crypt32", importc.}↵``` |
17:52:53 | FromDiscord | <vieru> ```nim↵DATA_BLOB* = CRYPT_INTEGER_BLOB↵``` |
17:52:59 | Araq | yeah, it's everywhere. the fact that even c2nim gets it wrong doesn't help :D |
17:53:27 | FromDiscord | <vieru> sent a code paste, see https://play.nim-lang.org/#ix=2sNO |
17:53:39 | Araq | we'll all be dead before this design mistake is fixed. Software is much "harder" to change than hardware. |
17:53:41 | FromDiscord | <vieru> araq any idea how to fix this ? |
17:54:18 | shashlick | @jken: ya that's c++ class stuff and nimterop doesn't support that - you can try c2nim for those declarations |
17:57:53 | * | abm quit (Quit: Leaving) |
18:00:48 | Araq | vieru: either patch winim or use 'ptr T' rather than 'ptr UncheckedArray[T]' |
18:00:54 | Araq | sucks I know |
18:02:11 | FromDiscord | <vieru> yeah but that still wont fix my code, it will only solve type errors |
18:02:39 | FromDiscord | <vieru> i don't even know what's wrong with it |
18:02:55 | FromDiscord | <Recruit_main707> have you tried what i said? |
18:03:05 | FromDiscord | <vieru> yep |
18:03:08 | FromDiscord | <vieru> still nothing |
18:03:29 | FromDiscord | <vieru> and i can't really echo pbData |
18:03:35 | FromDiscord | <vieru> its ptr BYTE |
18:03:48 | FromDiscord | <vieru> i just cast it to string |
18:04:31 | FromDiscord | <Recruit_main707> dont cast to nim strings/seqs, they are not the same as c strings |
18:04:45 | FromDiscord | <vieru> the only way i know CryptUnprotectData works is thu the `worked` let |
18:05:06 | FromDiscord | <vieru> CryptUnprotectData returns 1 or 0 |
18:05:25 | Zevv | When pushing a proc through a typed macro, I get a "previous declaration" on the same line. What is it I do not understand? |
18:05:25 | FromDiscord | <vieru> ```If the function succeeds, the function returns TRUE.↵↵If the function fails, it returns FALSE.``` |
18:07:16 | Zevv | https://play.nim-lang.org/#ix=2sNU |
18:08:55 | Zevv | works fine if I do it like this: https://play.nim-lang.org/#ix=2sNW |
18:10:00 | FromDiscord | <Recruit_main707> @vieru try setting `data_in.pbData` |
18:10:30 | FromDiscord | <Recruit_main707> like this: |
18:12:50 | FromDiscord | <vieru> is it just my discord ?↵cus i dont see anything |
18:13:03 | FromDiscord | <Recruit_main707> im trying thins :p |
18:13:06 | FromDiscord | <Recruit_main707> things |
18:13:22 | FromDiscord | <vieru> okok sry |
18:14:49 | FromDiscord | <Recruit_main707> sent a code paste, see https://play.nim-lang.org/#ix=2sO0 |
18:16:22 | FromDiscord | <vieru> imma try it rn |
18:18:16 | FromDiscord | <vieru> ```C:\Users\vieru\Documents\scheme_noi\password_test.nim(33) password_test↵C:\Users\vieru\Documents\scheme_noi\password_test.nim(29) convertToByteArray↵SIGSEGV: Illegal storage access. (Attempt to read from nil?)``` |
18:18:38 | FromDiscord | <vieru> i think result needs to be initialised somehow |
18:18:57 | Zevv | oh there's no outer StmtList |
18:18:57 | FromDiscord | <vieru> @Recruit_main707 |
18:18:58 | Zevv | that's funny |
18:20:27 | Araq | oh I reinvented Steensgaard’s algorithm |
18:20:33 | Araq | til |
18:21:36 | disruptek | i'm here, yeah. |
18:21:40 | disruptek | what's up? |
18:22:13 | Zevv | why do we need to *return* C |
18:22:16 | Zevv | we can just mutate it |
18:22:24 | disruptek | yes. |
18:22:36 | Zevv | ok. |
18:22:46 | disruptek | but there are immutable continuations, too. |
18:22:51 | Zevv | fuck them |
18:22:55 | disruptek | rude. |
18:22:59 | Zevv | we make them, right |
18:23:01 | Zevv | no one else |
18:23:40 | disruptek | mmm, i dunno. |
18:23:56 | disruptek | why do you say that? |
18:24:22 | Zevv | say what |
18:24:35 | disruptek | that only we create immutable continuations. |
18:24:43 | Zevv | we make the continuations right |
18:24:50 | Araq | why not follow the paper? |
18:25:00 | disruptek | we did that. it was dumb. |
18:25:09 | Araq | why? |
18:25:21 | disruptek | because this is nim, not c. |
18:25:56 | Araq | sure but maybe you can go into more details |
18:26:07 | disruptek | gimme a sec, i'm starving. |
18:26:50 | Zevv | disrupteks latest version basically worked, but things are not efficient - stuff gets copied around too much |
18:27:06 | FromDiscord | <vieru> @Recruit_main707 still here ? |
18:27:19 | Zevv | but now he's trying to go somewhere, but I still don't grasp what his true intentions are |
18:28:12 | Zevv | he's going full meta on me |
18:28:34 | disruptek | the intention is to deconstruct the concept to its barest minimum and then build it back up from there. |
18:29:14 | Zevv | well, can't argue with that |
18:30:10 | disruptek | what i /really/ want is to have the code<->data association be a compile-time-only thing. |
18:30:18 | disruptek | i'm just not sure we can get there. |
18:31:36 | FromDiscord | <Recruit_main707> @vieru im out of ideas |
18:32:09 | FromDiscord | <vieru> well fuck |
18:32:23 | FromDiscord | <vieru> ill try tomorrow a c implementation |
18:32:33 | FromDiscord | <vieru> and then import it in nim |
18:33:07 | FromDiscord | <vieru> it seems i cant implement it in nim only code |
18:34:14 | disruptek | part of the reason to deconstruct this stuff is to make it easier to apply to data and syntax that we already have. |
18:34:27 | disruptek | we want to be able to call continuations. it's very natural to do so. |
18:34:48 | disruptek | we want to be able to have those calls inject new data into the continuation environment. |
18:35:00 | disruptek | and we can continuations to be natural rvalues. |
18:35:05 | disruptek | s/can/want/ |
18:36:20 | disruptek | we're getting there. we have most of this working, and on generic continuation types that contain generic data. so it's pretty far beyond the paper's proposal. |
18:37:26 | disruptek | also, the entire impl is like 40 lines long. |
18:38:36 | disruptek | the rewriting bit is an impl detail, really. it is something like 600 lines and i think it can be probably under 100. |
18:38:47 | Zevv | twice |
18:38:50 | Zevv | but still |
18:39:24 | disruptek | it's a simple concept. it should be simple code. |
18:39:52 | Zevv | most of the complexity is juggling AST I guess |
18:39:52 | disruptek | it's needle-threading right now, as ever. 😁 |
18:39:54 | Zevv | not the CPS stuff itself |
18:41:01 | disruptek | the ast is getting simpler, too. |
18:49:22 | * | krux02 quit (Remote host closed the connection) |
19:01:33 | FromDiscord | <brainproxy> sent a code paste, see https://play.nim-lang.org/#ix=2sOg |
19:04:32 | * | NimBot joined #nim |
19:05:33 | disruptek | is it an oversight that deques cannot be instantiated from an openarray? or is it /my/ oversight? |
19:06:39 | FromDiscord | <Recruit_main707> @brainproxy yes |
19:08:13 | FromDiscord | <brainproxy> thanks |
19:11:27 | * | Senketsu joined #nim |
19:11:32 | * | maier joined #nim |
19:16:28 | * | maier quit (Ping timeout: 256 seconds) |
19:23:40 | Zevv | disruptek: http://wingolog.org/archives/2011/07/12/static-single-assignment-for-functional-programmers/ |
19:29:10 | * | zacts quit (Quit: WeeChat 2.8) |
19:29:35 | * | narimiran joined #nim |
19:30:21 | * | kenran joined #nim |
19:31:29 | * | dzamo quit (Quit: dzamo) |
19:36:30 | shashlick | Yardanico - do you know how many existing nimble packages still use the old babel format |
19:38:58 | shashlick | looks like you already did it for https://github.com/nim-lang/Nim/pull/14456 |
19:38:59 | disbot | ➥ fix #14453 babel files need to be considered too otherwise getnimblePkg,getnimblePkgId,belongsToPackage are wrong |
19:40:31 | shashlick | about time we deprecated and removed babel file support |
19:41:33 | FromDiscord | <haxscramper> Is it possible to access anonymous tuple elements as a field instead of using array-like index? Something like `(1, 2).field0` as opposed to `(1, 2)[0]` |
19:42:43 | * | nikita` quit (Quit: leaving) |
19:50:59 | FromDiscord | <Varriount> @haxscramper Yes, if the tuple type has defined fields. The return type of `proc foo(): tuple[a: int, b: int]` can be accessed using `[0]`, `[1]`, `.a` or `.b` |
19:51:53 | FromDiscord | <Varriount> And you can define tuple types: `type Bar = tuple[a: int, b: int]` |
19:53:34 | FromDiscord | <haxscramper> But if have anonymous I can *only* use `[element-index]` to get something from tuple |
19:59:59 | * | Jesin quit (Quit: Leaving) |
20:00:41 | FromDiscord | <Elegant Beef> Thanks to UFCS you could do something like this, probably a better way to automate this somewhere↵https://play.nim-lang.org/#ix=2sOr |
20:00:53 | FromDiscord | <Elegant Beef> (edit) 'Thanks to UFCS you could do something like this, ... probably' => 'Thanks to UFCS you could do something like this,there is' |
20:02:41 | * | Jesin joined #nim |
20:22:06 | * | Trustable joined #nim |
20:23:19 | disruptek | Zevv: this looks like a new bible, or maybe a collection of bibles. |
20:24:11 | disruptek | Zevv: what they are talking about with dominators is how i envision the next version of Env. |
20:26:22 | * | Senketsu quit (Read error: Connection reset by peer) |
20:31:06 | disruptek | the rewrite itself is the easy part. |
20:32:02 | disruptek | the hard part is getting the damned monad the compose. it's fucking ridiculous. |
20:32:08 | disruptek | s/the/to/ |
20:36:47 | * | Trustable quit (Remote host closed the connection) |
20:37:26 | * | kenran quit (Quit: leaving) |
20:44:02 | * | dulsi_ joined #nim |
20:44:43 | * | Senketsu joined #nim |
20:44:48 | * | zacts joined #nim |
20:45:16 | Zevv | and research.microsoft.com/~akenn/sml/CompilingWithContinuationsContinued.pdf. |
20:45:33 | Zevv | It even has some paragraphs in it that I understand |
20:46:14 | disruptek | i don't read math. |
20:46:25 | * | dulsi quit (Ping timeout: 240 seconds) |
20:48:29 | Zevv | this paper is recommended at a lot of places I read about this. I can't make head or tails of it. |
20:49:09 | disruptek | well, it doesn't matter how small it makes the thread if we can't get it close to the needle. |
20:49:27 | disruptek | ie. we need code the demonstrates the concept. |
20:49:50 | Zevv | what else |
20:49:56 | Zevv | not like that gibberish |
20:50:29 | disruptek | it's like i can have only half of it work. but there are three halves. |
20:50:42 | FromDiscord | <Varriount> `M ≡ let x = (λy.let z = a b in c) d in e.` |
20:50:57 | * | theelous3 quit (Read error: Connection reset by peer) |
20:50:57 | disruptek | now i don't have lazy eval working, for example, but everything else is fine. |
20:51:20 | FromDiscord | <Varriount> We need a dictionary/layman's guide to logic symbols and statements. |
20:51:24 | Zevv | three quarks for Muster Mark |
20:51:45 | FromDiscord | <Varriount> I always forget what those symbols mean in these contexts. |
20:51:48 | * | Vladar quit (Quit: Leaving) |
20:52:13 | Zevv | yeah, there's things I was once pretty fluent in |
20:52:18 | Zevv | and I just kind of lost that |
20:52:25 | disruptek | it's like, `let z: c = a(b)` afaik |
20:52:54 | FromDiscord | <Varriount> It doesn't help that academia is in love with single-letter variables. |
20:53:39 | disruptek | one thing that makes a lot of sense is to lift block names into adhoc continuations. |
20:53:56 | disruptek | while should be rewritten as block. |
20:54:00 | disruptek | and so on. |
20:54:13 | disruptek | it's free, as far as we're concerned. |
20:54:39 | Zevv | it is |
20:55:16 | disruptek | i would just rewrite for loops, too. |
20:55:48 | Zevv | maybe try to limit the greedyness of the rewrite in this next version |
20:56:31 | disruptek | agree, but i look at it as "leave things better than you found them and trust someone else to improve things even more". |
20:56:53 | Zevv | fair enough |
20:56:57 | disruptek | the rewrite pass is itself a continuation. 😉 |
20:57:17 | Zevv | implement cps in cps, just like nim is implemented in nim |
20:57:36 | disruptek | probably makes sense. |
20:58:37 | Zevv | I'm gonna see if I can find some time to chew through http://www.cs.cmu.edu/afs/cs/academic/class/15745-s07/www/papers/cytron-efficientSSA.pdf next days |
20:59:01 | Zevv | "Efficiently Computing Static Single Assignment Form and the Control Dependence Graph." |
20:59:03 | disruptek | another interesting side-effect i've been thinking about is embedding metadata to help with try/finally, for example. |
20:59:08 | disruptek | observable stores. |
20:59:48 | disruptek | like, why don't we pass information around during our rewrite process? |
21:00:03 | disruptek | i was gonna use a comment but, pffbt that's silly. |
21:00:18 | disruptek | we'll just embed some assignments or whatever. |
21:00:48 | disruptek | maybe `discard`. |
21:01:08 | Zevv | well, can't wait to see what I will wake up to tomorrow |
21:01:12 | Zevv | I'mma out |
21:01:20 | Zevv | lambda away! |
21:01:25 | disruptek | g'nite zevv |
21:01:31 | * | narimiran quit (Ping timeout: 256 seconds) |
21:01:33 | disruptek | probably no surprises tomorrow. 😉 |
21:01:49 | Zevv | I'd be surprised if there were no surprises, tho |
21:02:01 | disruptek | surprise! |
21:03:05 | * | audiofile quit (Ping timeout: 240 seconds) |
21:08:33 | mbuchel | what does "cannot prove it's safe to initialize ... with runtime value for the discrimminator kind" mean? |
21:08:49 | * | flop joined #nim |
21:12:24 | * | maier joined #nim |
21:13:25 | * | zacts quit (Quit: WeeChat 2.8) |
21:13:41 | * | mbuchel quit (Quit: WeeChat 2.8) |
21:14:12 | * | flop quit (Quit: WeeChat 2.8) |
21:14:47 | * | mbuchel joined #nim |
21:15:44 | * | mbuchel quit (Client Quit) |
21:17:38 | * | maier quit (Ping timeout: 260 seconds) |
21:18:05 | FromDiscord | <Varriount> shashlick: Aside from the constant conversion thing, are there any other major improvements that I could help make to Nimterop? |
21:18:45 | FromDiscord | <Varriount> shashlick: Looking through the source, it seems like there are some places that could be abstracted a bit. |
21:18:58 | shashlick | Have at it |
21:19:42 | FromDiscord | <Varriount> _gets out the chainsaw 😈_ |
21:20:48 | shashlick | Main things in my backlog are c macros to templates |
21:21:03 | shashlick | But there's always bugs |
21:21:13 | FromDiscord | <Varriount> Hm, does the preprocessor output all macros though? |
21:21:20 | disruptek | c macros to templates sounds nontrivial at best. |
21:21:24 | shashlick | Of course c++ is the next big thing but I'm not motivated yet |
21:22:00 | shashlick | Only regular types - int hex char string stuff |
21:22:45 | shashlick | Templates is doable but the hard part is to not break with crazy ones |
21:23:11 | shashlick | @jyapayne implemented expression parsing which can be leveraged |
21:24:38 | * | dulsi_ is now known as dulsi |
21:26:38 | FromDiscord | <Varriount> shashlick: C++ support would be nice for wrapping the WinRT APIs. Otherwise you have to write a projection for them (https://github.com/microsoft/xlang) |
21:28:31 | shashlick | It's a long lonely road let's just say, but could be done in a couple focused months |
21:28:50 | FromDiscord | <Varriount> Don't ask me why the team at Microsoft decided the best way to store an API specification was in a binary data format. |
21:28:55 | shashlick | Not done done, but reasonably usable |
21:29:16 | shashlick | Namespace, class, method support |
21:29:26 | shashlick | Templates might make it crazy |
21:30:49 | * | zacts joined #nim |
21:31:39 | FromDiscord | <Varriount> Anyone know if, with ARC, external C can do something like `nimValue->nimProceduralValue(nimValue)`, where `nimProceduralValue` is `proc foo(v: ref NimValueType) {.cdecl.}` and not have things break? |
21:33:12 | FromDiscord | <Varriount> (or put more simple, can external C code pass a pointer to a Nim value to a Nim procedure expecting a reference, assuming the Nim value was created on the heap in the first place) |
21:35:05 | disruptek | nimph has no known bugs. |
21:35:38 | disruptek | varriount: yes, pointers are pointers. |
21:36:50 | FromDiscord | <Varriount> Ok, that will make interfacing with COM a lot nicer |
21:37:06 | disruptek | yes, arc is huge for library use. |
21:42:26 | * | krux02 joined #nim |
21:53:27 | * | solitudesf quit (Ping timeout: 256 seconds) |
21:53:49 | * | tane quit (Quit: Leaving) |
22:07:07 | FromDiscord | <slymilano> I hope arc lands proper before c++ target |
22:07:15 | disruptek | what? |
22:09:33 | ForumUpdaterBot | New thread by Serge: Is there a way to ensure that a viriable is "passed by address" (or reference) in Nim , see https://forum.nim-lang.org/t/6626 |
22:15:40 | * | vicfred quit (Quit: Leaving) |
22:31:07 | * | arecacea1 quit (Remote host closed the connection) |
22:32:37 | FromDiscord | <Zachary Carter> nimgl: man the extension enums are a challenge |
22:32:45 | * | arecacea1 joined #nim |
22:32:45 | FromDiscord | <Zachary Carter> I think a macro would work better than this parser potentially |
22:33:19 | FromDiscord | <Zachary Carter> but uh - not sure I want to write that |
22:34:09 | lmariscal | @Zachary I have been adding some stuff to the vulkan generator this past weeks and the project that I use as a reference is pretty good |
22:34:16 | lmariscal | https://github.com/oakes/vulkan_triangle_nim |
22:34:55 | FromDiscord | <Zachary Carter> oh cool |
22:35:04 | lmariscal | Being honest with you I'm not quite as knowledgeable in Vulkan as I'm with OpenGL, but wanted to add Vulkan bindings into NimGL |
22:35:25 | lmariscal | So I'm trying my best and any feedback is more than welcome |
22:36:02 | FromDiscord | <Zachary Carter> so far the only thing I've struggled with is the missing extension enum values |
22:36:10 | FromDiscord | <Zachary Carter> but maybe Zach Oakes has fixed this in his fork? |
22:37:16 | FromDiscord | <Zachary Carter> nah it doesn't look like it |
22:37:33 | lmariscal | https://github.com/oakes/nimgl is his fork |
22:38:30 | FromDiscord | <Zachary Carter> yeah for instance he's missing - `VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT` |
22:38:55 | FromDiscord | <Zachary Carter> these extensions add values to already defined enumerations |
22:39:38 | FromDiscord | <Zachary Carter> and sometimes they do crazy shit like - `<enum offset="0" extends="VkQueryType" extnumber="166" name="VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR"/>` within an extension defintion |
22:40:15 | FromDiscord | <Zachary Carter> looking at some rust code I was able to figure out that you can determine the value for one of these extension enumeration values by doing - `value = 1000000000 + (extension.attr("number").parseInt() - 1) * 1000 + extensionEnum.attr("offset").parseInt()` |
22:40:30 | FromDiscord | <Zachary Carter> but I have no idea what to do when I encounter this - `extnumber="166"` |
22:41:22 | lmariscal | Yep, I think the generator is missing that stuff and seeing the alias below (In the reg) I'm also missing aliases |
22:42:22 | FromDiscord | <Zachary Carter> well I may have almost fixed the extension enum thing |
22:42:26 | FromDiscord | <Zachary Carter> and alias thing |
22:42:38 | FromDiscord | <Zachary Carter> but it's not ideal - and this is why I think a macro would work better |
22:42:46 | FromDiscord | <Zachary Carter> I basically have to check all extensions as I'm defining enums |
22:43:07 | * | rockcavera quit (Remote host closed the connection) |
22:44:30 | * | krux02 quit (Remote host closed the connection) |
22:44:47 | lmariscal | a macro that sets the value based on the offset / bitpos? |
22:44:49 | * | theelous3 joined #nim |
22:45:26 | lmariscal | cause extension defined constants are going to be fun to define in Nim, have to check out how they do it in C |
22:46:50 | * | rockcavera joined #nim |
22:47:35 | lmariscal | due to some personal stuff I have not been able to fully integrated all the changes that I want, but if you have a public repo that I can use as a ref to some changes it would be great |
22:48:09 | lmariscal | @Zachary https://github.com/nimgl/nimgl/issues/47 is also a good place to post this issues since I'm using it as a todo list |
22:48:11 | disbot | ➥ Wasn't able to setup a Vulkan message callback with the current API ; snippet at 12https://play.nim-lang.org/#ix=2sOZ |
22:48:22 | zacts | I wonder how difficult it would be to add nim support to nvim as an extension language. |
22:49:25 | zacts | I wonder if nim would be a good fit for this |
22:49:41 | FromDiscord | <Zachary Carter> gotcha |
22:49:50 | zacts | people are extending their nvim configs with Lua instead of vimscript, but I'm wondering about an alternative to Lua for this. |
22:50:04 | FromDiscord | <Zachary Carter> well I was just thinking with a macro we can pattern match against the generated AST |
22:50:19 | FromDiscord | <Zachary Carter> so getting references to types and enums etc that we've already defined wouldn't be an issue |
22:50:31 | FromDiscord | <Zachary Carter> lmariscal: hopefully I can just have a PR ready to fix this soon |
22:51:22 | zacts | I'm wondering if Nim is more in the genre of languages like Lua, or if it's more in the genre of Rust, or maybe in-between those two. |
22:51:39 | disruptek | more like rust than lua. |
22:51:51 | zacts | Ok, cool. |
22:53:51 | lmariscal | @Zachary that would be great, but I if not possible I will come round to it eventually (hopefully sooner than later) |
22:55:26 | FromGitter | <singularperturbation> is it possible to override https://nim-lang.org/docs/system.html#default%2Ctypedesc for a new type? |
22:55:39 | FromGitter | <singularperturbation> Something like https://play.nim-lang.org/#ix=2sP1 ? |
22:58:36 | FromDiscord | <Elegant Beef> Doesnt defaultFoo get called? |
22:58:39 | FromDiscord | <Elegant Beef> your f is 3.0 |
22:58:46 | FromDiscord | <Elegant Beef> oh nvm i see the isssue |
22:58:53 | FromDiscord | <Elegant Beef> (edit) 'isssue' => 'issue' |
23:01:06 | * | krux02 joined #nim |
23:01:16 | zacts | cool |
23:01:42 | * | zacts quit (Quit: WeeChat 2.8) |
23:01:43 | * | vicfred joined #nim |
23:02:00 | FromDiscord | <Elegant Beef> Nim is a systems programming language so it's at the same level as C/C++/Rust, just to add onto what was said |
23:03:03 | FromDiscord | <Elegant Beef> (edit) 'Nim is a systems programming language so it's ... at' => 'Nim is a systems programming language so it'sused' |
23:04:47 | * | zacts joined #nim |
23:05:17 | FromDiscord | <Zachary Carter> lmarsical: got it working 🙂 I'll put together a PR this weekend - also I fixed an issue with the bindings and MotenVK on macos you're actually supposed to link to libvulkan.1.dylib (the vulkan loader) which then in turn loads MoltenVK |
23:05:25 | FromDiscord | <Zachary Carter> so I'll include that fix and a couple others in the PR |
23:07:58 | zacts | https://github.com/dom96/nimkernel <-- nice |
23:13:17 | * | maier joined #nim |
23:18:30 | * | maier quit (Ping timeout: 256 seconds) |
23:18:35 | * | dadada quit (Ping timeout: 240 seconds) |
23:19:46 | FromDiscord | <Disciple> sent a code paste, see https://play.nim-lang.org/#ix=2sP5 |
23:20:39 | * | dadada joined #nim |
23:21:03 | * | dadada is now known as Guest14718 |
23:46:59 | * | Senketsu quit (Read error: Connection reset by peer) |
23:53:33 | FromDiscord | <j$> is there a way to loop through the entries of a non ordinal enum? |
23:54:09 | disruptek | i think you mean an enum with holes, and the answer is `no`. |
23:54:26 | disruptek | generate the possible values at compile-time and put them in a compile-time var. |
23:54:58 | FromDiscord | <Elegant Beef> If you mean this, then yes↵https://play.nim-lang.org/#ix=2sP9 |
23:55:50 | FromDiscord | <j$> nope I mean this |
23:55:51 | FromDiscord | <j$> https://play.nim-lang.org/#ix=2sPa |
23:57:43 | FromDiscord | <j$> I feel like I would need a macro to get the values of an enum or am I overlooking something? |
23:58:08 | disruptek | yes. |
23:58:55 | disruptek | you're overlooking compile-time procs. |
23:59:17 | * | krux02_ joined #nim |