00:02:08 | * | ftsf_ quit (Ping timeout: 246 seconds) |
00:02:24 | * | Jesin quit (Quit: Leaving) |
00:03:01 | * | Jesin joined #nim |
00:14:07 | * | ftsf_ joined #nim |
00:32:48 | zachcarter | morning ftsf_ |
00:33:00 | zachcarter | hrm.. just noticed something interesting about the SDL2 bindings |
00:33:08 | ftsf_ | how goes your framework zachcarter? |
00:33:17 | zachcarter | great thanks! got it running on android last night |
00:33:51 | zachcarter | I don’t think this is right - https://github.com/nim-lang/sdl2/blob/master/src/sdl2/image.nim#L18 |
00:33:51 | ftsf_ | awesome =) |
00:33:55 | zachcarter | thanks :D |
00:34:19 | ftsf_ | what's wrong with it? |
00:34:20 | zachcarter | oh maybe it is |
00:34:24 | zachcarter | if I install the correct version of the library... |
00:34:34 | zachcarter | well it’s interesting |
00:34:50 | ftsf_ | should probably split the external libraries out of the SDL wrapper |
00:35:00 | zachcarter | if I install SDL2 via brew, that actually works because brew symlinks sdl2 image includes into usr/local/include/SDL2 |
00:35:21 | zachcarter | but if you download the latest verison of SDL_image from the website |
00:35:31 | zachcarter | the directory structure is actually just SDL2_image/include |
00:35:38 | zachcarter | not SDL2_image/SDL/include |
00:35:49 | zachcarter | or SDL2/iSDL_image.h rather |
00:36:04 | zachcarter | not include |
00:36:22 | zachcarter | I’ll try downloading that specific verison of SDL_image |
00:37:38 | zachcarter | hrm, doesn’t appear to be availble on the website |
00:37:54 | zachcarter | but yeah I agree ftsf_ these shouldn’t be in the sdl2 wrapper it doesn’t make much sense |
00:40:20 | ftsf_ | there's a few issues with the SDL2 wrappers i need to submit back as PRs |
00:40:29 | ftsf_ | hopefully will have some time for that soon |
00:40:50 | ftsf_ | spent the weekend playing around with opengl+sdl2 in nim |
00:41:22 | zachcarter | nice |
00:41:24 | zachcarter | I’ve been down that road |
00:41:38 | zachcarter | I’m now using BGFX instead of just OpenGL |
00:41:43 | ftsf_ | got a model loaded and flying around with FPS style camera, starting to play with shaders and deferred rendering, but running into some issues now |
00:41:50 | zachcarter | hrm |
00:41:52 | zachcarter | maybe I can help |
00:42:14 | zachcarter | I’ve done skeletal animation with OpenGL and SDL / nim |
00:42:22 | zachcarter | so I’ve done the whole model loading with assimp thing |
00:42:29 | ftsf_ | yeah, that's next on my list =) |
00:42:31 | zachcarter | never done deferred rendering |
00:42:44 | ftsf_ | once i get my deferred rendering working |
00:42:51 | zachcarter | :) |
00:42:55 | ftsf_ | just loading in .objs manually at the moment |
00:43:00 | zachcarter | ah okay |
00:43:07 | ftsf_ | so easy to do in nim |
00:43:14 | zachcarter | yeah |
00:51:58 | * | gokr quit (Quit: Leaving.) |
01:12:35 | * | rauss joined #nim |
01:16:12 | * | user0___ joined #nim |
01:17:44 | * | couven92 quit (Quit: Client Disconnecting) |
01:19:12 | * | user0___ quit (Client Quit) |
02:02:32 | kulelu88 | is anybody familiar with parsing an sql file into nim? |
02:21:20 | ftsf_ | kulelu88, by SQL file you mean a file full of SQL commands? |
02:21:26 | ftsf_ | what do you want to do with it? |
02:22:18 | kulelu88 | ftsf: Here is my sql file: https://www.zerobin.net/?ee5fbc6b63e93ce0#Z21wAdwQ4YI8cj4J9tUy1qBeNGnGYjQwKdDqaGSdJD8= |
02:22:32 | kulelu88 | I want to import the sql data and run regex searches on it |
02:23:13 | ftsf_ | not sure that nim is the right tool for the job... why not just use your database for that? |
02:23:54 | kulelu88 | I want to programmatically do it for many sql files ftsf |
02:24:32 | ftsf_ | you want to run regexes on the SQL command file (what you're linked), or the SQL data (what you'd have in the database after running those commands)? |
02:25:19 | kulelu88 | ftsf: just the data |
02:25:45 | ftsf_ | ok, well i don't think there's a good way to get the data other than by running it through your database and extracting the data |
02:25:57 | ftsf_ | otherwise you'd have to reimplement your the database in nim |
02:26:58 | kulelu88 | ftsf: I did extract the data from the database via adminer. is there a better way to do it? I thought nims parsesql could do it |
02:27:30 | ftsf_ | "parses the SQL from input into an AST and returns the AST" an AST is likely not very useful to you |
02:27:43 | ftsf_ | if you want the data you probably want to export as CSV or something |
02:30:11 | ftsf_ | then use https://nim-lang.org/docs/parsecsv.html |
02:32:02 | kulelu88 | ftsf: can I programmatically import the .sql file into a mysql DB, then programmatically run regex queries on it via nim ? |
02:32:27 | ftsf_ | sure |
02:32:55 | ftsf_ | use https://nim-lang.org/docs/db_mysql.html perhaps |
02:33:56 | ftsf_ | import the file to the database then select it and run regex over it... but you can just use the DB to do regex too so may as well do that i'd think? |
02:43:29 | * | chemist69 quit (Ping timeout: 246 seconds) |
02:45:01 | * | Serenitor quit (Quit: Leaving) |
02:50:40 | kulelu88 | ftsf: how can I programmatically write regex strings to match against a DB without using a programming language? can sql queries be written themselves and run as a file? |
02:51:04 | ftsf_ | oh you can use a programming language to programmatically query the DB |
02:51:43 | ftsf_ | using the link i just gave |
02:55:44 | kulelu88 | alright thank you ftsf . I am going to try to import it first |
02:56:11 | * | chemist69 joined #nim |
03:02:34 | * | def-pri-pub quit (Ping timeout: 268 seconds) |
03:03:03 | * | def-pri-pub joined #nim |
03:25:31 | kulelu88 | ftsf: is there a way to connect to the root mysql user and create databases in nim ? |
03:36:57 | * | def-pri-pub quit (Quit: leaving) |
03:37:49 | ftsf_ | kulelu88, of course, just use the open() proc as in that example, but set the arguments appropriately |
03:38:00 | ftsf_ | then exec to create the database |
03:38:31 | kulelu88 | `let db = open("localhost", "root", "password")` doesn't work ftsf_ |
03:38:51 | ftsf_ | "doesn't work"... what happens? |
03:39:25 | kulelu88 | test.nim(2, 14) Error: type mismatch: got (string, string, string) . it expects 4 entries |
03:41:05 | ftsf_ | you need to specify the database argument as the 4th argument |
03:41:08 | ftsf_ | use "mysql" i guess |
03:45:33 | * | PMunch quit (Quit: leaving) |
03:45:56 | kulelu88 | ftsf: thank you, that worked. |
03:49:05 | kulelu88 | now to figure out how to import the .sql file |
03:50:38 | ftsf_ | read the lines of the file one by one and exec them. assuming each query is one line. if not you might need to split it by ";" |
03:50:55 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
03:51:20 | ftsf_ | much easier to get the DB to read the file directly though, if you don't mind feeling dirty it might be easier to use a shell exec |
03:52:26 | kulelu88 | I am looking at the commands directly and will run an exec for importing the file itself |
03:54:44 | ftsf_ | ahh if mysql can do that then cool |
03:55:36 | ftsf_ | ahh "source filename.sql" |
03:56:44 | kulelu88 | is there a framework for building CLI apps? I'd like to have something like: appname -f file.sql (which imports the .sql into the DB) |
03:57:13 | ftsf_ | https://nim-lang.org/docs/parseopt.html might be helpful |
03:57:41 | ftsf_ | https://github.com/c-blake/cligen |
03:57:53 | ftsf_ | https://nim-lang.org/docs/lib.html is a good place to look for libraries |
04:01:26 | kulelu88 | wow cligen is nice |
04:02:11 | kulelu88 | so I can essentially make procs for each activity and then use cli-gen to push instructions to each proc |
04:04:16 | ftsf_ | yeah, with dispatchMulti if you want mulitple commands |
04:12:43 | * | tautologico left #nim (#nim) |
04:38:59 | * | deavmi__ joined #nim |
04:40:37 | * | deavmi__ quit (Client Quit) |
05:30:49 | * | rauss quit (Ping timeout: 240 seconds) |
05:33:05 | * | rauss joined #nim |
05:54:35 | * | rauss quit (Read error: Connection reset by peer) |
05:58:28 | * | nsf joined #nim |
05:58:46 | * | rauss joined #nim |
06:26:29 | * | kulelu88 quit (Ping timeout: 240 seconds) |
06:34:47 | * | ftsf_ quit (Quit: :q!) |
06:48:29 | * | kulelu88 joined #nim |
06:49:30 | kulelu88 | what is the recommended way to interpolate a variable into a string? |
06:50:24 | ldlework | % macro |
06:50:32 | ldlework | iirc |
06:51:13 | kulelu88 | ldlework: not this: https://nim-lang.org/docs/strutils.html#%,string,openArray[string] ? |
06:52:00 | ldlework | why not that? |
06:54:25 | * | tankfeeder joined #nim |
06:55:06 | kulelu88 | ldlework: so something like this: db.exec(sql"CREATE DATABASE $val;" % [my-string]) ? |
06:55:25 | ldlework | kulelu88: do not use string interpolation to construct sql :( |
06:55:56 | kulelu88 | how else can I do it? ldlework . I want the user to provide the name of the DB and then I create it |
06:56:43 | ldlework | https://github.com/nanoant/nim-orm |
06:58:14 | kulelu88 | ldlework: but in theory, what I wrote will work? |
06:58:30 | ldlework | did you read the docs? |
06:58:42 | ldlework | is `$val` a thing it said you can do? |
07:06:49 | kulelu88 | alright, it didn't work XD |
07:07:04 | ldlework | just read the docs for the macro |
07:08:59 | kulelu88 | which macro? I'm not clear what you are referring to |
07:10:50 | kulelu88 | ldlework: that nim-orm is not even in nimble ? |
07:12:33 | ldlework | kulelu88: `%` is a nim macro that performs string interpolation |
07:12:44 | ldlework | you just need to read the docs to learn how to use it |
07:13:00 | ldlework | Its the very link you pasted to the channel |
07:13:11 | kulelu88 | ldlework: but you said I shouldnt use it to construct SQL queries, so I am looking at nim-orm, which is not in nimble |
07:13:21 | ldlework | And then you asked "Will it work anyway?" |
07:13:36 | ldlework | And I'm answering yes, that % is for string interpolation in Nim, regardless of what the string interpolation is for |
07:13:38 | * | Matthias247 joined #nim |
07:13:49 | ldlework | You in general should not construct SQL manually from string and rely on a tested ORM library |
07:14:02 | ldlework | If you're just creating a database, maybe there is not a lot that can go wrong |
07:14:16 | ldlework | but what about a database named "foo; drop all tables;" ? |
07:14:19 | ldlework | or whatever |
07:14:40 | kulelu88 | this isn't that type of app for someone to drop tables. it is for internal use |
07:15:22 | ldlework | Its your call. |
07:15:38 | kulelu88 | ldlework: my point thereafter was that I cannot install nim-orm |
07:15:58 | ldlework | Can't help troubleshoot right now sorry |
07:16:29 | kulelu88 | no worries |
07:16:54 | * | Vladar joined #nim |
07:32:09 | * | rokups joined #nim |
07:33:27 | kulelu88 | whoa, to install strfmt I need hg 0.o |
07:33:34 | kulelu88 | problem since 2015 based on the logs |
07:37:10 | * | BitPuffin|osx quit (Ping timeout: 258 seconds) |
07:42:31 | * | brechtm joined #nim |
07:50:54 | * | gokr joined #nim |
07:51:54 | * | brechtm quit (Remote host closed the connection) |
07:54:33 | * | girvo joined #nim |
07:58:03 | * | vlad1777d joined #nim |
08:06:59 | * | bjz joined #nim |
08:09:11 | Araq | kulelu88: I still don't know whether your problem would be solved by just reading the examples in https://nim-lang.org/docs/db_mysql.html |
08:10:01 | Araq | you keep talking about parsing a large .sql file. most people don't "parse large .sql" files, they store the data in the database |
08:10:11 | Araq | and then query the database to get the data back |
08:11:00 | * | bjz_ joined #nim |
08:11:09 | kulelu88 | Araq: I have done exactly that. I am now storing the .sql into a mysql database. my problem is that I cannot use a variable in the SQL string |
08:11:24 | kulelu88 | this didn't work either: db.exec(sql"CREATE DATABASE ?;", dbname) |
08:11:35 | kulelu88 | a similar problem here: https://forum.nim-lang.org/t/1659 |
08:11:52 | kulelu88 | its not for my lack of "you dont read the docs". I very much am reading it all the time |
08:11:59 | Araq | you mean you store the sql as text/blob in the mysql database? |
08:12:09 | * | bjz quit (Ping timeout: 260 seconds) |
08:12:32 | kulelu88 | yes, but I am building a CLI tool that first creates the DB, then it will fetch the file and import/store it in mysq; |
08:12:34 | kulelu88 | mysq; |
08:12:36 | kulelu88 | mysql |
08:14:28 | kulelu88 | so my problem is no longer parsing the sql, it is using a variable in a string: db.exec(sql"CREATE DATABASE ?;", dbname) --> doesn't work . nor did: db.exec(sql"CREATE DATABASE $val;" % [my-string]) |
08:16:07 | kulelu88 | it seems like a solved-problem in most languages, which is why I am asking here |
08:17:40 | Araq | db.exec(sql("create database " & mystring)) |
08:21:11 | * | zachcarter quit (Quit: zachcarter) |
08:21:47 | Araq | yeah, yeah, I know the stdlib must explain the very basics of how the programming language actually works |
08:25:30 | kulelu88 | Araq: seeing as I don't want to run circles around exactly what code I am writing, here it is, in all 5-line glory: https://www.zerobin.net/?b0e9e62910241296#qQ4B/WoWyzjJIFyuIBw0oVyXHUsZo9+IF7M8qKxZb3k= with the error-ouput below. |
08:27:43 | Araq | I'm pretty sure these 5 lines don't produce this "error-output" |
08:41:32 | * | djellemah quit (Ping timeout: 246 seconds) |
08:45:13 | * | rauss quit (Quit: WeeChat 1.7) |
08:45:19 | tstm | Araq: Also, having examples like "create database" & mystring are horrible as those should never be done in any application that takes in user input. |
08:45:43 | tstm | Sanitizing input is paramount. |
08:48:02 | Araq | tstm: true. but what about sql"create database " & asciiLettersOnly(mystring) |
08:49:14 | Araq | we could have asciiLettersOnly(s: string): Sql and & for sql datatype |
08:49:15 | kulelu88 | Araq: this is all the code I have and that is the error I am getting when attempting to run the proc using cli-gen |
08:49:59 | Araq | I have no idea what cli-gen is |
08:50:44 | flyx | from what he's saying, it's the tool that generates this „error“-Message |
08:51:31 | Araq | or rather proc identifier(s: string): Sql |
08:51:52 | kulelu88 | here it is: https://www.zerobin.net/?9cbf9e074c295616#t+zAJinOGsxBlkHL19dmPk6WIi7YNzULd3WNOYXUmJI= |
08:52:28 | kulelu88 | all 6 lines of code now |
08:52:54 | tstm | Araq: Yeah, that'd certainly be better! |
08:52:57 | flyx | have you tried `./file create_db dbname="db1"` |
08:53:23 | flyx | or perhaps only `./file dbname="db1"` |
08:53:37 | flyx | or more likely `./file --dbname="db1"` |
08:53:46 | flyx | just guessing what this tool does |
08:53:57 | flyx | you also could read its documentation |
08:57:36 | kulelu88 | flyx: yes, you are right. the problem is in the CLI-tool |
09:03:30 | * | _RPG_ quit (Remote host closed the connection) |
09:09:30 | kulelu88 | wow, odd tool. I had to initialize the variable as an empty string |
09:17:05 | * | couven92 joined #nim |
09:18:05 | flyx | I would guess that this is only necessary to make the syntax `./file --dbname="db1"` work and else it would be just `./file db1` |
09:20:19 | * | girvo quit (Ping timeout: 260 seconds) |
09:43:56 | * | pie__ joined #nim |
09:44:32 | couven92 | okay, follow-up question for nim.cfg: How can I use the value of a symbol define as part of the options that are passed to the compiler? |
09:47:30 | couven92 | e.g.: `--define:"thisIsAMagicCompileOption:magic"` and then `vcc.options.always = thisIsAMagicCompileOption` |
09:47:44 | couven92 | ah... wait: `$thisIsAMagicCompileOption`? |
09:52:06 | Araq | don't do that |
09:52:11 | Araq | it's a bad idea |
09:52:24 | couven92 | okay... why? |
09:54:19 | Araq | because that's not how the config system works |
09:54:42 | Araq | you can already override vcc.options.always in a project specific configuration file |
09:55:33 | * | Amun_Ra quit (Quit: WeeChat 1.0.1) |
09:55:37 | couven92 | Hmm... I was looking for a way to have the vcvarsall path in the config... Then vccexe wouldn't need to search for the compiler tools... would make it much more powerful |
09:56:25 | couven92 | can I change the vcc backend implementation to accept `vcc.options.vcvarsall`? |
09:56:42 | couven92 | or rather: `vcc.vcvarsall` |
09:57:58 | * | Amun_Ra joined #nim |
10:02:57 | * | Andris_zbx joined #nim |
10:06:51 | Araq | what are you trying to solve? |
10:06:57 | * | bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
10:07:07 | couven92 | the vccexe problem :P |
10:08:04 | * | djellemah joined #nim |
10:08:05 | couven92 | Hmm... I could just add a custom paccC for that... ooohhh... |
10:08:17 | couven92 | s/paccC/passC |
10:15:45 | * | bjz joined #nim |
10:33:24 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
10:36:43 | * | kulelu88 quit (Quit: Leaving) |
10:40:39 | * | bjz joined #nim |
10:47:35 | * | Ven joined #nim |
10:47:58 | * | Ven is now known as Guest90000 |
10:57:37 | * | brechtm joined #nim |
10:59:26 | * | brechtm quit (Remote host closed the connection) |
11:00:02 | * | brechtm joined #nim |
11:00:12 | * | brechtm quit (Read error: Connection reset by peer) |
11:00:43 | * | brechtm joined #nim |
11:02:39 | * | Snircle joined #nim |
11:28:04 | * | Guest90000 quit (Ping timeout: 260 seconds) |
11:33:38 | couven92 | howto convert a string into an enum-of-string value? |
11:33:53 | couven92 | basically the reverse of the $ operator? |
11:34:02 | Araq | strutils.parseEnum |
11:34:06 | couven92 | thx |
11:34:13 | Araq | strutils.parseEnum[MyEnum](str) |
11:36:57 | * | bjz_ joined #nim |
11:38:38 | * | bjz quit (Ping timeout: 246 seconds) |
11:58:15 | * | brechtm quit (Remote host closed the connection) |
11:59:38 | * | brechtm joined #nim |
12:01:49 | * | brechtm quit (Remote host closed the connection) |
12:04:12 | * | brechtm joined #nim |
12:09:59 | * | bjz_ quit (Ping timeout: 264 seconds) |
12:10:42 | * | bjz joined #nim |
12:14:36 | * | djellemah quit (Ping timeout: 240 seconds) |
12:14:59 | * | arnetheduck joined #nim |
12:16:15 | * | djellemah joined #nim |
12:19:51 | * | yglukhov joined #nim |
12:28:40 | * | zachcarter joined #nim |
12:35:58 | * | elrood joined #nim |
12:40:40 | * | Jehan_ joined #nim |
12:45:28 | * | zachcarter quit (Quit: zachcarter) |
12:51:23 | * | Snircle_ joined #nim |
12:54:14 | * | Snircle quit (Ping timeout: 246 seconds) |
13:05:22 | * | Snircle_ quit (Quit: Textual IRC Client: www.textualapp.com) |
13:22:22 | * | PMunch joined #nim |
13:24:43 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
13:27:44 | * | brechtm left #nim (#nim) |
13:29:43 | * | bjz joined #nim |
13:36:03 | * | Jehan_ quit (Quit: Leaving) |
13:36:29 | * | PMunch quit (Quit: leaving) |
13:39:31 | * | PMunch joined #nim |
13:59:03 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
14:02:21 | * | Jehan_ joined #nim |
14:06:50 | * | enthus1ast joined #nim |
14:11:16 | * | enthus1ast quit (Ping timeout: 240 seconds) |
14:11:50 | * | enthus1ast joined #nim |
14:26:53 | * | zachcarter joined #nim |
14:26:57 | zachcarter | o/ |
14:29:37 | * | Ven joined #nim |
14:30:00 | * | Ven is now known as Guest60921 |
14:30:06 | * | Snircle joined #nim |
14:31:46 | * | djellemah quit (Ping timeout: 240 seconds) |
14:34:55 | * | djellemah joined #nim |
14:40:53 | * | djellemah quit (Ping timeout: 260 seconds) |
14:43:20 | * | djellemah joined #nim |
14:45:40 | * | gokr quit (Quit: Leaving.) |
14:56:33 | * | BitPuffin|osx joined #nim |
15:02:11 | * | tankfeeder quit (Quit: Leaving) |
15:04:29 | ftsf | o/ |
15:04:49 | ftsf | https://gist.github.com/ftsf/488c917d7e2a744638d02f8ee7c97991 this is really frustrating, i can't seem to get a simple quad to draw =( |
15:05:39 | zachcarter | are you getting errrors? |
15:05:42 | zachcarter | or just a black screen? |
15:05:46 | ftsf | no errors, just black |
15:06:06 | zachcarter | did you try a triangle first? |
15:06:21 | zachcarter | I have some sample code that I know works I could point you to |
15:06:47 | zachcarter | https://gist.github.com/dgellow/f7bb51536c836ad82120 |
15:06:53 | ftsf | i did... gonna go back to basics and figure out what's up |
15:06:59 | ftsf | because my model rendering is working fine |
15:07:00 | zachcarter | okay |
15:07:02 | zachcarter | hrm |
15:07:07 | ftsf | but then trying to draw full screen quad for fx |
15:07:12 | ftsf | and nothing |
15:07:16 | zachcarter | :/ |
15:07:31 | zachcarter | I can’t see anything obviously wrong in your code |
15:12:08 | ftsf | thanks for checking |
15:23:11 | * | shashlick quit (Ping timeout: 264 seconds) |
15:25:24 | * | shashlick joined #nim |
15:26:48 | ftsf | aha! i figured it out |
15:26:55 | ftsf | my array was doubles not floats |
15:27:02 | PMunch | Haha :P |
15:27:37 | ftsf | yay |
15:28:11 | ftsf | so happy now :3 |
15:28:29 | * | Guest60921 quit (Ping timeout: 260 seconds) |
15:31:48 | * | Ven joined #nim |
15:32:12 | * | Ven is now known as Guest72549 |
15:35:04 | * | PMunch quit (Quit: leaving) |
15:37:46 | * | couven92 quit (Quit: Client disconnecting) |
15:39:33 | * | Andris_zbx quit (Remote host closed the connection) |
15:55:33 | * | Guest72549 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:13:05 | * | yglukhov quit (Remote host closed the connection) |
16:18:06 | * | yglukhov joined #nim |
16:22:16 | * | yglukhov quit (Ping timeout: 240 seconds) |
16:39:48 | * | sz0 joined #nim |
16:58:52 | * | Trustable joined #nim |
17:18:14 | * | yglukhov joined #nim |
17:20:38 | * | huonw quit (Ping timeout: 255 seconds) |
17:22:20 | * | yglukhov quit (Ping timeout: 246 seconds) |
17:29:04 | * | huonw joined #nim |
17:31:18 | * | brson joined #nim |
17:32:56 | * | yglukhov joined #nim |
17:39:48 | * | gokr joined #nim |
17:42:30 | * | Jehan_ quit (Read error: Connection reset by peer) |
17:56:31 | * | yglukhov quit (Remote host closed the connection) |
18:03:14 | * | Jehan_ joined #nim |
18:11:24 | * | federico3 quit (Quit: WeeChat 1.5) |
18:11:54 | * | tankfeeder joined #nim |
18:14:17 | * | kulelu88 joined #nim |
18:15:43 | * | federico3 joined #nim |
18:21:57 | * | federico3 quit (Quit: WeeChat 1.5) |
18:22:02 | * | federico1 joined #nim |
18:22:25 | * | federico1 quit (Client Quit) |
18:22:36 | * | federico3 joined #nim |
18:33:23 | * | Jehan_ quit (Read error: Connection reset by peer) |
18:39:18 | * | yglukhov joined #nim |
18:42:21 | * | Vladar quit (Remote host closed the connection) |
18:50:38 | * | bjz joined #nim |
18:55:04 | * | Vladar joined #nim |
18:56:00 | * | yglukhov quit (Remote host closed the connection) |
18:56:08 | * | Matthias247 quit (Read error: Connection reset by peer) |
18:57:36 | * | Matthias247 joined #nim |
19:03:04 | * | Jehan_ joined #nim |
19:12:02 | dyce[m] | nim has spoiled me with its sexy standard library |
19:12:14 | dyce[m] | and golang makes me angry having to have ~60 lines of code to unzip a file |
19:17:38 | * | tankfeeder quit (Quit: Leaving) |
19:19:39 | * | FromGitter quit (Remote host closed the connection) |
19:19:47 | * | FromGitter joined #nim |
19:25:30 | subsetpark | So it would seem to be more idiomatic to implement Options using object variants - why are they implemented with a `has` boolean in the stdlib? |
19:28:15 | Araq | because it's not exposed anyway, these are private fields |
19:28:27 | Araq | and a case object wouldn't be more efficient either |
19:28:46 | Araq | it would however make the compiler insert checks that the library already does |
19:32:59 | subsetpark | ah i see |
19:37:47 | * | gangstacat quit (Quit: Ĝis) |
19:39:02 | Vladar | Does anyone have some time to test my jam-game? https://vladar.itch.io/glorious-glacier-grotto |
19:42:07 | FromGitter | <ivankoster> my question got buried yesterday. Anyone know how to check in a macro if an identifier refers to an enum? if you have an enum defined somewhere that is called WireFormat, and you get passed a nimnode of nnkIdent with the value WireFormat, I want to find out if that NimNode refers to an enum or not |
19:43:25 | kulelu88 | Vladar: should we be able to see your code? |
19:44:31 | * | libman joined #nim |
19:44:46 | Vladar | kulelu88: what do you mean? |
19:45:09 | kulelu88 | its part of linux game jam, so should the game be OSS? |
19:45:31 | Vladar | yes, of course |
19:47:52 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
19:50:51 | dom96 | Vladar: looks cool. No OS X binaries though :\ |
19:51:30 | Vladar | dom96: is there even a way to build osx binaries on Linux? |
19:51:50 | Vladar | plus, nowhere to test then |
19:52:53 | dyce[m] | what does golang do for osx? |
19:57:33 | dyce[m] | Vladar: i think travisci has a osx environment you can build with |
19:57:54 | libman | I started working on a multiplatform Nim build environments, but never finished anything. |
19:59:35 | demi- | golang compiler can do it |
20:00:17 | * | gangstacat joined #nim |
20:00:21 | demi- | fwiw, building os x binaries outside of os x isn't officially supported as there is no official spec for the executable binary format |
20:03:37 | Araq | ivankoster: use macros.getType on a 'typed' macro parameter |
20:04:38 | FromGitter | <ivankoster> cant, i'm getting it from somewhere down the AST |
20:07:13 | FromGitter | <ivankoster> @araq ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Im in the PbMessage macro and have to check if SomeEnum is actually an enum [https://gitter.im/nim-lang/Nim?at=58d036707b3f37e754199caa] |
20:07:35 | FromGitter | <ivankoster> maybe something with bindsym and then gettype? does that work? |
20:07:35 | * | Jehan_ quit (Ping timeout: 264 seconds) |
20:08:07 | Araq | that means your macro is misdesigned :-) |
20:08:30 | FromGitter | <ivankoster> I don't understand, It's a code block |
20:08:36 | FromGitter | <ivankoster> passed to the macro |
20:08:51 | Araq | yeah but your code block cannot be analysed |
20:09:02 | Araq | neither by the compiler because it doesn't understand your DSL |
20:09:14 | Araq | nor by your macro because it cannot do symbol lookups nor type checking |
20:09:16 | FromGitter | <ivankoster> I cannot ask the compiler to lookup an identifier in its symbol table? |
20:09:27 | Araq | not in a macro |
20:09:34 | FromGitter | <ivankoster> darn |
20:10:15 | FromGitter | <ivankoster> then i have no choice but to annotate my DSL with SomeEnum is an enum.. |
20:10:20 | * | Jehan_ joined #nim |
20:10:41 | Araq | and then what? do you also demand to annotate it with the possible enum fields |
20:10:55 | FromGitter | <ivankoster> nope |
20:11:02 | FromGitter | <ivankoster> just have to know if its an enum or not |
20:11:06 | Araq | just write a macro that takes a proper type |
20:11:30 | Araq | your current approach is doomed to fail: type MyEvilAlias = uint32 |
20:11:46 | Araq | field: MyEvilAlias # can your macro handle that? |
20:12:35 | FromGitter | <ivankoster> can you give more context? How does that fit into the PbMessage call i wrote above? |
20:13:53 | * | cheatfate_ joined #nim |
20:14:09 | * | elrood_ joined #nim |
20:14:24 | * | sz0 quit (Quit: Connection closed for inactivity) |
20:14:34 | Araq | type Alias = PbInt32 |
20:14:48 | Araq | PbMessage ItemRow: |
20:14:48 | Araq | id: Alias @1 |
20:15:06 | Araq | # not supported. |
20:15:35 | * | couven92 joined #nim |
20:16:47 | * | Pisuke joined #nim |
20:17:14 | * | bbl__ joined #nim |
20:18:35 | * | PMunch joined #nim |
20:18:59 | * | antranig1 joined #nim |
20:20:00 | * | dexterk_ quit (Ping timeout: 258 seconds) |
20:20:04 | * | dexterk__ joined #nim |
20:20:41 | * | MyMind quit (Excess Flood) |
20:20:41 | * | elrood quit (Read error: Connection reset by peer) |
20:20:56 | * | euantor_ joined #nim |
20:21:45 | * | byyte512 joined #nim |
20:22:16 | * | federico1 joined #nim |
20:22:35 | * | benoliver999_ joined #nim |
20:23:33 | * | pigmej_ joined #nim |
20:23:34 | * | flyx|znc joined #nim |
20:26:33 | * | vqrs joined #nim |
20:26:33 | * | Trustable quit (Read error: Connection reset by peer) |
20:27:00 | * | Trustable joined #nim |
20:27:29 | * | federico1 is now known as federico2 |
20:29:11 | * | FromGitter quit (*.net *.split) |
20:29:11 | * | federico3 quit (*.net *.split) |
20:29:12 | * | vlad1777d quit (*.net *.split) |
20:29:12 | * | Jesin quit (*.net *.split) |
20:29:12 | * | byte512 quit (*.net *.split) |
20:29:13 | * | cheatfate quit (*.net *.split) |
20:29:13 | * | antranigv quit (*.net *.split) |
20:29:14 | * | vqrs_ quit (*.net *.split) |
20:29:14 | * | pigmej quit (*.net *.split) |
20:29:14 | * | jivank_ quit (*.net *.split) |
20:29:14 | * | joshbaptiste quit (*.net *.split) |
20:29:14 | * | euantor quit (*.net *.split) |
20:29:15 | * | j75__ quit (*.net *.split) |
20:29:15 | * | jmkr quit (*.net *.split) |
20:29:15 | * | flyx quit (*.net *.split) |
20:29:15 | * | bbl_ quit (*.net *.split) |
20:29:16 | * | benoliver999 quit (*.net *.split) |
20:29:17 | * | flyx|znc is now known as flyx |
20:29:17 | * | pigmej_ is now known as pigmej |
20:29:17 | * | joshbapt1 joined #nim |
20:29:20 | * | benoliver999_ is now known as benoliver999 |
20:29:25 | * | euantor_ is now known as euantor |
20:29:57 | * | vlad1777d joined #nim |
20:30:14 | * | federico2 is now known as federico3 |
20:30:15 | * | jmkr joined #nim |
20:31:24 | * | Jesin joined #nim |
20:31:56 | * | bjz joined #nim |
20:33:47 | * | FromGitter joined #nim |
20:39:10 | * | j75__ joined #nim |
20:42:03 | * | cheatfate_ is now known as cheatfate |
20:42:15 | * | rokups quit (Quit: Connection closed for inactivity) |
20:43:28 | * | vqrs quit (Ping timeout: 240 seconds) |
20:46:53 | * | vqrs joined #nim |
20:47:13 | * | Trustable quit (Remote host closed the connection) |
20:47:38 | * | await is now known as async |
20:48:46 | * | async is now known as windows |
21:02:10 | * | kier quit (Ping timeout: 258 seconds) |
21:06:17 | * | kier joined #nim |
21:10:31 | * | Sentreen quit (Read error: Connection reset by peer) |
21:10:32 | * | couven92 quit (Ping timeout: 246 seconds) |
21:11:04 | * | Sentreen joined #nim |
21:12:52 | * | couven92 joined #nim |
21:13:20 | * | Jehan_ quit (Ping timeout: 246 seconds) |
21:15:39 | * | Jehan_ joined #nim |
21:33:44 | couven92 | Okay... I have updated and modified the vccexe tool. https://github.com/nim-lang/Nim/pull/5575 |
21:34:12 | couven92 | I think the changes are reasonable and allow for better flexibility also for future VCC toolchains |
21:35:16 | couven92 | Heck, I can now even use vccexe for every other Visual C/C++ tool I want as well, and since I have in my PATH (since it sits next to nim.exe) this works everywhere for me! :) |
21:36:05 | couven92 | that means easy access to: nmake, ml, link, dumpbin, etc...! Yaih! :) |
21:45:02 | * | def-pri-pub joined #nim |
21:49:12 | * | Jehan_ quit (Quit: Leaving) |
21:53:51 | * | Jehan_ joined #nim |
22:03:39 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:09:05 | * | Vladar quit (Quit: Leaving) |
22:18:30 | cheatfate | couven92, you know why previouse version was better? because it was automatic |
22:18:37 | cheatfate | now it much worse |
22:18:51 | cheatfate | because everybody needs to modify nim.cfg file |
22:19:23 | couven92 | well... I have a nim.cfg lying in my %APPDATA%... But, yes... I see your point |
22:20:53 | cheatfate | we just need to find way to check for vs2017 |
22:20:53 | couven92 | cheatfate, okay, here's a deal: I'll put in the auto-detection if the vcvarsall argument is omitted. That sound okay? And I'll default to the latest SDK I find? |
22:21:09 | couven92 | cheatfate, yeah, I'm working on that |
22:21:23 | couven92 | will be a couple more days until that's ready thogh... |
22:21:35 | couven92 | s/thogh/though |
22:21:38 | cheatfate | couven92, you can only make a deal with Araq, not me |
22:21:45 | couven92 | :P |
22:22:11 | cheatfate | but i prefer automatic tool for every version |
22:22:29 | cheatfate | otherwise i will better use mingw |
22:23:45 | couven92 | Well... You'll get your auto for VS2015 and below, and once I have figured out vswhere, I'll also auto VS2017 (VS2017 will be a little more complicated though, since there are multiple versions there) |
22:40:28 | * | bjz joined #nim |
22:43:24 | couven92 | howto: enumerate the values of a non-ordinal enum type? |
22:45:50 | couven92 | nvm, I'll just create a list of all enum values, since I need it reversely sorted as well |
22:45:59 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:51:30 | * | gokr quit (Ping timeout: 268 seconds) |
22:55:36 | * | nsf quit (Quit: WeeChat 1.7) |
22:58:05 | Sentreen | Am I missing something obvious (again), or is it impossible to do something like `for x, y in zip(xs, ys):`? |
22:58:40 | Sentreen | Unless I am mistaken, the pairs iterator gets invoked, even when putting parentheses around the `x,y` |
22:59:48 | def- | Sentreen: items(zip(xs, ys)) |
23:01:38 | Sentreen | That does it, thanks! So using `items` just explicitly calls the iterator? |
23:01:40 | * | Jehan_ quit (Quit: Leaving) |
23:01:48 | def- | yes |
23:02:09 | Sentreen | Oaky, thanks again :) |
23:03:44 | * | Jehan_ joined #nim |
23:13:40 | couven92 | uhm, the standard library documentation states that the commandLineParams is not availble on POSIX. Howto get the commandline arguments the right way? |
23:13:46 | * | arnetheduck quit (Ping timeout: 240 seconds) |
23:14:59 | zachcarter | def-: thank you and yguklov for that SDL template repo |
23:15:06 | zachcarter | and nimes |
23:15:10 | zachcarter | helped me get my framework on android |
23:15:26 | stisa | couven92 parseopt2 I think |
23:15:28 | * | vlad1777d quit (Remote host closed the connection) |
23:18:42 | couven92 | stisa, yeah, but what if I don't need to parse any args... I just want the argv sequence passed into the main function? |
23:25:28 | stisa | not sure, sorry |
23:26:04 | couven92 | well, vcc is windows only anyways, so I don't really care, but I thought it was interesting... :P |
23:27:21 | * | xet7_ joined #nim |
23:30:06 | * | xet7 quit (Ping timeout: 240 seconds) |
23:30:36 | * | Jehan_ quit (Ping timeout: 240 seconds) |
23:31:50 | * | girvo joined #nim |
23:34:39 | cheatfate | couven92, check os.paramCount and os.paramStr |
23:34:52 | couven92 | ah! |
23:35:51 | cheatfate | couven92, 2017 is faster then 2015? |
23:36:09 | cheatfate | i mean interface? |
23:36:10 | couven92 | cheatfate, same issue! The documentation states: that os.paramStr is not available on POSIX |
23:36:32 | couven92 | cheatfate, what do you mean? If the discovery is faster? |
23:36:44 | cheatfate | os.paramStr is available on POSIX |
23:36:47 | cheatfate | as well as windows |
23:37:04 | couven92 | cheatfate, the documentation states otherwise: https://nim-lang.org/docs/os.html#paramStr,int |
23:37:36 | cheatfate | there no any word that it not available on POSIX |
23:38:06 | couven92 | Quote: "Availability: On Posix there is no portable way to get the command line from a DLL and thus the proc isn't defined in this environment." |
23:38:14 | cheatfate | or you want to get parameters inside of shared object? |
23:38:50 | cheatfate | you making executable or library? |
23:38:58 | couven92 | executable |
23:39:10 | cheatfate | so what the problem? |
23:39:28 | cheatfate | `there is no portable way to get the command line from DLL` |
23:40:03 | cheatfate | so if you are making DLL/SO then you are in trouble, but if you making executable you are ok |
23:40:19 | couven92 | I'm on Windows, so I have no problem. But if I understand correctly, the paramStr is not defined on POSIX, since there is no DLL (or library) to get the command line arguments from |
23:40:44 | cheatfate | couven92, you are reading wrong |
23:41:17 | couven92 | AH! Okay... Now, I get it... in a so or dll it doesn't work, right! Sorry! |
23:41:45 | couven92 | Why would you want to do that in a library anyways? :O |
23:44:22 | cheatfate | you can access even if you are in library, but somebody was too lazy to implement it cross-platform |
23:48:13 | * | def-pri-pub quit (Quit: leaving) |
23:56:45 | * | yglukhov joined #nim |