00:00:16 | * | Nimbecile joined #nim |
00:26:56 | * | Nimbecile left #nim (#nim) |
00:30:36 | * | leafiest joined #nim |
00:30:48 | * | leafiest left #nim ("WeeChat 0.4.2") |
00:31:31 | * | jinshil joined #nim |
00:47:23 | * | Nikky quit (Quit: WeeChat 1.9) |
00:47:34 | * | Nikky joined #nim |
00:48:08 | * | user0 quit (Read error: Connection reset by peer) |
00:49:11 | * | Nikky quit (Remote host closed the connection) |
00:49:40 | * | Nikky joined #nim |
00:51:39 | * | user0 joined #nim |
01:03:17 | * | yingjun_ joined #nim |
01:04:17 | * | yingjun_ quit (Remote host closed the connection) |
01:05:58 | * | yingjun_ joined #nim |
01:30:24 | * | jinshil quit (Ping timeout: 260 seconds) |
01:33:16 | user0 | Hi, I was trying to read an int from the stdin, echo stdin.readLine.int says that it's got TaintedString |
01:36:41 | user0 | > parseInt |
01:36:43 | user0 | Got it |
01:36:45 | user0 | nvm |
01:40:46 | * | chemist69_ quit (Ping timeout: 246 seconds) |
01:52:48 | * | vlad1777d quit (Ping timeout: 260 seconds) |
01:55:07 | * | chemist69 joined #nim |
02:25:35 | * | rauss joined #nim |
02:29:19 | FromGitter | <Varriount> user0: need help? |
02:30:55 | * | endragor joined #nim |
03:04:15 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
03:17:57 | user0 | Nah, I got it. |
03:18:49 | user0 | Though I am wondering how I could read a string from stdin, store the sorted string in a variable. |
03:19:27 | user0 | like stdin.readln.splitWhitespace.map(x => x.sort) |
03:20:39 | yingjun_ | hello |
03:20:45 | yingjun_ | I have a question |
03:21:02 | yingjun_ | is dynamic dispatch like virtual function in C++? |
03:30:13 | * | pilne quit (Quit: Quitting!) |
03:46:23 | yingjun_ | hello? |
03:46:33 | yingjun_ | is my understanding correct? |
04:01:15 | * | yingjun_ quit (Remote host closed the connection) |
04:01:35 | * | yingjun_ joined #nim |
04:03:07 | * | yingjun_ quit (Remote host closed the connection) |
04:06:34 | * | yingjun_ joined #nim |
04:11:49 | * | jinshil joined #nim |
04:28:57 | * | yingjun_ quit (Remote host closed the connection) |
04:29:06 | * | yingjun_ joined #nim |
04:30:04 | * | yingjun_ quit (Remote host closed the connection) |
04:35:00 | * | yingjun_ joined #nim |
04:35:01 | * | yingjun_ quit (Remote host closed the connection) |
04:35:33 | * | yingjun_ joined #nim |
04:36:38 | * | SusWombat joined #nim |
04:39:57 | * | yingjun_ quit (Ping timeout: 240 seconds) |
04:45:03 | * | dddddd quit (Remote host closed the connection) |
04:48:07 | * | yingjun_ joined #nim |
05:03:16 | * | andrzejk_ joined #nim |
05:06:17 | subsetpark | the beginnings of a useful little application - https://github.com/subsetpark/untitled-shell-history-application |
05:51:52 | * | andrzejk_ quit (Quit: Textual IRC Client: www.textualapp.com) |
05:53:20 | * | rauss quit (Quit: WeeChat 1.9) |
05:54:28 | FromGitter | <mratsim> @yingjun_ Most people in the Nim community are in Europe and the US currently so hard to reach at 3AM GMT. The more correct thing is that C++ virtual functions are an implementation of dynamic dispatch |
05:55:04 | FromGitter | <mratsim> Nim’s method are also an implementation, and the eagerly waited VTable/vtref another |
05:57:35 | yingjun_ | I see |
05:57:35 | yingjun_ | thank you! |
06:08:01 | * | yingjun_ quit (Ping timeout: 248 seconds) |
06:08:29 | * | yingjun_ joined #nim |
06:18:14 | * | skrylar joined #nim |
06:19:25 | skrylar | bibbly bobbles. |
06:30:23 | * | skrylar quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
06:30:48 | * | nsf joined #nim |
06:36:55 | * | tdc joined #nim |
06:44:41 | yingjun_ | hello |
06:44:50 | yingjun_ | I have a question again |
06:44:58 | yingjun_ | please see: |
06:45:20 | yingjun_ | method eval(e: PExpr): int = |
06:45:21 | yingjun_ | # override this base method |
06:45:21 | yingjun_ | quit "to override!" |
06:46:07 | yingjun_ | how do we know which class the method eval() is binded? |
06:47:44 | FromGitter | <andreaferretti> it is not clear what you are asking |
06:47:50 | FromGitter | <andreaferretti> there are no classes in nim |
06:48:27 | FromGitter | <andreaferretti> and the (currently existing) dynamic dispatch does not use a vtable attached to a class |
06:49:52 | FromGitter | <andreaferretti> maybe I can help more if you add some more detail about what is not clear |
06:52:18 | * | tdc quit (Remote host closed the connection) |
07:08:47 | * | couven92 joined #nim |
07:15:42 | * | yglukhov joined #nim |
07:17:10 | * | yglukhov_ joined #nim |
07:17:10 | * | yglukhov quit (Read error: Connection reset by peer) |
07:19:43 | * | yglukhov_ quit (Remote host closed the connection) |
07:19:58 | * | yglukhov joined #nim |
07:22:28 | FromGitter | <mratsim> @yingjun_ Nim’s method are not bound to any class: https://nim-lang.org/docs/tut2.html#object-oriented-programming-methods |
07:25:50 | yingjun_ | I see, Thank you! |
07:26:32 | FromGitter | <mratsim> If you need OO-like polymorphism check “object variant”. By the way most of the time you can use proc instead of method (static dispatch instead of dynamic dispatch) |
07:27:57 | FromGitter | <mratsim> Here is an (old) example: http://goran.krampe.se/2014/10/31/nim-and-oo-part-ii/ |
07:36:13 | FromGitter | <Varriount> Object variants work especially well for things like abstract syntax trees, where all the variants are known ahead of time. |
07:38:23 | * | skrylar joined #nim |
07:51:21 | * | yingjun_ quit (Remote host closed the connection) |
07:55:19 | * | yingjun_ joined #nim |
08:13:35 | * | xet7 quit (Remote host closed the connection) |
08:16:30 | * | dom96|w joined #nim |
08:29:41 | yingjun_ | hello |
08:29:49 | yingjun_ | I have another question |
08:29:56 | yingjun_ | Please see: proc complexProc() {.raises: [IOError, ArithmeticError].} = |
08:29:56 | Zevv | keep them coming :) |
08:30:36 | yingjun_ | besides IOError, there are some other exceptions in complexProc() |
08:31:11 | yingjun_ | such as ValueError, OverflowError |
08:31:23 | yingjun_ | however, the code can still be compiled |
08:32:51 | yingjun_ | what do you say? |
08:39:11 | yingjun_ | hello? |
08:42:57 | FromGitter | <stisa> Maybe the exception you have in `raises` are parent of the others? Not sure, never really used exception tracking, sorry |
08:43:48 | euantor | I'd guess that OverflowError einherits from ArithmeticError |
08:44:17 | euantor | And in fact it does: https://nim-lang.org/docs/manual.html#exception-handling-exception-hierarchy |
08:44:28 | * | Vladar joined #nim |
08:44:42 | euantor | Not entirely sure why it doesn't complain about ValueError though |
09:01:11 | crem | What was that website to search nim packages? And why it's so hard to google. :-\ |
09:05:35 | * | jinshil quit (Quit: Good-bye!) |
09:09:36 | euantor | https://nimble.directory/ is one, but it seems to be down right now - paging federico3 |
09:09:40 | FromGitter | <andreaferretti> nimsim.co |
09:09:43 | FromGitter | <andreaferretti> sorry |
09:09:45 | FromGitter | <andreaferretti> nimsim.co |
09:09:48 | FromGitter | <andreaferretti> sorry |
09:09:51 | FromGitter | <andreaferretti> nimism.co |
09:09:55 | FromGitter | <andreaferretti> :-D |
09:10:01 | euantor | Yeah, nimism was the other one from yesterday |
09:10:20 | crem | Yes I meant minism |
09:10:23 | crem | minism |
09:10:28 | yingjun_ | I see |
09:10:28 | crem | hard to type! |
09:10:31 | yingjun_ | thank you |
09:11:02 | crem | Thanks for reminding, bookmarked it. |
09:11:21 | yingjun_ | what will the pragma {.raises[...].} help to? |
09:20:43 | euantor | yingjun_: It's usually inferred by the compiler, the only reason to manually write it is for yourself to track exceptions |
09:21:53 | yingjun_ | why do I track exceptions? |
09:23:10 | euantor | So that when you write code you know which exceptions you need to catch |
09:24:00 | yingjun_ | I see |
09:24:28 | yingjun_ | thank you |
09:37:13 | * | SusWombat quit (Remote host closed the connection) |
10:09:29 | * | skrylar quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
10:12:58 | * | dankrad quit (Ping timeout: 260 seconds) |
10:14:00 | * | skrylar joined #nim |
10:14:43 | * | dankrad joined #nim |
10:33:36 | * | yingjun_ quit (Remote host closed the connection) |
10:39:27 | * | couven92 quit (Ping timeout: 240 seconds) |
10:40:48 | * | yingjun joined #nim |
10:57:17 | * | ShalokShalom joined #nim |
10:58:20 | * | vlad1777d joined #nim |
11:09:41 | * | yingjun quit (Remote host closed the connection) |
11:18:24 | * | BitPuffin|osx joined #nim |
11:20:57 | * | dankrad quit (Ping timeout: 240 seconds) |
11:21:32 | FromGitter | <zacharycarter> multiple materials + models working |
11:21:33 | FromGitter | <zacharycarter> (https://files.gitter.im/nim-lang/Nim/gOcj/Screen-Shot-2017-07-21-at-7.21.13-AM.png) |
11:28:46 | * | dankrad joined #nim |
11:29:39 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
11:30:00 | * | ShalokShalom_ joined #nim |
11:30:04 | * | ShalokShalom quit (Ping timeout: 260 seconds) |
11:39:30 | FromGitter | <zacharycarter> next up: skeletal animation |
11:47:56 | skrylar | zacharycarter hardware or soft skinning? |
11:48:31 | skrylar | Well. I've been told compute shaders are handy when it comes to getting the GPU to calculate things that aren't explicitly pixels. Although I think there may not be a benefit to doing skeletons with those |
11:49:05 | skrylar | from my limited experience it looks like skeletal animation is pretty simple if you're already getting keyframe data from stuff like assimp |
11:49:55 | skrylar | i ported the easing library to nim if that helps with animation https://github.com/Skrylar/skEasing |
11:50:00 | FromGitter | <zacharycarter> ooo |
11:50:11 | FromGitter | <zacharycarter> this will definitely help |
11:50:15 | FromGitter | <zacharycarter> and I will definitely be using it, thank you |
11:50:48 | FromGitter | <zacharycarter> and you're right assimp makes skeletal animation simpler to implement, but it's still somewhat difficult |
11:51:11 | FromGitter | <zacharycarter> and it's easy to get math incorrect and end up with wild results |
11:51:37 | skrylar | afaik you have to pick the max bones to support, then adjust the vertex shader to move based on motion*weight for each bone. Rustles my jimmies at how it sounds like the gpu gets to do a lot of pointless math on the extra unused bones, but seems how its done |
11:52:03 | FromGitter | <zacharycarter> yeah |
11:52:08 | FromGitter | <zacharycarter> skeletal animation often feels like this http://i.imgur.com/hIrGq7l.mp4 |
11:52:15 | FromGitter | <zacharycarter> once you implement and press play |
11:52:36 | skrylar | reminds me |
11:52:43 | skrylar | i did that port because i wanted a coreanimation clone :X |
11:52:49 | skrylar | well technically tween.lua clone, but same difference |
11:53:28 | skrylar | think araq abandoned libui because it wasn't helpful for nimedit; i sorta picked it up, haven't finished yet though |
11:53:52 | FromGitter | <zacharycarter> ooo |
11:54:06 | FromGitter | <zacharycarter> is it going to be better than niui? or whatever |
11:54:13 | skrylar | never used niui |
11:54:39 | FromGitter | <zacharycarter> sorry I meant https://github.com/trustable-code/NiGui/ |
11:54:43 | skrylar | its not my unfinished syl lib from go though :< |
11:54:51 | skrylar | was fond of that |
11:55:03 | skrylar | "turn the UI in to a scene graph, let the OS deal with whatever you just tried to do means" |
11:55:29 | skrylar | you just had 'buttons' and if you put those on a menu, it became a menu. or a submenu. no "i am a TMenu give me special API calls" bs |
11:55:45 | FromGitter | <zacharycarter> right |
11:55:47 | FromGitter | <zacharycarter> that does sound nice |
11:56:01 | skrylar | yes. and functional options are also nice. |
11:56:13 | skrylar | those can be done in nim i discovered, at the cost of extra []'s |
11:57:25 | skrylar | but no. bottlecap is just libui with some sugar templates. |
11:57:47 | FromGitter | <zacharycarter> gotcha |
11:58:05 | FromGitter | <mratsim> @skrylar in skEasing, why use T: float32|float64 and not SomeReal? |
11:58:21 | skrylar | is somereal a type or do you mean why did i not just alias and use that |
11:58:28 | FromGitter | <zacharycarter> somereal is a type |
11:58:36 | FromGitter | <zacharycarter> https://nim-lang.org/docs/system.html#SomeReal |
11:58:39 | skrylar | i guess i need to re-read the spec. |
11:58:56 | skrylar | oh. module system. |
11:59:00 | skrylar | i never bothered to read that one |
11:59:34 | skrylar | put an issue up about it (or don't; i wrote it down either way) |
12:00:00 | FromGitter | <mratsim> lol |
12:01:31 | * | dom96|w joined #nim |
12:01:55 | skrylar | tween.lua looks to be easy as long as one doesn't mind seq abuse |
12:02:33 | skrylar | they use that with LOVE2D. it just has an update function where you feed it a timestep and it just goes down the line moving animators. which are basically just closures. so. |
12:03:08 | * | Snircle joined #nim |
12:04:24 | * | Vladar quit (Quit: Leaving) |
12:05:37 | * | Guest15762 quit (Ping timeout: 255 seconds) |
12:06:19 | * | dddddd joined #nim |
12:08:41 | * | myp joined #nim |
12:10:20 | * | yingjun joined #nim |
12:12:50 | * | vlad1777d quit (Ping timeout: 240 seconds) |
12:14:35 | * | yingjun quit (Ping timeout: 240 seconds) |
12:22:07 | * | couven92 joined #nim |
12:26:04 | * | vlad1777d joined #nim |
12:33:48 | * | xet7 joined #nim |
12:47:35 | * | myp quit (Ping timeout: 240 seconds) |
12:50:58 | * | myp joined #nim |
12:51:51 | * | planhths joined #nim |
12:51:51 | * | ShalokShalom_ is now known as ShalokShalom |
12:55:13 | Zevv | I'm trying to do a literal port of some C code to Nim, but the C makes a lot of use of walking through strings by passing and incrementing char * pointers. |
12:55:40 | Zevv | I'm not sure what would be easier: I can pass around tuples of the original string and an offset, or use cstrings |
12:56:01 | Zevv | I guess using cstrings when not interfacing with C is frowned upon in Nimland? |
12:56:50 | flyx | is there even a `[]` for cstrings? |
12:57:32 | Zevv | there is |
12:57:34 | Zevv | and an inc() |
12:57:40 | Zevv | which does the p++ |
12:59:24 | flyx | interesting. can't find it in system |
13:00:27 | Zevv | hmm let me check, I might be talking bogus. That's what c2nim generates for me when doing a cold port of the code, but I haven't actually tried to build that yet |
13:01:32 | flyx | perhaps it's so much magic that it doesn't even have a proc def in system |
13:01:45 | couven92 | Uhm, `./koch boot -d:release` fails on Raspberry Pi running Raspbian |
13:01:53 | Zevv | you're right: that doesn't even work |
13:01:54 | couven92 | CC: compiler_nim |
13:01:54 | couven92 | Error: invocation of external compiler program failed. Cannot allocate memory 12 |
13:01:54 | couven92 | FAILURE |
13:06:56 | euantor | couven92: I think I've seen that reported before and I believe the recommendation is to build the C sources on another machine and then compile them on the Pi |
13:07:02 | euantor | Could be completely wrong though |
13:07:15 | euantor | I'm sure it used to be on the Nim wiki, but I can't find it now |
13:07:37 | couven92 | euantor, yeah either way, I'm logging an issue :P |
13:07:52 | couven92 | https://github.com/nim-lang/Nim/issues/6130 |
13:08:05 | euantor | Fair enough, I'm trying to dig up the comment I found about it in the past |
13:11:00 | couven92 | euantor, but you're right, obviously I had to compile nim from csources first before I could create and run koch. Compiling Nim from csources works great |
13:11:47 | Zevv | couven92: If you have a lot of patience, adding swap can probably help you out |
13:12:08 | euantor | Ah, perhaps it's there I'm getting mixed up. I found a couple of mentions of building it on a Pi running Arch, so I wonder if Raspbian is using more memory out of the box by running a UI |
13:12:59 | couven92 | hmm... might be... okay... The csources version is fine anyways, right? I was building vanilla v0.17.0 anyways |
13:14:41 | skrylar | Zevv it depends on what your goal is |
13:15:06 | skrylar | if you just want it running on nim, you can implement the same ptr uint8 type logic, and then have sugar functions which access the memory of arrays and seqs |
13:15:20 | skrylar | you can ultimately get addresses of seq and array values so the ptr magic versions "will" work |
13:16:38 | skrylar | if you're doing code with start/stop pointers, you can always put in a when debug: check index in the pointer version |
13:16:50 | skrylar | to maintain the indexing safeties of those types |
13:17:17 | Zevv | yeah, I was considering that, but I think I'll just use array indexing instead and benefit of the available sanity checks |
13:17:50 | skrylar | well, it's you paying the debugging costs and not me 8) |
13:17:57 | Zevv | :) |
13:25:33 | * | yuken joined #nim |
13:25:36 | yuken | well then https://i.imgur.com/di5DQWc.png |
14:08:49 | * | Jesin quit (Quit: Leaving) |
14:11:48 | * | Jesin joined #nim |
14:12:23 | * | rauss joined #nim |
14:12:39 | * | yingjun joined #nim |
14:15:55 | * | endragor quit (Remote host closed the connection) |
14:17:25 | * | yingjun quit (Ping timeout: 268 seconds) |
14:22:05 | * | BitPuffin|osx quit (Ping timeout: 240 seconds) |
14:29:29 | * | endragor joined #nim |
14:31:05 | * | user0 quit (Quit: user0) |
14:32:28 | * | user0 joined #nim |
14:33:05 | * | ShalokShalom quit (Ping timeout: 240 seconds) |
14:33:29 | * | ShalokShalom joined #nim |
14:34:22 | * | endragor quit (Ping timeout: 276 seconds) |
14:45:15 | * | jsgrant quit (Read error: Connection reset by peer) |
15:06:57 | FromGitter | <zacharycarter> yuken: looks like a problem with the package yu're trying to use |
15:06:58 | * | dankrad quit (Ping timeout: 255 seconds) |
15:07:00 | FromGitter | <zacharycarter> you're* |
15:07:22 | yuken | Yeah, I know what the issue is - I just can't fix it because I've never used nim or the libraries |
15:07:24 | * | PMunch joined #nim |
15:07:36 | yuken | at least I think I know*. it's trying to set a variable to an unknown class/object, right? |
15:07:53 | FromGitter | <zacharycarter> yeah something is being referred to - SF_INSTRUMENT, that hasn't been defined |
15:07:58 | FromGitter | <zacharycarter> somewhere in the code |
15:08:19 | yuken | I know where it isn't defined too and where it should have been, sndfile |
15:08:20 | * | Trustable joined #nim |
15:08:24 | yuken | I just can't fix it because I have no clue how that works lol |
15:08:37 | * | dankrad joined #nim |
15:08:38 | FromGitter | <zacharycarter> I believe @ftsf wrote that library |
15:08:42 | FromGitter | <zacharycarter> he may be able to offer some guidance |
15:08:51 | FromGitter | <zacharycarter> welcome to Nim btw, it's a lovely language |
15:09:08 | yuken | FromGitter, I actually don't use Nim, though I'm interested in it... the syntax seems relatively similar to my old language, it even uses proc too lol |
15:09:09 | FromGitter | yuken, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/nim-lang/Nim |
15:09:14 | yuken | oh |
15:09:18 | yuken | oh I meant zacharycarter oopsie. |
15:09:21 | FromGitter | <zacharycarter> what language are you coming from? |
15:09:49 | yuken | BYOND. |
15:10:12 | FromGitter | <zacharycarter> ah a byondr! you're quite a rare breed :P |
15:10:41 | yuken | Here's an example or two, https://gist.github.com/anonymous/1bfd2b91cdb3ceb4df36b24150cf9d59 & https://gist.github.com/anonymous/a2bbdc8b038909383e620c0032f39cc6 |
15:10:49 | yuken | zacharycarter, you've used it before? :o |
15:10:58 | FromGitter | <zacharycarter> I've heard about it when researching certain games |
15:11:05 | FromGitter | <zacharycarter> and been to the website / read about it |
15:11:10 | yuken | It's decent, but has too mnay problems right now. |
15:11:17 | crem | http://rosettacode.org/wiki/Function_definition doesn't even have byond. What is it. :-\ |
15:11:17 | yuken | Can't compile to binaries directly for example. |
15:11:23 | FromGitter | <zacharycarter> well Nim is much more of a programming language |
15:11:24 | yuken | https://secure.byond.com |
15:11:35 | yuken | zacharycarter, I realise that bit :p. But, SDL2 and such exist for it |
15:11:35 | FromGitter | <zacharycarter> vs BYOND which I believe is more of a scripting language? |
15:11:38 | yuken | so I doubt it'd be hard. |
15:11:47 | yuken | BYOND is a scripting language for its engine, DreamSeeker, yeah. |
15:11:50 | FromGitter | <zacharycarter> yuken: if your'e interested in gamedev, here's my current project |
15:11:55 | yuken | Can't be used for general purpose. |
15:11:59 | FromGitter | <zacharycarter> https://github.com/zacharycarter/zengine |
15:12:09 | yuken | oh my, 3D :o |
15:12:12 | FromGitter | <zacharycarter> http://fragworks.io/ was my last Nim project which has been put on indefinite hiatus |
15:12:31 | yuken | I have a video of my game back before I scrapped it because uh |
15:12:37 | yuken | well, in the previous build... 300 calls for regex, per tick |
15:12:38 | yuken | per mob. |
15:12:43 | FromGitter | <zacharycarter> ouch |
15:12:52 | yuken | https://www.youtube.com/watch?v=RJfnUScp7Yk |
15:13:26 | FromGitter | <zacharycarter> quite cool |
15:13:31 | FromGitter | <zacharycarter> using sdl2 as the renderer I take it? |
15:13:52 | FromGitter | <zacharycarter> oo was this multiplayer? |
15:14:03 | yuken | I'm not sure what BYOND uses other than its own engine |
15:14:07 | yuken | DirectX based though. |
15:14:13 | FromGitter | <zacharycarter> gotcha |
15:14:21 | yuken | zacharycarter, yep. Multiplayer arena sidescroller with 3 teams. |
15:14:27 | yuken | Technically, probably, an illegal game because it uses the Naruto IP ;) |
15:14:27 | FromGitter | <zacharycarter> very cool |
15:14:38 | FromGitter | <zacharycarter> meh graphics are hard |
15:14:56 | FromGitter | <zacharycarter> Nim isn't really a game programming language, it's much lower level than that |
15:15:14 | yuken | I realise that bit. |
15:15:16 | FromGitter | <zacharycarter> but you can build games with it certainly |
15:15:21 | yuken | It's the same idea as any other programming languages like C++ |
15:15:25 | FromGitter | <zacharycarter> exactly |
15:15:28 | yuken | not designed for games, just anything you want |
15:15:29 | PMunch | zacharycarter, what? |
15:15:37 | PMunch | Oh okay |
15:15:49 | FromGitter | <zacharycarter> I mean it's not directly geared towards creating games PMunch |
15:16:04 | FromGitter | <zacharycarter> but I think we're all on the same page ;P |
15:16:11 | yuken | https://github.com/YukenK/HunterNin - you can look through tyhe atrocity that is my game there |
15:16:14 | yuken | .dm files are code ;o |
15:16:52 | FromGitter | <zacharycarter> yuken: I hope to have my engine in a usable state in the next month or so |
15:17:28 | FromGitter | <zacharycarter> I need to get 3d skeletal animation working (I'll tackle that next week) and then add some API hooks but it's already pretty far along |
15:17:46 | FromGitter | <zacharycarter> if you're looking for a Nim project to play around with for games there are a few either WIP or already usable |
15:17:57 | FromGitter | <zacharycarter> https://github.com/ftsf/nico is one |
15:18:06 | FromGitter | <zacharycarter> I think PMunch has created one as well |
15:18:47 | FromGitter | <zacharycarter> @ftsf is probably the most avid game developer that uses Nim, and he just recently launched at title with his engine on steam / won a ludum dare with one of his entries |
15:20:11 | * | PMunch quit (Ping timeout: 258 seconds) |
15:20:12 | yuken | zacharycarter, I might check out the game engine when it's finished then :p. I'm looking to make 2D games right now, though. |
15:20:51 | FromGitter | <zacharycarter> yuken: my engine will support / already supports 2d and 3d |
15:21:09 | yuken | :o |
15:21:26 | yuken | also with the code in my github, some of the issues might also be my own ability |
15:21:30 | yuken | I'm not that great at things ;p |
15:21:54 | FromGitter | <zacharycarter> folks in here will gladly review code assuming it's Nim :P |
15:22:19 | FromGitter | <zacharycarter> there's a decent article floating around the webz about building a 2d game in SDL2 using Nim |
15:22:20 | FromGitter | <zacharycarter> one second |
15:22:23 | yuken | I've only been... seriously programming for a few months - programming as in learning the ideas that apply to most languages |
15:22:27 | FromGitter | <zacharycarter> https://hookrace.net/blog/writing-a-2d-platform-game-in-nim-with-sdl2/ |
15:22:37 | yuken | in fact |
15:22:42 | FromGitter | <zacharycarter> well what you've created is pretty impressive for only having been at it a few months |
15:22:43 | yuken | I only recently learned what typecasting was x-x |
15:22:56 | FromGitter | <zacharycarter> not sure how you survived :P |
15:23:04 | yuken | well, in BYOND, uh |
15:23:23 | yuken | you can use :, which is: "This is the runtime search operator. It is used to access a property of a var that is not explicitly prototyped." |
15:23:34 | yuken | I used that in my previous game until I realised how terrible it was. |
15:24:00 | FromGitter | <zacharycarter> yeah I'd strongly recommend learning a lower level programming language |
15:24:09 | FromGitter | <zacharycarter> I have a good book recommendation too |
15:24:11 | FromGitter | <zacharycarter> if you're interested |
15:24:18 | federico3 | anybody using Nim on AVR/atmega/arduino? |
15:24:30 | yuken | zacharycarter, sure I'll bookmark it :p. |
15:24:36 | FromGitter | <zacharycarter> https://learncodethehardway.org/c/ |
15:24:48 | yuken | Rust and C are systems languages, is Nim the same or no? |
15:25:05 | FromGitter | <zacharycarter> yes it is |
15:25:16 | FromGitter | <zacharycarter> Nim compiles down to C and then invokes the native compiler on the system |
15:25:20 | yuken | :o nice |
15:25:24 | yuken | explains why I needed a C compiler on Windows. |
15:25:27 | FromGitter | <zacharycarter> it can also compile to JavaScript, C++, Objective-C, etc |
15:25:35 | FromGitter | <zacharycarter> yup! |
15:25:54 | yuken | JavaScript o-o? Does that mean I could run it in a browser? |
15:25:59 | * | PMunch joined #nim |
15:26:20 | PMunch | Sorry, my network got disconnected.. |
15:26:33 | PMunch | But yeah zachary, I think we're on the same page :P |
15:27:20 | PMunch | yuken, yup |
15:27:50 | PMunch | https://github.com/dom96/snake |
15:27:54 | yuken | One of the other issues with BYOND is that every single thing is server-side |
15:27:59 | PMunch | There's an example for you ^ |
15:28:08 | yuken | meaning that even _input_ is server-side |
15:28:28 | FromGitter | <zacharycarter> yuken: weird |
15:28:41 | yuken | It was designed for text-based MUDs back in 1998~ |
15:28:51 | yuken | and kind've evolved into a 2D sprite-based engine |
15:29:41 | FromGitter | <zacharycarter> yuken: I made this with Nim |
15:29:49 | FromGitter | <zacharycarter> https://play.nim-lang.org/ |
15:29:52 | FromGitter | <zacharycarter> front-end and back-end |
15:30:24 | FromGitter | <zacharycarter> it uses some other technologies as well, such as docker, but the point is, yes you can build web apps with Nim |
15:30:26 | yuken | That's nice, I wanted my game to be able to run in a browser without needing plugins. |
15:30:32 | yuken | Nim seems real nice so far then. |
15:30:44 | yuken | Without being too hard to learn, it's similar enough to BYOND that it doesn't seem too difficult. |
15:30:49 | FromGitter | <zacharycarter> Nim can also leverage emscripten / web assembly |
15:31:10 | FromGitter | <zacharycarter> Rust is too similar / becoming too similar to C++ for my tastes |
15:31:29 | FromGitter | <zacharycarter> Nim for me offers that sweet spot of productivity, performance, and lack of friction |
15:32:12 | FromGitter | <zacharycarter> @dom96 : did you read / see yesterday I got Nim running on AWS lambda? |
15:32:55 | yuken | Well, Nim seems good so far. Gonna have to learn it once I finish with this game. |
15:33:07 | yuken | Or maybe just switch over, right now my game has all base mechanics and 6 characters, so it isn't too far in |
15:33:18 | yuken | (there is supposed to be a total of 150+ characters, hence the not-so-far-in ;)) |
15:33:42 | FromGitter | <zacharycarter> so yuken: this is a thing you may not care about but when you switch to Nim and start doing game programming you will quickly hit a bridge |
15:33:58 | yuken | go on |
15:34:03 | FromGitter | <zacharycarter> and you'll have to navigate the hardware performant optimized rendering vs what sdl2 offers |
15:34:11 | FromGitter | <zacharycarter> issue |
15:34:25 | * | smt quit (Ping timeout: 248 seconds) |
15:34:28 | yuken | Hm. Hopefully it won't be too bad, as I'm just using 2D sprites without any sort of particles and such. |
15:34:43 | FromGitter | <zacharycarter> it probably will not be and if that's the case then sdl2 might be all you need |
15:34:50 | yuken | Stuff that, by looks, you could run on a 486 if you made it properly. |
15:35:08 | FromGitter | <zacharycarter> I'd just be aware that sdl2's renderer is not optimized |
15:35:16 | FromGitter | <zacharycarter> that's why projects like mine exist |
15:35:24 | FromGitter | <zacharycarter> and of course doesn't offer any sort of 3d |
15:35:33 | yuken | Image of the game, https://i.imgur.com/VEzI9u2.png |
15:35:37 | PMunch | zacharycarter, one of the things that really annoys me about sdl2.. |
15:35:48 | yuken | zacharycarter, well I'll have to look into it. I might even make a DOS build of my game if that's possible ;) |
15:36:23 | FromGitter | <zacharycarter> PMunch: yup but what can you do? it's kind of a black hole - 3d I mean - so I understand the design decisions made by the sdl2 team |
15:36:43 | PMunch | Oh, I meant the renderer thing |
15:36:45 | FromGitter | <zacharycarter> yuken: cool! I'm not sure about DOS but if there's a way to cross compile to it and toolchains available I'm sure it's possible |
15:36:48 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
15:37:02 | FromGitter | <zacharycarter> PMunch: oh right that too, yes but also writing an optimized 2d renderer can be difficult as well |
15:37:09 | yuken | Well, if it can compile to C, and I don't use any libraries that require a modern OS |
15:37:12 | yuken | I don't think it'd be too hard. |
15:37:20 | yuken | I'm not even going to use music really, just MIDIs. |
15:37:49 | FromGitter | <zacharycarter> man you should probably just use https://github.com/zacharycarter/blt-nim :P |
15:37:52 | FromGitter | <zacharycarter> go totally terminal |
15:38:04 | yuken | nah, need muh sprites |
15:38:15 | FromGitter | <zacharycarter> although even that leverages sdl2 / opengl |
15:38:18 | yuken | I doubt a 2D action sidescroller would work that well in a terminal! :p |
15:38:28 | PMunch | yuken, you should check out my SDLgamelib as well :) |
15:38:40 | PMunch | Offers a slightly different approach to game programming |
15:38:46 | PMunch | https://pastebin.com/tFr2wHsc |
15:39:08 | yuken | BYOND is Windows only (insanely easy to run in WINE, I can do it on my 10 year old Core 2 Duo mobile), Nim should have no real problems under Linux & macOS correct? I see zacharycarter uses (ew) macOS ;p. |
15:39:36 | FromGitter | <zacharycarter> I do use osx |
15:39:45 | PMunch | I'm running linux yuken, no trouble here |
15:39:56 | yuken | well that's pretty much all my questions I can think of then. |
15:40:00 | FromGitter | <zacharycarter> you have to cross compile to hit different targets but yes Nim can run on whatever OS you choose |
15:40:07 | FromGitter | <zacharycarter> I've gotten game engines running on android with Nim |
15:40:29 | PMunch | I'm trying to make a seq and an array share their data. I've got seq -> array working with the above, but I was wondering, what happens if the seq goes out of scope and gets garbage collected? |
15:40:32 | FromGitter | <zacharycarter> I <3 osx I still claim it has the best developer experience |
15:40:34 | yuken | oooh, what about ARM compatibility? Iunno if you meant Android ARM or Android x86 |
15:40:46 | FromGitter | <zacharycarter> I was targetting arm32 |
15:41:09 | yuken | so I could even get my game running on a Raspberry Pi or similar board too |
15:41:11 | yuken | that's lovely. |
15:41:14 | FromGitter | <zacharycarter> yup |
15:41:15 | PMunch | yuken, yeah I've also run sdl2 games with my gamelib on Android |
15:41:20 | PMunch | Android ARM that si |
15:42:35 | yuken | How do sprites/spritesheets work in Nim? here's uh, what my sprites look like right now: https://i.imgur.com/FWVtKEq.png |
15:42:39 | yuken | well |
15:42:41 | yuken | SDL2/similar |
15:42:49 | FromGitter | <zacharycarter> you code them yourself |
15:43:36 | FromGitter | <zacharycarter> I believe that one article I linked earlier about sdl2 / Nim deals with spritesheets |
15:43:48 | yuken | <3 |
15:43:52 | FromGitter | <zacharycarter> but again, non optimized, just leveraging the sdl2 renderer |
15:45:14 | PMunch | yuken, I've got support for the spritesheets that TexturePacker generates for LibGDX in SDLgamelib :) |
15:45:31 | PMunch | With rotation, animations, and ninepatch images. |
15:45:49 | FromGitter | <zacharycarter> ooo ninepatch support is nice |
15:46:40 | FromGitter | <zacharycarter> PMunch, maybe I can eventually convince you to write something like your library on top of zengine |
15:46:47 | FromGitter | <zacharycarter> zengine is analogous to raylib |
15:47:26 | FromGitter | <zacharycarter> but I don't see it getting into high level concepts like sprite sheets etc |
15:47:33 | FromGitter | <zacharycarter> maybe if I get super ambitious |
15:48:30 | FromGitter | <zacharycarter> I'd rather focus on low level plumbing code and expand the engine's capabiilites |
15:50:28 | * | dddddd quit (Ping timeout: 260 seconds) |
15:53:44 | FromGitter | <zacharycarter> Araq: you said Karax wasn't optimized yet or you were working on optimizing the library? How's that going? I'm talking about creating some type of prototype for a project at work using it, then doing a talk on it |
15:53:53 | FromGitter | <zacharycarter> talking to a co-worker* |
15:54:19 | FromGitter | <zacharycarter> Go is possibly entering our toolchain and I figure why not Nim |
15:56:42 | Araq | zacharycarter devel branch of karax is optimized against a real world application, not sure about its benchmark results |
15:57:06 | Araq | but it should be fast enough for anything you throw at it, I think |
15:57:08 | * | planhths quit (Ping timeout: 240 seconds) |
15:57:46 | FromGitter | <zacharycarter> are there any ambitions for building a flux based state management lib around it? |
15:58:00 | FromGitter | <zacharycarter> or any type of state management library? |
15:58:16 | Araq | we want to add "reactive" lists etc |
15:58:25 | Araq | not sure how these compare to flux |
15:58:43 | PMunch | zacharycarter, I was thinking about decoupling gamelib from SDL to allow this. As it is a library it already tries to force as few things as possible. For example the animations type is not only for sprites but can be used for anything that has a frame structure. |
15:58:56 | FromGitter | <zacharycarter> flux gives you essentially a data store that is immutable beyond certain components touching it |
15:59:16 | FromGitter | <zacharycarter> so it comes with the concept of mutators or reducers which touch the store |
15:59:28 | FromGitter | <zacharycarter> those are fed by actions in most architecures |
16:00:07 | FromGitter | <zacharycarter> I guess a view layer isn't enough for most people, they require hand holding in maintaining application state |
16:00:27 | FromGitter | <zacharycarter> Araq: https://facebook.github.io/flux/ |
16:03:44 | FromGitter | <zacharycarter> PMunch: interesting... I need to check out your library and then maybe we can put our heads together and figure out how to integrate it with zengine |
16:04:03 | * | dddddd joined #nim |
16:04:03 | FromGitter | <zacharycarter> zengine currently lacks support for 2d animation but I plan on remedying that soon |
16:04:05 | Araq | meh, I cannot watch these hipsters talking |
16:04:31 | PMunch | Araq, better if I show you my implementation of persistent vectors in Nim? |
16:04:34 | FromGitter | <zacharycarter> :P |
16:05:02 | FromGitter | <zacharycarter> Araq: I know it burns you but there is a lot of hype around these immutable data store architectures for front-end frameworks |
16:05:10 | Araq | as soon as I hear "business logic" I stop listening |
16:05:16 | FromGitter | <zacharycarter> lol |
16:05:40 | PMunch | I actually have a question about those. I tried to get a seq and an array to share data. But are seqs implemented as flexible struct arrays? |
16:05:43 | FromGitter | <zacharycarter> I just think people are going to look at Karax and perceive a view layer with nothing else behind it |
16:05:57 | FromGitter | <zacharycarter> and then throw it in the bucket with MarkoJS etc |
16:07:07 | FromGitter | <zacharycarter> also things like server side rendering / pre rendering come into play |
16:07:22 | FromGitter | <zacharycarter> when folks are hunting for their golden front end solution |
16:07:32 | Araq | I don't care about "people", "people" use JS for everything, fail to see any problems with it and enjoy GoT |
16:07:38 | * | ShalokShalom quit (Ping timeout: 255 seconds) |
16:08:50 | PMunch | Haha |
16:09:15 | PMunch | Speaking of immutability zacharycarter: https://github.com/PMunch/nim-persistent-vector |
16:09:31 | yglukhov | hey guys, introducing https://github.com/yglukhov/cassandra |
16:09:37 | PMunch | Clojures persistent (immutable) vectors in Nim :) |
16:09:37 | Araq | PMunch: a seq is a struct {len, cap: int; data: <variably sized array>} |
16:09:55 | FromGitter | <zacharycarter> yuri: Nice! |
16:10:08 | FromGitter | <zacharycarter> Araq: yeah but people will also buy / use your shit :P |
16:10:28 | PMunch | And data is not a pointer but a flexible array thing? |
16:10:35 | Araq | exactly |
16:10:53 | FromGitter | <zacharycarter> yglukhov: what do I need to do to come work for you :P |
16:10:53 | Araq | actually a seq is a *pointer* to this struct |
16:11:06 | FromGitter | <zacharycarter> seems like you're just constantly pumping out useful Nim projects |
16:11:43 | yglukhov | zacharycarter: mind for relocation? ;) |
16:11:52 | Araq | PMunch: can you name it "persistent seq" instead. a vector is something like (1, 1, 2) |
16:11:57 | FromGitter | <zacharycarter> Nope! in fact I'm working on selling my house haha |
16:12:11 | PMunch | Araq, damn. Then I can't optimise away the cap and len fields when my structures are of their max size |
16:13:12 | Araq | I wrote a persistent/immutable BTree. to insert 100 entries, it needs to replicate the root node 100 times. ridiculous crap. |
16:13:20 | PMunch | Araq, hmm that would make more sense. It's named after the Clojure structure.. And currently it's more like a stack, only add and delete in one end (but can update anywhere). |
16:13:30 | yglukhov | zacharycarter: we might be seeking for badass game engine architects/gurus |
16:13:43 | yglukhov | sounds fun? |
16:13:59 | FromGitter | <zacharycarter> sounds very fun |
16:14:01 | PMunch | Araq, the root node obviously needs to be copied. Which is why it's kept lean. |
16:14:17 | FromGitter | <zacharycarter> if you end up hiring for those positions, please toss me a link to the advert yglukhov |
16:15:07 | yglukhov | zacharycarter: deal |
16:15:26 | FromGitter | <zacharycarter> :) |
16:16:11 | Araq | PMunch: it's stupid ;-) |
16:16:35 | PMunch | I tried yesterday and was able to have 1_000_000 vectors ranging in size from 0-1_000_000 elements (generated by starting with an empty vector and adding to it in a loop). Took four seconds and about 400MB of RAM, in comparison the same time/memory was achieved when using only 15_000 seqs of sizes 0-15_000 (and they were just allocated, not actually filled with data). |
16:16:52 | PMunch | So they are great for things like infinite undos |
16:17:25 | PMunch | Plus immutability is awesome for asynchronous stuff. |
16:18:29 | * | yglukhov quit (Remote host closed the connection) |
16:18:34 | Araq | for undos they don't help that much (I might want to undo larger batches of work) and for everything else I don't see their advantages |
16:19:04 | * | yglukhov joined #nim |
16:20:00 | PMunch | What do you mean they don't help that much? |
16:21:54 | * | rdsome joined #nim |
16:21:58 | * | rdsome left #nim (#nim) |
16:22:56 | * | yglukhov_ joined #nim |
16:23:22 | * | yglukhov quit (Ping timeout: 260 seconds) |
16:23:30 | * | ShalokShalom joined #nim |
16:23:38 | PMunch | Oh by the way. Boarding a plane soon so might leave abruptly but looking at the vector.nim code is "high" supposed to be removed? |
16:23:51 | PMunch | That gives me weird errors.. |
16:25:51 | * | PMunch quit (Quit: leaving) |
16:27:08 | * | yglukhov_ quit (Ping timeout: 240 seconds) |
16:29:45 | * | ShalokShalom quit (Quit: No Ping reply in 180 seconds.) |
16:30:55 | * | ShalokShalom joined #nim |
16:36:43 | * | jsgrant joined #nim |
16:37:34 | * | endragor joined #nim |
16:38:34 | * | endragor quit (Remote host closed the connection) |
16:48:49 | * | ShalokShalom quit (Quit: No Ping reply in 180 seconds.) |
16:50:57 | * | ShalokShalom joined #nim |
16:52:46 | Trustable | I have a problem: All my Nim programs compile to "shared library" instead of executable files. I use Manjaro. I blame the latest system update. |
16:55:25 | * | vlad1777d quit (Remote host closed the connection) |
16:56:37 | * | ShalokShalom quit (Ping timeout: 260 seconds) |
16:58:35 | * | ShalokShalom joined #nim |
17:02:22 | * | endragor joined #nim |
17:11:58 | * | yglukhov joined #nim |
17:15:42 | FromGitter | <Varriount> Trustable: O_o |
17:16:52 | * | yglukhov quit (Ping timeout: 276 seconds) |
17:19:57 | * | dankrad quit (Ping timeout: 268 seconds) |
17:20:14 | * | dankrad joined #nim |
17:21:16 | * | v17d joined #nim |
17:21:30 | * | xet7 quit (Remote host closed the connection) |
17:25:02 | * | xet7 joined #nim |
17:28:23 | * | yglukhov joined #nim |
17:31:07 | * | endragor quit (Remote host closed the connection) |
17:38:29 | * | endragor joined #nim |
17:39:15 | Zevv | My post just disappeared from the Nim forum. Still searchable, but the post itself gives a 404 |
17:39:22 | Zevv | Did I violate some kind of policy? |
17:43:27 | FromGitter | <Varriount> Zevv: Are you a new user? It might be that your post requires approval first. |
17:43:34 | FromGitter | <Varriount> What's your question? |
17:45:17 | Zevv | I was asking if there are any alternatives for re/nre that have no external dependencies |
17:45:32 | Zevv | and if not, that I would consider porting Lua pattern matching to Nim |
17:46:20 | Zevv | (if this was not done already, that is) |
17:50:13 | * | Vladar joined #nim |
17:50:26 | * | Trustable quit (Remote host closed the connection) |
17:50:58 | * | v17d quit (Remote host closed the connection) |
17:54:12 | Araq | Zevv: we have a pegs.nim module |
17:54:31 | Zevv | yes, I found that one. But it's a bit cumbersome for quicky regexes |
17:54:32 | Araq | 2) you were in moderation, so once you logged out, the post "disappeared" |
17:54:40 | Zevv | Araq: that explains, thanks! |
17:54:51 | Araq | I made you a "user", so now everybody can read it |
17:54:58 | Zevv | \o/ |
17:57:13 | Zevv | I'm pretty impressed by Nim from what I saw up to now, so porting the Lua pattern matcher seems like a nice project to get started |
17:58:32 | Araq | pegs.nim is based on Lua's patterns |
17:59:12 | Araq | it's unclear what you gain by reimplementing it |
17:59:21 | Araq | if the API sucks, improve the API |
18:04:06 | * | endragor quit (Remote host closed the connection) |
18:14:26 | * | yglukhov quit (Remote host closed the connection) |
18:14:54 | * | endragor joined #nim |
18:15:34 | * | yingjun joined #nim |
18:18:41 | Zevv | is it based on lua patterns, or on lpeg |
18:18:48 | Zevv | because that's two completely differnt beasts |
18:18:51 | Zevv | but I'll look into that |
18:19:47 | FromGitter | <ephja> PEGs, lPEG :p |
18:19:57 | * | yingjun quit (Ping timeout: 240 seconds) |
18:20:33 | Zevv | yeah indeed |
18:20:54 | Zevv | the good thing about the native lua patterns is that it's just compact and simple, but does the job most of the times |
18:21:08 | Zevv | the whole impelemntation is less then 500 LOC |
18:22:41 | * | endragor quit (Remote host closed the connection) |
18:24:59 | * | endragor joined #nim |
18:35:02 | * | endragor quit (Remote host closed the connection) |
18:36:02 | FromGitter | <cyberlis> guys, nim has `varargs`. it is like `*args` in python. I want list of named args, like python `*kwargs` |
18:36:15 | FromGitter | <cyberlis> Does nim have this? |
18:36:37 | FromGitter | <cyberlis> or i have to implement it myself with `macro` |
18:37:49 | dom96 | Nim doesn't have this |
18:38:02 | FromGitter | <cyberlis> thank you |
18:39:46 | Araq | you can indeed access the named parameters in a macro |
18:50:20 | * | Nimbecile joined #nim |
18:50:45 | * | Nimbecile left #nim (#nim) |
18:58:50 | * | Matthias247 joined #nim |
19:00:51 | Araq | Zevv: well be my guest and write a 500 line implementation :-) |
19:01:07 | Araq | originally the Nim version was tiny too iirc and then it grew features |
19:28:28 | * | yglukhov joined #nim |
19:39:17 | * | v17d joined #nim |
19:45:04 | * | v17d quit (Ping timeout: 255 seconds) |
19:50:05 | * | xet7 quit (Ping timeout: 240 seconds) |
19:53:21 | * | Vladar quit (Quit: Leaving) |
19:54:38 | * | xet7 joined #nim |
19:57:21 | * | v17d joined #nim |
20:04:28 | * | flashmozzg left #nim (#nim) |
20:07:45 | * | jsgrant_ joined #nim |
20:07:56 | * | jsgrant quit (Ping timeout: 246 seconds) |
20:08:01 | * | ShalokShalom quit (Ping timeout: 248 seconds) |
20:26:34 | FromGitter | <mratsim> @Zevv, when you say pattern matching I’m always thinking about Rust/Haskell-like pattern matching, not regex. (Pattern matching like: https://github.com/andreaferretti/patty) |
20:38:46 | FromGitter | <cyberlis> > **<Araq>** you can indeed access the named parameters in a macro ⏎ Can anyone make an example of this? it is hard to find mocros code example for nim :( |
20:41:19 | * | rauss quit (Quit: WeeChat 1.9) |
20:51:35 | dom96 | yeah, example would be nice. I'm not even entirely sure how to achieve this. |
20:56:11 | FromGitter | <mratsim> @zacharycarter @yuken so much drama around learn C the hard way - http://hentenaar.com/dont-learn-c-the-wrong-way |
21:04:24 | Araq | the node kind is nnkExprEqExpr, iterate over the args in the macro and look for this node kind, it's possible to figure this out on your own if you use 'echo repr n' which is what every macro tutorial shows |
21:05:41 | FromGitter | <cyberlis> can you give a link to this tutorial. I will make it myself because it is interesting task |
21:05:43 | * | xet7 quit (Quit: Leaving) |
21:11:19 | * | rauss joined #nim |
21:15:57 | Araq | https://nim-lang.org/docs/tut2.html#macros |
21:18:18 | * | jsgrant joined #nim |
21:18:29 | dom96 | How would this macro work? |
21:18:36 | dom96 | macroCall(foo=42, bar=12)? |
21:19:19 | * | jsgrant_ quit (Ping timeout: 276 seconds) |
21:23:37 | * | yglukhov quit (Remote host closed the connection) |
21:28:56 | Araq | I don't understand the question |
21:29:19 | dom96 | nvm, maybe it's a silly question, i'm tired. |
21:29:20 | Araq | it works how you want it to work the macro specifies the transformation |
21:30:23 | Araq | htmlgen maps keywords args to HTML attributes, for instance |
21:33:10 | FromGitter | <cyberlis> I want make it like this: ⏎ ⏎ ```macro `@`(body: untyped): untyped = ⏎ result = newStmtList() ⏎ echo lispRepr(body)``` ⏎ ⏎ but after compilataion i only get ... [https://gitter.im/nim-lang/Nim?at=5972731676a757f808342196] |
21:34:28 | Araq | macro `@`(args: varargs[untyped]): untyped |
21:35:44 | Araq | but @ is a bad choice because that's already in system.nim |
21:36:36 | FromGitter | <cyberlis> ok, i understood |
21:55:59 | FromGitter | <cyberlis> One more question |
21:56:20 | FromGitter | <cyberlis> can i get a function deffenition in macro |
22:06:17 | * | ShalokShalom joined #nim |
22:11:16 | Araq | getBody() but it's usually a sign that you're doing it wrong |
22:11:37 | Araq | the proc might not have a body (imported from C/DLL or forward declared) |
22:12:40 | * | ShalokShalom quit (Ping timeout: 260 seconds) |
22:18:41 | * | yingjun joined #nim |
22:23:05 | * | yingjun quit (Ping timeout: 240 seconds) |
22:33:11 | user0 | Is there any uniq() function that returns the unique values in a sequence? |
22:34:21 | user0 | > deduplicate |
22:34:27 | user0 | got it, nvm |
22:38:48 | * | arnetheduck quit (Ping timeout: 255 seconds) |
22:42:02 | user0 | How does one declare a sequence of tuple that contains a string and an int? |
22:42:30 | user0 | like let arr: seq[(string, int)] ? |
22:43:31 | user0 | > let counts = new seq[(string, int)] |
22:43:33 | user0 | Got it |
22:43:36 | user0 | nvm |
22:44:20 | FromGitter | <cyberlis> > **<Araq>** getBody() but it's usually a sign that you're doing it wrong ⏎ i meant proc Head. Not a proc Body |
22:44:52 | FromGitter | <cyberlis> user have to define `kwargs` in his function |
22:45:07 | FromGitter | <cyberlis> it have to be `Table` |
22:46:24 | FromGitter | <cyberlis> It can be table of string, string or string, int. I want get this defenition to initTable in macro |
22:51:23 | * | nsf quit (Quit: WeeChat 1.9) |
22:59:14 | * | ShalokShalom joined #nim |
23:09:22 | * | ShalokShalom quit (Ping timeout: 255 seconds) |
23:17:35 | user0 | Anyone here? |
23:18:03 | user0 | How can I dereference a key? |
23:20:29 | user0 | an object* |
23:39:44 | FromGitter | <cyberlis> anObject[] |
23:39:55 | FromGitter | <cyberlis> `[]` - dereference |
23:43:55 | * | PMunch joined #nim |
23:46:07 | PMunch | Hmm, just made genui for gtk2 as well (the bindings in nimble) |
23:49:55 | PMunch | But I'm not sure if my current approach of making pull requests to the toolkit in question is the right one.. |
23:50:12 | PMunch | Maybe they should be distributed separately |
23:51:00 | PMunch | I just went that route when the wxWidgets bindings proved to need some changes for it to work properly. |