<< 28-04-2018 >>

00:03:33*noonien quit (Quit: Connection closed for inactivity)
00:04:17*endragor joined #nim
00:06:09leruOr, I could just look into the code without building something m(
00:09:13*endragor quit (Ping timeout: 268 seconds)
00:10:40codevance1Xd
00:15:49*jrbrt quit (Quit: jrbrt)
00:18:39*CodeVance joined #nim
00:19:38*codevance1 quit (Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org)
00:34:05leruDo I get it right: there is no trim function for strings?
00:34:56*darithorn joined #nim
00:36:47*vivus quit (Quit: Leaving)
00:36:57leorizeleru: you mean a function to strip trailing whitespace from string?
00:37:34leorizehttps://nim-lang.org/docs/strutils.html#strip,string,set[char]
00:37:34leruleorize, leading and trailing, yes
00:38:02leorizeleru: see the link above
00:38:22leruI see, thank you, leorize
00:40:08*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:46:17*CodeVance2 joined #nim
00:47:46*CodeVance quit (Ping timeout: 264 seconds)
00:53:43*Snircle joined #nim
00:59:21*leru quit (Ping timeout: 256 seconds)
01:04:03*endragor joined #nim
01:08:45*endragor quit (Ping timeout: 264 seconds)
01:28:18*gangstacat quit (Quit: Ĝis!)
01:28:34*sz0 quit (Quit: Connection closed for inactivity)
01:35:51shashlickleru: see docs from older versions like => https://nim-lang.org/0.17.0/manual.html
02:11:09*brainpro1 quit (Ping timeout: 264 seconds)
02:20:49*dddddd quit (Remote host closed the connection)
03:08:47*smt` quit (Read error: Connection reset by peer)
03:08:58*smt` joined #nim
03:27:04*athenot joined #nim
03:30:00*endragor joined #nim
03:30:22*athenot_ joined #nim
03:32:09*athenot quit (Ping timeout: 265 seconds)
04:12:44*rockcavera quit (Remote host closed the connection)
04:13:39*rockcavera joined #nim
04:17:17*CodeVance2 quit (Read error: Connection reset by peer)
04:19:17shashlickwhy doesn't this work? `echo log2(100000.0)` ==> 16.60964047443681, but `log2(100000.0) == 16.60964047443681` ==> false
04:28:50tersecThere seems to be a regression in the test suite -- in 0.18.0 released, tests/manyloc/argument_parser/ex_wget.nim builds fine, but in current git, it doesn't.
04:31:48tersecPresumably this could be straightforwardly bisected, but I've not done so.
04:33:21*Cthalupa quit (Ping timeout: 264 seconds)
04:33:51tersec(Or, maybe ex_wget.nim isn't valid Nim anymore.)
04:37:33*Cthalupa joined #nim
04:37:47tersecshashlick: in general, FP decimal representations aren't necessarily bit-exact in IEEE-754 terms. Do you have any particular reason to believe that invariant should hold?
04:38:36FromGitter<sherjilozair> Hi. I'm new to Nim. Any documentation on how to use finalizers?
04:39:21*athenot_ quit (Ping timeout: 240 seconds)
04:39:45tersectests/errmsgs/tproper_stacktrace2.nim also seems to have an exit code of 0 (rather than the expected exit code of 1) now, at least on amd64 Linux with git head.
04:42:52tersechttps://nim-lang.org/docs/manual.html#type-bound-operations-destructors ?
04:45:58FromGitter<sherjilozair> I thought destructors and finalizers are different. And that I should be using finalizers instead of destructors, since the latter is an experimental feature while former is not.
04:46:55FromGitter<sherjilozair> I want to wrap a C library with RAII semantics. So I want a way to be able to call the `destroy_` functions in C with guarantee. How can I do that?
04:47:29tersecAh, right, I'm not sure. They are in some languages, but I don't know Nim that well either, so I won't claim to know whether there are supposed to be distinct. I just knew destructors existed and "Be aware that destructors are not called for objects allocated with new. This may change in future versions of language, but for now the finalizer parameter to new has to be used." in the docs.
04:47:41tersecWhich conflates them.
04:48:15FromGitter<sherjilozair> Yeah, so I wanted docs of the new operator, and see an example of how it's used.
04:48:27FromGitter<sherjilozair> With the finalizer parameter, that is.
04:49:30tersecRight, so I don't know, and will defer to someone with actual knowledge to hopefully address this.
04:53:32*darithorn quit (Remote host closed the connection)
05:03:38leorizesherjilozair: they're currently experimental https://github.com/nim-lang/Nim/wiki/Destructors
05:36:35*xkapastel quit (Quit: Connection closed for inactivity)
06:10:45*sz0 joined #nim
06:25:49*Trustable joined #nim
06:39:43*miran joined #nim
06:46:40*r3d9u11 joined #nim
06:53:44*tiorock joined #nim
06:53:44*rockcavera quit (Killed (tolkien.freenode.net (Nickname regained by services)))
06:53:44*tiorock is now known as rockcavera
06:53:44*rockcavera quit (Changing host)
06:53:44*rockcavera joined #nim
06:54:30*tiorock joined #nim
06:58:09*rockcavera quit (Ping timeout: 248 seconds)
06:58:48*tiorock quit (Remote host closed the connection)
07:00:45*Trustable quit (Remote host closed the connection)
07:03:10shashlicksherjilozair: there's try/finally and a defer statement
07:03:55shashlickNot sure if it helps but worth checking
07:04:05shashlickhttps://nim-lang.org/docs/manual.html#exception-handling-defer-statement
07:06:00shashlickIs it possible to read a file and take a string from that file and then call that as a proc in a macro? Basically name isn't known at compile time
07:06:21*rockcavera joined #nim
07:07:16shashlicktersec: I'm not sure, basically the value printed by Nim for the float value isn't exactly the value for == to work
07:14:34FromGitter<Varriount> shashlick: It should be.
07:15:40*yglukhov joined #nim
07:20:09*rockcavera quit (Remote host closed the connection)
07:22:09*miran quit (Ping timeout: 248 seconds)
07:23:27*yglukhov quit (Remote host closed the connection)
07:23:58*yglukhov joined #nim
07:23:59Araqshashlick: you can macros.parseStmt()
07:24:49*r3d9u11 quit (Remote host closed the connection)
07:28:33*yglukhov quit (Ping timeout: 248 seconds)
07:30:34*yglukhov joined #nim
07:36:28*rockcavera joined #nim
07:42:21*r3d9u11 joined #nim
08:05:31*yglukhov quit (Remote host closed the connection)
08:06:07*yglukhov joined #nim
08:10:27*yglukhov quit (Ping timeout: 240 seconds)
08:18:21*sz0 quit (Quit: Connection closed for inactivity)
09:01:59*leru joined #nim
09:15:04FromGitter<Varriount> Araq, dom96: What is the "official" way to create a new project?
09:15:19*xet7 quit (Quit: Leaving)
09:15:31FromGitter<Varriount> Sorry, I mean, what is the "current" type of project configuration file standard?
09:22:37*SenasOzys quit (Remote host closed the connection)
09:23:53*SenasOzys joined #nim
09:25:14*yglukhov joined #nim
09:27:18leruI just tried the iterator example from https://nim-lang.org/docs/tut1.html#iterators
09:27:31leruCompiler says: Error: attempting to call undeclared routine: 'countup'
09:27:50def-leru: compiler version? works fine for me with current one
09:28:09def-countup is defined here: https://nim-lang.org/docs/system.html#countup.i,T,T,int
09:28:15lerudef-, Nim Compiler Version 0.18.1 [Linux: amd64]
09:29:08def-built from git I assume? Try updating to most recent one
09:29:18leruit might be defined there, but i actually wanted to use the iterator myself
09:29:29leruoh, alright. i try
09:33:43lerudef-, that didn't help
09:33:52def-so other programs compile fine?
09:35:02leruyes, everything was fine until i added the iterator example
09:35:36def-correct Nim binary in $PATH?
09:35:59def-I don't see what would be wrong with countup specifically
09:37:16lerunot countup specifically. it's the iterator statement itself. i wrote my own iterator function, or whatever you call it, and it didn't work either
09:37:29leruthe $PATH is alright
09:39:21*leorize quit (Ping timeout: 240 seconds)
09:40:54FromGitter<Varriount> leru: Could you post your file?
09:41:31leruit's pretty much this https://pastebin.com/uxtk0aAc
09:42:10def-well, it's an inline iterator
09:42:13def-can't use it that way
09:42:29def-I thought you were just trying to get the code from the tutorial working
09:43:06leruI thought, too
09:44:22def-Closure iterator seems to be what you want: https://nim-by-example.github.io/for_iterators/
09:44:35def-inline iterators get transformed into loops
09:45:25def-https://nim-lang.org/docs/manual.html#iterators-and-the-for-statement-first-class-iterators
09:47:04*yglukhov quit (Remote host closed the connection)
09:48:10*yglukhov joined #nim
09:52:33*yglukhov quit (Ping timeout: 255 seconds)
09:52:52leruI see. Thank you, def-!
09:57:33*codevance1 joined #nim
10:01:57*nsf joined #nim
10:40:19federico3https://github.com/nim-lang/nim-zmq/pull/8 any zmq user around?
10:44:57Araqfederico3: looks good to me, want me to merge it?
10:45:32federico3if you don't mind, yes please
10:45:55Araqvarriount: "nimble init"? register on appveyor/travis with a configuration inspired by Nim's
10:46:15Araqand ... yeah, that's a good start
10:50:31federico3Varriount: if you want something fancier, https://github.com/FedericoCeratto/nim_project_maker
10:54:17*r3d9u11 quit (Remote host closed the connection)
11:02:54*dddddd joined #nim
11:05:17codevance1Are most people awake now? Isnt everyone american?
11:09:10*leru_ joined #nim
11:11:29*leru quit (Ping timeout: 248 seconds)
11:13:02FromDiscord<claude> no
11:13:08FromGitter<GULPF> I think Nim has more users in europe
11:14:18*asdf__ joined #nim
11:14:27leru_I don't know, but I'm not american
11:22:14*brainpro1 joined #nim
11:22:26ehmryI'm muriccan, but I'm in europe
11:25:55*asdf__ quit (Ping timeout: 260 seconds)
11:28:14codevance1Ya ive realised that people are up at my daytime
11:32:35leru_Does Nim have a short way to initialize arrays instead of looping through?
11:35:33FromDiscord<claude> theres sequtils.fill
11:41:10leru_it's neither in the docs nor does my compiler know it
11:41:43FromDiscord<claude> oh i lied its algorithm.fill
11:41:44leru_module algorithm has it
11:41:48FromDiscord<claude> theres sequtils.newSeqWith though
11:42:31leru_There should be something similar for arrays
11:47:32def-previous discussion here: https://github.com/nim-lang/Nim/issues/2462
11:49:42FromGitter<data-man> @dom96 @shashlick: "nim -v" like this? #7714
11:52:23leru_I mean, if there is a newArrWith, why is there no newArrWith?
11:55:25leru_*if there is newSeqWith...
12:11:59*SenasOzys quit (Ping timeout: 256 seconds)
12:17:15FromDiscord<claude> template newArrayWith*(len: static[int], init: untyped): untyped =
12:17:15FromDiscord<claude> var result: array[len, type(init)]
12:17:15FromDiscord<claude> for i in 0 ..< len:
12:17:16FromDiscord<claude> result[i] = init
12:17:16FromDiscord<claude> result
12:19:45*PMunch joined #nim
12:19:56def-because there is sequtils, but not arrutils :D
12:22:53*SenasOzys joined #nim
12:23:48*SenasOzys quit (Remote host closed the connection)
12:26:48*flasheeprom joined #nim
12:26:54FromGitter<data-man> @mratsim: If you are interested, yet another image viewer for terminal (cross-platform): https://github.com/stolk/imcat
12:27:50FromGitter<data-man> Yes! :)
12:29:45flasheepromTrying to install gtk3 package gintro , got the message => 'cannot open 'gir'
12:30:09FromGitter<data-man> @mratsim: I compiled it with new version of stb_image (bugs-fixed).
12:35:00*r3d9u11 joined #nim
12:35:23*flasheeprom quit ()
12:36:20dom96flasheeprom: Can you gist the full nimble output?
12:38:36dom96claude: nice, but note that the name should be initArrayWith :)
12:38:44dom96(Since arrays are not allocated on the heap)
12:39:54*leru_ quit (Remote host closed the connection)
12:41:38*SenasOzys joined #nim
12:43:34*nsf quit (Quit: WeeChat 2.0.1)
12:49:11*miran joined #nim
13:02:21*r3d9u11 quit (Remote host closed the connection)
13:18:09*sz0 joined #nim
13:19:09*xkapastel joined #nim
13:33:21*Lord_Nightmare quit (Ping timeout: 248 seconds)
13:36:42*Lord_Nightmare joined #nim
13:37:09*endragor quit (Remote host closed the connection)
13:45:51*endragor joined #nim
13:50:21*endragor quit (Ping timeout: 240 seconds)
13:59:45*endes[m] joined #nim
14:04:52endes[m]hi
14:05:10FromGitter<zacharycarter> hi
14:06:12endes[m]I have this problem: I have a generic that is passed to a C function as a pointer and this function call a nim proc with this pointer. How I can cast the pointer to the original generic type??
14:11:41codevance1This might be wrong but nim does have cast endes
14:17:52endes[m]Yes but it doesnt works with generics or idk how to use it with generics
14:18:22Araqmygeneric[typeHere] # instantiate it
14:18:59Araqyou need to instantiate the generic so that it can be passed to the C function.
14:21:08FromGitter<data-man> Gitter's dark theme is cool! :)
14:21:13endes[m]The generic is actually intantiate, but the C function calls the nim proc with a pointer argument
14:21:33endes[m]And I need to cast the pointer to the generic type
14:21:49AraqC doesn't have generic types
14:23:28endes[m]The C function recive an adress of the generic
14:24:04endes[m]And It uses as a parameter for calling the nim proc
14:24:34miranhey Araq! when the new notNil behaviour for strings and seqs is fully implemented - can we expect v0.18.2?
14:27:49FromGitter<zacharycarter> dom96: did you by any chance have a moment to look at the PM I sent you via gitter?
14:28:16dom96zacharycarter: if you send me a PM on gitter you need to let me know, I rarely check it
14:29:02FromGitter<zacharycarter> well - I sent it late last night (my time) so no worries
14:29:14FromGitter<zacharycarter> that's kind of why I was asking - because I figured that was the situation :)
14:29:32FromGitter<zacharycarter> but if you have a chance to read over it at some point - I'd love some feedback as to whether or not you think it's an idea worth exploring further
14:30:35dom96zacharycarter: cool, thanks for the heads up, will read ASAP and reply
14:30:37FromGitter<data-man> Oh! @Araq I sent you the PM, too. :)
14:30:43FromGitter<zacharycarter> thank you kindly
14:30:46Araqmiran: no.
14:31:17Araqit would be 0.19
14:31:43Araqand I don't want an 0.19, that is not RC1
14:32:00miranyeah, 0.19 makes sense as it is quite large change....
14:32:30mirani would like to have this behaviour in the stable branch before i publish my beginners tutorial
14:33:21codevance1Miran what about using option?
14:33:25miranwill RC mean feature-freeze and focus on bugfixes?
14:33:26*gangstacat joined #nim
14:33:37*gangstacat quit (Remote host closed the connection)
14:34:06*gangstacat joined #nim
14:34:13mirancodevance1: the thing is, i don't want to introduce beginners to "you need to do `result = @[]`, but only for some more time, then you will not have to do it anymore"
14:34:39codevance1Miran, true
14:36:43*darithorn joined #nim
14:37:36FromGitter<xmonader> I understand nim prefers composition over inheritance, but i guess its ADTis bit weak to represent some structure or maybe i'm wrong
14:37:58FromGitter<xmonader> i've couple of ref objects (IntType, StrType, ListType) all inherit from BencodeType
14:38:46Araqyeah don't. the ADTs are good enough, usually it's wrapped in accessors anyway
14:38:55Araqwe don't use inheritance for json either.
14:38:56FromGitter<xmonader> and ListType object has underlying seq[BencodeType] and I want to call .encode on all of them .. i guess i need some how to type assert it?
14:39:10Araquse an ADT.
14:39:36FromGitter<xmonader> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae487a72d0e228d7bc08215]
14:40:00FromGitter<xmonader> this is my code do you mind giving me a hand to get it the nim way?
14:40:25FromGitter<zacharycarter> hrm
14:40:36FromGitter<zacharycarter> I mean - like the Nim way while still embracing OOP
14:40:39FromGitter<zacharycarter> or do you want idiomatic Nim?
14:41:06FromGitter<xmonader> first if i want to use type assert do `case of el` and match against the subclasses?
14:41:23FromGitter<xmonader> 2nd if i want to use adt which are enums right?
14:41:29Araqtold you to use a 'case object'
14:41:44miranbtw Araq, wasn't there some bug discovered not even one week after 0.18.0, and you wanted to release 0.18.2 ASAP? (yeah, i'm rooting for version bump :))
14:42:43FromGitter<zacharycarter> @xmonader - why don't you just use a generic here OR an object variant
14:43:04FromGitter<xmonader> @Araq is case object an enum ?
14:43:11Araqyou cannot use a generic here. it's runtime polymorphic.
14:43:36FromGitter<zacharycarter> oh I see what you mean
14:44:22FromGitter<xmonader> https://nim-lang.org/docs/manual.html#types-object-variants is this what yu guys call a case object?
14:44:46FromGitter<zacharycarter> no
14:44:54FromGitter<zacharycarter> err I don't know what a case objec tis
14:44:57FromGitter<zacharycarter> object is
14:45:07Araqxmonader: yes.
14:45:08FromGitter<zacharycarter> but I guess if I were to imagine one it would be akin to it
14:45:40Araqmiran: well too late.
14:45:47FromGitter<xmonader> I see thanks guys
14:48:07miranAraq: ok, can you then estimate how long until RC1? is it closer to a month, or 6 months?
14:49:22AraqI don't answer these questions anymore.
14:49:39Araqfor 6 years it's now "almost there"
14:50:37miranwell, then i'll bore you and dom96 some more about version bump while we wait for "almost there" to come :P :)
14:51:24dom96I don't see why we should wait for an RC
14:51:29dom96just release 0.19.0
14:53:00*miran literally nods his head
14:55:01codevance1V1 can come when its ready
14:55:10codevance1Theres no need to rush it
14:55:39FromGitter<xmonader> ```code paste, see link``` ⏎ ⏎ i get cannot instanitate table "got bencodekind, type bencodeType" expected A,B ⏎ ? any ideas? [https://gitter.im/nim-lang/Nim?at=5ae48b6b62316e05050c90b9]
14:56:00FromGitter<data-man> @Araq: Merge, please https://github.com/nim-lang/c2nim/pull/129
14:56:46Araqdata-man: oh, thanks. when the tests are green.
14:57:22dom96Ideally we should have regular releases
14:58:01codevance1Dom define targets then when reached release.
14:58:29dom96hrm?
14:58:52mirandom96: yeah, that would be nice, but i guess regular releases can also be the part of "post V1" plan :)
14:59:38codevance1Dom, what would the next regular release need
15:00:15miraneven if they are irregular - more frequent releases might be good for nim exposure (no, i don't mean new version every month)
15:01:00codevance1I think regular just means regular. Mostly planned for.
15:02:29*darithorn quit (Remote host closed the connection)
15:03:06dom96codevance1: It's not about what it would need. Regular means it would happen no matter what.
15:03:35codevance1Isnt that bad
15:04:02FromGitter<zacharycarter> I mean that's basically CD
15:04:06FromGitter<aboisvert> @xmonader in `Table[btString, BencodeType]`, `btString` is not a type
15:04:16codevance1What zachary said
15:04:19FromGitter<zacharycarter> which is a pretty widely adopted pattern in software dev these days
15:04:29FromGitter<aboisvert> (it's a value of type BencodeType)
15:04:32FromGitter<zacharycarter> CI/CD
15:05:02FromGitter<xmonader> @aboisvert but the only allowed types as keys for the table are the ones of string case
15:05:12FromGitter<xmonader> how can i describe that?
15:06:09*darithorn joined #nim
15:07:33FromGitter<zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae48e34dad6fb186ff79af1]
15:07:35FromGitter<aboisvert> @xmonader I'm not sure that can be expressed using Nim today
15:07:36FromGitter<zacharycarter> something like that maybe?
15:09:26FromGitter<xmonader> @zacharycarter I need to try maybe this works
15:09:37FromGitter<aboisvert> I think there's two parts here: 1) how you want to index the table, and 2) do you want the table's values (of type `BencodeType`) to be statically known to be of the `btString` variant
15:09:59FromGitter<aboisvert> I'm not sure #2 is possible
15:10:39FromGitter<xmonader> :(
15:12:00FromGitter<xmonader> @mratsim no the bencode doesn't always have to to have strings, it can be just 1 int or list of ints
15:12:36FromGitter<xmonader> the existence of string `bencodedString` is needed for 1- string values, 2- bencode dict keys
15:13:32FromGitter<aboisvert> It would be nice to be able to express, e.g. something like `BencodeType of [kind: btString]`
15:15:18AraqTable[string, BencodeType]
15:17:00FromGitter<xmonader> @Araq but then i won't have used the btString type i defined right?
15:17:17Araqwhy would you.
15:17:32Araqbtw JsonNode is already a thing in Nim.
15:18:14AraqI don't like bijections to JsonNode, JsonNode, it is a thing, use it.
15:18:21FromGitter<data-man> @Araq: Tests are green. :)
15:20:33FromGitter<xmonader> Ah I see, apparently haskell does it the same way ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Thank you [https://gitter.im/nim-lang/Nim?at=5ae4914162316e05050ca7b2]
15:20:52*smt_ joined #nim
15:24:57*smt` quit (Ping timeout: 264 seconds)
15:27:06*sz0 quit (Quit: Connection closed for inactivity)
15:33:09*rockcavera quit (Ping timeout: 256 seconds)
15:38:17*leru joined #nim
15:42:58FromGitter<xmonader> how can i forward declare a method? ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ encode complains that encode_s isn't defined ? [https://gitter.im/nim-lang/Nim?at=5ae496822b9dfdbc3adbcfd3]
15:43:39miranput just a header of `encode_s` at the top
15:43:51FromGitter<xmonader> even the question itself smells, I think there should be a better way do
15:44:07FromGitter<xmonader> @mratsim header including `method` keyword or without ?
15:44:38miranhttps://nim-lang.org/docs/tut1.html#procedures-forward-declarations
15:44:47*codevance1 quit (Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org)
15:45:39FromGitter<xmonader> @mratsim i searched in the manual couldn't find the mixin maybe it's another term?
15:47:03FromGitter<xmonader> forward declaration works my compiler is happy now
15:47:40FromGitter<xmonader> macros in nim is bit too much i guess for my case .. too many concepts i need to settle on subset of nim :D
15:48:05miran@mratsim - your messages are not forwarded to IRC!?!
15:48:19FromGitter<xmonader> I see maybe the encoder object is an overkill
15:48:49dom96huh, indeed. mratsim isn't being forwarded, that's odd.
15:48:58dom96oprypin ^^
15:49:15miran@mratsim - and also i haven't seen them in gitter until i refreshed the page :/
15:49:18oprypinwat
15:49:50narimiran[m]test 1 2
15:50:19miranok, matrix/riot works, it is not that. other people on gitter are visible
15:50:52FromGitter<mratsim> what about now?
15:50:57mirannow it works
15:51:14FromGitter<mratsim> okay, so I had a checkbox “use Gitter Next” that I deactivated
15:51:35*CodeVance joined #nim
15:51:53miranmistery solved :)
15:52:00FromGitter<mratsim> it’s strange because I certainly checked that like 3 weeks ago at least
15:52:10FromGitter<mratsim> the plot thickens actually :D
15:52:11dom96huh, what is "Gitter Next"/
15:52:14dom96*?
15:52:22FromGitter<mratsim> I don’t know :P
15:52:47oprypinmratsim, gitter's api never pushed your message so i dunno
15:53:15FromGitter<mratsim> it happened a couple of times this week so I think they broke their Gitter next backend
15:53:26oprypinif you can reproduce this problem, maybe you should report it to them
15:53:27FromGitter<mratsim> it’s their devel branch
15:53:54CodeVanceDoes nim have a "with" statement (for automatically closing open files/connections)
15:54:01FromGitter<mratsim> My last interaction with Gitter was so, so. They basically dismissed my issue until I put their nose into it.
15:54:03CodeVancelike in python
15:54:23FromGitter<mratsim> @CodeVance there is a thread in the forum with several solution
15:54:34CodeVancemratsim thanks :)
15:54:40FromGitter<mratsim> also check the “lock/guard” section of the manual
15:54:59FromGitter<mratsim> a template with body, and release works pretty good
15:55:02miranCodeVance: https://nim-lang.org/docs/tut2.html#templates see the example above 'macros'
15:57:04CodeVancemiran, can I help with the beginner tutorial writting?
15:57:32leruWhat is the current way to set up a http server? Module httpserver "will soon be deprecated in favour of the asyncdispatch", but asyncdispatch needs module sockets and sockets is deprecated...
15:57:39miranCodeVance: you can help with "beta-testing", once it is in beta stage :) (soon TM)
15:58:08miranafter beta-testing, there will be probably more things to write, add, improve, etc.
15:58:54miranthe best help currently would be to convince our BDFL to release new stable version soonish :)
15:58:58CodeVancemiran, I'm asking cause I wanted to do something similar, but you're already working on it. I'm not as experienced so I'm going to let you go first. and do some other things
15:59:51CodeVanceYa. maybe just move past that issue. write the tutorial then show him the parts that need stable
16:00:01FromGitter<mratsim> Does someone know how to solve this macro issue? https://gist.github.com/mratsim/df6d09745d18c391e73ada98525aaf1e. I’m extracting a subtype T from a Context[T] argument to build a Foo[T] but Nim “Cannot Instantiate, got <seq[int]> but expected <int>” I suppose I have to change something in getTypeInst
16:01:02miranCodeVance: my tutorial is 'almost finished' (or maybe it's better to say: almost ready for beta-testing), so it is better if we don't duplicate our work
16:01:34CodeVancemratsim, one is seq[int] the other Context[
16:01:35CodeVanceseq[int]]
16:02:13miranfew days ago we discussed here that what is (also) missing are "do X with nim" kinds of tutorial. maybe you can do something like that if you have experience in some interesting field?
16:02:33CodeVanceGame dev!
16:02:33FromGitter<mratsim> It’s not that, there is a subtype macro to extract the subtype of Context\[seq\[int\]\]
16:02:45miranCodeVance: do it!!
16:02:51CodeVanceBut I'm still struggeling with gamedev
16:03:14FromGitter<zacharycarter> well
16:03:17FromGitter<zacharycarter> I have thoughts on that one
16:03:19FromGitter<mratsim> do a pong in Nim :P
16:03:36FromGitter<zacharycarter> probably too many thoughts on it :P
16:04:05CodeVancemratsim I need to run your code. its obvious either the extraction or the genModel part you didn't implement the same as in genModelFromCtx
16:04:32CodeVancezachary. Pong is easy luckilu
16:05:09FromGitter<mratsim> As long as it’s not “Yet another Fibonacci” example
16:05:13FromGitter<zacharycarter> I think it's been well established that Nim can work really well for 2d games - and can even be used to build libraries or frameworks with the help of libs like SDL2 / GLFW3 and OpenGL etc
16:05:25CodeVanceI think i'd start with pure sdl/sdl2 first then do something else in nimgame2 (since nimgame2 is the most developed i think)
16:05:29FromGitter<zacharycarter> and if you want to do that - there is a lot of code floating around out there right now showing you different ways to do that
16:05:29FromGitter<mratsim> “well established” with who? ;)
16:05:39FromGitter<zacharycarter> well with our own community
16:05:54*leorize joined #nim
16:06:02FromGitter<mratsim> a newcomer wouldn’t know though
16:06:07FromGitter<zacharycarter> so yeah - a tutorial for the public would be great - and I think there is one out there on def-'s old blog
16:06:14CodeVanceI've done pong before Its pretty easy
16:06:21FromGitter<zacharycarter> but his blog isn't very active so it probably isn't attracting many newcomers
16:06:21*SenasOzys quit (Ping timeout: 240 seconds)
16:06:24miranCodeVance: pong is easy *for you* (or anyone with gamedev experience). for me, the logic is easy, but i have no idea how to make graphical part - i would love to have a tutorial on that!
16:06:46CodeVancemiran sometimes you speak latin as well
16:06:59lerumiran, ever tried SDL?
16:07:02FromGitter<mratsim> Expelliarmus
16:07:04CodeVanceaccronyms and field specific words
16:07:42miranleru: i have zero experience in graphical things. and 0.00001 experience in web-dev (i know there is html and css, that's about it)
16:08:00mirane.g.? :D :D :D
16:08:09CodeVancemratsim redefinition of 'ctxSubtype'
16:08:12miran(i really enjoy meta :) )
16:08:32CodeVancemratsim cannot instantiate Conv2DLayer
16:08:33CodeVancegot: <seq[int]>
16:08:33CodeVancebut expected: <T>
16:09:02FromGitter<mratsim> yes, so basically the type I extracted is not a real type
16:09:27FromGitter<mratsim> I think I have to transform the NimSym seq and NimSym int into NimIdent, I’m testing that
16:10:10FromGitter<mratsim> type + macros are a real pain >_>
16:12:14leruI think a great thing would be Love2d or LÖVE or whatever it is called now to be ported to Nim. It's a great Library for game development
16:12:23shashlickdata-man: I see the logic behind #7714
16:12:44FromGitter<zacharycarter> meh
16:12:52FromGitter<zacharycarter> I think Nim has enough 2d libs
16:13:02FromGitter<zacharycarter> if people want to help improve / maintain / take over their development
16:13:07*nsf joined #nim
16:13:31FromGitter<zacharycarter> I think Nim needs a banging 3d engine - but that's going to take researching and prototyping how to develop certain subsystems and integration patterns I think
16:13:31shashlickso macros.parseStmt() is the only way to convert a string into a proc?
16:13:44FromGitter<zacharycarter> and is going to require ditching SDL2 / GLFW3
16:13:55CodeVanceleru maybe :) at least some of the frontend
16:14:02FromGitter<zacharycarter> and either require a multi platform input handling / window lib or using like just that code from CSFML
16:14:10FromGitter<zacharycarter> and not relying on the threading code
16:14:14CodeVanceleru. I don't really see lua2nim anywhere
16:14:20FromGitter<zacharycarter> even that is suboptimal because tmk CSFML uses STL allocators / collections
16:14:24shashlickdata-man: good to see PRs into c2nim
16:16:28miranCodeVance: someone mentioned 'NiGui' on reddit as awesome GUI library. if you can do pong tutorial in NiGui (or some other popular nim graphical library), and after that maybe tetris - i would be very interested in that (and i'm sure i wouldn't be the only one)
16:16:30FromGitter<mratsim> @CodeVance, solved my issue: I indeed had to replace the NimSym by NimIdent: https://gist.github.com/mratsim/df6d09745d18c391e73ada98525aaf1e#file-solution-nim
16:17:16CodeVancemiran nigui mighy be able to do it. plus its light. I'll check
16:17:23FromGitter<zacharycarter> I have a tetris example in zengine
16:17:25FromGitter<zacharycarter> :/
16:17:37FromGitter<zacharycarter> krux has one in opengl sandbox
16:17:40CodeVancezachary :)
16:17:45miraneven folks who are very experienced in that field and are working with other languages might be interested to see how to do the same things in nim (much more simply :))
16:18:44CodeVanceYa the thing about nigui is that for every feature he includes he adds a demo XD
16:18:58FromGitter<zacharycarter> nigui isn't a game library though
16:19:01FromGitter<zacharycarter> it's a gui library
16:19:04CodeVanceSo its easy to check it out for how things are done
16:19:07Araqshashlick: yes
16:19:13CodeVancenigui, for pong its the same
16:19:22CodeVanceif you don't actually use graphics
16:19:46FromGitter<zacharycarter> meh - I don't know - I don't get it but maybe you guys are thinking of a use case I'm not
16:19:54CodeVanceOr you could just do a boring gui tut XD
16:19:57FromGitter<zacharycarter> I've just never used a gui framework to render graphics for a game
16:21:00CodeVanceok lets examine. I think we should do sdl in nim first. Since that includes the mainloop and all that already
16:21:14CodeVancethat's hidden away with a gui lib
16:21:41FromGitter<zacharycarter> sdl2 does a LOT
16:22:25*yglukhov joined #nim
16:23:45FromGitter<zacharycarter> https://hookrace.net/blog/writing-a-2d-platform-game-in-nim-with-sdl2/
16:23:51FromGitter<zacharycarter> exists as well
16:24:17leruI used SDL with C and C++, but I quit it when I found out about love2d. Way easier to get things done. It does SDL and audio and networking and what not
16:24:20FromGitter<zacharycarter> could be easily adapted to pong or whatever kind of tut you'd like
16:24:41FromGitter<zacharycarter> yes - but we have projects in the community that are akin to love2d already
16:24:45FromGitter<zacharycarter> we really don't need a port of another one
16:24:54FromGitter<zacharycarter> no matter how fantastic love2d is
16:25:00CodeVancezachary sdl2 does the usual doesn't it?
16:25:10FromGitter<zacharycarter> I don't know what the usual is :P
16:25:22CodeVanceI don't actually care about platform stuff. I just want my input true/false
16:25:26FromGitter<zacharycarter> I also don't know what "doing sdl is"
16:26:00FromGitter<zacharycarter> I mean if you want a game engine and just to write gameplay code with Nim
16:26:02FromGitter<zacharycarter> I'd go use godot
16:26:04FromGitter<zacharycarter> that option is already there
16:26:05CodeVancelove2d is just another 'flavour' If it actually has some strengths then its fine. But I'd have to rexamine it
16:26:21FromGitter<zacharycarter> as much as I don't love godot or even like it really - if your goal is just to write gameplay code with nim on top of an engine
16:26:23FromGitter<zacharycarter> you can already do that
16:26:46*yglukhov quit (Ping timeout: 264 seconds)
16:26:47CodeVanceI wouldn't make pong in godot XD
16:26:52miranre: "nigui isn't a game library" - now you see how little to i know abot all that stuff ;)
16:27:06FromGitter<zacharycarter> why wouldn't you make pong in godot?
16:27:06miran*do
16:27:12FromGitter<zacharycarter> I think the godot docs even contain a pong tutorial
16:27:25CodeVanceI think nigui has already got a calculator example and a bunch of demos
16:27:32FromGitter<zacharycarter> again...
16:27:35FromGitter<zacharycarter> nigui is not a game framework
16:27:37*leru quit (Remote host closed the connection)
16:27:37CodeVanceand nimgame has two games and a bunch of demos
16:27:40FromGitter<zacharycarter> it's a cross platform gui framework
16:27:45FromGitter<zacharycarter> nimgame and nigui are not comparable
16:27:56FromGitter<zacharycarter> they don't even fall into the same problem domain
16:28:01CodeVanceminsweeper is a gui game :P
16:28:33shashlickThanks araq
16:28:59FromGitter<zacharycarter> if you just want to write a game and you don't care about using a renderer
16:29:02FromGitter<zacharycarter> then just go write a roguelike IMO
16:29:05FromGitter<zacharycarter> and use curses
16:29:27FromGitter<zacharycarter> I mean - if you really want to do something out there and build a game with a gui framework
16:29:28FromGitter<zacharycarter> more power to you
16:29:36FromGitter<zacharycarter> but I think you'll struggle mor ethan you're realizing
16:29:36CodeVanceI'd actually like to do that but your better with procedural than I cam
16:29:39FromGitter<zacharycarter> trying to build a game with nigui
16:30:00FromGitter<zacharycarter> I think if you want to build games with Nim - check out what's already out there
16:30:04FromGitter<zacharycarter> ask the authors who are still around questions
16:30:13FromGitter<zacharycarter> because many of us have already done exactly what you guys are describing
16:30:20FromGitter<zacharycarter> with Nim
16:30:50FromGitter<zacharycarter> except for the building a pong game with NiGUI
16:30:54FromGitter<zacharycarter> I don't think anyone has tried that yet
16:30:56FromGitter<zacharycarter> :P
16:31:03FromGitter<data-man> @shashlick: Which the logic? Thousands of projects don't use this way. It's not accidental, do not you think so?
16:31:19CodeVancezachary, I want to describe how a game works. which isn't something I can do with nimgame2. But I should contact them anyway
16:31:53miranif lots of stuff is already done/written/explained *somewhere*, can we at least have one place where all that will be linked to make it more visible to the rest of the world?
16:32:31FromGitter<zacharycarter> https://github.com/VPashkov/awesome-nim
16:32:32miranyou want X? look here, there and there. you want to do Y with Z? explained here
16:32:37FromGitter<zacharycarter> miran: all of that takes effort
16:32:52FromGitter<zacharycarter> some of our projects (mine for instance) aren't even well documented
16:33:30FromGitter<zacharycarter> I think people in the community are happy to do some level of hand holding and guidance
16:33:43FromGitter<zacharycarter> and even spend time writing and maintaining and documenting nim libs
16:34:04FromGitter<zacharycarter> but A) there has to be a cut off point for explaining how to do something to someone - that's what books and tutorials are for at the end of the day
16:34:25CodeVancemiran I think I understand what you mean. you want likes to resources. not pkgs
16:34:33FromGitter<zacharycarter> and B) without a lot of users or contributors - those goals are often difficult to achieve or not realistic or practical
16:36:39FromGitter<zacharycarter> game dev isn't simple
16:36:44shashlickdata-man: well, so it would be one nim file recompiled and a relink so I agree the cost to put in a unique date won't be too expensive
16:37:13FromGitter<zacharycarter> to treat it as such is naive - and it isn't difficult because game logic is hard to program - it's difficult because real time simulations are very difficult to run in the first place
16:37:34FromGitter<zacharycarter> and depending on what your goals are and what you want to achieve - the approach you take with your project will vary greatly
16:37:57FromGitter<zacharycarter> like - if you don't want to use the built in SDL2 renderer - then you're going to be writing OpenGL code or using GLFW3 or something
16:38:24FromGitter<zacharycarter> or maybe the SDL2 thread handling code causes issues for you with Nim's memory model and how you'd like to write your engine / game
16:39:18FromGitter<zacharycarter> like - if all you want to do is write gameplay code - then you need an already built engine or framework - and we have those already at our disposal - maybe they need some work or maintenance / love - but if no one is using them either - and you just port a new one over - I imagine it will eventually end up in the same state
16:40:07FromGitter<mratsim> I think that boils down to: find someone who likes Nim and likes to write, so that he can show some examples.
16:40:24FromGitter<zacharycarter> sure
16:40:38CodeVanceI want to help
16:40:45CodeVanceBut I don't know where to start
16:40:47FromGitter<zacharycarter> well - figure out what you want to do first exactly
16:40:59FromGitter<zacharycarter> you said you don't want to work on any platform stuff - you just want to write game logic
16:41:02shashlickso macro question -> how do you pass a string to a macro when the string is loaded from a file? so basically it is in a variable? static[string] doesn't work since it isn't known at compile time and other methods simply send the variable name rather than the contents
16:41:12CodeVancehttps://github.com/CodeVance/nim-links/blob/master/README.md mratsim. Add some links
16:41:30FromGitter<mratsim> @shashlick, if it was staticRed it might work
16:41:32CodeVanceor maybe this should be on the nim-wiki
16:41:33FromGitter<mratsim> read*
16:41:54FromGitter<zacharycarter> if that's the case - you need to do one of two things: eliminate the platform requirements - IE don't use a graphical renderer, etc... or you find a library / framework / engine that handles that stuff for you
16:42:33FromGitter<mratsim> @CodeVance, I think this is a nice small project for emulation, the code is quite short: https://github.com/mratsim/chirp8, and obviously def- nimes: https://github.com/def-/nimes
16:42:36FromGitter<zacharycarter> which one you use - will take some understanding of your goals / requirements and the features of the target you're looking at
16:42:41miranto get back to the start, we need "do X with nim" tutorials
16:42:49FromGitter<mratsim> +1
16:43:00FromGitter<zacharycarter> well someone needs to write them that has the time and desire and energy
16:43:21FromGitter<mratsim> I will definitely do some “Do neural networks with Nim”, maybe even “Do an unbeatable pong AI in Nim” :D
16:43:35shashlickmratsim: so the value has to be read within the macro - I cannot pass it to another?
16:43:42CodeVancemratsim. I think I'll try each project and write my thoughts on them :)
16:43:43FromGitter<zacharycarter> once I make a lib / framework / engine I don't want to re-write by the time i'm done with it - I'll write blog posts on how to use it
16:43:57FromGitter<zacharycarter> but that hasn't happened yet
16:44:15FromGitter<zacharycarter> although I could certainly write some guides on building roguelikes with Nim
16:44:18FromGitter<mratsim> @shashlick, to pass from macros to macros you have to use getAST.
16:44:24miranzachary: CodeVance seems like a man with time and energy
16:44:36FromGitter<zacharycarter> he does certainly :D
16:44:41CodeVanceonly time nothing else
16:44:48CodeVancenot even much time either XD
16:45:01FromGitter<zacharycarter> time should really be the universal currrency
16:45:02mirani'm writing general tutorial for beginners
16:45:03FromGitter<zacharycarter> I guess it already is
16:45:07FromGitter<zacharycarter> but uh anyways
16:45:38FromGitter<zacharycarter> playground is first on my todolist - then helping with the AWS sdk - then I'll hopefully get back to some nim / game stuff
16:45:42mirani could do "do basic linear algebra with nim" but that's not as interesing as X = {gamedev, graphical stuff, NN, etc.}
16:46:00FromGitter<xmonader> What's parallel fields iterator?
16:46:21*darithorn quit (Remote host closed the connection)
16:46:30FromGitter<xmonader> I get parallel fields iterator doesnt work for case objects when setting a value in a map ⏎ ⏎ ``` d[curKey] = obj``` [https://gitter.im/nim-lang/Nim?at=5ae4a565109bb043320f2d95]
16:46:58CodeVancemiran graphical stuff is sometimes boring. Cause its math times 3
16:47:01FromGitter<mratsim> https://forum.nim-lang.org/t/2774
16:47:24*darithorn joined #nim
16:47:25*gangstacat quit (Quit: Ĝis!)
16:47:34FromGitter<mratsim> @xmonader but I don’t know what parallel field iterator are, it sounds like a hyperspace engine from whatever Sci-Fi novel.
16:48:09Araqit means you need to define your own ==
16:49:04FromGitter<mratsim> inb4 “PR welcome"
16:49:08FromGitter<zacharycarter> 3d graphics is really just a bunch of linear algebra
16:49:12FromGitter<zacharycarter> you need to understand matricies
16:49:33FromGitter<zacharycarter> and it gets more advanced when you get into shaders and lighting models
16:50:07FromGitter<zacharycarter> but it doesn't require an innate knowledge of the math involved
16:50:09FromGitter<zacharycarter> it just helps
16:50:16*SenasOzys joined #nim
16:50:27FromGitter<xmonader> @Araq sorry but shouldn't case classes be unequal by default?
16:50:30FromGitter<mratsim> The linear algebra libraries are quite different though, in gamedev it seems like you often work with {x, y, z} coordinate tuple, but not in science
16:50:40FromGitter<zacharycarter> very true
16:51:29FromGitter<zacharycarter> you're primarily working with 2d / 3d vectors, matrices, and quaternions
16:51:47FromGitter<zacharycarter> because you're mostly just defining points in 3d space
16:51:59FromGitter<zacharycarter> and then performing linear algebra operations on them
16:52:52FromGitter<zacharycarter> well not linear algebra operations - but operations
16:53:13CodeVancemiran, those are emulators. They aren't nim coded games are they?
16:53:54*yglukhov joined #nim
16:54:31FromGitter<mratsim> @CodeVance, what I sent are emulators indeed
16:54:42FromGitter<mratsim> I think the best games to showcase are the one from Ludum Dare
16:54:56FromGitter<mratsim> @dom96 ^
16:55:36FromGitter<mratsim> there are other gameJam with people using Nim but I don’t have the links
16:56:09FromGitter<zacharycarter> CodeVance: I'd go check out - https://github.com/zacharycarter/zengine/tree/a9e30eb771553cb572af5df8c7ca89f6661e5e50 - which is a commit from before the wasm branch got merged into zengine - the code was much easier to read at this point because I hadn't introduced the whenDefined plague into my codebase yet. There's a tetris example and some other trivial stuff in there.
16:56:27FromGitter<zacharycarter> I'm not recommending you use zengine
16:56:35FromGitter<zacharycarter> but I tried to make / keep the code very clean and simple and readable
16:57:01CodeVancezachary I understand what you mean
16:58:21CodeVancezachary are you going to remove the ifDefined? perhaps the stable one should be stable ?
16:58:36CodeVanceor tag that specific commit
17:00:01*nsf quit (Quit: WeeChat 2.0.1)
17:00:21FromGitter<zacharycarter> zengine is dead at this point - I don't plan on making any more changes to that repo - I'll most likely end up archiving it once I have the next iteration of my engine design in flight
17:00:34*noonien joined #nim
17:00:36FromGitter<zacharycarter> which is going to focus primarily on 3d first and editor support
17:02:42FromGitter<zacharycarter> I don't have professional experience or really any experience doing what I do when I start out on one of these projects
17:03:10FromGitter<zacharycarter> I might know how to do certain things - but it's never the case where I've built the same thing or even relatively the same thing before
17:03:23FromGitter<zacharycarter> so it's always a learning experience and often leads to suboptimal solutions - but it gives me a place to start from next time around
17:03:39CodeVanceis frag wip?
17:03:56FromGitter<zacharycarter> frag was zengine's predecessor
17:03:58*Lord_Nightmare2 joined #nim
17:04:01FromGitter<zacharycarter> so no - it too is dead
17:04:24CodeVancewhat ? o_o
17:04:28FromGitter<xmonader> okay defining equality needed to define hash ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ and how do i hash a table? [https://gitter.im/nim-lang/Nim?at=5ae4a99cb01085166ccf19f9]
17:04:32CodeVanceoh I got confused then
17:04:43FromGitter<data-man> @zacharycarter: You very modest person! :)
17:05:05*Lord_Nightmare quit (Ping timeout: 248 seconds)
17:05:07*Lord_Nightmare2 is now known as Lord_Nightmare
17:05:21FromGitter<zacharycarter> :p
17:06:25FromGitter<data-man> Have you tried the NixOS?
17:06:41FromGitter<zacharycarter> not yet - I need to
17:08:48FromGitter<data-man> While I experimented with it, have saved up many useful links. If you need it, please contact me. :)
17:09:27FromGitter<zacharycarter> oooo thank you! I certainly will!
17:11:13FromGitter<data-man> Nix 2.0 finally can cache the list of packages. It pleases.
17:16:41*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
17:16:57ehmrydoes nixpkgs have nimble packages now?
17:18:28FromGitter<data-man> Nim only https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/compilers/nim/default.nix ⏎ And old version :(
17:19:09*Trustable joined #nim
17:19:12FromGitter<Varriount> @zacharycarter I've made some progress on the XML serialization stuff, mostly with the macro portion.
17:19:27FromGitter<Varriount> I don't think I'll be able to make much progress this week - I have to study for finals.
17:19:53FromGitter<zacharycarter> well - you did better than me ;) I'll try to get some things done this weekend / week once I finish fixing the playground situation
17:19:59FromGitter<zacharycarter> also - good luck on your finals! :D
17:26:01*gangstacat joined #nim
17:30:49*gangstacat quit (Client Quit)
17:31:46dom96data-man: s/0.17.2/0.18.0/ :)
17:36:59FromGitter<data-man> @dom96: I've returned to the Arch Linux. The NixOS does not suit me. :)
17:37:16dom96oh? How come?
17:37:56*xet7 joined #nim
17:39:27FromGitter<zacharycarter> I'm going to update the kernel on the digital ocean server the playground is running on
17:39:32FromGitter<zacharycarter> I think they have specific docker enabled kernels
17:39:42FromGitter<zacharycarter> which I hope will solve the problems I'm encountering in getting the daemon to start
17:41:41FromGitter<data-man> @dom96: No mirrors for packages, very slow update (for me).
17:45:09*dddddd quit (Remote host closed the connection)
17:53:03*yglukhov quit (Remote host closed the connection)
17:59:25FromGitter<xmonader> How to show echo messages from my library in nimble tests?
18:02:43*yglukhov joined #nim
18:03:05*yglukhov quit (Read error: Connection reset by peer)
18:03:16*yglukhov joined #nim
18:04:10FromGitter<xmonader> @dom96 I used --verbose and --debug flags and still nothing
18:04:22*yglukhov quit (Read error: Connection reset by peer)
18:04:59*yglukhov joined #nim
18:05:20dom96xmonader: what do you mean by `nimble tests`?
18:05:28dom96Do you mean running `nimble test`?
18:05:33dom96do you have a custom `test` task?
18:06:12FromGitter<xmonader> no my basic test1.nim is just like that ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae4b814270d7d3708174ec1]
18:06:31FromGitter<xmonader> and i run it with `nimble test` yes
18:14:00dom96IIRC there is a bug with the default 'test' task
18:14:08dom96Your test1.nim might not be getting executed at all
18:17:38*NimBot joined #nim
18:21:18dom96Try creating something like this: https://github.com/nim-lang/nimble/blob/master/nimble.nimble#L32
18:21:25*yglukhov quit (Read error: Connection reset by peer)
18:22:03*yglukhov joined #nim
18:37:55*salewski joined #nim
18:38:29salewski12:29:45 flasheeprom Trying to install gtk3 package gintro , got the message => 'cannot open 'gir'
18:39:33salewskiWell, I guess you found out yourself -- you may have to install gobject-introspection, for your OS whatever it may be.
18:39:37*salewski quit (Client Quit)
18:40:31*rockcavera joined #nim
18:48:25*xet7 quit (Read error: Connection timed out)
18:49:07*xet7 joined #nim
18:51:19dom96salewski: why is this necessary?
18:52:11dom96my god, why does installing gintro spam my terminal?
18:53:05dom96and it ended up crashing with a SIGSEGV :/
18:53:53FromGitter<zacharycarter> !eval echo "Hello World!"
18:53:56NimBotHello World!
18:54:22FromGitter<zacharycarter> ugh - that took a lot longer to fix than I had hoped it would
18:54:59FromGitter<zacharycarter> once I stopped focusing on re-writing and focused on fixing instead like you suggested dom
18:55:14FromGitter<zacharycarter> anywho - now I can work on revamping this sucker
18:55:34CodeVanceWow
18:55:40CodeVance!echo 1+1
18:55:45*salewski joined #nim
18:55:54FromGitter<zacharycarter> no you need to do !eval first
18:55:56CodeVance!eval echo 1+1
18:55:58NimBot2
18:56:07CodeVance:3
18:56:11FromGitter<zacharycarter> dom created the NimBot
18:56:18salewskidom, well gintro depends on GTK3 of course.
18:56:20FromGitter<zacharycarter> I created - https://play.nim-lang.org/
18:56:23FromGitter<zacharycarter> which powers the nimbot
18:56:33CodeVanceI think its ought to be on #nim-nologs though XD
18:56:59CodeVanceis playground working now you say?
18:57:08salewskiMaybe that guy has not installed gobject-introspection package for his OS -- how should I know that.
18:57:08FromGitter<zacharycarter> yes
18:57:11FromGitter<zacharycarter> well not gists
18:57:17FromGitter<zacharycarter> because github deprecated anon gists
18:57:25FromGitter<zacharycarter> but I'm going to overhaul this project
18:57:34FromGitter<zacharycarter> so I probably wont' provide a fix for that before the overhaul
18:57:40FromGitter<zacharycarter> I think the overhaul will be more beneficial
18:57:43CodeVanceI can always manual gist
18:58:00CodeVanceis the forum playground working now?
18:58:08CodeVanceBTW how does it work?
18:58:24CodeVanceis it like in-browser or on-server evaluation?
18:59:19FromGitter<zacharycarter> I imagine the forum one is - because I think it uses the I linked
18:59:37FromGitter<zacharycarter> no the code is evaluated inside a docker container on the server
18:59:46dom96salewski: "could not open" sounds like the Nim compiler cannot find a module
18:59:53dom96It's got nothing to do with DLL deps
19:00:26dom96zacharycarter: so what was the issue?
19:00:59FromGitter<zacharycarter> well - I think I updated some packages on the server - and I think one of the packages that got updated was the docker-engine package that I had installed
19:01:24salewskidom96, yes I am not really sure. Of course there should be no SIGSEGV -- I may have to test with latest compiler.
19:01:36dom96salewski: it also shouldn't spam my terminal
19:01:38FromGitter<zacharycarter> I think the next time the docker daemon was restarted - it failed to come up because the version of docker-engine that had been upgraded to, wasn't supported by the OS kernel
19:01:46FromGitter<data-man> !eval import sqlite3; echo libversion
19:01:48NimBotCompile failed: in.nim(1, 22) Error: type mismatch: got <proc (): cstring{.cdecl.}>
19:02:02FromGitter<zacharycarter> so my initial solution when I first encountered the problem - was to uninstall docker and reinstall it
19:02:12FromGitter<zacharycarter> but that just made the problem worse - because now I had an even more up to date version of docker installed
19:02:13FromGitter<data-man> !eval import sqlite3; echo $libversion
19:02:14NimBotCompile failed: in.nim(1, 22) Error: type mismatch: got <proc (): cstring{.cdecl.}>
19:02:18dom96zacharycarter: ahh, you probably have to restart the droplet to get it to run under a new kernel version
19:02:37salewskidom96, gintro is doing heavy work -- that is reflected in much output. Fine for now, we will remove it when we have more users.
19:02:40FromGitter<zacharycarter> well - that's what I did eventually - I upgraded the kernel of the droplet and installed the latest and greatest docker
19:02:43FromGitter<zacharycarter> and things are working now
19:02:52dom96salewski: If I was a user that would scare me
19:02:58dom96and possibly annoy me
19:03:40salewskidome 96, see https://github.com/StefanSalewski/gintro/issues/27
19:03:43dom96salewski: If I wasn't testing this package to see if it installs I would have CTRL+C'd the installation as soon as it started spamming
19:03:54salewskiSo our recent customer was successful.
19:04:36FromGitter<data-man> !eval import sqlite3; echo $libversion_number()
19:04:38NimBot3011000
19:04:56FromGitter<zacharycarter> good NimBot
19:04:57salewskiAnd I treid install some days ago too, sucessfully, but not with latest compiler, and only on Linux AMD64.
19:04:59FromGitter<zacharycarter> :P
19:05:02dom96salewski: here is the error I got: https://gist.github.com/dom96/13022ad1eeb0d22db49850690c4b9b76
19:05:12dom96This is on macOS
19:05:17FromGitter<xmonader> Can someone explain this output to me? ⏎ ⏎ ``` S : i12345e ⏎ EPOS: 6 ⏎ int string: 12345e ⏎ PARSED INT: 12 ⏎ I is 12``` [https://gitter.im/nim-lang/Nim?at=5ae4c5ed2b9dfdbc3adc7c9a]
19:05:18dom96zacharycarter: :D
19:06:02FromGitter<data-man> @NimBot: How are you?
19:06:08salewskiThanks dom86, will investigate. Is that for Linux?
19:06:55FromGitter<zacharycarter> !eval echo NimVersion
19:06:57NimBot0.18.0
19:07:01FromGitter<zacharycarter> ooph
19:07:19FromGitter<data-man> @NimBot: Do you like Nim?
19:07:20Araq0.18.0? that's oooolllddd. Nim just got fixed strings and seqs...
19:07:35FromGitter<zacharycarter> well - it's probably that whole - the docker repo hasn't been updated thing again
19:07:36Araqwell ... i'm still working on it
19:07:55FromGitter<zacharycarter> should I bug the maintainer to update it so we can use a later version other playground?
19:08:04FromGitter<zacharycarter> or should I just leave it be? or...
19:09:10salewskiDom96, well when it is macOS, indeed no one has used gintro or oldgtk3 on macOS already. So it may be hard for me to find the bug.
19:09:37FromGitter<alehander42> what are "fixed strings" :D
19:10:09dom96salewski: that's fine, but please make it so that it doesn't spam my terminal :)
19:10:28dom96zacharycarter: btw, it'd be cool if you could support older versions :)
19:10:55FromGitter<zacharycarter> should be easy enough to do - I can make that happen with the overhaul I htink
19:10:57FromGitter<zacharycarter> think*
19:11:33salewskidom96, without output people may tell me just that it does not work. with spam they may tell me the ""last words". Some people are stupid.
19:12:11dom96salewski: Change the messages to "Preprocessing <filename>" or something like this then
19:12:25dom96You don't need this much granularity
19:13:22FromGitter<xmonader> is tehre something wrong with slicing in strings? ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ output is `1` [https://gitter.im/nim-lang/Nim?at=5ae4c7d215c9b03114475b94]
19:14:02salewskiWell, I have currently one user. So there is not much feedback. But maybe I will make it quit -- less stress for me :-)
19:14:32FromGitter<xmonader> ok <6 works what the difference between ^6 and < 6 ? in slicing context?
19:14:39salewskiBye.
19:15:19*salewski quit (Quit: WeeChat 2.0.1)
19:18:57FromDiscord<claude> s[1..^6] is s[1..(s.len - 6)], s[1..<6] is s[1..5]
19:19:28FromGitter<xmonader> argh thanks
19:28:07*salewski joined #nim
19:28:26*nsf joined #nim
19:30:16salewskidom96, well that seems to be a strange problem with your gintro and macos. g_irepository_get_dependencies () seems to return nil, which it should not do.
19:30:31salewskihttps://developer.gnome.org/gi/1.56/GIRepository.html#g-irepository-get-dependencies
19:31:07salewskiHave no idea currently, sorry.
19:41:26*gangstacat joined #nim
19:42:33FromGitter<xmonader> ok guys on my second day, I wrote a bencode encoder/decoder in nim!! :)
19:45:09*yglukhov quit (Read error: Connection reset by peer)
19:45:41*yglukhov joined #nim
19:46:48dom96salewski: interesting. Please don't quit, you've created a great project :)
19:48:16FromGitter<ephja> !eval echo "🤷"
19:48:18NimBot
19:52:40FromGitter<data-man> !eval import unicode; echo $toRunes("🤷")
19:52:43NimBot
19:53:17FromGitter<data-man> !eval import unicode; echo toRunes("🤷")
19:53:19salewskiSorry dom96, typo: quiet, not quit. :-)
19:53:19NimBot
19:53:54dom96do make it quiet :)
19:54:02*yglukhov quit (Read error: Connection reset by peer)
19:54:36*yglukhov joined #nim
19:55:39salewskiFor macos I may check g_irepository_get_dependencies () for nil result, so empty import list. Not necessary from api docs, but maybe macos gtk3 is buggy.
19:59:00FromGitter<ephja> @data-man huh
20:01:03FromGitter<ephja> 🤷
20:01:24dom96salewski: that sounds likely :)
20:02:24FromGitter<xmonader> If anyone interested in reviewing what i learned today https://github.com/xmonader/nim-bencode
20:07:05dom96xmonader: awesome, but why are you using methods?
20:07:29*Trustable quit (Remote host closed the connection)
20:08:07FromGitter<xmonader> @dom96 i thought it's bit organized `encoder.encode` and `decoder.decode` no?
20:08:11FromGitter<data-man> @ephja: heh :)
20:08:16*tiorock joined #nim
20:08:16*rockcavera quit (Killed (orwell.freenode.net (Nickname regained by services)))
20:08:16*tiorock is now known as rockcavera
20:08:28dom96xmonader: You don't need methods for that, Nim has UFCS
20:08:42dom96You only need methods if you're using inheritance and want to override these methods
20:08:56dom96also you should defined a ``newEncoder`` proc
20:09:00FromGitter<xmonader> what is UFCS sorry not really fluent with nim i'd call it my second day
20:09:11dom96Unified Function Call Syntax
20:09:33dom96echo("Hello World") is the same as "Hello World".echo()
20:09:58FromGitter<xmonader> ah I see i'll try to update it to procs
20:10:43*tiorock joined #nim
20:10:43*tiorock quit (Changing host)
20:10:43*tiorock joined #nim
20:10:43*rockcavera is now known as Guest99063
20:10:43*Guest99063 quit (Killed (hitchcock.freenode.net (Nickname regained by services)))
20:10:43*tiorock is now known as rockcavera
20:12:43*rockcavera quit (Remote host closed the connection)
20:13:45FromGitter<xmonader> @dom96 all updated (y)
20:14:29dom96xmonader: nice
20:14:37FromGitter<xmonader> wow nim doesn't have a bencode library!!
20:14:55FromGitter<data-man> @xmonader: Yet another Bittorrent lib :) https://github.com/twist-vector/nim-bped
20:15:32FromGitter<data-man> With methods also
20:16:05FromGitter<xmonader> nice maybe i pick up somethign or two from this code
20:16:24FromGitter<xmonader> maybe someone would start writing "idiomatic nim" or effective nim docs with those notes?
20:17:19FromGitter<xmonader> from my side i'm planning to write another tutorial summing this library and what i learned
20:22:52salewskixmonader, your Encoder and Decoder objects look like plain dummy objects on first view. I must miss omething.
20:26:21salewskiYou pass them as this parameter, but it seems to be never really used?
20:30:32FromGitter<ephja> a habit from other languages perhaps
20:33:10FromGitter<xmonader> @salewski yea just for code organization really nothing more
20:38:23*tiorock joined #nim
20:38:30*xkapastel quit (Quit: Connection closed for inactivity)
20:38:59*tiorock quit (Changing host)
20:38:59*tiorock joined #nim
20:38:59*tiorock is now known as rockcavera
20:42:17*xkapastel joined #nim
20:43:07*salewski quit (Quit: WeeChat 2.0.1)
21:03:09*yglukhov quit (Read error: Connection reset by peer)
21:03:21*miran quit (Quit: Konversation terminated!)
21:03:47*yglukhov joined #nim
21:12:38FromGitter<Varriount> Araq: When does `ntyInferred` occur in Nim code?
21:13:20FromGitter<Varriount> Also, `ntyOpt`
21:14:05*yglukhov quit (Read error: Connection reset by peer)
21:14:32AraqntyOpt is dead
21:14:37*yglukhov joined #nim
21:14:45AraqntyInferred is bullshit
21:15:11FromGitter<Varriount> And `ntyAnd`, `ntyOr`, `ntyNot`?
21:15:49Araqint | float # ntyOr
21:16:09FromGitter<Varriount> Ah, ok
21:16:09Araqsimilar for the others
21:16:32Araqif you work on serialization, just bail out on these
21:18:37*yglukhov quit (Read error: Connection reset by peer)
21:19:04Araqwe need an isConcreteType helper
21:19:10*yglukhov joined #nim
21:19:36Araqnim is full of stupid meta-types nobody knows how to handle, not even the compiler itself
21:20:52Araqsee any concept/static[T] related crash.
21:21:52*yglukhov quit (Read error: Connection reset by peer)
21:22:29*yglukhov joined #nim
21:24:29FromGitter<Varriount> Hm, well I might still need to support concepts
21:25:17FromGitter<Varriount> However there are 4 different type class types: `ntyBuiltinTypeClass`, `ntyUserTypeClass`, `ntyUserTypeClassInst`, and `ntyCompositeTypeClass`
21:25:49FromGitter<Varriount> Beats me what the difference between some of them are, or how to even get examples of their ASTs
21:26:35AraqntyBuiltinTypeClass is something like a standalone 'array'
21:26:47AraqntyUserTypeClass is a 'concept'
21:26:59AraqntyCompositeTypeClass is or, and, not
21:27:08AraqntyUserTypeClassInst is a mystery.
21:27:23FromGitter<Varriount> Thanks!
21:27:30Araqwell it's an instantiation of a 'concept'
21:27:44Araqso x.lastSon should be the real type
21:28:08FromGitter<Varriount> Araq: I really appreciate all this help. I just wish I didn't have to ask you about these things so much.
21:29:18Araqyou're welcome. I think there are doc comments for their compiler siblings
21:29:21FromDiscord<claude> are auto parameters shorthand for `proc foo[T](x: T)`
21:29:34AraqtyBuiltinTypeClass, etc.
21:29:38FromGitter<data-man> @jangko: you around?
21:30:40Araqvarriount: how can you support a 'concept'?
21:31:39Araqin my limited imagination I never figured out what to do with a concept in a serialization context.
21:36:04FromGitter<Varriount> Araq: Well, right now I'm just trying to improve the (very brittle) customPragmaValue code
21:37:18FromGitter<Varriount> Though, with something like concepts you run into the question, "should I retrieve the pragma from the concept definition, or the concrete type, or both?"
21:38:54*dddddd joined #nim
21:42:20*gangstacat quit (Quit: Ĝis!)
21:48:39PMunchHmm, well that's a bit annoying
21:49:10PMunchSince set's only cover int16 I can't use it to check unicode scalars like this: if code notin {0..0xD7FF, 0xE000..0x10FFFF}
21:51:26*darithorn quit (Remote host closed the connection)
21:51:42FromGitter<Varriount> PMunch: Could you break the scalar into 2 int16's?
21:52:04FromGitter<Varriount> Or perhaps use a range type?
21:52:33PMunchVarriount, can't break it into two
21:52:46PMunch10FFFF-E000 is still larger than int16
21:53:26CodeVancegoz
21:53:50PMunchRange types seemed to work though :)
21:53:54PMunchCompletely forgot about those
21:55:34FromGitter<Varriount> I think range types are probably the most neglected part of the type system.
22:02:37dom96Yay, my dissertation is pretty much complete.
22:02:54PMunchOh nice dom96
22:04:16petersjt014[m]any way I can do a map after a map?
22:04:55*petersjt014[m] sent a long message: petersjt014[m]_2018-04-28_22:04:54.txt <https://matrix.org/_matrix/media/v1/download/matrix.org/VmZgBwQrmftgXsdKbEOpmKck>
22:07:05dom96petersjt014[m]: yep, one is not to use the do notation
22:07:41dom96xmlseq.map((item) => item.child()...).map(...)
22:07:48dom96(Import 'sugar' for that)
22:08:12FromGitter<data-man> @dom96: What subject of the dissertation?
22:08:26dom96data-man: A C/C++ Obfuscator written in Nim
22:10:01FromGitter<data-man> The second dissertation will be "C/C++ Unobfuscator"? :)
22:11:10FromGitter<Varriount> dom96: Going for your masters already?
22:11:22dom96Varriount: nope
22:11:30dom96BSc dissertation
22:12:23dom96petersjt014[m]: you can also wrap the whole do expression in parenthesis, but that sucks. One of the reasons why I don't use the do notation and think it should be removed from the language.
22:14:00FromGitter<Varriount> dom96: Wait, why do you think the 'do' notation should be moved?
22:14:21FromGitter<data-man> Goog luck! I hope that after receiving a bachelor's degree, you will have more time for Nim! :)
22:14:27*CodeVance quit (Ping timeout: 240 seconds)
22:15:54dom96Varriount: Because it doesn't fit the language
22:16:29dom96data-man: definitely, but soon enough it will be time to start earning money :/
22:16:39FromGitter<ephja> dom96: was it never possible to have multiple statements with =>?
22:17:07dom96ephja: IIRC it never was.
22:17:31dom96For multiple statements you should just use the boring old 'proc (item: Item) = ...' syntax
22:18:04petersjt014[m]phooey :|
22:18:29petersjt014[m]I was having so much fun playing hide from the instance variable
22:19:59FromGitter<sherjilozair> Hey guys, where does Nim look for headers specified using the `header :` tag in FFI?
22:20:04dom96How I would write it: https://gist.github.com/dom96/406341ad69ac8954fd7be81d87679cfb
22:20:29dom96sherjilozair: same place a C compiler looks :)
22:20:47FromGitter<sherjilozair> @dom96 Can it not be in my project directory?
22:22:46dom96sherjilozair: possibly passing `--passC:-I./` to Nim might work
22:22:52dom96But I'm curious what you're up to
22:23:10FromGitter<sherjilozair> I'm wrapping SFML.
22:23:17FromGitter<sherjilozair> From here: https://www.sfml-dev.org/download/csfml/
22:23:30FromGitter<zacharycarter> errr
22:23:37FromGitter<zacharycarter> csfml wrappers already exist though
22:23:45FromGitter<zacharycarter> or bindings rather
22:24:03FromGitter<sherjilozair> The maintainer says they're not done well.
22:24:24FromGitter<sherjilozair> I assume you're referring to this: https://github.com/oprypin/nim-csfml
22:24:59dom96I've used them successfully, the only complaint I had with them was the use of `foo=` instead of setFoo (which makes searching in the SFML docs annoying)
22:25:02FromGitter<sherjilozair> I want to develop a more idiomatic library.
22:25:03FromGitter<zacharycarter> well - folks have used those bindings with success in the past - so I don't know how horrible the problems actually are
22:25:44dom96But if you're writing a wrapper you shouldn't be bundling the header file with it
22:25:53dom96It'll be installed on the user's system
22:26:31FromGitter<sherjilozair> @dom96 I can't be sure it will be installed in user's system right? Why would CSFML be installed in user's system.
22:27:16FromGitter<sherjilozair> @zacharycarter to use these bindings, you have to call destroy on each object you create right?
22:27:31dom96Actually, now that I think about it, you shouldn't be using 'header' but 'dynlib' instead
22:27:45FromGitter<zacharycarter> I don't know - I never use CSFML / GLFW3 / SDL2 for anything other than windowing and input support
22:28:08FromGitter<zacharycarter> and I'm probably just going to end up eventually porting a lot of CSFML - minus the rendering and a lot of the system code - to Nim
22:28:48FromGitter<sherjilozair> @zacharycarter What would you port CSFML for?
22:28:51dom96but if a user is developing code with csfml they should have the -dev package installed.
22:28:56FromGitter<zacharycarter> well I'd port SFML
22:28:59FromGitter<zacharycarter> not CSFML
22:29:33FromGitter<zacharycarter> so that Nim would have a pure x-plat windowing library
22:29:34FromGitter<sherjilozair> Oh the C++ api. Oh yeah, that's possible in Nim.
22:29:39FromGitter<zacharycarter> no no not the C++ API
22:29:43FromGitter<zacharycarter> I'd port it to Nim
22:29:46FromGitter<zacharycarter> not wrap or bind
22:29:50FromGitter<sherjilozair> Ah I see.
22:29:56FromGitter<zacharycarter> but again - only windowing and input code
22:29:59FromGitter<sherjilozair> does nim2cpp exist?
22:30:03FromGitter<zacharycarter> no
22:30:12FromGitter<zacharycarter> nim2 anything doesn't exist
22:30:13FromGitter<zacharycarter> c2nim exists
22:30:20FromGitter<zacharycarter> and has a cpp, and Nim can compile to C++
22:30:21FromGitter<sherjilozair> right I meant cpp2nim
22:30:29dom96`nim cpp` is technically nim2cpp :)
22:30:30FromGitter<zacharycarter> err it has a cpp flag c2nim does
22:31:50FromGitter<sherjilozair> @dom96 Didn't get what you meant by "-dev package".
22:32:29*nsf quit (Quit: WeeChat 2.0.1)
22:32:40dom96On Ubuntu for example, you'd install csfml-dev which is distinct from csfml. The former installs the header files, the latter just the .so DLL
22:33:21FromGitter<sherjilozair> @dom96 How would I package the final binary such that users who don't have anything installed can run the binary.
22:34:00dom96Depends on your target platform. On Linux you would just tell them to use their favourite package manager to install the dependencies
22:34:12dom96You could also statically link with sfml, but that's more involved
22:34:54dom96on macOS you'd bundle the .dylib into an app bundle (or tell people to install sfml via homebrew)
22:35:34FromGitter<sherjilozair> It would have to be bundling. I'm imagining games here. People won't install anything, except right-click a bundle.
22:36:02dom96Sure. I've done that successfully for my game: https://ldjam.com/events/ludum-dare/40/coastal-postal
22:36:09FromGitter<sherjilozair> So is it a better idea to wrap SFML or CSFML? I just saw that Nim can also wrap CPP.
22:36:49FromGitter<sherjilozair> oh cool, so you used oprypin's nim-csfml for this?
22:36:56dom96yep
22:37:22FromGitter<sherjilozair> So do you think nim-csfml cannot be improved on?
22:37:25dom96I'm not sure there would be much benefit to wrapping SFML directly
22:37:37dom96only the API I think
22:37:47dom96The setters only bothered me IIRC
22:38:13dom96Indeed, destructors could make it better. But AFAIK Nim's destructors aren't ready for that yet (Araq can correct me here if I'm wrong)
22:38:21FromGitter<sherjilozair> But you had to destroy your objects manually. Would you not prefer Python-like contexts?
22:38:54AraqPython-like contexts? that's just a template in Nim.
22:39:20Araqthe real thing for this are destructors
22:39:32FromGitter<sherjilozair> @araq
22:39:49FromGitter<sherjilozair> Destructors would be awesome, but are they ready for use right now?
22:40:01FromGitter<sherjilozair> What's the timeline on destructors?
22:40:17dom96Sure, but doing this isn't too difficult: https://github.com/dom96/ld40/blob/master/ld40.nim#L344
22:41:10Araqdestructors are ... I dunno. 80% done?
22:41:12*rockcavera quit (Remote host closed the connection)
22:42:23FromGitter<sherjilozair> @dom96 this isn't difficult for good programmers, no. But for a library to be useful I think it's important to minimize errors even if the programmer is not careful.
22:42:25Araqyou can give them a try with --newruntime but bugs tagged with that don't yet have priority, sadly.
22:42:42*CodeVance joined #nim
22:48:10CodeVanceCan someone help me with an error please
22:48:50CodeVancehttps://gist.github.com/CodeVance/1b4f541abc850495ce258f84df27b036
22:49:13dom96what's the error?
22:49:14CodeVanceI get Hint: [Link]
22:49:17CodeVanceHint: operation successful (20500 lines compiled; 27.236 sec total; 38.445MiB peakmem; Debug Build) [SuccessX]
22:49:18CodeVanceHint: bin\game_core [Exec]
22:49:18CodeVancegame_core.nim(70) game_core
22:49:18CodeVancegame_core.nim(56) newPaddle
22:49:18CodeVancesystem.nim(2833) sysFatal
22:49:18CodeVanceError: unhandled exception: invalid object conversion [ObjectConversionError]
22:49:19CodeVanceError: execution of an external program failed: 'bin\game_core '
22:49:27dom96Please gist that next time
22:50:08CodeVanceOk
22:50:12CodeVanceI put it on the gist
22:52:18FromDiscord<claude> you can't go up in the inheritance tree
22:52:30dom96yeah, you can't convert up in the inheritance tree
22:52:37dom96You'll need to create the Paddle type directly
22:53:00CodeVancenew and init procs seperately?
22:53:18dom96Paddle(pos: pos, size: size, ..., dir: dir)
22:53:35FromDiscord<claude> or you can do this https://gist.github.com/hlaaftana/0112c9cdfaaf8741b5aa612d4e63a39d
22:54:19dom96yes, but please call it `setupGameObj` or something
22:54:35dom96initGameObj by convention should return a non-ref GameObj type
22:54:38FromDiscord<claude> oops, `obj: GameObj` should be `obj: var GameObj`
22:54:58dom96and since I'm talking about convention: GameObj should be called Game since it's a ref type
22:55:00Araqclaude: no you can't?
22:55:20CodeVanceinit in python was a void type proc
22:55:32CodeVanceis why I used that convention
22:55:34*smt_ quit (Read error: Connection reset by peer)
22:56:09*smt joined #nim
22:56:10CodeVanceclaude, You might not realise it but I appreciate pointing out where I can improve
22:56:35CodeVanceNo to var GameObj?
22:58:34dom96CodeVance: If you want some more points: format your code more consistently, it's annoying at first but once you get used to it it's hard to stop :)
22:58:57dom96In particular, things like putting space before and after a '='
22:59:18CodeVancedom96 I was litterally banging it together.
22:59:27CodeVanceBut I'll do so ... in a moment
22:59:43CodeVancewhere is nep1 btw
23:00:07CodeVanceI found it
23:00:28dom96That document needs to be updated
23:01:54dom96There is some advice it gives that is wrong
23:06:13CodeVanceI'll just follow my own common sense then :)
23:07:29dom96Just look at any of my projects for a good example of what idiomatic Nim should look like, even Nimble is pretty well formatted: https://github.com/nim-lang/nimble/blob/master/src/nimble.nim ;)
23:07:48FromGitter<sherjilozair> How can I specify custom location to pick up dylibs from to the nim compiler?
23:07:59CodeVanceXD
23:08:32CodeVancesher Link pragma
23:08:32CodeVanceThe link pragma can be used to link an additional file with the project:
23:08:32CodeVance{.link: "myfile.o".}
23:08:49CodeVanceOr are you talking about search a folder
23:09:13FromGitter<sherjilozair> latter yeah.
23:10:50CodeVancesher PassL pragma
23:11:01CodeVancehttps://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html
23:11:06CodeVanceIS that the right?
23:15:06dom96sherjilozair: dylibs are picked up from the DYLD_LIBRARY_PATH on macOS
23:15:12dom96There is no way to tell the Nim compiler to change this
23:15:25dom96This is how it is for all applications
23:32:09*Lord_Nightmare quit (Ping timeout: 264 seconds)
23:36:28*Lord_Nightmare joined #nim
23:49:24FromGitter<Varriount> dom96: How does NEP1 need to be updated?
23:49:57*skrylar joined #nim
23:49:59skrylarpoof.
23:50:04*skrylar appears in a puff of logic
23:51:04*FromGitter * Varriount throws a congratulatory dove at skrylar
23:51:40dom96Varriount: hrm, it seems I already updated it at some point
23:51:45dom96it could use more details though
23:52:02FromGitter<Varriount> The only thing I would change is how multi-line parameters should be written.
23:53:57FromGitter<Varriount> Lately I've fallen in love with something like this: https://gist.github.com/Varriount/3fd164ffa45e3b75616c59aa3bc5c482
23:57:07skrylarhum. i looked at our existing protobuf libs. i guess i'm the only one who is a fan of merging the serial/deserial with objects already in the app
23:57:22skrylareveryone else has been implementing them as objects you create to copy data over in to and then copy again to the bitstream
23:58:31FromGitter<sherjilozair> @dom96 So this should work? `DYLD_LIBRARY_PATH=\`pwd\`/lib/ nim c -r pong.nim`
23:58:36FromGitter<sherjilozair> `DYLD_LIBRARY_PATH=`pwd`/lib/ nim c -r pong.nim`
23:58:40FromGitter<sherjilozair> "DYLD_LIBRARY_PATH=`pwd`/lib/ nim c -r pong.nim"
23:58:44FromGitter<sherjilozair> but it doesn't.
23:59:18FromGitter<sherjilozair> I get `could not load: libcsfml-graphics.dylib`