<< 18-03-2017 >>

00:02:49*bjz_ quit (Ping timeout: 260 seconds)
00:03:08*bjz joined #nim
00:04:21*Nobabs27 quit (Quit: Leaving)
00:41:57*PMunch joined #nim
00:43:21*arnetheduck joined #nim
01:07:46*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
01:18:41*def-pri-pub joined #nim
01:27:40*girvo joined #nim
01:32:06*girvo quit (Ping timeout: 240 seconds)
01:53:47zachcarterhrm I’m still not understanding how dynlibOverride works
01:53:54zachcartercan someone help clairfy a few things for me?
02:06:30*brson quit (Quit: leaving)
02:06:37*brson joined #nim
02:08:05*bjz joined #nim
02:08:49*chemist69 quit (Ping timeout: 260 seconds)
02:10:38*girvo joined #nim
02:11:48*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
02:14:55*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
02:15:21*girvo quit (Ping timeout: 260 seconds)
02:18:36*bjz joined #nim
02:22:07*chemist69 joined #nim
02:23:57*bjz quit (Ping timeout: 260 seconds)
02:53:07*fold4 quit (Ping timeout: 260 seconds)
02:53:42*kunev quit (Ping timeout: 260 seconds)
02:55:27*ftsf quit (Ping timeout: 260 seconds)
02:57:05*kunev joined #nim
02:59:39*ftsf joined #nim
03:00:02*kulelu88 quit (Quit: Leaving)
03:03:53zachcarterdom96: I’m compiling my project with —dynlibOverride but in my dependent module’s generated C source I’m still seeing : Dl_741594 = (TY_AmjdYmUQVe5bzSrEV9bGTAA) nimGetProcAddr(T_3thlnIOalhOW1nJvGS0x9cQ_2, "bgfx_init");
03:04:05zachcarterlooks like a dynamic link to me :/
03:08:21*brson quit (Quit: leaving)
03:19:45*girvo joined #nim
03:26:10ftsfzachcarter, need to specify which library to override
03:26:21zachcarterI believe I am
03:26:36ftsfeg i have in my nim.cfg dynlibOverride = "SDL2"
03:26:55zachcarterthe command I”m using to compile is this :
03:27:09zachcarternimble c --dynlibOverride:bgfx-shared-libDebug -r examples/desktop/00-hello-world/main
03:27:20zachcarterI’m not even providing a library to statically link against
03:27:20ftsfif you're running on linux try using ldd on the created binary to see if it shows in the list
03:27:36zachcarterand my example still runs fine
03:28:52ftsfwhat's the code with the {.dynlib: ???.}
03:29:10zachcarterone sec
03:29:36zachcarterhttps://github.com/zacharycarter/bgfx.nim/blob/master/bgfxdotnim.nim#L1-L10
03:30:00zachcarterdo I need to be overriding libname?
03:30:19ftsfmmm seems like that should be fine, assuming you're doing a debug build
03:31:16ftsfaccording to --advanced the matching is fuzzy
03:31:29ftsf--dynlibOverride:lua matches dynlib: "liblua.so.3"
03:31:45zachcarterhmm okay
03:32:16ftsfdoes ldd ./outputbin show the bgfx library?
03:32:20ftsf(if you're on linux)
03:32:29zachcarterI’m on osx
03:32:33ftsfnot sure of the equivalent on that
03:32:34zachcarterlet me try to find the equivalent command
03:32:53zachcarterotool -L apparently
03:33:35zachcartermain:
03:33:35zachcarter /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
03:33:36zachcarteris all I get
03:35:15ftsfnot sure sorry, but doesn't look like it's doing what you want
03:35:35zachcarteryeah :/
03:35:46zachcarterthanks for trying to help though :)
03:35:56FromGitter<Varriount> Anyone know a bit more about https://nim-lang.org/docs/manual.html#type-bound-operations ?
03:43:12*bjz joined #nim
03:44:43zachcarterI’m reading this irc log ftsf: https://irclogs.nim-lang.org/03-10-2016.html
03:44:53zachcarterapparently on osx anyway, nim doesn’t bundle shared libraries with the executable
03:45:06zachcarterhttps://irclogs.nim-lang.org/03-10-2016.html#09:39:08
03:46:20zachcarterso I’m not sure wtf dynliboverride is supposed to do for me
03:46:26zachcarterugh
03:47:22ftsfat least on linux it makes the linker do the work instead of using dlopen to link at runtime
03:48:06zachcarteryeah
03:58:04zachcarterokay intersting...
03:58:11zachcarterdynliboverride seems to work with a simpler library name
03:58:15zachcarterthink this is a bug perhaps
04:02:03*girvo quit (Quit: leaving)
04:13:25FromGitter<Varriount> zachcarter: https://nim-lang.org/docs/nimc.html#dynliboverride
04:13:43FromGitter<Varriount> It's primarily used to force static linking instead of dynamic linking.
04:13:54zachcarteryeah that’s exactly what I’m trying to do
04:14:03zachcarterI just couldn’t get the pattern to match my library but I think I got it now
04:33:03zachcarterstill not really sure how to accomplish what I’m trying to do
04:33:06zachcarter:/
04:33:41ftsfwhat are you trying to do?
04:33:55zachcarterit’s a little complicated but I’ll try to explain to the best of my ability
04:34:01zachcarterI have project A) which I’m deploying to android
04:34:38zachcarterso I’m not actually linking any of the code I’m compiling - I’m just compiling it and sticking it into the JNI folder and the android arm compiler will take care of building it
04:35:07zachcarternow one of the files I”m compiling references another module I’ve built - that bgfx wrapper
04:35:20zachcarterand I’m using nimble to manage the dependency
04:36:07zachcarterwhen I compile my code, if I look in the compiled C sources, none of the procs I’m calling in the wrapped library seem to be getting exposed, I’m guessing because I’m not actually doing any linking
04:36:17*CabbageLife joined #nim
04:36:30*CabbageLife left #nim ("Leaving")
04:37:15zachcarterhttps://gist.github.com/zacharycarter/374e68dde969c7609d10f86cceb4385d
04:37:24zachcarterone file is the generated C sources for the wrapper
04:37:40zachcarterthe other file is where I’m referencing the module and calling a method in the wrapped library, specificlally on this line -
04:37:51zachcarterhttps://gist.github.com/zacharycarter/374e68dde969c7609d10f86cceb4385d#file-test-nim-L30
04:38:05zachcarterbut that init method is nowhere inside the generated C sources for the bindings
04:39:28ftsfi dunno sorry
04:39:58zachcarterall good :) it’s not the simplest of processes haha
04:49:38*bungoman joined #nim
04:50:06*fold4 joined #nim
04:51:26*bungoman_ quit (Ping timeout: 246 seconds)
05:01:47*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
05:34:41*bjz joined #nim
05:52:18*PMunch quit (Quit: leaving)
05:53:16*def-pri-pub quit (Quit: leaving)
05:53:44*nsf joined #nim
06:03:49*smt_ quit (Ping timeout: 240 seconds)
06:14:43zachcarterwell… I managed to cross compile the project and link it but I still don’t see the procs I’m calling in the generated C code :/
06:14:48zachcartergoing to have to ask Araq about this tomorrow
06:14:52zachcarteror later today I guess
06:16:33*smt joined #nim
06:36:27*Vladar joined #nim
06:42:13*BitPuffin|osx quit (Ping timeout: 256 seconds)
06:48:44Araqzachcarter: what's the question?
06:49:12zachcarterzachcarter: I have project A) which I’m deploying to android
06:49:12zachcarter[12:34am] zachcarter: so I’m not actually linking any of the code I’m compiling - I’m just compiling it and sticking it into the JNI folder and the android arm compiler will take care of building it
06:49:14zachcarter[12:35am] zachcarter: now one of the files I”m compiling references another module I’ve built - that bgfx wrapper
06:49:15zachcarter[12:35am] zachcarter: and I’m using nimble to manage the dependency
06:49:16zachcarter[12:36am] zachcarter: when I compile my code, if I look in the compiled C sources, none of the procs I’m calling in the wrapped library seem to be getting exposed, I’m guessing because I’m not actually doing any linking
06:49:17zachcarter[12:36am]
06:49:44SusWombatMorning
06:49:59zachcarterI’m wondering what the best way to do this is Araq : I’m building a project that depends on a my bindings to bgfx and I’d like to deploy it to android and link bgfx statically
06:50:33ftsfhttps://gist.github.com/ftsf/988228c32d0b261d7dd2e8542f57e4d6 this is very odd! o__O
06:50:39zachcarterif I compile using dynlibOverride in the project I’m trying to deploy, I don’t see the procs I’m calling in the generated C code
06:50:55zachcarter(the procs binding to bgfx I mean)
06:51:39zachcarterand good morning all
06:51:58ftsfmornin
06:52:03Araqftsf: is that a seq of arrays?
06:52:19Araqthere is no $ for arrays iirc so neither should compile iirc
06:52:28ftsfAraq, it's a seq of Vec3f... which (checks) they are arrays.
06:52:49ftsfwait, no objects
06:53:15ftsfhttps://github.com/krux02/nim-glm/blob/master/glm/vec.nim Vec3f is defined here
06:55:36ftsfwhen iterating, from the second index on they appear incorrectly
06:58:37*user0____ joined #nim
06:58:42Araqzachcarter: why would they be exposed?
06:59:04ftsfhmm, a simple test case seems to work, so maybe i'm corrupting stuff
06:59:15zachcarteryeah I mean I guess it makes sense they wouldn’t be, but I’m not sure what the best way to go about this is
07:00:30Araqzachcarter: the linking step doesn't generate C code, so if you leave it out, nothing changes
07:01:06zachcarterhmm okay, something else must be going on then
07:01:15AraqI don't understand your problem. android gets a list of C files
07:01:46zachcarteryeah I don’t have any problem getting a Nim program running on android
07:02:02zachcarterit’s once I make a call into a static library I’m tring to link to that things fall apart
07:03:17ftsfmyseq.add(foo) and myseq.add([foo]) should behave identically yes? if they're not it would suggest memory corruption?
07:03:40Araqftsf: perhaps
07:03:46zachcarterprogram A) calls Nim procedure foo which calls C procedure bar
07:05:27zachcarterfoo is my bgfx binding methods, bar is the underlying C bgfx code and program A) is my nim program
07:05:53zachcarterthat’s what I can’t get working on android
07:08:54Araqif the C bgfx code in the dir too?
07:08:58Araq*is
07:09:17zachcarterno
07:09:34zachcarterI didn’t think about trying that
07:41:48*xet7_ joined #nim
07:44:33*xet7 quit (Ping timeout: 256 seconds)
07:50:49*user0___ joined #nim
07:51:34*user0____ quit (Read error: Connection reset by peer)
07:51:48*user0___ quit (Read error: Connection reset by peer)
07:52:35*user0___ joined #nim
07:54:51*user0___ quit (Client Quit)
08:01:43*Trustable joined #nim
08:23:52*littleli joined #nim
08:29:04*gangstacat quit (Quit: Ĝis)
08:35:12*gangstacat joined #nim
08:44:28*pie____ quit (Ping timeout: 240 seconds)
09:11:17*gangstacat quit (Quit: Ĝis)
09:17:49*gangstacat joined #nim
09:36:02*wgf_ joined #nim
09:36:44*tdc joined #nim
09:37:08*tdc is now known as Guest70241
09:37:45*Guest70241 quit (Remote host closed the connection)
10:06:20*vlad1777d joined #nim
10:12:24*Vladar quit (Remote host closed the connection)
10:30:31*wgf_ quit (Quit: Leaving)
10:38:33*couven92 joined #nim
11:02:20*Snircle joined #nim
11:03:51*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
11:14:34dom96Has anybody else been able to use project_name.nims vs. project_name.nim.cfg successfully.
11:14:37dom96*?
11:16:05*zachcarter quit (Quit: zachcarter)
11:24:50*tankfeeder joined #nim
11:28:08*willprice joined #nim
11:30:27*willprice quit (Remote host closed the connection)
11:38:16*bjz joined #nim
11:39:51*bjz quit (Client Quit)
11:41:17*elrood joined #nim
11:58:52*bjz joined #nim
12:08:27FromGitter<rsirres> hey guys
12:08:40FromGitter<rsirres> is it possible to pass a table as arguments ?
12:09:23FromGitter<rsirres> in python I would do the following:
12:09:26FromGitter<rsirres> d = {'param' : 'test'}
12:09:33FromGitter<rsirres> f(**d)
12:09:50FromGitter<rsirres> which is equivalent to f(param="test")
12:10:20dom96Sadly no, that would be nice to have though :)
12:11:58FromGitter<rsirres> :(
12:12:11FromGitter<rsirres> thx for the quick response ^^
12:12:42Araqthat can only be done with a macro
12:13:05couven92Araq, do we want to do this first class?
12:13:28Araqcouven92: hell no.
12:13:45FromGitter<rsirres> in javascript one has the special variable "arguments"
12:14:18Araqyes, we're not JS, we're Nim. and we don't have dynamic typing.
12:14:20couven92I mean.... I come from C# where we don't (really) have this and I do not really feel a need for this... (But that is just me)
12:14:39FromGitter<rsirres> ok
12:15:19*user0___ joined #nim
12:23:30*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
12:24:21*bjz joined #nim
12:25:51*ehmry[m] quit (Remote host closed the connection)
12:25:52*Guest73656[m] quit (Read error: Connection reset by peer)
12:25:52*stisa quit (Read error: Connection reset by peer)
12:25:53*Jipok[m] quit (Read error: Connection reset by peer)
12:25:53*dyce[m] quit (Write error: Connection reset by peer)
12:25:54*hohlerde quit (Write error: Broken pipe)
12:25:54*M-Quora quit (Remote host closed the connection)
12:25:54*TheManiac quit (Write error: Connection reset by peer)
12:25:54*jivank[m] quit (Write error: Broken pipe)
12:25:54*MrAxilus[m] quit (Write error: Connection reset by peer)
12:38:05*dyce[m] joined #nim
13:06:56*Vladar joined #nim
13:14:36*couven92 quit (Ping timeout: 240 seconds)
13:27:11*bjz_ joined #nim
13:27:49*bjz quit (Ping timeout: 240 seconds)
13:28:45*jivank[m] joined #nim
13:28:47*hohlerde joined #nim
13:28:49*MrAxilus[m] joined #nim
13:28:49*M-Quora joined #nim
13:28:49*ehmry[m] joined #nim
13:28:54*stisa joined #nim
13:28:56*Jipok[m] joined #nim
13:28:56*TheManiac joined #nim
13:28:56*Guest73656[m] joined #nim
13:30:13*couven92 joined #nim
13:37:17*arnetheduck quit (Ping timeout: 268 seconds)
13:38:57littlelihi guys, I'm completely new to Nim and I'm a Mac user with the most recent version of the OS version. I don't see homebrew as recommended way to use Nim. Is it ok to use the version from brew?
13:42:57FromGitter<Varriount> littleli: The version on brew is probably out of date
13:42:57*Trustable quit (Remote host closed the connection)
13:43:51FromGitter<Varriount> Unless this is a cask or something (IIRC, casks allow for downloading latest sources, etc)
13:47:49littlelithere is nim 0.16 in brew, which should be the most recent one. So I'm rather lucky.
13:48:31dom96Installing it via brew should work fine.
13:48:47dom96You can also install the latest development version by running ``brew install --HEAD nim`` IIRC
13:49:20FromGitter<Varriount> Who maintains the brew package?
13:49:32ftsfopengl is so frustrating sometimes
13:49:38dom96Varriount: cask is for GUI apps
13:50:18FromGitter<Varriount> dom96: My bad.
13:50:36FromGitter<Varriount> ftsf: Only sometimes? ;p
13:50:48ftsfsometimes i'm lucky =)
13:51:24ftsfi got it to load my model and textures and draw them and i can move the camera around with keyboard + mouse
13:51:36ftsfbut then i tried to add deferred rendering and now it's broken /o\
13:54:02littlelidocker is also possible, but sounds a little bit like overkill to me
13:54:43littleliis there a good support in some popular editors?
13:54:53littleliI like to use vscode
13:55:55littleliok, there is 5 star nim extension to vscode... I'll give it a try
14:19:58*bjz joined #nim
14:20:05*bjz_ quit (Ping timeout: 256 seconds)
14:23:23*tankfeeder quit (Quit: Leaving)
14:32:41*elrood quit (Ping timeout: 260 seconds)
14:43:11*PMunch joined #nim
14:48:08*tankfeeder joined #nim
14:56:23dom96hrm, it would be interesting to rate the popularity of programming languages based on the amount of discussion happening in each language's Gitter/IRC/Slack channels.
14:56:41PMunchHmm, indeed
14:56:51*gokr joined #nim
14:56:56PMunchBut do you weight all messages equally?
14:57:01PMunchIRC has a limit on message length
14:58:41dom96True. But that shouldn't have that much of an effect on the results.
14:58:59PMunchProbably not
14:59:15PMunchAnd of course the regular problem with these metrics arises
14:59:19dom96You could also look at the amount of messages and how many different users are writing those messages.
14:59:39PMunchOh yeah, that would definitely be interesting
15:00:26PMunchThe problem is distinguishing the conversation. We could talk about anything in here and it would count as language popularity
15:01:30dom96Sure, no statistics is perfect.
15:01:38dom96But it would nonetheless be interesting
15:01:51PMunchI did find a Nim IRC bot a while ago
15:02:03dom96NimBot?
15:02:07PMunchYeah
15:02:11dom96I wrote it :P
15:02:16PMunchOh nice
15:02:30PMunchBut you might get more instant results from looking at IRC logs
15:02:43dom96hrm, true.
15:02:54dom96An application that analyses IRC logs would probably work best
15:02:57PMunchBut that would require you to write parsers for the different logs
15:03:21PMunchAnd some logs might filter out join/quit messages which could be interesting
15:03:24dom96For Slack and Gitter that would work well, but for IRC-- yeah, you'd get many different formats.
15:03:42PMunchWith the IRC bot approach you would be able to get the same data on all channels
15:03:51dom96yep
15:04:15PMunchAnd you could even gauge the popularity of anything with an IRC channel
15:04:56dom96So many ideas, so little time :)
15:05:07*vlad1777d quit (Remote host closed the connection)
15:05:17PMunchIndeed
15:05:32dom96I have another idea as well, for our new website's features page.
15:05:41dom96Which I might actually do today
15:05:44Calinouhi
15:05:49PMunchFeatures page?
15:05:55PMunchHi Calinou
15:06:06dom96An implementation of the Snake game using our JS backend to show it off to new users.
15:06:21PMunchOh that would be cool
15:06:51dom96Hrm, I could make it even cooler by showing real-time high scores :P
15:07:02dom96Damn, that in itself might be a fun little game lol
15:08:28PMunchHaha, that sounds awesome :P
15:12:19PMunchHmm, building NimBot fails
15:12:26PMunchI cloned the repo and ran nimble install
15:12:41PMunchIt grabbed irc and jester but failed the compilation with a traceback..
15:12:54dom96what's error?
15:12:55*user0___ quit (Quit: user0___)
15:13:10*user0___ joined #nim
15:13:12dom96Argh. def-pri-pub's html5_canvas has no release tags.
15:13:49PMunchhttp://ix.io/p5t
15:14:06PMunchThat's with --verbose
15:14:18Xedom96: when you download the library then, you'll always have to get a HEAD
15:14:32dom96PMunch: try --debug
15:14:43*Serenitor joined #nim
15:14:43dom96or compile using nim
15:14:57PMunchnimbot.nim(8, 14) Error: undeclared identifier: 'PAsyncIRC'
15:15:00dom96Xe: yeah, it's not the end of the world, just not ideal.
15:15:13PMunchhttp://ix.io/p5u
15:15:36dom96PMunch: Ahh. Looks like PAsyncIRC was renamed without a deprecated alias in the IRC package.
15:16:15dom96PMunch: Fix should be a simple s/PAsyncIRC/AsyncIRC/
15:16:21dom96PRs appreciated :)
15:18:54PMunchNow I'm getting nimbot.nim(8, 3) Error: illegal recursion in type 'AsyncIRC'
15:19:04dom96Any good libraries for 2D collision detection in Nim?
15:19:17PMunchOh wait :P
15:19:47PMunchWhat do you need? Some of the game engines/libraries have decent implementations
15:20:06*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
15:20:19*vlad1777d joined #nim
15:20:21dom96Something that will work with JS
15:20:26dom96so it should be written in Nim
15:20:28dom96and be simple
15:20:39dom96I guess I'll end up using what I already have from another game I was writing
15:21:54*NimBot-test joined #nim
15:22:05PMunchWhoo, now it works
15:22:10*gokr quit (Ping timeout: 258 seconds)
15:22:16*NimBot-test quit (Remote host closed the connection)
15:22:31PMunchI wrote some simple stuff
15:22:44PMunchIt only does rectangles at the moment
15:23:09PMunchAnd gives you a direction as well
15:23:53dom96I guess I may as well use what I have
15:24:00PMunchhttps://github.com/PMunch/SDLGamelib/blob/master/gamelib/collisions.nim
15:31:43*xet7_ quit (Quit: Leaving)
15:31:58PMunchdom96, https://github.com/nim-lang/nimbot/pull/12
15:32:39dom96thanks, but please don't change its nickname :)
15:33:02PMunch?
15:33:07PMunchOH crap :P
15:33:53PMunchThere
15:39:39dom96Here is my set of modules: https://github.com/dom96/gamelight
15:40:12dom96Merged, thanks.
15:47:30*BitPuffin|osx joined #nim
16:05:15FromGitter<raydf> @dom96, i would like to output the string with the unicode string based encoding like php json_encode. Ex: \u0027 for '
16:05:28FromGitter<raydf> is there any way to do that in nim?
16:06:00dom96So: json_encode("'") -> "\u0027"?
16:06:10FromGitter<raydf> yes
16:06:20*xet7 joined #nim
16:07:16FromGitter<raydf> sorry is there a function json_encode? i'm looking in the docs and can't find it.
16:08:09dom96https://nim-lang.org/docs/json.html#escapeJson,string
16:08:35FromGitter<raydf> nice, thanks for the help (y)
16:09:21dom96np :)
16:10:08PMunchHmm, var users = initTable[string, CountTable]()
16:10:13PMunchThat fails for some reason
16:10:47dom96What error does it give?
16:11:04PMunchOh wait
16:11:13dom96:P
16:11:20dom96Did the error help? :P
16:11:25PMunchIn my editor using NimSuggest it gives me a different error then when I compile..
16:11:51PMunchI get the initTable(64) unknown type error in my editor
16:12:12PMunchBut when I compile I get invalid type CountTable in this context
16:14:11dom96Yeah, don't trust NimSuggest 100% just yet :)
16:14:36PMunchThe problem is that I can trust it 90% :P So I end up trusting it too much
16:15:03PMunchlib/system.nim(644, 16) Error: invalid type: 'CountTable' in this context: 'proc (s: var seq[KeyValuePair[system.string, tables.CountTable]], len: Natural){.noSideEffect.}'
16:15:10PMunchThat's the actual error
16:21:07*PMunch quit (Quit: leaving)
16:26:29*BitPuffin|osx quit (Ping timeout: 240 seconds)
16:33:39*xet7 quit (Ping timeout: 268 seconds)
16:39:57*SusWombat quit (Remote host closed the connection)
16:41:41*SusWombat joined #nim
17:16:29*brechtm joined #nim
17:36:33*brechtm_ joined #nim
17:40:15*brechtm quit (Ping timeout: 268 seconds)
17:48:31*SusWombat quit (Quit: Leaving)
17:48:53*SusWombat joined #nim
18:04:32*zachcarter joined #nim
18:15:54*deavmi__ joined #nim
18:20:44zachcartercross compilation is such a bitch
18:20:50zachcarter"/
18:20:51zachcarter:/
18:21:03zachcarterdoing it not so much but verifying that everything is right is
18:27:05*def-pri-pub joined #nim
18:49:37*brechtm_ quit (Remote host closed the connection)
18:52:16*brechtm joined #nim
18:54:25*libman joined #nim
19:03:55*brechtm quit (Remote host closed the connection)
19:15:00*brechtm joined #nim
19:24:10zachcarterWEWT got bgfx initializing on android :D
19:24:54def-pri-pubDoes anyone know if there are any simple collision detection libraries out there for Nim? I not looking for a whole physics engine, but something just like "circle touches box,"
19:25:37Vladardef-pri-pub: as a part of Nimgame2 engine: https://github.com/Vladar4/nimgame2/blob/master/nimgame2/collider.nim
19:26:12Vladarpoint, box, circle, line, polygon
19:27:30*brechtm quit (Remote host closed the connection)
19:28:22zachcarterVladar: Do you mind if I rip off that for frag at least for a starting point for collision detection?
19:29:35Vladarsure, go ahead, also you might want to look at http://paulbourke.net/geometry/
19:29:46zachcarterthank you :D
19:30:11zachcarterbookmarked
19:34:12*brechtm joined #nim
19:34:17*Ven joined #nim
19:34:42*Ven is now known as Guest27220
19:36:26*brechtm quit (Remote host closed the connection)
19:37:03*brechtm joined #nim
19:37:57*kulelu88 joined #nim
19:38:18kulelu88does anybody have an example for using parsesql.nim ?
19:39:23Araq echo(renderSQL(parseSQL(newStringStream("""
19:39:23Araq CREATE TYPE happiness AS ENUM ('happy', 'very happy', 'ecstatic');
19:39:23Araq CREATE TABLE holidays (
19:39:23Araq num_weeks int,
19:39:24Araq happiness happiness
19:39:25Araq );
19:39:25*rauss joined #nim
19:39:26Araq CREATE INDEX table1_attr1 ON table1(attr1);
19:39:27Araq SELECT * FROM myTab WHERE col1 = 'happy';
19:39:28Araq """), "stdin")))
19:41:18*brechtm quit (Ping timeout: 258 seconds)
19:41:54*brechtm joined #nim
19:41:57def-pri-pubHow do you tell if a file is being compiled as a lib again?
19:42:10def-pri-pubwasn't it `when defined(lib)` or something like that?
19:44:22Araqwhen appType == "lib"
19:45:40def-pri-pubthanks!
19:54:10dom96Araq: Gist it next time. Copying this is a PITA.
19:54:40Araqit's only 11 lines.
19:55:00Araq9 even
19:55:45zachcarterMy IRC client warns me anything over 8 I thnk
19:55:46zachcarter:P
19:55:49dom965 too many
19:58:00Calinou4 is the limit before throttling
19:58:09Calinou(in most clients/servers)
20:00:06kulelu88Araq: is that an example to open a .sql file and parse its contents ?
20:00:52Araqit shows how to parse sql into an AST and how to get back a readable string from AST again
20:20:19*deavmi__ quit (Quit: deavmi__)
20:28:18FromGitter<moigagoo> I've been fooling around with Nim's JS backend and dom module. How do I get and set an input value? Unlike in JS, in Nim`Element` type doesn't have `value` attribute, so I can't do `e.value = "myvalue"`. Setting `e.nodeValue = "myvalue"` doesn't work either because, per specification, `nodeValue` of `Node`s of type `Element` is `null` and can't be set.
20:31:38FromGitter<moigagoo> I can set the value with `e.setAttribute("value", "myvalue")` and get the value with `getAttribute` after that, *but* if the value is not set with `setAttribute`, there's no way to get it. At least, I haven't found any.
20:32:45stisamoigagoo I think you can define a type Input that inherits from Element, and add the field value there
20:33:42*tankfeeder quit (Quit: Leaving)
20:34:03FromGitter<moigagoo> @stisa Still, how would I extract the input's value in this type? I still have to do it through existing Element's and Node's methods, don't I?
20:39:15kulelu88Araq: getting this error: file.nim(3, 25) Error: undeclared identifier: 'newStringStream'
20:39:46dom96kulelu88: https://nim-lang.org/docs/theindex.html Ctrl+F: newStringStream
20:39:57*rauss quit (Quit: WeeChat 1.7)
20:40:38dom96moigagoo: Try casting to OptionElement
20:40:48kulelu88requires a lib? dom96
20:41:25dom96kulelu88: It's in the stdlib
20:41:34dom96Doing what I said yields the following:
20:41:35dom96newStringStream:
20:41:35dom96 streams : newStringStream(s: string = ""): StringStream
20:41:36kulelu88import streams
20:41:40dom96indeed
20:42:44kulelu88I'm not sure if I am doing something right/wrong here, but all it does it echoes the contents
20:43:55*demi- quit (Quit: Server shutdown in 3... 2... 1...)
20:43:55stisamoigagoo not sure I understand, I meant something like https://gist.github.com/stisa/6e56afa0b8bd2ef0c203253df053b8d3
20:47:16FromGitter<moigagoo> @dom96 Thanks, it did the trick! I did notice that OptionElement had this `value` attribute but didn't think I could actually just cast an `Element` to it. ⏎ ⏎ Is this a workaround around missing functionality in dom module (i.e. `value` attribute for `Element`) or the right way to assign value to and read values from inputs?
20:47:24dom96kulelu88: the `$` for whatever type it returns probably simply renders it as SQL
20:48:11dom96moigagoo: good question. I'm not sure because I didn't write the dom module. Araq should know.
20:48:40*demi- joined #nim
20:49:03kulelu88dom96: do you use wordpress?
20:49:04dom96But yeah, you can do what stisa said as well I think. Just please, please, don't put your 'type' on the same line as your type identifier :)
20:49:37dom96kulelu88: Not really, why?
20:49:50kulelu88dom96: that is the database I want to parse into nim
20:49:57kulelu88well not the DB, just 1 table
20:50:13dom96Why do you need to parse SQL for that?
20:50:45kulelu88dom96: so that I can do some pattern-matching with regex
20:50:49FromGitter<moigagoo> @stisa Thanks a ton! Looks like a nice and clean way to do it.
20:51:24dom96kulelu88: what's the end goal of this?
20:52:18kulelu88dom96: mostly experimental for now, but I want to match certain pieces of DB-data with their regex (like finding google-ad links)
20:54:31kulelu88I was told I should parse the SQL first and not run queries against the entire .sql file
20:54:55stisabtw dom96,what's the reason for type on another line? I often collapse all in my editor, and it would hide types names
20:56:09dom96stisa: because you usually have more than one type definition in the same file, and they should be placed under one type section.
21:01:31Araqkulelu88: why not use db_mysql ?
21:01:32stisaMmh ok, well I still prefer my type names to be visible when collapse. Does that mean const,let,var sections should be preferred too?
21:01:49kulelu88Araq: is that another built-in ?
21:02:05Araqit's a stdlib module, yes.
21:02:33Araqplease don't misuse the word built-in
21:02:53kulelu88Araq: semantics?
21:03:37dom96stisa: only when at the top level.
21:05:28stisadom96 ok thanks
21:06:25Araqkulelu88: builtin in Nim means .magic annotation.
21:07:05kulelu88alright, my mistake then. sorry
21:07:13dom96stisa: That is a good reason to keep them on the same line though.
21:14:17*Trustable joined #nim
21:34:32*Vladar quit (Quit: Leaving)
21:49:55*user0___ quit (Quit: user0___)
22:01:58*brechtm_ joined #nim
22:05:26*brechtm quit (Ping timeout: 258 seconds)
22:05:51*tax joined #nim
22:14:14*sz0 joined #nim
22:19:58*nsf quit (Quit: WeeChat 1.7)
22:24:28*tax quit (Quit: Leaving)
22:26:08*pie_ joined #nim
22:28:01*Trustable quit (Remote host closed the connection)
22:34:44*zxtx quit (Quit: ZNC - http://znc.in)
22:47:49dom96I don't suppose we have anything in the stdlib for prefixing integers with leading zeros do we?
22:48:39Araqdom96: we do. intToStr
22:49:12dom96Awesome :D
22:51:35Araqagain, my questions:
22:52:02Araq* should 'nim c -x' be precise or fast?
22:52:27Araq* can nimble get less picky directory rules?
22:52:52Araqwe can make the compiler 'import jester' transform to 'import jester/jester' if jester is a directory or something
22:53:57AraqI don't want more directories, I hate them. I moved nimsuggest from nim/tools/ to nim/ directly and got more productive working on nimsuggest. no kidding.
22:56:41dom96Isn't what you're suggesting going to increase the amount of directories?
22:56:47dom96In any case, we already discussed this
22:58:41AraqI'm not happy with the outcome.
23:00:33*def-pri-pub quit (Quit: leaving)
23:01:01*libman quit (Quit: Connection closed for inactivity)
23:04:41dom96what is `nim c -x`?
23:05:35Araqnim c -r but it takes checksums of the deps
23:05:44Araqand when nothing changed, it just runs the exe
23:07:43*brechtm_ quit (Remote host closed the connection)
23:28:05*Jesin quit (Quit: Leaving)
23:31:38*Jesin joined #nim
23:38:13*vlad1777d quit (Remote host closed the connection)
23:42:23*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
23:43:56*donlzx joined #nim
23:44:42*zxtx joined #nim
23:45:36donlzxCan anyone point me to some guides or tutorials on how to use assembly codes in a Nim project?
23:46:56donlzxOr is it possible to use some SSE/AVX instructions to speed up complex computations in some easy way?
23:52:23*PMunch joined #nim
23:54:57PMunchvar users = initTable[string, CountTable]()
23:55:04PMunchIt really doesn't like this
23:55:21PMunchlib/system.nim(644, 16) Error: invalid type: 'CountTable' in this context: 'proc (s: var seq[KeyValuePair[system.string, tables.CountTable]], len: Natural){.noSideEffect.}'
23:59:46*def-pri-pub joined #nim
23:59:46*def-pri-pub quit (Changing host)
23:59:46*def-pri-pub joined #nim
23:59:54dom96PMunch: Still having trouble with this?