<< 27-03-2017 >>

00:15:24*couven92 quit (Quit: Client Disconnecting)
00:17:18*ftsf joined #nim
00:29:18*Jesin quit (Quit: Leaving)
00:30:04*vlad1777d quit (Remote host closed the connection)
00:32:26*Jesin joined #nim
00:50:09*Tiberium quit (Read error: Connection reset by peer)
00:50:29*Tiberium joined #nim
01:02:17*yglukhov joined #nim
01:06:26*Tiberium quit (Remote host closed the connection)
01:07:17*yglukhov quit (Ping timeout: 268 seconds)
01:11:20FromGitter<Varriount> Tiberium: Disabling zoom is usually a sign of bad design.
01:12:53FromGitter<TiberiumPY> Varriount: optionally maybe?
01:13:28FromGitter<TiberiumPY> Because in Dom's game it's annoying then page zooms in
01:13:45*krux02 quit (Remote host closed the connection)
01:36:09FromGitter<Varriount> Oh, well games are an exception
01:36:59FromGitter<Varriount> But I've had too many news sites disable zoom because it would break shoddy design
01:38:32*krux02 joined #nim
01:40:25*chemist69 quit (Ping timeout: 256 seconds)
01:55:12*chemist69 joined #nim
02:02:12*Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif)
02:17:39def-pri-pub /quit
02:17:41def-pri-pubwhoops
02:17:43*def-pri-pub quit (Quit: leaving)
02:28:59*krux02 quit (Remote host closed the connection)
02:38:57*Serenitor joined #nim
02:40:06FromGitter<TiberiumPY> Lol :)
03:18:19*user0___ joined #nim
03:24:43*vendethiel- joined #nim
03:25:37*vendethiel quit (Ping timeout: 260 seconds)
03:33:42*user0___ quit (Quit: user0___)
04:32:50*ftsf quit (Quit: :q!)
04:34:20*ftsf joined #nim
05:14:43*Nobabs27 quit (Quit: Leaving)
05:44:40*Serenitor quit (Quit: Leaving)
05:45:51*rauss quit (Quit: WeeChat 1.7)
06:18:15*Tiberium joined #nim
06:27:50*nsf joined #nim
06:44:53*user0___ joined #nim
06:48:26*rokups joined #nim
06:54:25*sz0 quit (Quit: Connection closed for inactivity)
06:55:42*user0___ quit (Quit: user0___)
07:02:01*gokr joined #nim
07:13:09ldleworkIf I wanted to generate sound and create some basic oscillators what would I use?
07:14:03ftsfldlework, in nim?
07:14:09ldleworkftsf: heh I just found your IRC logs
07:14:12ldleworkvia google
07:14:15ldleworkXD
07:14:24ftsf=)
07:14:25ldleworkftsf_ hmm very sleepy ~__~ accidentally was up till 4am writing a synth in nim
07:14:33ldleworkftsf: how did that go?
07:14:49ftsfhehe, pretty well, it's now a modular synth studio
07:14:51ldleworkhttp://static.impbox.net/synth.mp4 nice!
07:14:56ldleworkftsf: woahh
07:15:06ftsfhttps://www.youtube.com/watch?v=sDop4JELAhc latest version
07:15:16ldleworkoh my god
07:15:21ftsfplanning to opensauce it soon
07:15:28ldleworkoh fuck yes
07:15:37ftsfbut if you're interested i can share with you now, but keep in mind it's pretty messy
07:16:04ldleworkftsf: wow I'm totally interested
07:16:26ldleworkftsf: it definitely looks like you're rushing towards a dwarf fortress situation here
07:16:31ftsfhaha
07:16:35ldleworkthough despite that, everything looks so cool
07:16:48ftsfwell yes, with a modular synth it's never done, can always add more modules
07:16:59ldleworkdude, I was just talking about how shoddy pd is
07:17:01ftsfbut i want to get the base framework solid then open source it so people can add new modules to extend it
07:17:02ldleworkor maam
07:17:04ldleworkw/e
07:17:40ftsfmaam?
07:17:45ldleworklol
07:17:52ldleworkftsf: I didn't want to assume your gender
07:17:57ftsfoh right
07:18:11ftsfthanks
07:18:23ldleworkftsf: does Nim have a good web-framework yet?
07:18:31ldleworkWhat if we let web-tech take care of the UI?
07:18:32ftsfhmm i've not tried any
07:18:45ftsfhehe i like my retro pixel UI, but probably not for everyone
07:18:57ldleworkftsf: no I like it, its probably just tiresome to create new UI
07:19:10ftsfyeah, trying to cleanup some of the UI stuff now
07:19:13ftsfit's not so fun
07:19:14gokrftsf: Impressive shit.
07:19:16ldleworkif people didn't have to learn a new thing and could make modules and slap some webstuff on it, it might go faster
07:19:44ftsfmm creating a module doesn't require any UI work for the most part (unless you want to extend the UI)
07:19:50ftsfanyway, gotta run sorry
07:19:58ftsfwill be back online later
07:20:03ldleworkftsf: if you made me a collaborator just so I could look around that'd be cool
07:20:39*ftsf quit (Quit: :q!)
07:21:15*yglukhov joined #nim
07:23:46ldleworkwell that's exciting
07:45:27*bjz joined #nim
07:45:40Tiberiumcan I have a template, so I can call it like echo my_templ(data, ">") so I have an if statement inside this template, and want to set > or < based on value passed in template
07:49:47*vlad1777d joined #nim
07:50:19Araqtemplate my_templ(cond): string = if cond: "<" else ">"
07:51:41TiberiumAraq, and how do I call it? my_templ(">") ?
07:52:20TiberiumAraq, ah
07:52:36TiberiumAraq, I mean I have an if statement like "if oneObj <comp> secondObj: do stuff"
07:54:00Tiberiumand I want to call template like my_templ(">") so if statement inside template would be "if oneObj > secondObj: do stuff"
07:54:26Tiberiumit's not dynamic (I mean, I will have two calls to this template with ">" and "<"
07:55:53Araqtemplate my_templ(a, b): string = if a < b: "<" else ">"
07:56:09Araqtemplate my_templ(cmp, a, b): string = if cmp(a, b): "<" else ">"
07:56:19TiberiumAraq, ah, yes!
07:56:20Araqecho my_templ(`<`, a, b)
07:56:22Tiberiumthanks
07:57:05Araqsounds more like you're looking for a macro though
07:57:12Araqto do condition inspection
07:59:49TiberiumAraq, code like this doesn't work https://glot.io/snippets/eodgwv4v02
08:00:18Tiberiumget_bars returns seq[Bar], type Bar = tuple[name: string, lat, long: float, seatsCount: int]
08:00:26Tiberiumdata is JsonNode
08:02:31Tiberiumjust curious if I can do this with template
08:03:10Tiberiumif there's no way to do it with template, I would just add checks in proc like if ">": do greater comp else: do less comp
08:08:56*Vladar joined #nim
08:11:05*couven92 joined #nim
08:14:18Tiberiumyglukhov, hi. can you give me the link for your game made in Nim?
08:14:26Tiberiumis there a steam page or something?
08:15:03yglukhovTiberium: its not officially released yet, sorry.
08:16:03Tiberiumyglukhov, but is there any page about it?
08:18:13Tiberiumyglukhov, and can you please look at this issue? https://github.com/SSPkrolik/nim-native-dialogs/issues/10 ?
08:18:49yglukhovTiberium: well, there's a fb page. https://www.facebook.com/reelvalley
08:19:13yglukhovTiberium: youre using linux?
08:19:17Tiberiumyglukhov, yeah
08:19:36*vlad1777d quit (Quit: Leaving)
08:20:02yglukhovTiberium: sorry, don't have linux. the problem is likely somewhere in gtk calls.
08:20:17Tiberiumyglukhov, also I know that you can speak Russian, so on this fb page one label at the bottom of recommended section says "27 человекам"
08:22:53Tiberiumyglukhov, I probably know the issue, let me try..
08:23:27yglukhovTiberium: hrm? i don't see any russian text there. do you happen to use russian locale?
08:24:00Tiberiumyglukhov, I'm russian actually, I mean this is the text from facebook itself, don't worry
08:24:06Tiberiumit's not the issue with this page :)
08:25:08yglukhovTiberium: oh ok.
08:25:19ldleworkno screenshots :(
08:38:17Tiberiumdom96, are you on linuX?
08:40:48*Tiberium quit (Remote host closed the connection)
08:51:55*Tiberium joined #nim
08:52:09Tiberiumhow to compile Nim via visual c++ ?
08:52:20Tiberiumwith "cl"
08:52:24Tiberiumit's C/C++ compiler
08:55:49FromGitter<vegansk> --сс:vcc
08:58:34*user0___ joined #nim
08:59:32Tiberiumvegansk: it can't find "vccexe.exe"
09:03:09FromGitter<vegansk> I thought that it must be built by ``koch tools``, try to build it yourself: https://github.com/nim-lang/Nim/blob/devel/tools/vccenv/vccexe.nim
09:05:39Tiberiumvegansk: is there any full instructions on how to build Nim from source on Windows?
09:05:45Tiberiumso I'll 100% need to install mingw?
09:07:39*scriptum quit (Remote host closed the connection)
09:07:44FromGitter<vegansk> @Tiberium, I'm always using standard instruction with mingw on Windows. Dunno if you can bootstrap the compiler with vcc
09:11:44*vlad1777d joined #nim
09:25:24*Tiberium quit (Ping timeout: 258 seconds)
09:32:17*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
09:34:10*bjz joined #nim
09:37:20*Andris_zbx joined #nim
09:39:48*vlad1777d quit (Quit: Leaving)
09:53:58*Tiberium joined #nim
09:58:39Tiberiumhow can I reverse a sequence?
09:59:00Tiberiumah, nvm
10:00:37FromGitter<vegansk> @Tiberium, you can use ``search`` feature from this page: https://nim-lang.org/docs/lib.html
10:00:50TiberiumxD thanks :0
10:00:52FromGitter<vegansk> just type ``reverse`` :-)
10:02:08Tiberiumvegansk: yeah, i found this already
10:05:15Tiberiumok, another question: how to convert all values from split to int? I have " var rowData: seq[string] = row.split(".") "
10:05:22TiberiumrowData = rowData.mapIt(int(it)) doesn't work
10:06:28Tiberiumah
10:06:58FromGitter<vegansk> @Tiberium, use parseutils or
10:07:18FromGitter<vegansk> https://github.com/vegansk/nimboost/blob/master/src/boost/parsers.nim which has more features
10:07:36Tiberiumoh my god
10:07:39TiberiumI just forgot
10:07:46Tiberiumthat it's not int() in Nim
10:10:08*shashlick quit (Ping timeout: 240 seconds)
10:10:50FromGitter<brechtm> How can I get a quick overview of the procs which work on seqs?
10:11:18*shashlick joined #nim
10:11:51FromGitter<brechtm> The system module docs do list them, but they are not grouped for seq
10:12:36*PMunch joined #nim
10:12:54*couven92 quit (Quit: Client disconnecting)
10:14:52stisabrechtm: to the left, groupby->type
10:15:07FromGitter<brechtm> @stisa: thanks
10:15:23stisaIt's limited to the current module though
10:15:32Tiberiumhow can I convert seq to array?
10:15:51FromGitter<brechtm> And is there something similar to Python's enumerate?
10:16:01Tiberiumyes
10:16:11Tiberiumjust instead of "for x in thing" use "for index, x in thing"
10:16:13Tiberiummagic
10:16:17FromGitter<brechtm> Or should I use a HashSet to store a collection of things for which order is not important.
10:16:30FromGitter<brechtm> @Tiberium lovely!
10:16:35Tiberiumit works for me
10:17:28Tiberiumif not, use pairs(items)
10:17:53FromGitter<brechtm> Is it safe to use delete on a seq while iterating over its items?
10:18:05Tiberiummaybe with mitems?
10:19:17FromGitter<brechtm> It sure would be nice to have a constructor that would automatically be called...
10:22:56FromGitter<vegansk> @brechtm, do you mean default values? Because there is default constructor that just zeroes fields
10:23:13*couven92 joined #nim
10:24:00FromGitter<vegansk> Here is the example: https://glot.io/snippets/eodkvus60o
10:24:30FromGitter<brechtm> @vegansk Yes... But I'd like to provide other default values. And seqs are nil by default, so those definitely needs to be initialized
10:25:27*couven92 quit (Read error: Connection reset by peer)
10:25:33FromGitter<vegansk> @brechtm, see this macro: http://vegansk.github.io/nimboost/docs/0.4.0/boost/typeutils.html
10:26:41*couven92 joined #nim
10:26:41FromGitter<brechtm> @vegansk interesting... I'll have a look at that
10:30:22FromGitter<brechtm> hmm: "Error: cannot open 'typeutils'"
10:30:27*krux02 joined #nim
10:30:57FromGitter<brechtm> ah, this isn't part of the stdlib
10:31:07FromGitter<vegansk> @brechtm , ``nimble install nimboost`` and then ``import boost.typeutils``
10:34:04*couven92 quit (Read error: Connection reset by peer)
10:35:45FromGitter<brechtm> @vegansk Could it be it doesn't work with seqs?
10:37:14FromGitter<brechtm> @vegansk ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=58d8eb59d7ab15e81723c613]
10:37:49FromGitter<vegansk> The syntax must be: ⏎ ⏎ ```data Test ref object: ⏎ size = 2 ⏎ let sequence: seq[int] = @[]``` [https://gitter.im/nim-lang/Nim?at=58d8eb7cb52518ed4dafeb4a]
10:38:03FromGitter<brechtm> oh, I didn't use the init proc
10:38:25FromGitter<vegansk> But yes, it doesn't work. Finding out what's wrong
10:38:41FromGitter<brechtm> I was hoping I could just say: var t = Test()
10:39:49*bjz_ joined #nim
10:40:45FromGitter<brechtm> initTest doesn't seem to be available
10:41:38*bjz quit (Ping timeout: 240 seconds)
10:41:43FromGitter<vegansk> Because it's ref object, use newTest()
10:42:10FromGitter<brechtm> oops, RTFM, right? =-)
10:43:15FromGitter<vegansk> Added the test: https://github.com/vegansk/nimboost/blob/master/tests/boost/test_typeutils.nim#L348
10:43:22FromGitter<brechtm> @vegansk a seq member always needs to be var?
10:45:00FromGitter<vegansk> @brechtm, no. It's an immutable field in the test above
10:45:29FromGitter<brechtm> ah, I think I get it. For an empty seq, specify the type, no default value. For a non-empty seq, don't specify the type but do specify the default value...
10:47:05FromGitter<vegansk> No, you must specify the default value even for empty seq: ⏎ ⏎ ``` data RefTypeWithSeq ref object, show: ⏎ let a: seq[int] = @[] ⏎ b = @["a"]``` [https://gitter.im/nim-lang/Nim?at=58d8eda88e4b63533d6a0faf]
10:48:20FromGitter<vegansk> Updated the example one more time
10:48:31FromGitter<brechtm> I see. But it makes little sense for a to be immutable of course...
10:49:20FromGitter<vegansk> a and b are immutable here. Use var if you need mutable fields
10:50:16FromGitter<brechtm> I have the feeling OOP is a bit of a second-class citizen in Nim.
10:51:46*vivus joined #nim
10:53:06FromGitter<vegansk> @brechtm, why do you think so? https://github.com/pragmagic/nimue4 is a wrapper for an Unreal Engine. And it's 100% of OOP :-) https://github.com/pragmagic/nimue4/wiki/Defining-Unreal-Types
10:53:51Tiberiumhmm
10:53:52TiberiumError: type mismatch: got (FlowVar[streams.Stream]) but expected 'Stream = ref StreamObj'
10:53:58Tiberiumtrying parallel
10:54:53FromGitter<brechtm> It was suggested to me several times to avoid using methods.
10:56:40FromGitter<vegansk> @brechtm, you need methods only if you are using inheritance and dynamic dispatching. I don't need inheritance in 99% cases :-)
10:58:17FromGitter<brechtm> So ue4 offers macro's for more advanced OOP?
10:58:18FromGitter<vegansk> PS: But I don't write GUI
10:58:56FromGitter<vegansk> Not ue4, but nimue4.
10:59:16FromGitter<brechtm> The ue4 module, I mean
10:59:31vivushey Araq , as the only person familiar with 're', can you explain why this doesn't work: https://www.zerobin.net/?86b6663e232d00d6#sWf1+nd0B9pXFdrjm1xeTIQMSxbDIyz0Zbr3/g44K48=
10:59:38FromGitter<brechtm> I use OOP as a way of structuring programs.
11:02:55FromGitter<vegansk> Then the only thing that you don't have in Nim out of the box is interfaces I guess.
11:03:18Araqapparently I'm the only person who can read :P
11:03:20Araqhttps://nim-lang.org/docs/re.html
11:03:26AraqNote: The 're' proc defaults to the extended regular expression syntax which lets you use whitespace freely to make your regexes readable. However, this means to match whitespace \s or something similar has to be used.
11:28:59vivusAraq: so for " " you use "\s" once? what if I have 6 whitespaces? then: "\s\s\s\s\s\s" ?
11:31:57*elrood joined #nim
11:32:08*dexterk quit (Read error: Connection reset by peer)
11:32:34Araq\s+
11:32:44*dexterk joined #nim
11:32:51cheatfatevivus: "\s+", or "\s{6}"
11:33:11vivusAraq: you know we hate reading and prefer the sweetness of your replies ;)
11:45:06vivuswhat is the URL for the online nim code playground?
11:45:20elroodwhat if you want to match only spaces, not tabs? '\ ' ?
11:45:28Tiberiumvivus, simplest one - glot.io
11:45:33Tiberiumbut it doesn't support many things
11:45:53Tiberiumvivus, if you really want to have full Nim compiler, use c9.io or codeanywhere
11:48:59vivusthanks Tiberium . Araq I created a reproducible environment here: https://glot.io/snippets/eodn7sd4ib . I did exactly as you said and it still returns incorrectly
11:55:31vivusI will love you forever if you help me Araq :P
12:02:50FromGitter<dom96> Vivus: didn't I already help you out with this?
12:03:18FromGitter<dom96> https://gist.github.com/dom96/091bc3e8526844e7f6bdcc4bb1aa3083
12:04:22vivus@dom96 I ran it a couple of times and it isn't giving the correct output
12:05:28vivus@dom96 see the link here: https://glot.io/snippets/eodn7sd4ib . I adjusted my code to your gist + araqs \s and it returns an empty sequence
12:08:09Vladarhm, is there a convenient way to convert an openarray to an array (or get the array pointer from an openarray)?
12:09:13vivusVladar: the docs specify it: https://nim-lang.org/docs/tut1.html
12:11:09*user0___ quit (Ping timeout: 240 seconds)
12:11:35Vladarvivus: where exactly?
12:12:03vivusVladar: https://nim-lang.org/docs/tut1.html#advanced-types-open-arrays
12:13:11Vladarvivus: I can't see any instructions of openarray->array conversion there
12:13:28TiberiumVladar, ah, you've got same question as me
12:13:41Tiberiumopenarrays are for proc definition if I remember correctly
12:13:53Vladarwell, yes, they are
12:13:57vivusyou cant use openarrays outside proc definitions
12:14:27TiberiumVladar, so you can use openarray just like an array inside of proc?
12:15:01Vladarit has no address, so i can't addr it
12:15:37vivusyou can't IIRC
12:15:43FromGitter<dom96> vivus: that's because you have no regex subgroups. Try putting your regex pattern in parenthesis.
12:16:05Vladarwell, that sucks…
12:17:48Vladarthough docs says: "Open arrays are implemented as a pointer to the array data and a length field." and I thought there's a way to get the pointer
12:19:18vivus@dom96 done and still returns empty
12:28:54*user0___ joined #nim
12:29:16AraqVladar: getting the pointer is easy, unsafeAddr ftw. the problem is that a pointer is not an array
12:29:48Araqbut you can cast it to a ptr to an unchecked array.
12:32:40VladarAraq: oh, thanks! It might be helpful
12:42:05*mjanssen joined #nim
12:42:09*user0___ quit (Quit: user0___)
12:42:23*user0___ joined #nim
13:06:12*zachcarter_ joined #nim
13:08:58*zachcarter quit (Ping timeout: 240 seconds)
13:08:58*zachcarter_ is now known as zachcarter
13:08:59*PMunch quit (Remote host closed the connection)
13:10:27*PMunch joined #nim
13:11:27*couven92 joined #nim
13:22:01*bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
13:25:26*dmi0 joined #nim
13:34:31*smt quit (Ping timeout: 260 seconds)
13:40:15*vlad1777d joined #nim
13:44:22krux02Araq, don't you have to cast the pointer to a pointer to an unchecked array?
13:45:03krux02zachcarter, hi, good morning to you, or whatever time you have there
13:45:09*Serenitor joined #nim
13:45:59zachcarterHey Krux02: one sec, work call
13:49:14zachcarteralright I’m here krux02 :)
13:49:30zachcartergood afternoon to you
13:49:40krux02thank you
13:49:55zachcartermorning here :) just getting started
13:50:05krux02I see you did a lot of progress in your game library
13:50:22zachcarterah yeah I read your post last night
13:51:22krux02yea, in the beginning I wrote a whole section about my library, because I was triggered to do so, and then I realized, that is not the right place to do it and deleted it again :P
13:51:36zachcarterahaha, well that’s okay I wouldn’t mind :P
13:51:49zachcarteryour library is very good
13:52:00zachcarterI was going to use it originally haha
13:52:21krux02I know, but sadly I can't support mac, nor openglES 2
13:52:58krux02ok to say I do not have access to a mac would be a lie, I sit right in between two unused imacs right now
13:53:07zachcarterahaha
13:53:24krux02but I do not own them and at the time of writing the library I did work on several different linux machines
13:53:31*rauss joined #nim
13:54:15krux02I thought of adding a mac layer to the library
13:54:24krux02but I don't know how well that works
13:54:34zachcarterhrm
13:55:00zachcarterthis is one reason bgfx comes in handy
13:55:10krux02yea I know
13:55:16krux02bgfx is cool no question
13:55:21zachcarterlots of overhead for bgfx
13:55:23zachcarterbut imo worth it
13:55:27krux02and I kind of do a lot of the stuff bgfx does
13:55:32zachcarteryeah
13:55:39krux02but I also do things differently, and I do not want a lot of layers
13:55:46zachcarteryeah your lib is def a lot thinner
13:56:07zachcarterI think we have some great game dev options emerging for Nim
13:56:38krux02I like this trend of modern c++ libraries to support a C API
13:56:40vivusAraq: any assistance? XD
13:57:02zachcarterme too
13:57:10krux02C API = possible to wrap in a lot of languages
13:57:25zachcarterI’m always sad when no C API exists for something
13:57:45krux02at least you found chipmunk
13:57:51zachcarterlike right now I’m working on a Nim port for http://dragonbones.com/
13:58:00zachcarterwhich is down atm apparently
13:58:14zachcarterhttps://github.com/DragonBones
13:58:17krux02github pages down
13:58:28zachcarteryeah
13:59:23krux02what does it do?
13:59:30zachcarterthe same thing that library Spine does I showed you last night
13:59:33zachcarterexcept this one is open source
13:59:42krux02cool
14:00:00krux02It definitively opens a lot of possibilities for artists
14:00:02zachcarterlotta code to port though "/
14:00:03zachcarter:/
14:00:04zachcarteryeah
14:00:06zachcarterdefnitely
14:00:07Araqvivus: as dom96 already told you, use reges captures
14:00:55Araqand parsing html via regexes is stupid, use parsehtml module
14:01:00vivuslike this: re"(<a\s href=.*\s style=.*>.*<\/a>)"
14:01:05krux02I try to get nim into a state of easy game concept prototyping, something that blitz basic was to me for 2D games
14:01:29krux02And that means to me, do the rendering manually, but don't require tedious work
14:01:46zachcarterright
14:02:24krux02I think it is important, that the game desigener can freely choose the datastructure they build their levels in
14:02:51krux02and the rendering system should be flexible to adjust to everything
14:03:10krux02I mean everything is impossible, but everything thas has arrays
14:03:16zachcarterright
14:03:49krux02I always hate it, when game engines push me in these predefined tracks to develop games
14:03:53Araqvivus: I'm not gonna tell you how to abuse regexes for href extraction.
14:04:31krux02I think I already mentioned it, but I don't like when the game engine tells me "Hey this is how meshes look like, this is how animatios look like, this is how scenes look like, etc"
14:04:33cheatfatevivus: please use https://regex101.com and find your own way in capture html via regexes
14:05:26*gokr quit (Ping timeout: 260 seconds)
14:05:31vivusyeah no worries, I'll keep at it or otherwise try python instead
14:05:38krux02The idea is, when I want to make a chess game, I should be able to make the bare bone terminal version, and then based on that I just put in a 3D renderer and I have a 3D game
14:05:55zachcarterthat would be very nice to be able to do
14:06:14*nsf quit (Quit: WeeChat 1.7)
14:06:57krux02well that version would have a 3D renderer, it would still interact from the command line, but it should not be far off to implement a 3D interface
14:07:33krux02a click on screen is easyly reversible into the original grid
14:07:47Araqsure python can magically inject () capturing for you.
14:08:30*rauss quit (Quit: WeeChat 1.7)
14:09:01krux02Araq: just an idea question, do you think it could be possible to make autocompletion for nim in DSLs programmable?
14:09:07*rauss joined #nim
14:09:29Araqit mostly works in macros already.
14:09:53Araqthere are tests for it.
14:10:10*samuell joined #nim
14:10:29krux02I am not talking about default completion, I mean I can execute code that provides the alternative completions?
14:10:56krux02or do you mean that, too?
14:11:18*rauss quit (Client Quit)
14:11:38*rauss joined #nim
14:12:06*vendethiel joined #nim
14:13:01*vendethiel- quit (Ping timeout: 260 seconds)
14:14:22*rauss quit (Client Quit)
14:17:12*rauss joined #nim
14:17:15Vladaraww, yes, finally https://github.com/Vladar4/nimgame2/tree/master/demos/demo18
14:17:20vivusAraq: well I thought I would try Nim first to support the language in production, but obviously I first have to overcome people being condescending first
14:19:30Araqhttps://nim-lang.org/docs/htmlparser.html#example-transforming-hyperlinks
14:20:10Araqhttps://nim-lang.org/docs/parsexml.html#example-2-retrieve-all-html-links
14:22:12*rauss quit (Quit: WeeChat 1.7)
14:22:30*rauss joined #nim
14:22:47Araqkrux02: yeah well, I have no plans for that.
14:31:14*Tiberium quit (Remote host closed the connection)
14:31:28*Tiberium joined #nim
14:31:38Araqcondescending is just an effect of your questions.
14:31:50AraqMitleid gibt's umsonst, Neid muss man sich verdienen.
14:34:17*byte512 quit (Quit: Bye.)
14:34:57vivuscondescending is a reflection of your handling of people who don't have a mastery of the language you have written. It will be easier to just say "I can't help you" instead of using words like "stupid" to deal with people
14:35:27vivusbut of course, I can't teach/enlighten you (or anyone else) how to behave
14:36:39*smt joined #nim
14:38:03*rauss quit (Quit: WeeChat 1.7)
14:38:21*rauss joined #nim
14:39:01*rauss quit (Client Quit)
14:39:17*rauss joined #nim
14:40:31*rauss quit (Client Quit)
14:44:41*Tiberium quit (Remote host closed the connection)
14:44:55*Tiberium joined #nim
14:49:15Araqno, it's a reflection of your particular behaviour. Don't you worry, I'm friendlier to people who are not as barefaced.
14:49:33cheatfatevivus, why you blame Nim for your knowledge of Regular Expressions?
14:49:47vivuscheatfate: my regular expression is fine
14:50:11vivusAraq: I am not worried. small-language syndrome seems like a thing now.
14:51:07krux02The biggest problem in any language is: humans
14:51:27cheatfatevivus, do you really think this is fine "(<a\s href=.*\s style=.*>.*<\/a>)"? this string will not capture anything by design...
14:52:01cheatfateand it will not capture anything in python, php, perl and many others
14:52:39vivuscheatfate: this was the original and tested on regexr.com: <a href=.* style=.*>.*<\/a>) . it was actually highly refined previously and trimmed down to see if the problem was the regex, not the language, but everything was/is blamed except the language
14:53:36vivusI was even prepared to contribute to the shitty documentation, but I'm too "barefaced" or "stupid" to do so
14:53:50euantorThat apttern doesn't capture anything on regexr...
14:54:00euantorIt matches the string, but doesn't __capture__ anything
14:54:17*rauss joined #nim
14:54:29euantorhttps://usercontent.irccloud-cdn.com/file/ScZ8XnNw/Capture.PNG
14:55:04euantorIf Python magically captures non-capture groups, that's a bug in Python's regex implementation
14:55:11AraqI already gave 2 links that solve his problem.
14:55:23Araqbut he chose to go into troll mode instead.
14:57:03cheatfatevivus, your regexr.com (which uses javascript version of regular expressions) with your crafted regular expression also capture this string "<a href="Asdasd" and here i'm also dont care style="asdasd" i dont care about anything>asdasd</a>"
14:58:03vivusAraq: firstly, nobody is trolling here. you don't call people "stupid" and "barefaced" and then say they're trolling you.
14:59:23*vlad1777d quit (Quit: Leaving)
15:00:05vivuseuantor: I used this and it captured 2 outputs: https://www.zerobin.net/?5331415485a832e4#+au/u72GuUiDxGs2i8in/eeUNuu0t9MDPv4LOFl11fg=
15:00:31euantorIn Python?
15:00:37vivusin regexr.com
15:00:43cheatfatevivus, show your code please
15:00:44*yglukhov quit (Remote host closed the connection)
15:01:02cheatfatei mean nim code which uses your regular expression to capture
15:01:09euantorIn regexr it __matches__ two strings, but doesn't __capture__ anything
15:01:26*vlad1777d joined #nim
15:01:35FromGitter<dom96> And in Nim the variables which stores the "captures" is called "matches"
15:01:52FromGitter<dom96> I can see why this would be confusing.
15:02:49FromGitter<dom96> That said, the documentation does help out: https://nim-lang.org/docs/re.html#match,string,Regex,openArray[string],int
15:02:59FromGitter<dom96> "and the captured substrings in the array matches"
15:03:06euantorTHis is how it should look if you're capturing something:
15:03:15euantorhttps://usercontent.irccloud-cdn.com/file/bkvxgf32/Capture.PNG
15:04:12euantorRegexr's user interface isn't particularly helpful here either. I usually prefer regexhero, but it requires silvershite *ahem*, I mean silverlight
15:08:17vivuseuantor: so in nim I cannot "capture" something that "matches" ?
15:09:05euantorThe naming in Nim is different. A "match" in Nim is a "Group" in regexr
15:10:40vivusand what is a "match" from regexr = in nim ?
15:12:48FromGitter<dom96> vivus: I think what you want is ``findAll``
15:12:49euantorThe result of the "match" procedure
15:13:09FromGitter<dom96> It will return all substrings matched in the string
15:13:17FromGitter<dom96> ``match`` only returns a boolean
15:13:27FromGitter<dom96> and ``find`` only returns the start index
15:14:31vivuscheatfate: regex101.com even generated the code for me in python: https://www.zerobin.net/?cb5c989cd58cd9fb#KT8DWUox2DU5TBadpPJIuim1rAO4/Ts4huJx0dGQpH4=
15:14:44cheatfatei know
15:17:16euantorEither way, matching HTML with regex is bad and extremely error prone. Use the htmlparser as Araq said
15:19:39vivuseuantor: I am not only matching HTML. I am building a PoC where there will be multiple other different entries and need to stick to 1 pattern, and parseHTML will not support other patterns
15:20:56vivusbut thank you @dom96 euantor and cheatfate for showing some decency and helping me. It is much appreciated (in all sincerity)
15:22:21euantorNo problem. For future reference if all that you wanted was the HTML, this would work: https://glot.io/snippets/eodt3smvsq
15:22:35euantorIn case the missing link was how to actually parse the string as HTML
15:39:22*Trustable joined #nim
15:45:09*PMunch quit (Quit: leaving)
15:48:28*libman joined #nim
15:49:03*couven92 quit (Quit: Client disconnecting)
15:51:42*Andris_zbx quit (Remote host closed the connection)
15:51:52*yglukhov joined #nim
15:54:42*sz0 joined #nim
15:56:08*yglukhov quit (Ping timeout: 240 seconds)
15:58:17*samuell quit (Remote host closed the connection)
16:05:15*Jesin quit (Quit: Leaving)
16:06:36*yglukhov joined #nim
16:07:19*nsf joined #nim
16:11:48*Jesin joined #nim
16:33:01*yglukhov quit (Remote host closed the connection)
16:35:39*yglukhov joined #nim
16:36:13*yglukhov quit (Remote host closed the connection)
16:37:54*yglukhov joined #nim
16:41:37dom96Araq: Any ideas how to improve errors such as this: https://gist.github.com/dom96/5e3dc61e071db4c269b42f8b338fa89a ?
16:42:02dom96In particular, things like "asyncmacro.nim processClientIter" aren't really helpful
16:42:08*yglukhov quit (Remote host closed the connection)
16:45:26*yglukhov joined #nim
16:48:23*yglukhov quit (Remote host closed the connection)
16:53:34*yglukhov joined #nim
17:13:14*ggVGc quit (Ping timeout: 246 seconds)
17:14:22*brson joined #nim
17:25:08*gokr joined #nim
17:30:36*krux02 quit (Quit: Leaving)
17:30:37*yglukhov quit (Remote host closed the connection)
17:33:02*nsf quit (Quit: WeeChat 1.7)
17:34:38*byte512 joined #nim
17:41:35*yglukhov joined #nim
17:42:44Tiberiumsorry for my noob question again, but why this code produces 0 everytime?
17:42:44Tiberiumhttps://glot.io/snippets/eodwz18goc
17:42:55TiberiumIf I pass different parameters to binary, nothing happens
17:42:59Tiberiumit just prints zeros
17:45:34cheatfatevar data: int = 0
17:45:39cheatfatedata = n * data
17:45:45cheatfaten is starting from 0
17:45:58cheatfateso in first iteration data becomes 0
17:46:12Tiberiumcheatfate, oh, thanks. shiet
17:46:13cheatfateall other iterations made data equal to 0
17:46:44SusWombatare nims macros more similiar to rust or lisp?
17:46:52SusWombattheyre macros i mean
17:47:01Tiberiumlist I think
17:47:28cheatfateTiberium, also you dont need to have 2 times `if paramCount() < 1: quit()`
17:47:39cheatfateone under `when isMainModule` is enough
17:47:54SusWombatdom96, you seem to know about that stuff a lot maybe you could answer?
17:48:20SusWombatTiberium, thanks
17:49:10dom96Hrm, not sure what they're more similar to. They're definitely more powerful than Rust's :)
17:52:18SusWombatdom96, ok thanks
17:55:15*Matthias247 joined #nim
17:57:33*yglukhov quit (Remote host closed the connection)
18:04:25*sz0 quit (Quit: Connection closed for inactivity)
18:07:08*yglukhov joined #nim
18:07:15*yglukhov quit (Remote host closed the connection)
18:07:28*yglukhov joined #nim
18:15:08ldleworkAnyone have a sense of how often ftsf is around?
18:16:48*gangstacat quit (Quit: Ĝis!)
18:21:26dom96I would guess after work hours Australia time zone
18:22:26*gangstacat joined #nim
18:23:01ldleworkOK so still a while I guess
18:23:31vivusdom96: you mentioned about "\s", but in regex101.com , all generated code from the example uses the raw regex, with no need for "\s". is this a quirk in the nim 're' lib?
18:30:07*vivus quit (Quit: Leaving)
18:31:58*Serenitor quit (Ping timeout: 240 seconds)
18:37:18*xet7 joined #nim
18:38:59*Trustable quit (Remote host closed the connection)
18:48:22*user0___ quit (Quit: user0___)
18:48:30*user0___ joined #nim
19:05:47*nightmared quit (Ping timeout: 264 seconds)
19:08:03dom96This is why writing a Snake game pays off. I just found a pretty bad bug in the async macro :)
19:08:10dom96(And fixed it!)
19:08:29ldleworkdom96, :)
19:08:47dom96But man, that sure was a subtle bug.
19:10:02*Serenitor joined #nim
19:20:33Tiberiumoh, I will release first *develop* version of my bot to GitHub. Sorry, but it's written with Russian comments and README (because vk.com is a Russian social network)
19:22:10Tiberiumlol, not now :) I'll need to make some plugins for it
19:22:29*couven92 joined #nim
19:24:23*RushPL quit (Ping timeout: 255 seconds)
19:24:59demi-Tiberium: how do you plan on doing that?
19:25:14Tiberiumdemi-, they're compiled with bot itself now
19:25:29TiberiumI plan to make them as separate libs maybe?
19:25:38*RushPL joined #nim
19:26:03demi-yeah, i'd be curious as to how you handle plugin management like that because i was looking at doing something similar recently and stopped because i wasn't sure how to properly implement it with nim
19:26:19Tiberiumdemi-, I don't know how to do it properly too
19:26:38demi-right, so when you do, i would like to know how you approached the problem :)
19:26:56TiberiumNow I have plugins with one function - call, and call this function from main bot file xD
19:28:52*couven92 quit (Quit: Client Disconnecting)
19:29:44cheatfatedemi-, what the problem you have with plugins? if you consider about declarations it can be achieved with simple dlload/dlsym
19:30:06euantorYeah, that's how other projects like Apache handle it
19:30:55*couven92 joined #nim
19:31:12demi-cheatfate: yeah in theory but it doesn't seem so clean to architect around (unlike platforms i'm use to working on)
19:31:19cheatfateI see only one problem, currently all nim's so/dlls need to be initialized with call to `NimMainModule()`
19:32:16*rokups quit (Quit: Connection closed for inactivity)
19:32:52cheatfatedemi-, is your platforms support dlsym/dlload?
19:33:25demi-yeah, but Cocoa also has some built-in plugin architecture support to handle this very well
19:34:42demi-you say, load this plugin at this path, and it will do that and it has metadata for the default class/code to initialize and run once it gets loaded into process you can get the plugin's code cleanly integrated into the main application
19:35:37cheatfatedemi-, i understand, but nim is not OOP
19:35:47demi-i know
19:36:04cheatfateand i think all this ^^^ happen via dlsym/dlload
19:36:33demi-indeed, but that work is wrapped and i don't want to do that wrapping myself
19:37:15cheatfateyou can export `proc initalize(vtable: objectwhichconsistofprocs)`
19:37:18demi-and stuff like resolving nim type names at runtime isn't possible i believe so it makes it hard to write delegate based code
19:37:58cheatfateor you want to make plugins to be in different languages?
19:38:34*brson quit (Quit: leaving)
19:38:41demi-yeah that is the other possibility i considered but that is also significant amounts of work
19:38:47*brson joined #nim
19:39:16cheatfatedemi-, not so many because nim types are not so runtime specific...
19:39:27AraqI disagree, it's not much work.
19:39:39cheatfateits like one hour to make workable POC
19:39:56demi-cheatfate: the runtime names aren't deterministic afaict
19:39:59Araqit's essentially how Python's internals work and Python is written in C...
19:40:34cheatfatedemi-, everything will be done with function calls...
19:40:35Araqdemi-: I told you before. the name mangling is not important.
19:40:45Araq.exportc overrides the name mangling
19:41:09Araqbut since the procs end up in an object you pass to the registerPlugin proc it doesn't matter anyway.
19:41:37*Nobabs27 joined #nim
19:45:33*cyraxjoe quit (Ping timeout: 255 seconds)
19:47:35*bjz joined #nim
19:48:39demi-i'm not sure i understand how that would work; since the libraries (plugins) wouldn't be able to call into the main application on their own, so the application would have to get something from the library (plugin) first to register it
19:49:00*cyraxjoe joined #nim
19:51:07cheatfatedemi-, application create dispatch table (object) with function addresses it wants to export to plugins... loads plugin via dlload(), calls `NimMainModule` if it present (to initialize GC and others), after calls `PluginInitalize()` and passes to it address of dispatch table...
19:51:46Vladartried to build 64-bit windows app under wine for the first time, anyone have a minute to check if it runs under a real OS? https://github.com/Vladar4/ng2gggrotto/releases/download/v1.2/gggrotto-1.2-win64.zip
19:52:19cheatfatedemi-, after this steps loaded plugins can easily invoke functions in dispatch table
19:53:12dom96huh, does a for loop inside a closure iterator yield the closure iterator?
19:53:28FromGitter<Varriount> Vladar: It doesn't run on OSX. :P
19:54:00VladarVarriount: don't have a mac :(
19:58:39dom96oh, nope, it doesn't.
19:58:47dom96I have another loop that does yield inside it
20:05:08Tiberiumdom96, quick question about htmlparser (if you know) - how to get random element from page if there's like 10 elements with type "div" and class "text" ?
20:05:12Tiberiumlist comprehension?
20:05:48dom96generate a random index?
20:06:19Tiberiumdom96, I have code like for elem in html.findAll("div"): if elem.attr("class") == "text": do stuff with element
20:06:25Tiberiumbut how do I get only random index here?
20:06:38Tiberiummaybe if elem.attr("class") == "text" and index == randomIndex ?
20:08:10Tiberiumhmm, seems no
20:08:25Tiberiumsimplest way - just parse all results and then return one random of them xD
20:12:09*vendethiel quit (Ping timeout: 240 seconds)
20:12:40*vendethiel joined #nim
20:13:30*yglukhov quit (Remote host closed the connection)
20:20:36*dexterk quit (Ping timeout: 240 seconds)
20:20:57*dexterk joined #nim
20:33:34*Tiberium_ joined #nim
20:34:14*Tiberium quit (Read error: Connection reset by peer)
20:37:37*nsf joined #nim
20:37:52*Tiberium_ quit (Remote host closed the connection)
20:41:05*Ven joined #nim
20:41:28*Ven is now known as Guest82746
20:44:23*Jesin quit (Quit: Leaving)
20:47:10*Jesin joined #nim
20:55:50dom96So I made lots of Snake server-side fixes. Testing appreciated http://picheta.me/snake/
20:56:54*Vladar quit (Quit: Leaving)
21:02:44dom96That was a nice game :)
21:04:56dom96Any feedback?
21:07:22*Guest82746 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:11:04*libman quit (Quit: Connection closed for inactivity)
21:14:03ldleworkdom96, yes, the extra pellet should only start dissolving once you are within a certain range
21:14:14ldleworkIE the one where it is actually theoretically possible to get it
21:14:31*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:14:36dom96but then you'd always be able to get it
21:14:42ldlework...
21:14:52ldleworkif there's no way to get it period, then there's no reason for it to exist
21:17:17dom96there is a way to get it...
21:18:31*Ven_ joined #nim
21:20:02dom96Maybe you ran into a bug where you can't get it? I've tested in Firefox and Chrome so far.
21:26:21*Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:26:34*Ven_ joined #nim
21:27:21*sz0 joined #nim
21:28:04*Ven_ quit (Client Quit)
21:29:57*rauss quit (Quit: WeeChat 1.7)
21:39:25subsetparkHey y'all, I posted this yesterday: http://blog.zdsmith.com/posts/nim-for-python-programmers.html
21:40:03ldleworkdom96, I beat your score!
21:40:25*def-pri-pub joined #nim
21:41:18ldleworkdom96, also what I mean is that, sometimes the item spawns too far and decays before you could ever get to it, based on your speed
21:41:23ldleworkI guess the longer you get the faster you get
21:42:43dom96ldlework: yes, and you're not meant to always get it
21:42:48dom96It's down to luck
21:42:50ldleworkfair enough
21:42:54ldleworkthink you'll beat my score?
21:43:00dom96Cheat :P
21:43:05ldleworkwhat?!
21:43:27ldleworkI would never!
21:43:47ldleworkI'm insulted dom96
21:44:12dom96Can you connect to it?
21:45:00ldleworkdom96, no
21:45:08ldleworkthe system is down
21:45:11dom96Good, so my IP ban works :P
21:45:20ldleworklame
21:46:51ldleworkdom96, where's the source?
21:47:20dom96Isn't it obvious?
21:47:29ldleworkfine I'll go to github myself
21:48:13ldleworkdom96, is the underlying library "gamelight"?
21:48:26dom96yes
21:49:17ldleworkdom96, super duper cool
21:49:31ldleworkdom96, is there a small doc explaining how to get a basic gamelight game working?
21:49:33ldleworklike building it and stuff
21:50:07dom96nope, the game is... well.. very light
21:50:17dom96I pulled out stuff from another project basically
21:52:38ldleworkdom96, I just mean, how would I draw a circle with gamelight and compile it right
21:52:44ldleworkso I could deploy the webstuff
21:52:50ldleworknothing more
21:53:02dom96it doesn't even support drawing circles lol
21:53:08ldleworkhehe
21:53:24ldleworkdom96, instead of something like gamelight
21:53:39ldleworkwe should work on a webapi module that contains things like the Canvas API and the WebAudio API
21:53:42ldleworkhttp://webaudioapi.com/samples/
21:53:57def-pri-pubdomg96: Not using my Canvas bindings, I'm sadface.jpg now
21:54:10ldleworkLooks like Canvas API is done :)
21:54:17ldleworkdef-pri-pub, where are those?
21:54:26def-pri-pubshould be the `html5_canvas` package
21:54:32def-pri-pubThere's also a WebGL one too
21:54:36def-pri-pub(not mine though)
21:55:15def-pri-pubAlso, check the `sound` package. Someone already got the Web Audio API bound.
21:55:24ldleworkWow
21:55:35ldleworkI wonder if I could convince ftsf to target the web!
21:55:46ldleworkWow imagine being able to share your pads
21:56:06def-pri-pubI'm porting a game I made in SDL & OpenGL for the Linux Game Jam a week ago.
21:56:21ldleworkporting it to your html5_canvas package?
21:56:42def-pri-pubI had some issues with the `sound` package myself, but that's probably because of the ACLs on my assets in GCS
21:56:45dom96def-pri-pub: I was going to but it felt much too complex.
21:56:56def-pri-pubhow was it too complex?
21:57:03ldleworkWhat does it even mean to create a javascript binding?
21:57:18dom96I had a single file implementation already so I decided to use it
21:57:22def-pri-pubah
21:57:50dom96Also I disliked your use of 'emit' everywhere
21:58:03ldleworkWe should hash this out and come up with really good web modules
21:58:27def-pri-pubWhat should it be using than emit instead?
21:59:35FromGitter<stisa> def-pri-pub : importcpp probably
22:00:35def-pri-pubah, I see so. I think I did try to use that if I could, but there were some cases I don't think importcpp would have helped.
22:01:06ldleworkam I alone in thinking that efforts should converge to create standard web-modules?
22:01:41def-pri-pube.g, look at the 'fillStyle=' and the 'strokeStyle=' procs. IIRC, It tried using importcpp on them, but It didn't go over well.
22:01:58*dmi0 quit (Ping timeout: 240 seconds)
22:02:40dom96def-pri-pub: Take a look at my canvasjs module
22:04:59dom96ldlework: There isn't really much to the compilation except 'nim js --out:tests/snake.js snake'
22:05:03*user0___ quit (Quit: user0___)
22:05:05dom96Good night
22:05:58ldleworkhuh
22:07:26*brson quit (Quit: leaving)
22:07:27FromGitter<stisa> def-pri-pub mmh, why make it a proc though? it's a property, so you can just declare it as a field of the object, no?
22:08:08FromGitter<stisa> oh sorry, didn't read the comment
22:12:43*brson joined #nim
22:14:38*vendethiel quit (Ping timeout: 240 seconds)
22:15:18*vendethiel joined #nim
22:19:50*brson quit (Quit: leaving)
22:29:12*couven92 quit (Quit: Client Disconnecting)
22:31:24zachcarteranyone know how I can cast characters to a unit?
22:31:27zachcarterlike if I have FF
22:31:51zachcarterI would want 255
22:32:15zachcarterI need to be able to specify the base as well
22:32:24zachcarterbase 16 in this example…
22:34:14zachcarterparseHexInt
22:34:15zachcarterwoot
22:34:57FromGitter<brechtm> I run into segmentation faults now and then when I access a nil-object. Is there by any chance a compiler flag that points me to the source code line where this happens?
22:46:07*nsf quit (Quit: WeeChat 1.7)
22:50:14*elrood_ joined #nim
22:52:19*elrood quit (Ping timeout: 258 seconds)
23:14:19*elrood_ quit (Quit: Leaving)
23:14:49*gokr quit (Ping timeout: 240 seconds)
23:26:04*vendethiel- joined #nim
23:26:26*vendethiel quit (Ping timeout: 258 seconds)
23:34:26*sz0 quit (Quit: Connection closed for inactivity)
23:40:57*vlad1777d quit (Quit: Leaving)
23:41:58*arnetheduck quit (Ping timeout: 240 seconds)
23:46:51*Matthias247 quit (Read error: Connection reset by peer)