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:47 | zachcarter | hrm I’m still not understanding how dynlibOverride works |
01:53:54 | zachcarter | can 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:53 | zachcarter | dom96: 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:05 | zachcarter | looks like a dynamic link to me :/ |
03:08:21 | * | brson quit (Quit: leaving) |
03:19:45 | * | girvo joined #nim |
03:26:10 | ftsf | zachcarter, need to specify which library to override |
03:26:21 | zachcarter | I believe I am |
03:26:36 | ftsf | eg i have in my nim.cfg dynlibOverride = "SDL2" |
03:26:55 | zachcarter | the command I”m using to compile is this : |
03:27:09 | zachcarter | nimble c --dynlibOverride:bgfx-shared-libDebug -r examples/desktop/00-hello-world/main |
03:27:20 | zachcarter | I’m not even providing a library to statically link against |
03:27:20 | ftsf | if you're running on linux try using ldd on the created binary to see if it shows in the list |
03:27:36 | zachcarter | and my example still runs fine |
03:28:52 | ftsf | what's the code with the {.dynlib: ???.} |
03:29:10 | zachcarter | one sec |
03:29:36 | zachcarter | https://github.com/zacharycarter/bgfx.nim/blob/master/bgfxdotnim.nim#L1-L10 |
03:30:00 | zachcarter | do I need to be overriding libname? |
03:30:19 | ftsf | mmm seems like that should be fine, assuming you're doing a debug build |
03:31:16 | ftsf | according to --advanced the matching is fuzzy |
03:31:29 | ftsf | --dynlibOverride:lua matches dynlib: "liblua.so.3" |
03:31:45 | zachcarter | hmm okay |
03:32:16 | ftsf | does ldd ./outputbin show the bgfx library? |
03:32:20 | ftsf | (if you're on linux) |
03:32:29 | zachcarter | I’m on osx |
03:32:33 | ftsf | not sure of the equivalent on that |
03:32:34 | zachcarter | let me try to find the equivalent command |
03:32:53 | zachcarter | otool -L apparently |
03:33:35 | zachcarter | main: |
03:33:35 | zachcarter | /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0) |
03:33:36 | zachcarter | is all I get |
03:35:15 | ftsf | not sure sorry, but doesn't look like it's doing what you want |
03:35:35 | zachcarter | yeah :/ |
03:35:46 | zachcarter | thanks for trying to help though :) |
03:35:56 | FromGitter | <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:43 | zachcarter | I’m reading this irc log ftsf: https://irclogs.nim-lang.org/03-10-2016.html |
03:44:53 | zachcarter | apparently on osx anyway, nim doesn’t bundle shared libraries with the executable |
03:45:06 | zachcarter | https://irclogs.nim-lang.org/03-10-2016.html#09:39:08 |
03:46:20 | zachcarter | so I’m not sure wtf dynliboverride is supposed to do for me |
03:46:26 | zachcarter | ugh |
03:47:22 | ftsf | at least on linux it makes the linker do the work instead of using dlopen to link at runtime |
03:48:06 | zachcarter | yeah |
03:58:04 | zachcarter | okay intersting... |
03:58:11 | zachcarter | dynliboverride seems to work with a simpler library name |
03:58:15 | zachcarter | think this is a bug perhaps |
04:02:03 | * | girvo quit (Quit: leaving) |
04:13:25 | FromGitter | <Varriount> zachcarter: https://nim-lang.org/docs/nimc.html#dynliboverride |
04:13:43 | FromGitter | <Varriount> It's primarily used to force static linking instead of dynamic linking. |
04:13:54 | zachcarter | yeah that’s exactly what I’m trying to do |
04:14:03 | zachcarter | I just couldn’t get the pattern to match my library but I think I got it now |
04:33:03 | zachcarter | still not really sure how to accomplish what I’m trying to do |
04:33:06 | zachcarter | :/ |
04:33:41 | ftsf | what are you trying to do? |
04:33:55 | zachcarter | it’s a little complicated but I’ll try to explain to the best of my ability |
04:34:01 | zachcarter | I have project A) which I’m deploying to android |
04:34:38 | 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 |
04:35:07 | zachcarter | now one of the files I”m compiling references another module I’ve built - that bgfx wrapper |
04:35:20 | zachcarter | and I’m using nimble to manage the dependency |
04:36:07 | 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 |
04:36:17 | * | CabbageLife joined #nim |
04:36:30 | * | CabbageLife left #nim ("Leaving") |
04:37:15 | zachcarter | https://gist.github.com/zacharycarter/374e68dde969c7609d10f86cceb4385d |
04:37:24 | zachcarter | one file is the generated C sources for the wrapper |
04:37:40 | zachcarter | the other file is where I’m referencing the module and calling a method in the wrapped library, specificlally on this line - |
04:37:51 | zachcarter | https://gist.github.com/zacharycarter/374e68dde969c7609d10f86cceb4385d#file-test-nim-L30 |
04:38:05 | zachcarter | but that init method is nowhere inside the generated C sources for the bindings |
04:39:28 | ftsf | i dunno sorry |
04:39:58 | zachcarter | all 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:43 | zachcarter | well… 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:48 | zachcarter | going to have to ask Araq about this tomorrow |
06:14:52 | zachcarter | or 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:44 | Araq | zachcarter: what's the question? |
06:49:12 | zachcarter | zachcarter: I have project A) which I’m deploying to android |
06:49:12 | zachcarter | [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:14 | zachcarter | [12:35am] zachcarter: now one of the files I”m compiling references another module I’ve built - that bgfx wrapper |
06:49:15 | zachcarter | [12:35am] zachcarter: and I’m using nimble to manage the dependency |
06:49:16 | zachcarter | [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:17 | zachcarter | [12:36am] |
06:49:44 | SusWombat | Morning |
06:49:59 | zachcarter | I’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:33 | ftsf | https://gist.github.com/ftsf/988228c32d0b261d7dd2e8542f57e4d6 this is very odd! o__O |
06:50:39 | zachcarter | if 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:55 | zachcarter | (the procs binding to bgfx I mean) |
06:51:39 | zachcarter | and good morning all |
06:51:58 | ftsf | mornin |
06:52:03 | Araq | ftsf: is that a seq of arrays? |
06:52:19 | Araq | there is no $ for arrays iirc so neither should compile iirc |
06:52:28 | ftsf | Araq, it's a seq of Vec3f... which (checks) they are arrays. |
06:52:49 | ftsf | wait, no objects |
06:53:15 | ftsf | https://github.com/krux02/nim-glm/blob/master/glm/vec.nim Vec3f is defined here |
06:55:36 | ftsf | when iterating, from the second index on they appear incorrectly |
06:58:37 | * | user0____ joined #nim |
06:58:42 | Araq | zachcarter: why would they be exposed? |
06:59:04 | ftsf | hmm, a simple test case seems to work, so maybe i'm corrupting stuff |
06:59:15 | zachcarter | yeah 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:30 | Araq | zachcarter: the linking step doesn't generate C code, so if you leave it out, nothing changes |
07:01:06 | zachcarter | hmm okay, something else must be going on then |
07:01:15 | Araq | I don't understand your problem. android gets a list of C files |
07:01:46 | zachcarter | yeah I don’t have any problem getting a Nim program running on android |
07:02:02 | zachcarter | it’s once I make a call into a static library I’m tring to link to that things fall apart |
07:03:17 | ftsf | myseq.add(foo) and myseq.add([foo]) should behave identically yes? if they're not it would suggest memory corruption? |
07:03:40 | Araq | ftsf: perhaps |
07:03:46 | zachcarter | program A) calls Nim procedure foo which calls C procedure bar |
07:05:27 | zachcarter | foo is my bgfx binding methods, bar is the underlying C bgfx code and program A) is my nim program |
07:05:53 | zachcarter | that’s what I can’t get working on android |
07:08:54 | Araq | if the C bgfx code in the dir too? |
07:08:58 | Araq | *is |
07:09:17 | zachcarter | no |
07:09:34 | zachcarter | I 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:34 | dom96 | Has anybody else been able to use project_name.nims vs. project_name.nim.cfg successfully. |
11:14:37 | dom96 | *? |
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:27 | FromGitter | <rsirres> hey guys |
12:08:40 | FromGitter | <rsirres> is it possible to pass a table as arguments ? |
12:09:23 | FromGitter | <rsirres> in python I would do the following: |
12:09:26 | FromGitter | <rsirres> d = {'param' : 'test'} |
12:09:33 | FromGitter | <rsirres> f(**d) |
12:09:50 | FromGitter | <rsirres> which is equivalent to f(param="test") |
12:10:20 | dom96 | Sadly no, that would be nice to have though :) |
12:11:58 | FromGitter | <rsirres> :( |
12:12:11 | FromGitter | <rsirres> thx for the quick response ^^ |
12:12:42 | Araq | that can only be done with a macro |
12:13:05 | couven92 | Araq, do we want to do this first class? |
12:13:28 | Araq | couven92: hell no. |
12:13:45 | FromGitter | <rsirres> in javascript one has the special variable "arguments" |
12:14:18 | Araq | yes, we're not JS, we're Nim. and we don't have dynamic typing. |
12:14:20 | couven92 | I 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:39 | FromGitter | <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:57 | littleli | hi 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:57 | FromGitter | <Varriount> littleli: The version on brew is probably out of date |
13:42:57 | * | Trustable quit (Remote host closed the connection) |
13:43:51 | FromGitter | <Varriount> Unless this is a cask or something (IIRC, casks allow for downloading latest sources, etc) |
13:47:49 | littleli | there is nim 0.16 in brew, which should be the most recent one. So I'm rather lucky. |
13:48:31 | dom96 | Installing it via brew should work fine. |
13:48:47 | dom96 | You can also install the latest development version by running ``brew install --HEAD nim`` IIRC |
13:49:20 | FromGitter | <Varriount> Who maintains the brew package? |
13:49:32 | ftsf | opengl is so frustrating sometimes |
13:49:38 | dom96 | Varriount: cask is for GUI apps |
13:50:18 | FromGitter | <Varriount> dom96: My bad. |
13:50:36 | FromGitter | <Varriount> ftsf: Only sometimes? ;p |
13:50:48 | ftsf | sometimes i'm lucky =) |
13:51:24 | ftsf | i got it to load my model and textures and draw them and i can move the camera around with keyboard + mouse |
13:51:36 | ftsf | but then i tried to add deferred rendering and now it's broken /o\ |
13:54:02 | littleli | docker is also possible, but sounds a little bit like overkill to me |
13:54:43 | littleli | is there a good support in some popular editors? |
13:54:53 | littleli | I like to use vscode |
13:55:55 | littleli | ok, 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:23 | dom96 | hrm, 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:41 | PMunch | Hmm, indeed |
14:56:51 | * | gokr joined #nim |
14:56:56 | PMunch | But do you weight all messages equally? |
14:57:01 | PMunch | IRC has a limit on message length |
14:58:41 | dom96 | True. But that shouldn't have that much of an effect on the results. |
14:58:59 | PMunch | Probably not |
14:59:15 | PMunch | And of course the regular problem with these metrics arises |
14:59:19 | dom96 | You could also look at the amount of messages and how many different users are writing those messages. |
14:59:39 | PMunch | Oh yeah, that would definitely be interesting |
15:00:26 | PMunch | The problem is distinguishing the conversation. We could talk about anything in here and it would count as language popularity |
15:01:30 | dom96 | Sure, no statistics is perfect. |
15:01:38 | dom96 | But it would nonetheless be interesting |
15:01:51 | PMunch | I did find a Nim IRC bot a while ago |
15:02:03 | dom96 | NimBot? |
15:02:07 | PMunch | Yeah |
15:02:11 | dom96 | I wrote it :P |
15:02:16 | PMunch | Oh nice |
15:02:30 | PMunch | But you might get more instant results from looking at IRC logs |
15:02:43 | dom96 | hrm, true. |
15:02:54 | dom96 | An application that analyses IRC logs would probably work best |
15:02:57 | PMunch | But that would require you to write parsers for the different logs |
15:03:21 | PMunch | And some logs might filter out join/quit messages which could be interesting |
15:03:24 | dom96 | For Slack and Gitter that would work well, but for IRC-- yeah, you'd get many different formats. |
15:03:42 | PMunch | With the IRC bot approach you would be able to get the same data on all channels |
15:03:51 | dom96 | yep |
15:04:15 | PMunch | And you could even gauge the popularity of anything with an IRC channel |
15:04:56 | dom96 | So many ideas, so little time :) |
15:05:07 | * | vlad1777d quit (Remote host closed the connection) |
15:05:17 | PMunch | Indeed |
15:05:32 | dom96 | I have another idea as well, for our new website's features page. |
15:05:41 | dom96 | Which I might actually do today |
15:05:44 | Calinou | hi |
15:05:49 | PMunch | Features page? |
15:05:55 | PMunch | Hi Calinou |
15:06:06 | dom96 | An implementation of the Snake game using our JS backend to show it off to new users. |
15:06:21 | PMunch | Oh that would be cool |
15:06:51 | dom96 | Hrm, I could make it even cooler by showing real-time high scores :P |
15:07:02 | dom96 | Damn, that in itself might be a fun little game lol |
15:08:28 | PMunch | Haha, that sounds awesome :P |
15:12:19 | PMunch | Hmm, building NimBot fails |
15:12:26 | PMunch | I cloned the repo and ran nimble install |
15:12:41 | PMunch | It grabbed irc and jester but failed the compilation with a traceback.. |
15:12:54 | dom96 | what's error? |
15:12:55 | * | user0___ quit (Quit: user0___) |
15:13:10 | * | user0___ joined #nim |
15:13:12 | dom96 | Argh. def-pri-pub's html5_canvas has no release tags. |
15:13:49 | PMunch | http://ix.io/p5t |
15:14:06 | PMunch | That's with --verbose |
15:14:18 | Xe | dom96: when you download the library then, you'll always have to get a HEAD |
15:14:32 | dom96 | PMunch: try --debug |
15:14:43 | * | Serenitor joined #nim |
15:14:43 | dom96 | or compile using nim |
15:14:57 | PMunch | nimbot.nim(8, 14) Error: undeclared identifier: 'PAsyncIRC' |
15:15:00 | dom96 | Xe: yeah, it's not the end of the world, just not ideal. |
15:15:13 | PMunch | http://ix.io/p5u |
15:15:36 | dom96 | PMunch: Ahh. Looks like PAsyncIRC was renamed without a deprecated alias in the IRC package. |
15:16:15 | dom96 | PMunch: Fix should be a simple s/PAsyncIRC/AsyncIRC/ |
15:16:21 | dom96 | PRs appreciated :) |
15:18:54 | PMunch | Now I'm getting nimbot.nim(8, 3) Error: illegal recursion in type 'AsyncIRC' |
15:19:04 | dom96 | Any good libraries for 2D collision detection in Nim? |
15:19:17 | PMunch | Oh wait :P |
15:19:47 | PMunch | What 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:21 | dom96 | Something that will work with JS |
15:20:26 | dom96 | so it should be written in Nim |
15:20:28 | dom96 | and be simple |
15:20:39 | dom96 | I 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:05 | PMunch | Whoo, 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:31 | PMunch | I wrote some simple stuff |
15:22:44 | PMunch | It only does rectangles at the moment |
15:23:09 | PMunch | And gives you a direction as well |
15:23:53 | dom96 | I guess I may as well use what I have |
15:24:00 | PMunch | https://github.com/PMunch/SDLGamelib/blob/master/gamelib/collisions.nim |
15:31:43 | * | xet7_ quit (Quit: Leaving) |
15:31:58 | PMunch | dom96, https://github.com/nim-lang/nimbot/pull/12 |
15:32:39 | dom96 | thanks, but please don't change its nickname :) |
15:33:02 | PMunch | ? |
15:33:07 | PMunch | OH crap :P |
15:33:53 | PMunch | There |
15:39:39 | dom96 | Here is my set of modules: https://github.com/dom96/gamelight |
15:40:12 | dom96 | Merged, thanks. |
15:47:30 | * | BitPuffin|osx joined #nim |
16:05:15 | FromGitter | <raydf> @dom96, i would like to output the string with the unicode string based encoding like php json_encode. Ex: \u0027 for ' |
16:05:28 | FromGitter | <raydf> is there any way to do that in nim? |
16:06:00 | dom96 | So: json_encode("'") -> "\u0027"? |
16:06:10 | FromGitter | <raydf> yes |
16:06:20 | * | xet7 joined #nim |
16:07:16 | FromGitter | <raydf> sorry is there a function json_encode? i'm looking in the docs and can't find it. |
16:08:09 | dom96 | https://nim-lang.org/docs/json.html#escapeJson,string |
16:08:35 | FromGitter | <raydf> nice, thanks for the help (y) |
16:09:21 | dom96 | np :) |
16:10:08 | PMunch | Hmm, var users = initTable[string, CountTable]() |
16:10:13 | PMunch | That fails for some reason |
16:10:47 | dom96 | What error does it give? |
16:11:04 | PMunch | Oh wait |
16:11:13 | dom96 | :P |
16:11:20 | dom96 | Did the error help? :P |
16:11:25 | PMunch | In my editor using NimSuggest it gives me a different error then when I compile.. |
16:11:51 | PMunch | I get the initTable(64) unknown type error in my editor |
16:12:12 | PMunch | But when I compile I get invalid type CountTable in this context |
16:14:11 | dom96 | Yeah, don't trust NimSuggest 100% just yet :) |
16:14:36 | PMunch | The problem is that I can trust it 90% :P So I end up trusting it too much |
16:15:03 | PMunch | lib/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:10 | PMunch | That'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:44 | zachcarter | cross compilation is such a bitch |
18:20:50 | zachcarter | "/ |
18:20:51 | zachcarter | :/ |
18:21:03 | zachcarter | doing 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:10 | zachcarter | WEWT got bgfx initializing on android :D |
19:24:54 | def-pri-pub | Does 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:37 | Vladar | def-pri-pub: as a part of Nimgame2 engine: https://github.com/Vladar4/nimgame2/blob/master/nimgame2/collider.nim |
19:26:12 | Vladar | point, box, circle, line, polygon |
19:27:30 | * | brechtm quit (Remote host closed the connection) |
19:28:22 | zachcarter | Vladar: Do you mind if I rip off that for frag at least for a starting point for collision detection? |
19:29:35 | Vladar | sure, go ahead, also you might want to look at http://paulbourke.net/geometry/ |
19:29:46 | zachcarter | thank you :D |
19:30:11 | zachcarter | bookmarked |
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:18 | kulelu88 | does anybody have an example for using parsesql.nim ? |
19:39:23 | Araq | echo(renderSQL(parseSQL(newStringStream(""" |
19:39:23 | Araq | CREATE TYPE happiness AS ENUM ('happy', 'very happy', 'ecstatic'); |
19:39:23 | Araq | CREATE TABLE holidays ( |
19:39:23 | Araq | num_weeks int, |
19:39:24 | Araq | happiness happiness |
19:39:25 | Araq | ); |
19:39:25 | * | rauss joined #nim |
19:39:26 | Araq | CREATE INDEX table1_attr1 ON table1(attr1); |
19:39:27 | Araq | SELECT * FROM myTab WHERE col1 = 'happy'; |
19:39:28 | Araq | """), "stdin"))) |
19:41:18 | * | brechtm quit (Ping timeout: 258 seconds) |
19:41:54 | * | brechtm joined #nim |
19:41:57 | def-pri-pub | How do you tell if a file is being compiled as a lib again? |
19:42:10 | def-pri-pub | wasn't it `when defined(lib)` or something like that? |
19:44:22 | Araq | when appType == "lib" |
19:45:40 | def-pri-pub | thanks! |
19:54:10 | dom96 | Araq: Gist it next time. Copying this is a PITA. |
19:54:40 | Araq | it's only 11 lines. |
19:55:00 | Araq | 9 even |
19:55:45 | zachcarter | My IRC client warns me anything over 8 I thnk |
19:55:46 | zachcarter | :P |
19:55:49 | dom96 | 5 too many |
19:58:00 | Calinou | 4 is the limit before throttling |
19:58:09 | Calinou | (in most clients/servers) |
20:00:06 | kulelu88 | Araq: is that an example to open a .sql file and parse its contents ? |
20:00:52 | Araq | it 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:18 | FromGitter | <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:38 | FromGitter | <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:45 | stisa | moigagoo 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:03 | FromGitter | <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:15 | kulelu88 | Araq: getting this error: file.nim(3, 25) Error: undeclared identifier: 'newStringStream' |
20:39:46 | dom96 | kulelu88: https://nim-lang.org/docs/theindex.html Ctrl+F: newStringStream |
20:39:57 | * | rauss quit (Quit: WeeChat 1.7) |
20:40:38 | dom96 | moigagoo: Try casting to OptionElement |
20:40:48 | kulelu88 | requires a lib? dom96 |
20:41:25 | dom96 | kulelu88: It's in the stdlib |
20:41:34 | dom96 | Doing what I said yields the following: |
20:41:35 | dom96 | newStringStream: |
20:41:35 | dom96 | streams : newStringStream(s: string = ""): StringStream |
20:41:36 | kulelu88 | import streams |
20:41:40 | dom96 | indeed |
20:42:44 | kulelu88 | I'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:55 | stisa | moigagoo not sure I understand, I meant something like https://gist.github.com/stisa/6e56afa0b8bd2ef0c203253df053b8d3 |
20:47:16 | FromGitter | <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:24 | dom96 | kulelu88: the `$` for whatever type it returns probably simply renders it as SQL |
20:48:11 | dom96 | moigagoo: 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:03 | kulelu88 | dom96: do you use wordpress? |
20:49:04 | dom96 | But 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:37 | dom96 | kulelu88: Not really, why? |
20:49:50 | kulelu88 | dom96: that is the database I want to parse into nim |
20:49:57 | kulelu88 | well not the DB, just 1 table |
20:50:13 | dom96 | Why do you need to parse SQL for that? |
20:50:45 | kulelu88 | dom96: so that I can do some pattern-matching with regex |
20:50:49 | FromGitter | <moigagoo> @stisa Thanks a ton! Looks like a nice and clean way to do it. |
20:51:24 | dom96 | kulelu88: what's the end goal of this? |
20:52:18 | kulelu88 | dom96: mostly experimental for now, but I want to match certain pieces of DB-data with their regex (like finding google-ad links) |
20:54:31 | kulelu88 | I was told I should parse the SQL first and not run queries against the entire .sql file |
20:54:55 | stisa | btw 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:09 | dom96 | stisa: because you usually have more than one type definition in the same file, and they should be placed under one type section. |
21:01:31 | Araq | kulelu88: why not use db_mysql ? |
21:01:32 | stisa | Mmh 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:49 | kulelu88 | Araq: is that another built-in ? |
21:02:05 | Araq | it's a stdlib module, yes. |
21:02:33 | Araq | please don't misuse the word built-in |
21:02:53 | kulelu88 | Araq: semantics? |
21:03:37 | dom96 | stisa: only when at the top level. |
21:05:28 | stisa | dom96 ok thanks |
21:06:25 | Araq | kulelu88: builtin in Nim means .magic annotation. |
21:07:05 | kulelu88 | alright, my mistake then. sorry |
21:07:13 | dom96 | stisa: 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:49 | dom96 | I don't suppose we have anything in the stdlib for prefixing integers with leading zeros do we? |
22:48:39 | Araq | dom96: we do. intToStr |
22:49:12 | dom96 | Awesome :D |
22:51:35 | Araq | again, my questions: |
22:52:02 | Araq | * should 'nim c -x' be precise or fast? |
22:52:27 | Araq | * can nimble get less picky directory rules? |
22:52:52 | Araq | we can make the compiler 'import jester' transform to 'import jester/jester' if jester is a directory or something |
22:53:57 | Araq | I 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:41 | dom96 | Isn't what you're suggesting going to increase the amount of directories? |
22:56:47 | dom96 | In any case, we already discussed this |
22:58:41 | Araq | I'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:41 | dom96 | what is `nim c -x`? |
23:05:35 | Araq | nim c -r but it takes checksums of the deps |
23:05:44 | Araq | and 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:36 | donlzx | Can anyone point me to some guides or tutorials on how to use assembly codes in a Nim project? |
23:46:56 | donlzx | Or 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:57 | PMunch | var users = initTable[string, CountTable]() |
23:55:04 | PMunch | It really doesn't like this |
23:55:21 | PMunch | lib/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:54 | dom96 | PMunch: Still having trouble with this? |