00:04:56 | * | rockcavera quit (Killed (adams.freenode.net (Nickname regained by services))) |
00:04:57 | * | rockcavera joined #nim |
00:32:48 | FromDiscord | <Technisha> What's the matrix channel for Nim? |
00:32:54 | * | Onionhammer quit (Quit: The Lounge - https://thelounge.chat) |
00:33:17 | * | Onionhammer joined #nim |
00:33:40 | * | xet7 joined #nim |
00:59:42 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
01:00:02 | * | njoseph joined #nim |
01:05:36 | leorize | @Technisha #freenode_#nim:matrix.org |
01:07:04 | FromDiscord | <Technisha> Thanks! |
01:07:42 | * | TechnishaCircuit joined #nim |
01:07:44 | TechnishaCircuit | Yeetus |
01:07:56 | FromDiscord | <Technisha> Oh look, it's me- |
01:08:01 | FromDiscord | <Technisha> Ew it says I'm using IRC |
01:09:14 | * | TechnishaCircuit is now known as Technisha[m] |
01:09:25 | Technisha[m] | Welp |
01:09:32 | Technisha[m] | It is what it is- |
01:10:27 | FromDiscord | <Technisha> Now it shows me using Matric? |
01:10:42 | Technisha[m] | Hm. |
01:14:52 | Technisha[m] | <FromDiscord "<Technisha> @yglukhov, could i h"> @yglukhov |
01:15:38 | Technisha[m] | This is the post btw: https://forum.nim-lang.org/t/7757 |
01:18:23 | FromDiscord | <Technisha> Oof Matrix fucking up |
01:19:57 | leorize | well you're technically talking to discord via irc :P |
01:20:34 | leorize | the discord bridge use the `[m]` in your irc nick as the differentiator for matrix vs irc |
01:22:33 | Technisha[m] | O |
01:22:51 | Technisha[m] | Wait does Matrix have IRC support natively? |
01:23:50 | Technisha[m] | If so that sucks |
01:24:03 | * | vicfred quit (Ping timeout: 260 seconds) |
01:28:47 | FromDiscord | <ElegantBeef> Why? |
01:28:48 | leorize | matrix has a good-enough irc bridge |
01:28:52 | leorize | and the bridge is native |
01:28:54 | leorize | to irc |
01:31:12 | FromDiscord | <ElegantBeef> Compatibility to irc is a good thing means if you used irc you dont need a second client 😛 |
01:33:06 | * | rockcavera quit (Remote host closed the connection) |
01:46:54 | FromDiscord | <Technisha> IRC just sucks- |
01:47:53 | lain | is there a way for a template accepting a string argument to use that argument as an identifier (e.g. for declaring a proc whose name is the contents of the string)? |
01:48:19 | lain | alternatively should I be accepting it as untyped and then making a string out of the identifier when I need it as a string? (if so, how do I do that :o ) |
01:48:33 | lain | ((or is this a job for macros)) |
01:48:51 | leorize | astToStr() |
01:49:14 | leorize | !eval echo astToStr(randomIdentHere) |
01:49:16 | NimBot | randomIdentHere |
01:49:27 | lain | leorize: awesome, thanks! |
01:49:29 | leorize | !eval echo astToStr(even + expression / works) |
01:49:31 | NimBot | even + expression / works |
01:49:44 | lain | :D |
01:53:19 | * | rockcavera joined #nim |
02:03:43 | lain | is it possible to pass parameter declarations to a template? like: someTemplate(id: uint32, mask: uint32) |
02:05:13 | lain | seems to confuse the parser, I'm getting "Error: type expected" on the line where I use the template |
02:06:42 | FromDiscord | <ElegantBeef> What are you trying to do? |
02:07:32 | lain | I want to declare a handful of things (a type, a var, and a proc) based on an identifier and a list of args for the proc |
02:07:48 | lain | it's always the same so a template or macro seems appropriate |
02:08:02 | * | Tanger joined #nim |
02:09:03 | FromDiscord | <ElegantBeef> Might have to use a macro, would be good to see a desired implementation |
03:29:25 | * | spiderstew joined #nim |
03:32:23 | * | spiderstew_ quit (Ping timeout: 260 seconds) |
03:44:36 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
03:56:50 | * | rockcavera quit (Remote host closed the connection) |
04:02:52 | * | motersen quit (Remote host closed the connection) |
04:03:09 | * | motersen joined #nim |
04:12:57 | FromDiscord | <Rika> In reply to @dom96 "you need to add": This makes me wonder why nimble doesn’t edit the nimble file when I do nimble install |
04:28:06 | FromDiscord | <Yardanico> In reply to @Rika "This makes me wonder": `nimble install` is context-independent, it doesn't behave differently based on which folder you're in |
04:28:19 | FromDiscord | <Rika> Yes I know but why would it be |
04:28:22 | FromDiscord | <Yardanico> why not? |
05:19:32 | * | narimiran joined #nim |
05:21:00 | * | haxscramper joined #nim |
05:34:41 | FromDiscord | <Yardanico> https://www.reddit.com/r/ProgrammingLanguages/comments/mm9j4k/closures_in_llvm/ nim mentioned in a top comment (on how to implement closures) :) |
05:34:45 | FromDiscord | <Yardanico> with the link to https://nim-lang.org/docs/intern.html#code-generation-for-closures |
05:36:07 | FromDiscord | <Yardanico> although seems like this is quite a standard way of making closures |
06:17:57 | * | teal joined #nim |
06:39:28 | * | teal quit (Quit: WeeChat 3.1) |
06:39:38 | leorize | Yardanico: because the alternative way works better :) literally every "just works" package manager does it |
06:40:23 | FromDiscord | <Yardanico> really? pip and other similar package managers don't write the package to the requirements file in the dir if you do "pm install package", no? |
06:40:42 | leorize | well npm, cargo, go does |
06:40:49 | leorize | and they are very, very successful |
06:41:45 | leorize | pip on the other hand is universally hated :) |
06:42:02 | leorize | the chances of pip f-ing up your python installation is higher than it should be |
06:42:13 | leorize | even using virtualenv is kinda a requirement if you want to stay sane |
06:42:30 | FromDiscord | <Yardanico> i mean sure, it can be good behaviour, but only after we get nimble lockfiles :) |
06:45:01 | leorize | as of currently this mythical nimble lock file never manifested |
06:46:33 | leorize | frankly I have little faith on any development related to nimble given the project's negligence on it |
06:47:42 | FromDiscord | <Yardanico> there are commits for lockfile support though |
06:47:57 | FromDiscord | <Yardanico> https://github.com/bobeff/nimble/tree/feature/lock-file and https://github.com/bobeff/nim/tree/feature/nimble-lockfile-support |
06:50:19 | * | PMunch joined #nim |
06:52:30 | leorize[m] | hopefully this will turn nimble into something that can be fully trusted |
06:57:50 | FromDiscord | <mrotaru> most people would probably expect the package manager to put installed packages in the current project, and update whatever mechanism there is for keeping track of project deps |
06:58:48 | FromDiscord | <mrotaru> even after reading the docs it was still a bit unclear to me that `nimble` does things quite a bit differently |
06:59:03 | FromDiscord | <haxscramper> You can put `requires` and then do nimble build/test/run etc. and it will install package |
06:59:23 | FromDiscord | <haxscramper> Though it is a bit backwards |
06:59:23 | FromDiscord | <Rika> also `nimble install` |
06:59:46 | FromDiscord | <haxscramper> nimble `install` should install. not `add-dep` |
06:59:51 | FromDiscord | <Rika> adding a requires then a bare nimble install will install the package you're developing (so --depsonly) |
07:00:13 | FromDiscord | <ElegantBeef> I do think `nimble find-deps` would be a nice addon and i think dom said "it wouldnt be too hard to implement" |
07:00:29 | * | fredrikhr joined #nim |
07:01:35 | FromDiscord | <Yardanico> In reply to @ElegantBeef "I do think `nimble": hmm, what should this do? find all nimble packages imported in the current project and add them to the requires? |
07:02:43 | FromDiscord | <mrotaru> maybe a cli switch for `nimble install` ? so `nimble install fsevents --local` will put package in current project, and also update the `.nimble` file |
07:03:09 | leorize | there's --localdeps for installing to the current project |
07:03:18 | leorize | updating the .nimble doesn't exist though |
07:03:34 | FromDiscord | <ElegantBeef> Yea yardanico |
07:04:09 | FromDiscord | <Yardanico> In reply to @ElegantBeef "Yea yardanico": I don't think this is that easy |
07:04:13 | FromDiscord | <Yardanico> it depends on how you implement it of course |
07:04:33 | FromDiscord | <ElegantBeef> Well that's what dom said iirc, dont look at me |
07:04:41 | FromDiscord | <Yardanico> looks at ElegantBeef |
07:05:52 | FromDiscord | <mrotaru> `-l, --localdeps Run in project local dependency mode` - that's a bit opaque |
07:06:17 | leorize | it is as vague as how well supported that feature is :) |
07:06:30 | FromDiscord | <mrotaru> makes sense 😄 |
07:06:46 | leorize | you have to read into nimble manual to figure out how you are supposed to use it |
07:07:06 | leorize | there is a mode where it's just scoped to you and a vendored mode iirc |
07:07:36 | FromDiscord | <mrotaru> i get the impression i'd be saving myself some headaches if i just manually downloaded the packages 😄 |
07:09:02 | leorize | someone wrote a nim package manager on that concept |
07:09:37 | leorize | it worked well but was never adopted and probably doesn't work now :P |
07:11:15 | FromDiscord | <mrotaru> i don't that would scale though; manually keeping track of deps for deps would be a pain |
07:11:45 | FromDiscord | <mrotaru> nimble ain't that bad but docs could be improved |
07:12:04 | leorize[m] | https://github.com/disruptek/nimph <- you can try playing with it if you have time |
07:13:28 | FromDiscord | <mrotaru> too early for that, i barely know the language |
07:15:05 | * | l1x joined #nim |
07:15:21 | Clonkk[m] | <leorize "@Clonkk @zetashift fixed that bu"> Will try ! Thanks |
07:19:28 | Clonkk[m] | It seems to work |
07:24:56 | PMunch | Hmm, I've been doing some stuff in F# recently. Really starting to like the static types we enjoy in Nim after that.. |
07:27:57 | * | leorize quit (Ping timeout: 240 seconds) |
07:38:18 | FromDiscord | <flywind> yet another arc +{.global.} issue https://github.com/nim-lang/Nim/issues/16823 |
07:39:24 | * | leorize joined #nim |
07:50:53 | * | Vladar joined #nim |
08:24:03 | FromDiscord | <arnetheduck> we use git submodules + make instead of trying to deal with all nimble issues - there are lock files being developed for nimble which is sort of a minimum standard for any PM to be usable |
08:24:45 | * | leorize quit (Ping timeout: 240 seconds) |
08:24:55 | FromDiscord | <arnetheduck> https://github.com/status-im/nimbus-build-system/ - it's not pretty but it does get the job done to create reliable builds |
08:39:54 | * | Tanger quit (Remote host closed the connection) |
08:47:53 | * | haxscramper quit (Ping timeout: 260 seconds) |
09:00:07 | * | rwiser[m] quit (Quit: Idle for 30+ days) |
09:00:16 | * | tane_ joined #nim |
09:02:21 | FromDiscord | <zetashift> In reply to @PMunch "Hmm, I've been doing": Static types? |
09:02:46 | FromDiscord | <zetashift> Also is https://nimble.directory/ down for anybody else? |
09:04:25 | * | leorize joined #nim |
09:07:02 | FromDiscord | <Yardanico> ping @federico3 |
09:07:10 | FromDiscord | <Yardanico> In reply to @zetashift "Also is https://nimble.directory/ down": yep |
09:07:16 | FromDiscord | <willyboar> Yes me too |
09:07:54 | FromDiscord | <ElegantBeef> Zeta i believe pmunch means things like `type Thing[I: static int] = object` |
09:08:11 | FromDiscord | <ElegantBeef> Or the actual static typing that F# doesnt have D: |
09:10:35 | FromDiscord | <zetashift> Huh? F# has "static typechecking", right? It does not have the `static T` thing, but tbh that sometimes works for me and sometimes doesn't haha |
09:10:54 | FromDiscord | <ElegantBeef> It's functional so most things are just implied afaik |
09:11:05 | FromDiscord | <ElegantBeef> I've never wrote any so i'm just assuming |
09:11:32 | FromDiscord | <zetashift> It has typechecking, but a lot of types can be inferred, so they are rarely written. It uses https://en.wikipedia.org/wiki/Hindley%E2%80%93Milner_type_system |
09:11:48 | FromDiscord | <zetashift> But when dealing with lots of OO stuff from C# you have to annotate yeah |
09:23:03 | * | lritter joined #nim |
09:30:03 | PMunch | Oh I meant the explicit types |
09:30:38 | PMunch | One thing returns the wrong type now suddenly it composes together with 10 other things and you've got a type error somewhere but no idea where it came from |
09:31:29 | * | johannes_ joined #nim |
09:31:34 | * | johannes_ is now known as kenran |
09:48:12 | FromDiscord | <zetashift> Ah yeah that's messed up |
09:48:23 | FromDiscord | <zetashift> Errors not helpful? |
09:50:28 | PMunch | Well it might just be me not used to reading them |
09:50:58 | PMunch | But I seem to change something in one place and receive an error in a completely different place |
09:53:32 | FromDiscord | <zetashift> There is an F# Slack that's always been helpful to me, they know a lot. Also narimiran might have some tips too |
09:53:52 | PMunch | I've been asking in the ##fsharp IRC channel, but it's not very active |
09:54:11 | * | krux02 joined #nim |
09:54:50 | PMunch | I mean its not so bad that I can't figure it out |
09:57:14 | narimiran | heh, i haven't used F# in quite a while.... |
09:57:24 | FromDiscord | <zetashift> The slack is more active...but yeah that requires Slack. |
09:57:58 | FromDiscord | <zetashift> In reply to @narimiran "heh, i haven't used": Nimming it all the way up |
09:58:06 | narimiran | yep :) |
10:02:02 | FromDiscord | <patasuss> Did the 'assertions' module get moved/deleted? Or where do I get a 'assert' from now? https://play.nim-lang.org/#ix=2Vno |
10:03:24 | PMunch | !eval assert(1 != 1) |
10:03:27 | NimBot | /usercode/in.nim(1) in↵/playground/nim/lib/system/assertions.nim(30) failedAssertImpl↵/playground/nim/lib/system/assertions.nim(23) raiseAssert↵/playground/nim/lib/system/fatal.nim(49) sysFatal↵Error: unhandled exception: /usercode/in.nim(1, 7) `1 != 1` [AssertionDefect] |
10:03:31 | * | m4r35n357 quit (Ping timeout: 248 seconds) |
10:03:47 | PMunch | Assertions are built in, where they ever their own module? |
10:04:23 | * | m4r35n357 joined #nim |
10:05:40 | FromDiscord | <patasuss> oh weird, there is https://nim-lang.org/docs/assertions.html |
10:06:31 | FromDiscord | <patasuss> Googling "nim assert" brings up that page. |
10:06:51 | FromDiscord | <Yardanico> In reply to @patasuss "oh weird, there is": it's always imported |
10:07:01 | FromDiscord | <Yardanico> In reply to @PMunch "Assertions are built in,": some parts of system are split up into modules |
10:08:14 | FromDiscord | <flywind> see https://nim-lang.github.io/Nim/assertions.html |
10:08:19 | FromDiscord | <flywind> docs imporved |
10:08:29 | FromDiscord | <flywind> > This module is reexported by system and thus does not need to be imported directly (with system/assertions). |
10:09:15 | FromDiscord | <flywind> !eval import system/assertions; assert(1 != 1) |
10:09:17 | NimBot | /usercode/in.nim(1) in↵/playground/nim/lib/system/assertions.nim(30) failedAssertImpl↵/playground/nim/lib/system/assertions.nim(23) raiseAssert↵/playground/nim/lib/system/fatal.nim(49) sysFatal↵Error: unhandled exception: /usercode/in.nim(1, 33) `1 != 1` [AssertionDefect] |
10:11:52 | FromDiscord | <patasuss> any reason why there are two versions of the documentation? Why don't both URLs point to the same resource? |
10:13:16 | FromDiscord | <flywind> devel docs are latest docs built from the Nim devel branch(night version). Rebuilt on every commit. stable docs are built from every release version(stable version). |
10:13:35 | FromDiscord | <flywind> https://nim-lang.org/documentation.html |
10:13:55 | FromDiscord | <flywind> see Bleeding Edge Docs on that page |
10:19:36 | FromDiscord | <flywind> though we need a better navigation https://github.com/nim-lang/Nim/issues/10744 |
10:24:52 | federico3 | @Yardanico: fixed, thanks for the ping |
10:51:34 | FromGitter | <ynfle> @patasuss, https://nim-lang.github.io/Nim is the docs built from `devel` branch and https://nim-lang.org/docs are the previous released stable version |
10:54:32 | FromDiscord | <patasuss> flywind already answered that, but thanks |
11:12:35 | FromDiscord | <Charlotte> :p |
11:35:49 | * | kenran quit (Quit: leaving) |
11:41:54 | FromDiscord | <madman> hey can someone help me with this |
11:41:55 | FromDiscord | <madman> https://play.nim-lang.org/#ix=2VnW |
11:44:40 | FromDiscord | <Yardanico> you should use codegenDecl |
11:45:24 | FromDiscord | <Yardanico> but there's another problem - nim's own rules for exporting/importing can contradict with this KINC_FUNC macro |
11:45:59 | FromDiscord | <madman> yeah i some error that had to do with this:"`imp_nimLoadLibrary'" |
11:46:02 | FromDiscord | <Yardanico> ah, right, they wont with cdecl |
11:46:13 | FromDiscord | <Yardanico> In reply to @x19 "yeah i some error": something like |
11:46:37 | FromDiscord | <Yardanico> might work |
11:46:43 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2VnZ |
11:47:52 | FromDiscord | <Yardanico> also |
11:48:05 | FromDiscord | <Yardanico> the C macro has no effect if you're importing from a dll unless you also include the header |
11:48:44 | FromDiscord | <Yardanico> because you're importing the proc, not implementing it yourself |
11:48:58 | FromDiscord | <Yardanico> so you probably don't need this KINC_FUNC at all |
11:49:21 | FromDiscord | <madman> well i am importing the proc but it's failing |
11:49:28 | FromDiscord | <Yardanico> In reply to @x19 "well i am importing": define "failing" |
11:49:54 | FromDiscord | <Yardanico> but yeah, you don't need KINC_FUNC here, it's only needed in the actual implementation |
11:49:57 | FromDiscord | <madman> its weird. it doesnt crash when i step over the function call in debug mode, but it doesnt update the shaders with the correct data |
11:50:15 | FromDiscord | <madman> yes because i am importing the dll |
11:50:31 | FromDiscord | <Yardanico> In reply to @x19 "its weird. it doesnt": maybe the problem is something else? |
11:51:25 | FromDiscord | <madman> could be |
11:52:03 | FromDiscord | <Yardanico> without the code which doesn't work as intended it's really hard to guess :P |
11:52:44 | FromDiscord | <madman> hehe |
11:53:10 | FromDiscord | <madman> it was working but i updated the C lib and there was this new macro added |
11:53:50 | FromDiscord | <Yardanico> maybe something changed in behaviour of kinc itself? |
11:54:04 | FromDiscord | <Yardanico> that macro has nothing to do with importing the functions as we found out |
11:54:12 | FromDiscord | <madman> ok cool |
11:54:16 | FromDiscord | <madman> then i can rule that one out |
11:54:20 | FromDiscord | <madman> and look for other things |
11:54:23 | FromDiscord | <madman> thanks |
12:02:16 | FromDiscord | <zetashift> @madman are you binding Kinc? The haxe/C graphics lib? |
12:02:41 | FromDiscord | <madman> yes' |
12:02:47 | FromDiscord | <madman> u wanna work with me dude? |
12:03:31 | FromDiscord | <zetashift> I don't know C that well |
12:03:38 | FromDiscord | <madman> `c2nim --dynlib:"something/dll" file.h`↵i cant get c2nim to emit " for some reason it ignores them |
12:03:51 | FromDiscord | <zetashift> Did you try nimterop? |
12:04:00 | FromDiscord | <madman> no |
12:04:03 | FromDiscord | <madman> i got it to work |
12:04:07 | FromDiscord | <madman> but then i updated Kinc |
12:04:16 | FromDiscord | <madman> now im redoing the c2nim again |
12:04:32 | FromDiscord | <madman> i was able to use shaders and draw and triangle |
12:04:45 | FromDiscord | <madman> i never tried nimterop |
12:05:07 | FromDiscord | <madman> u dont need to know C at all with c2nim xD |
12:05:36 | FromDiscord | <zetashift> Oh pretty cool, got a repo, I'd like to try it out |
12:06:24 | FromDiscord | <Conifer> The online playground doesn’t support user input does it? |
12:07:13 | FromDiscord | <haxscramper> It doesn't, but nim is available at https://wandbox.org/ which has support for user input |
12:07:33 | FromDiscord | <haxscramper> And also supports `devel` compiler version |
12:08:00 | FromDiscord | <Conifer> Thanks |
12:14:52 | FromDiscord | <Yardanico> yeah wanbox is quite nice |
12:14:59 | FromDiscord | <Yardanico> they update devel every week or more often |
12:22:41 | * | rockcavera joined #nim |
12:22:50 | * | waleee-cl joined #nim |
12:23:10 | FromDiscord | <Conifer> Huh.↵Just tried to ran simple test on wandbox with user input but I’m getting error.↵↵Difficult to get it written as I’m at work so I thought I would play around with Nim |
12:23:51 | FromDiscord | <Conifer> Technically raiseEOF and Error: unhandled exception: EOF reached (EOFError) |
12:26:02 | FromDiscord | <Yardanico> what "simple test"? |
12:26:21 | FromDiscord | <Yardanico> if you require standard input, you have to provide it in "stdin" before running the code |
12:26:56 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/829693793208238080/unknown.png |
12:27:12 | FromDiscord | <Conifer> Ah. There we go. That I wasn’t aware I need on here |
12:27:33 | FromDiscord | <Conifer> Lowkey starting to feel like installing vsc on this piece of crap and keep it hidden |
12:42:22 | FromDiscord | <Conifer> In reply to @Yardanico "": Did exactly the same thing as you. Still got an error |
12:42:30 | FromDiscord | <Yardanico> what's your code though? |
12:42:58 | FromDiscord | <Conifer> I ran the same as the one on your screenshot |
12:43:09 | FromDiscord | <Yardanico> with nim HEAD ? |
12:43:25 | FromDiscord | <Conifer> Yeah |
12:43:30 | FromDiscord | <Yardanico> weird |
12:43:35 | FromDiscord | <Yardanico> can you show a screenshot? |
12:43:38 | FromDiscord | <Conifer> Tried 1.4.4 too |
12:43:54 | FromDiscord | <haxscramper> In reply to @Yardanico "can you show a": wandbox support code share |
12:44:07 | FromDiscord | <Yardanico> In reply to @haxscramper "wandbox support code share": the code is the same as they say |
12:44:07 | FromDiscord | <Conifer> I’m at work so don’t have discord on it |
12:44:15 | FromDiscord | <Yardanico> In reply to @Yoshiharu "I’m at work so": you can make a photo from the phone :) |
12:44:24 | FromDiscord | <Conifer> Yeah was going to say I will do that |
12:46:46 | FromDiscord | <Conifer> https://media.discordapp.net/attachments/371759389889003532/829698780680028180/image0.jpg https://media.discordapp.net/attachments/371759389889003532/829698781980786768/image1.jpg |
12:46:48 | FromDiscord | <Conifer> There we go. |
12:47:26 | FromDiscord | <Conifer> Oh wait. I think I might of... realised something |
12:47:29 | FromDiscord | <Conifer> Yeah |
12:47:37 | FromDiscord | <Conifer> Well trial and error boys... |
12:47:41 | FromDiscord | <Conifer> Trial and stupidity too |
12:47:55 | FromDiscord | <Conifer> Didn’t know I have to use the Stdin before running it |
12:48:01 | FromDiscord | <Yardanico> I said that to you :) |
12:48:02 | FromDiscord | <Conifer> Or rather “write in it” |
12:48:10 | FromDiscord | <Conifer> Must of missed it |
12:48:16 | FromDiscord | <Yardanico> In reply to @Yardanico "if you require standard": > you have to provide it in "stdin" before running the code |
12:49:21 | FromDiscord | <Conifer> Did miss it |
12:50:56 | FromDiscord | <madman> hey @Yardanico i fixed it.↵quick question. when binding stuff using c2nim, if i leave out some fields in the nim file, it fails to compile |
12:51:10 | FromDiscord | <madman> i mean it fails to use the proc correctly |
12:51:20 | FromDiscord | <Yardanico> can you show the part of the code and the full error? |
12:51:34 | FromDiscord | <madman> there is no real error |
12:51:43 | FromDiscord | <madman> the proc just doesnt fill the shader |
12:51:47 | FromDiscord | <madman> wanna go voice chat? |
12:51:53 | FromDiscord | <Yardanico> you will stream? |
12:51:55 | FromDiscord | <madman> yes |
12:52:02 | FromDiscord | <Yardanico> ok, sure |
12:52:17 | FromDiscord | <madman> cool |
13:28:21 | FromDiscord | <Charlotte> Does Nim have generators? |
13:28:59 | FromDiscord | <Yardanico> define "generators"? |
13:29:23 | Prestige | I think an iterator is what you want? |
13:30:59 | * | letto quit (Ping timeout: 248 seconds) |
13:31:35 | FromDiscord | <Charlotte> For asynchronous functions |
13:31:41 | FromDiscord | <Charlotte> It has asyncdispatch, right? |
13:33:16 | FromDiscord | <Charlotte> I'm just being dumb nvm me |
13:36:18 | * | letto joined #nim |
13:41:51 | * | letto quit (Ping timeout: 260 seconds) |
13:44:15 | * | letto joined #nim |
13:44:31 | * | rockcavera quit (Remote host closed the connection) |
13:50:43 | * | letto_ joined #nim |
13:50:47 | * | letto quit (Ping timeout: 268 seconds) |
13:53:44 | * | letto_ quit (Read error: Connection reset by peer) |
13:55:12 | * | letto_ joined #nim |
14:22:57 | * | narimiran quit (Ping timeout: 260 seconds) |
15:00:21 | * | leorize quit (Ping timeout: 240 seconds) |
15:03:57 | * | leorize joined #nim |
15:41:46 | FromDiscord | <Rozzamarine> Nobody asked me for URL randomizer in pure Nim, so I prototyped it without asking: https://gist.github.com/Guevara-chan/7d20b40001449a9d9694f62829a6f852↵Am I cool yet ? |
16:00:03 | FromDiscord | <ajusa> sent a code paste, see https://paste.rs/AVm |
16:00:42 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=2VoZ |
16:15:57 | ozzz | I unable to import monotimes |
16:16:31 | ozzz | import std/monotimes ... std/[os,monotimes] not work |
16:16:54 | leorize | what version of nim are you using? |
16:17:02 | * | couven92 joined #nim |
16:17:18 | ozzz | Nim Compiler Version 0.19.4 |
16:17:46 | ozzz | oh! sorry, seems it's VsCOde bug |
16:17:46 | leorize | that's very, very old |
16:18:06 | ozzz | leorize, that one in debian repo |
16:18:24 | leorize | if you enable backports you should get 1.4.2 I think |
16:18:37 | leorize | federico3 would know more about debian packaging of nim |
16:18:50 | ozzz | thanks for the info |
16:19:11 | leorize | yea, 1.0.4 is in buster-backports |
16:19:14 | federico3 | ozzz: I guess you are using Buster |
16:19:19 | ozzz | I can compile it manually |
16:19:25 | ozzz | federico3, right |
16:19:28 | leorize | if you want the latest then I'd recommend choosenim or manually compiling |
16:19:29 | federico3 | I could backport 1.4.2 actually |
16:19:32 | ozzz | buster, 10 |
16:19:41 | * | fredrikhr quit (Ping timeout: 240 seconds) |
16:20:18 | ozzz | thanks guys, I will switch to the newer version |
16:24:01 | federico3 | time to test the new laptop with a Nim build |
16:41:50 | FromDiscord | <haxscramper> I'm getting a weird error from this code https://play.nim-lang.org/#ix=2Vpb - "target cannot be assigned to". It happens as soon as I moved from just `var DoxVersionNumber` to `var | var seq` and added `when` check |
16:42:36 | FromDiscord | <haxscramper> How can this be fixed without splitting implementation into two different overloads? |
16:43:56 | * | couven92 is now known as fredrikhr |
16:45:46 | FromDiscord | <clyybber> @haxscramper `var (DoxVersionNumber | seq[DoxVersionNumber]);` |
16:46:48 | FromDiscord | <haxscramper> Yes, that worked, |
17:00:26 | * | fputs quit (Quit: WeeChat 3.1) |
17:01:50 | FromDiscord | <Chem> Is anyone by chance familiar with C/C++ interop in Nim?↵I'm trying to get a simple 20 line C `.dll` program ported to Nim and it's crashing the host program/not working ;..; |
17:02:25 | FromDiscord | <Chem> sent a code paste, see https://play.nim-lang.org/#ix=2Vpl |
17:02:53 | leorize | how is your nim code looking right now? |
17:03:23 | FromDiscord | <Chem> sent a code paste, see https://play.nim-lang.org/#ix=2Vpm |
17:04:56 | FromDiscord | <hugogranstrom> sent a code paste, see https://play.nim-lang.org/#ix=2Vpo |
17:06:16 | FromDiscord | <hugogranstrom> And one of the many lines in the error message pointed to this line: https://github.com/nim-lang/Nim/blob/8ccde68f132be4dba330eb6ec50f4679e564efac/lib/pure/asyncfile.nim#L150 |
17:06:39 | * | rockcavera joined #nim |
17:07:21 | FromDiscord | <hugogranstrom> But `DWORD` is a `unint32` and should be able to handle that now that I think about it: https://github.com/nim-lang/Nim/blob/8ccde68f132be4dba330eb6ec50f4679e564efac/tools/urldownloader.nim#L82 |
17:09:17 | FromDiscord | <hugogranstrom> Not sure where I'm going with this 🙃 I guess I should file a issue? |
17:11:37 | * | narimiran joined #nim |
17:14:02 | * | leorize quit (Remote host closed the connection) |
17:14:31 | * | leorize joined #nim |
17:14:44 | FromDiscord | <Chem> @hugogranstrom https://media.discordapp.net/attachments/371759389889003532/829766222186545171/unknown.png |
17:15:07 | FromDiscord | <Chem> Does Nim not just have a "make an HTTP request and pipe the response bytes as a binary stream to a file" method? |
17:15:25 | FromDiscord | <Chem> open a pipe to the download URL and set the pipe out to be an `fd` |
17:15:41 | FromDiscord | <hugogranstrom> In reply to @Chem "<@!454991120028663809>": Didn't know about that 🙂 But I should still be under that, right? |
17:15:55 | FromDiscord | <hugogranstrom> I may have found the culprit: https://github.com/nim-lang/Nim/blob/8ccde68f132be4dba330eb6ec50f4679e564efac/lib/windows/winlean.nim#L38 |
17:16:07 | FromDiscord | <hugogranstrom> It's defined as `DWORD = int32` on windows |
17:16:32 | FromDiscord | <Chem> Yeah, but I don't know that I would deem any sort of function that is meant to download files, that has a hard-set nonconfigurable limit as acceptable lol |
17:17:06 | FromDiscord | <Chem> files are just bytes, network connections are just streams, you should in theory be able to open a stream in which one end is the file download and then pipe it directly to a file descriptor as output |
17:17:41 | FromDiscord | <hugogranstrom> That's true 🤔 |
17:18:34 | FromDiscord | <Chem> Dunno if there's some Windows limitation about this or if pipes aren't a thing on Windows↵I use Windows now (unfortunately) but spent most of my life on Linux and so only really know how nix kernels works |
17:18:36 | FromDiscord | <Chem> (edit) "works" => "work" |
17:20:07 | FromDiscord | <Chem> (sockets are literally network file-descriptors) |
17:20:23 | FromDiscord | <hugogranstrom> Haha Windows is unpredictable as usual xD |
17:23:30 | FromDiscord | <Chem> sent a code paste, see https://play.nim-lang.org/#ix=2Vpt |
17:24:04 | ozzz | strange, I updated from backports nim compiler in debian, and now my code wont work |
17:24:16 | ozzz | I get segfaults :) |
17:26:01 | ozzz | btw koch not provided with pkg? |
17:27:54 | FromDiscord | <hugogranstrom> In reply to @Chem "Basically I'd imagine you'd": Yeah I guess so 🤔 haven't really done much networking before |
17:28:56 | FromDiscord | <Chem> Ah. Even if you have it's not really intuitive, this sort of notion of everything being mostly streams and file-descriptors is also a bit low-level unix centric |
17:29:35 | FromDiscord | <Chem> you can work with web/net stuff for a long time and never be exposed to the concept of streams/pipes and all this, and you don't really need it (most API's don't use streams) |
17:30:13 | FromDiscord | <Chem> but I think it's good background context/understanding. With the disclaimer that Windows might be completely different and none of this applies on Windows. |
17:30:26 | FromDiscord | <Chem> (edit) "but I think it's good background context/understanding. With the disclaimer that Windows might be completely different and ... none" added "maybe" |
17:31:49 | FromDiscord | <hugogranstrom> It's always nice to learn new thing 🙂 But preferably not when you're frustrated that it doesn't work 🤣 |
17:32:06 | FromDiscord | <Chem> "Concrete" file downloads to a physical file on disk = creation of a new file descriptor, opening that `fd` handle as a writeable stream, opening a connection to the file on the network through a socket (which is also a `fd`, just on the net), and then streaming the data into the local `fd` and closing the writeable stream. |
17:32:20 | FromDiscord | <Chem> that's what happens behind the scenes |
17:32:59 | FromDiscord | <Chem> also maybe you don't stream directly into the local file, maybe you're storing it in memory temporarily and then copying the data over to the `fd` afterwards, that works too |
17:34:36 | FromDiscord | <Chem> In reply to @hugogranstrom "It's always nice to": This is with the language's default HTTP client? |
17:34:55 | FromDiscord | <hugogranstrom> Yes, that correct |
17:36:04 | FromDiscord | <Chem> I would definitely file an issue if you can confirm it's not something weird on your end |
17:36:05 | FromDiscord | <hugogranstrom> In reply to @Chem ""Concrete" file downloads to": Interesting 🙂 TIL ↵Yeah when handling smaller files, storing them in memory works but when you get to this scale it can be a stretch |
17:36:44 | FromDiscord | <hugogranstrom> Mind trying to replicate it if you also have windows? It should be a small program |
17:36:46 | FromDiscord | <Chem> That would mean the Windows implementation can't download files over 4GB |
17:36:48 | FromDiscord | <Chem> Yeah sur |
17:36:49 | FromDiscord | <Chem> (edit) "sur" => "sure" |
17:36:56 | FromDiscord | <Chem> might just take a while to download because of the size |
17:37:50 | FromDiscord | <hugogranstrom> In reply to @Chem "That would mean the": Yeah that seems about right sadly |
17:37:57 | FromDiscord | <hugogranstrom> In reply to @Chem "Yeah sure": Nice, one minute |
17:38:42 | FromDiscord | <hugogranstrom> In reply to @Chem "might just take a": I'm spoiled with fiber since the autumn 🙃 |
17:42:53 | * | vicfred joined #nim |
17:44:55 | * | vicfred_ joined #nim |
17:46:57 | FromDiscord | <hugogranstrom> sent a code paste, see https://play.nim-lang.org/#ix=2Vpw |
17:47:11 | FromDiscord | <hugogranstrom> (edit) "https://play.nim-lang.org/#ix=2Vpw" => "https://play.nim-lang.org/#ix=2Vpx" |
17:47:41 | * | vicfred quit (Ping timeout: 240 seconds) |
17:47:57 | FromDiscord | <Chem> You on Windows 10 out of curiosity? |
17:48:16 | FromDiscord | <hugogranstrom> Yes |
17:51:51 | FromDiscord | <Chem> sent a code paste, see https://play.nim-lang.org/#ix=2VpA |
17:52:08 | FromDiscord | <Chem> (edit) "https://play.nim-lang.org/#ix=2VpA" => "https://play.nim-lang.org/#ix=2VpB" |
17:52:16 | FromDiscord | <hugogranstrom> I changed from Async to ordinary httpclient and it worked as well :/ |
17:52:37 | FromDiscord | <Chem> (edit) "https://play.nim-lang.org/#ix=2VpB" => "https://play.nim-lang.org/#ix=2VpE" |
17:52:47 | FromDiscord | <Chem> Win10 comes with `curl` now apparently |
17:53:05 | FromDiscord | <Chem> you can use the verbose/showprogress flag and pipe the output |
17:53:05 | FromDiscord | <hugogranstrom> In reply to @Chem "Win10 comes with `curl`": That's nice 😄 |
17:53:08 | FromDiscord | <Chem> if you wanna see progress |
17:53:12 | FromDiscord | <Chem> instead of re-implementing this yourself |
17:53:52 | FromDiscord | <Chem> `--progress-bar` |
17:56:20 | FromDiscord | <Chem> In reply to @hugogranstrom "I changed from Async": Would maybe file an issue anyways 🤔 Not really sure, dunno much about Nim or expected behavior/limitations |
17:56:44 | * | lkjasdf joined #nim |
17:57:27 | FromDiscord | <Chem> Would be grateful if anyone that's worked with porting C/C++ would be able to say if they see any obvious/glaring translation errors in this little snippet btw 🙏 |
17:57:42 | FromDiscord | <Chem> sent a code paste, see https://play.nim-lang.org/#ix=2Vpl |
17:57:54 | FromDiscord | <Chem> sent a code paste, see https://play.nim-lang.org/#ix=2VpH |
17:59:18 | FromDiscord | <hugogranstrom> @Chem Many thanks for helping me out 😄 ↵Yes I'll file an issue, one would expect async and ordinary to work the same. |
17:59:55 | FromDiscord | <hugogranstrom> In reply to @Chem "Would be grateful if": Do you have any reason to belive it has errors? Any error messages or such? |
18:00:50 | FromDiscord | <Chem> It gets loaded as an addon `.dll` by an external, closed-source Windows application and the Nim once causes the application to crash immediately upon loading it haha |
18:00:51 | * | vicfred_ quit (Quit: Leaving) |
18:01:08 | FromDiscord | <Chem> whereas the C one pops up a console message on the screen that says "Hello world" |
18:04:54 | FromDiscord | <hugogranstrom> In reply to @Chem "It gets loaded as": Hmm okay, I'm not fluent in C++ by any means but from my little experience I don't see any glaring errors :/ |
18:05:08 | FromDiscord | <hugogranstrom> But something with the function casting would be my guess |
18:05:58 | FromDiscord | <hugogranstrom> If Nim attaches more information to its functions than C++ does or something like that |
18:07:53 | FromDiscord | <hugogranstrom> In reply to @Chem "It gets loaded as": Have you looked at the generated Nim c++ code and compared? |
18:11:30 | FromDiscord | <Chem> Yeah I have, the generated Nim code even with `-d:danger` is essentially unreadable. Though it does look close enough to be honest |
18:12:19 | FromDiscord | <hugogranstrom> I don't think it's too chabby most of the time. But I think ordinary C++ is ugly as well 😛 |
18:12:30 | FromDiscord | <Chem> https://media.discordapp.net/attachments/371759389889003532/829780761879904286/mreaper_nim.nim.c |
18:13:34 | FromDiscord | <hugogranstrom> I take back my word 😱 |
18:14:19 | FromDiscord | <Chem> `nim c --cc:vcc --gc:orc --app:lib --noMain:on -d:danger --listcmd src/reaper_nim.nim` |
18:14:28 | FromDiscord | <Clonkk> In reply to @Chem "It gets loaded as": If you export Nim code to a dll I think you need a flag to not export the gc in your dll |
18:14:53 | FromDiscord | <Chem> Ahh the GC would mess with it? |
18:15:08 | FromDiscord | <Clonkk> Otherwise compiling Nim code into a dll that you call from C will be messy |
18:15:24 | FromDiscord | <Chem> Ah I was planning on having just Nim coded |
18:15:25 | FromDiscord | <Chem> (edit) "coded" => "code" |
18:15:40 | FromDiscord | <Chem> I only have the C code as the starting point for what works, trying to work backwards from that |
18:16:24 | FromDiscord | <Clonkk> Same thing. If you call Nim code from Nim using a dll you'll end up with weird gc issues |
18:16:42 | FromDiscord | <Chem> Ahh didn't know this |
18:17:01 | FromDiscord | <pranavbaburaj> I am new to nim and trying to run my first nim program . But, I get some errors. |
18:17:07 | FromDiscord | <Chem> > --gc:none. No memory management strategy nor a garbage collector. Allocated memory is simply never freed. You should use --gc:arc instead. |
18:17:45 | FromDiscord | <pranavbaburaj> sent a code paste, see https://play.nim-lang.org/#ix=2VpS |
18:18:03 | FromDiscord | <Clonkk> In reply to @Chem "> --gc:none. No memory": Give me a minute I'll find it out again |
18:18:12 | FromDiscord | <pranavbaburaj> sent a code paste, see https://paste.rs/WpJ |
18:19:15 | FromDiscord | <Chem> In reply to @SneakyBaguette "Give me a minute": I don't mind `gc:none` |
18:20:03 | FromDiscord | <Chem> I'm more just curious about getting the proper translation going, I think once I can do the first C struct + function pointers right, then I'll be able to translate most of the rest |
18:21:20 | FromDiscord | <Clonkk> https://nim-lang.org/docs/nimc.html#dll-generation |
18:21:53 | FromDiscord | <Clonkk> Its -d:useNimRtl |
18:21:55 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2VpT |
18:22:08 | FromDiscord | <Chem> > --embedsrc:on|off embeds the original source code as comments in the generated output↵This would probably be useful as well lol |
18:22:20 | FromDiscord | <Clonkk> In reply to @Chem "I'm more just curious": If it's simple code you can try c2nim and compare the result |
18:22:20 | FromDiscord | <haxscramper> In reply to @haxscramper "https://wandbox.org/permlink/6Z7te74WVUgnrGEv how d": It works perfectly fine for me on the playground, and even prints what is expected |
18:22:27 | FromDiscord | <Chem> In reply to @SneakyBaguette "Its -d:useNimRtl": 🤦♂️ |
18:22:39 | FromDiscord | <Chem> In reply to @SneakyBaguette "If it's simple code": Unfortunately, this is using the output of `c2nim` 😅 |
18:22:56 | FromDiscord | <Clonkk> Haha, well it looks correct |
18:24:12 | FromDiscord | <Clonkk> In reply to @Chem "🤦♂️": Read the docs carefully it's the nimRtl is tricky |
18:24:26 | FromDiscord | <Clonkk> It's not obvious at all |
18:25:16 | FromDiscord | <Chem> Oh wait no I'm an idiot -- `c2nim` actually changes based on whether you pass a `.c` or `.h` file |
18:25:27 | FromDiscord | <Chem> It'll convert function bodies as well if it's not a header |
18:25:57 | FromDiscord | <Chem> I just tried it as `.c` instead of the `.h` as it is in the source |
18:26:45 | FromDiscord | <Chem> https://media.discordapp.net/attachments/371759389889003532/829784344301404187/unknown.png |
18:27:03 | FromDiscord | <Chem> It just cant' translate this:↵`void (ShowConsoleMsg)(const char text) = rec->GetFunc("ShowConsoleMsg");` |
18:27:07 | FromDiscord | <Clonkk> Yeah c2nim can a lot of Things as long as the C code is straight forward |
18:27:19 | FromDiscord | <Chem> but I think `cast[ShowConsoleMsg](rec.GetFunc)` is right |
18:28:09 | FromDiscord | <Clonkk> In reply to @Chem "It just cant' translate": I don't see why not |
18:28:10 | FromDiscord | <Chem> Okey, I will add the `rtl` in there, I'm almost certain that's what it was -- thank you!! 🙏 |
18:28:45 | FromDiscord | <Chem> https://media.discordapp.net/attachments/371759389889003532/829784849144479794/unknown.png |
18:28:53 | FromDiscord | <Chem> Just a bug, I hit quite a few of them with `c2nim` so far haha |
18:29:09 | FromDiscord | <Chem> but it's much better than nothing |
18:29:14 | FromDiscord | <Clonkk> Don't forget to generate the nimrtl.dll |
18:29:28 | FromDiscord | <Clonkk> You can try nimterop if c2nim fails |
18:29:50 | FromDiscord | <Clonkk> it's on github it can translate C code into Nim as well |
18:30:05 | FromDiscord | <Chem> Did not know about that, let me try to run that really quick instead as well |
18:30:19 | FromDiscord | <Chem> I'm sure between that Nimterop thing and the inclusion of the rtl DLL that'll probably do it |
18:30:22 | FromDiscord | <Clonkk> https://github.com/Clonkk/duckdb_wrapper |
18:30:29 | FromDiscord | <Chem> (it's got to be the runtime lib DLL missing) |
18:30:32 | FromDiscord | <Clonkk> Here is an example on duckdb |
18:30:42 | FromDiscord | <Chem> Bless u fren🙏 |
18:30:58 | FromDiscord | <Chem> DuckDB is so cool |
18:31:30 | FromDiscord | <Clonkk> In reply to @Chem "(it's got to be": https://nim-lang.org/docs/nimc.html#dll-génération read more carefully 😋 |
18:32:55 | FromDiscord | <Chem> Can you script the build process with this `.nims` configuration file, to automatically have the flags? |
18:33:19 | FromDiscord | <Clonkk> You should be able to |
18:33:27 | FromDiscord | <Chem> Will google this, ty |
18:35:33 | FromGitter | <awr1> is there a define that identifies the nim reference compiler as opposed to say, nlvm? |
18:36:10 | FromGitter | <awr1> if not there should be a PR for this |
18:36:33 | FromDiscord | <Clonkk> You can use --cc:gcc,--cc:clang |
18:36:51 | FromDiscord | <Clonkk> So switch which C compiler gets invoked |
18:36:58 | FromDiscord | <Clonkk> Is that what you meant? |
18:37:01 | FromGitter | <awr1> eh that's not robust enough |
18:37:36 | FromGitter | <awr1> unless you were talking to Chem |
18:37:38 | FromDiscord | <Clonkk> Why? |
18:37:44 | m33[m] | hi guys, I'm nearly finished with my 1st program in nim 🙂 I made a nimble package and all. I don't quite get if publishing nimbles packages is encouraged for single use apps, or only for frameworks, libraries and reusable components...? |
18:37:57 | FromDiscord | <Clonkk> In reply to @awr1 "is there a define": I was answering to this |
18:38:24 | FromDiscord | <Clonkk> In reply to @awr1 "eh that's not robust": Who do you think it's not robust |
18:39:04 | FromDiscord | <Clonkk> (edit) "Who" => "Why" |
18:39:46 | FromGitter | <awr1> because nim reference compiler has enough potential variability to its backend. there's no one simple define that says "this is the 'bonafide original' nim compiler suite." nim compiler can produce JS, C, C++, you can change the C compiler to your own custom thing, etc. |
18:40:05 | FromDiscord | <Clonkk> In reply to @m33 "hi guys, I'm nearly": Meh I've published package that I probably am the only one to use so I'd say go ahead |
18:40:18 | FromDiscord | <Clonkk> There is no nimble police to stop you 😆 |
18:40:59 | FromGitter | <awr1> there is already a define (of sorts, not really a define but more of a magical directive) for `nimvm` |
18:42:03 | FromDiscord | <Clonkk> In reply to @awr1 "because nim reference compiler": Ah you mean inside Nim code? |
18:42:27 | m33[m] | <FromDiscord "<Clonkk> There is no nimble poli"> hum, what ? the nimble repository is not moderated ? |
18:42:31 | FromDiscord | <Clonkk> You can do when defined(cpp) for example |
18:43:20 | FromDiscord | <Clonkk> In reply to @m33 "<FromDiscord "<Clonkk> There is": In order to publish a package all you have to do is your package to the json package list and make a PR |
18:43:35 | FromDiscord | <Clonkk> All you're doing is adding a few lines to a json |
18:43:48 | m33[m] | <FromDiscord "<Clonkk> You can do when defined"> ok, a PR would be fine indeed |
18:44:19 | FromDiscord | <Clonkk> Nimble publish can do it fr you If you have a github token ready |
18:44:38 | FromGitter | <awr1> yes |
18:45:04 | FromGitter | <awr1> that might work, actually. basically i'm testing for emit pragma presence |
18:45:32 | FromDiscord | <Clonkk> When defined(js), when defined(gcc), when defined(clang) etc. should work I think |
18:46:43 | FromDiscord | <Clonkk> https://www.github.com/Clonkk/nimjl/tree/master/nimjl%2Fprivate%2Fbasetypes_helpers.nim |
18:46:59 | FromDiscord | <Clonkk> In reply to @awr1 "that might work, actually.": I do something like this in this file |
18:47:23 | m33[m] | <FromDiscord "<Clonkk> Nimble publish can do i"> oh, that would not work, my repos in on git.qoto.org. I have a github account of course but I try not to use it so often |
18:47:58 | FromDiscord | <haxscramper> Nimble can use non-github repositories |
18:48:15 | FromDiscord | <Clonkk> Where a function change definition on the C++ background because of const char /char being different in C VS C++ |
18:48:48 | FromDiscord | <Clonkk> In reply to @haxscramper "Nimble can use non-github": Yep. The github account is just to make the PR on the json package file |
19:04:19 | * | lritter quit (Ping timeout: 248 seconds) |
19:07:41 | * | vicfred joined #nim |
19:10:45 | ForumUpdaterBot | New thread by Japplegame: Interrupt vector table implementation trouble, see https://forum.nim-lang.org/t/7763 |
19:22:31 | FromDiscord | <Chem> sent a code paste, see https://play.nim-lang.org/#ix=2Vq7 |
19:22:46 | FromDiscord | <Chem> Is this meant to be run from somewhere special, it appears to be compiling `./lib/nimrtl.nim` but that's not a file I know of |
19:24:06 | FromDiscord | <Chem> Ah it looks like it's part of the Nim source code |
19:24:13 | FromDiscord | <Chem> so need to clone from github |
19:48:50 | FromDiscord | <Conifer> iirc can I just slap parseInt/parseFloat infront of the readLine proc when asking for input? |
20:03:15 | * | narimiran quit (Ping timeout: 268 seconds) |
20:04:32 | * | NimBot joined #nim |
20:07:00 | FromDiscord | <ajusa> just to make sure I don't reinvent the wheel, are there libpcap bindings for Nim? Not just parsing pcap files like https://github.com/PMunch/nim-pcap but bindings that allow me to call pcap_loop directly? |
20:14:39 | * | Vladar quit (Quit: Leaving) |
20:25:54 | * | blueberrypie6 joined #nim |
20:26:29 | * | MightyJoe joined #nim |
20:26:52 | * | clemens3 quit (Ping timeout: 268 seconds) |
20:26:53 | * | blueberrypie quit (Ping timeout: 268 seconds) |
20:26:53 | * | ddevault quit (Ping timeout: 268 seconds) |
20:26:53 | * | cyraxjoe quit (Ping timeout: 268 seconds) |
20:26:53 | * | blueberrypie6 is now known as blueberrypie |
20:27:04 | * | ddevault_ joined #nim |
20:28:40 | * | clemens3 joined #nim |
20:28:50 | * | ddevault_ is now known as ddevault |
20:59:18 | * | gpanders quit (Remote host closed the connection) |
21:04:24 | * | lkjasdf quit (Quit: WeeChat 3.0.1) |
21:04:48 | * | lkjasdf joined #nim |
21:29:49 | * | tane_ quit (Quit: Leaving) |
21:35:12 | ForumUpdaterBot | New post on r/nim by dullbananas: Are there any good examples with JavaScript FFI?, see https://reddit.com/r/nim/comments/mn236p/are_there_any_good_examples_with_javascript_ffi/ |
21:43:15 | ForumUpdaterBot | New post on r/nim by dullbananas: i switched, see https://reddit.com/r/nim/comments/mn2adg/i_switched/ |
21:45:57 | * | leorize quit (Ping timeout: 240 seconds) |
21:56:16 | * | gpanders joined #nim |
22:00:38 | * | gpanders quit (Remote host closed the connection) |
22:04:11 | * | shmorgle quit (Ping timeout: 240 seconds) |
22:08:32 | PMunch | Seems like there's an increase in people using Nim for embedded :) https://forum.nim-lang.org/t/7763 |
22:12:59 | FromDiscord | <inv> Hi, is it possible to have some static fields in object? |
22:17:09 | FromDiscord | <Hi02Hi> sent a code paste, see https://play.nim-lang.org/#ix=2Vre |
22:18:09 | PMunch | @Hi02Hi, yet that doesn't work in your example |
22:19:43 | PMunch | You can do this though: https://play.nim-lang.org/#ix=2Vrf |
22:20:30 | FromDiscord | <inv> holy ... |
22:20:42 | PMunch | Huh? |
22:22:35 | FromDiscord | <inv> the first time I see the syntax |
22:22:38 | FromDiscord | <Hi02Hi> should have checked before replying, sorry |
22:23:06 | PMunch | I used that quite extensively in my Arduboy experiments. Basically having a type that on runtime was just a pointer to an array, but which on compile-time also knew the dimensions and size of the buffer. This was used to create optimisations for the Arduino target |
22:23:31 | PMunch | It's just the generic syntax really, just tricked into keeping data for us :) |
22:27:00 | FromDiscord | <inv> How to write proc for it? https://play.nim-lang.org/#ix=2Vrg |
22:28:47 | * | hyiltiz quit (Ping timeout: 268 seconds) |
22:30:04 | FromDiscord | <inv> ok, probably better question: how to pass it from argument |
22:30:49 | FromDiscord | <inv> ... but I can pass it from generic 🙂 |
22:32:10 | * | hyiltiz joined #nim |
22:32:10 | * | hyiltiz quit (Changing host) |
22:32:10 | * | hyiltiz joined #nim |
22:32:46 | FromDiscord | <InventorMatt> something like this |
22:32:47 | FromDiscord | <InventorMatt> https://play.nim-lang.org/#ix=2Vri |
22:32:49 | PMunch | You can write a template I think to get around that |
22:33:13 | PMunch | Oh, or like that I guess .P |
22:41:00 | FromDiscord | <inv> And the next question: how to initialize set with custom range? https://play.nim-lang.org/#ix=2Vrk |
22:44:04 | FromDiscord | <ElegantBeef> `{1..10}` `{11..14,16..19,110}` |
22:44:29 | FromDiscord | <ElegantBeef> Oh that |
22:44:53 | FromDiscord | <inv> it is still ``0..65535`` |
22:46:19 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2Vrl |
22:46:24 | FromDiscord | <ElegantBeef> It's how i'd do it atleast |
22:46:34 | FromDiscord | <ElegantBeef> Hmm need a macro for this |
22:47:03 | FromDiscord | <inv> hm, quite complicate for autogeneration |
22:47:18 | FromDiscord | <ElegantBeef> Proceeds to make a macro to add to the devel `std/setutils` |
22:50:56 | FromDiscord | <inv> thx |
23:01:40 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2Vrt @inv |
23:01:57 | FromDiscord | <inv> thx |
23:02:09 | FromDiscord | <ElegantBeef> Now to make a PR and get told it's unneeded 😄 |
23:06:22 | FromDiscord | <InventorMatt> for the original problem an rfc may be needed as it should be able to figure out the proper range automatically in a scenario like that |
23:06:37 | FromDiscord | <ElegantBeef> I suppose |
23:07:34 | FromDiscord | <ElegantBeef> Very much seems like this is a odd work around but it benefits if you use distincts |
23:08:00 | FromDiscord | <ElegantBeef> Hmm |
23:08:11 | FromDiscord | <ElegantBeef> Probably not really needed in setutils.... hmmmm |
23:14:21 | FromDiscord | <inv> Another question: https://play.nim-lang.org/#ix=2Vry |
23:14:45 | FromDiscord | <inv> With the new syntax (for me) - how can I pass field from one type into another? |
23:15:35 | FromDiscord | <ElegantBeef> Fields cannot be set |
23:15:39 | FromDiscord | <ElegantBeef> Atleast those ones |
23:15:46 | FromDiscord | <ElegantBeef> Those are static and apart of the type description |
23:15:47 | FromDiscord | <inv> undeclared field: 'field1' for type initFoo.b:type |
23:16:01 | FromDiscord | <ElegantBeef> Oh wait |
23:16:03 | FromDiscord | <ElegantBeef> Never mind 😄 |
23:16:23 | FromDiscord | <inv> Trying: https://play.nim-lang.org/#ix=2Vrz |
23:17:06 | * | PMunch quit (Quit: leaving) |
23:18:24 | FromDiscord | <InventorMatt> this seems to get it to compile https://play.nim-lang.org/#ix=2VrA |
23:18:39 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2VrB or the explict generic https://play.nim-lang.org/#ix=2VrB |
23:18:44 | FromDiscord | <ElegantBeef> (edit) removed "https://play.nim-lang.org/#ix=2VrB" |
23:18:54 | * | jess joined #nim |
23:20:10 | FromDiscord | <inv> @InventorMatt, a bit strange , the only diff is in static for Bar which is static |
23:21:22 | FromDiscord | <inv> @ElegantBeef I was trying to replace F1 with static[int], but it did not work, but this one is fine - thx |
23:22:39 | FromDiscord | <InventorMatt> it is able to implicitly figure out the deafult parameters when you don't have the static there is my guess |
23:30:46 | * | krux02 quit (Remote host closed the connection) |
23:58:11 | * | lkjasdf quit (Ping timeout: 248 seconds) |