<< 02-11-2016 >>

00:01:36*couven92 quit (Read error: Connection reset by peer)
00:09:40*lyro quit (Ping timeout: 260 seconds)
00:36:26*lyro joined #nim
00:40:15*yglukhov joined #nim
00:46:42*yglukhov quit (Ping timeout: 256 seconds)
00:56:52*brson quit (Ping timeout: 250 seconds)
01:10:28*Gonzih quit (Ping timeout: 245 seconds)
01:11:54*Gonzih joined #nim
01:28:32*desophos quit (Ping timeout: 260 seconds)
01:44:41*yglukhov joined #nim
01:50:28*yglukhov quit (Ping timeout: 260 seconds)
02:07:44*dmi0 quit (Ping timeout: 256 seconds)
02:10:32*dddddd quit (Remote host closed the connection)
02:15:05*chemist69 quit (Ping timeout: 260 seconds)
02:28:10*chemist69 joined #nim
02:48:58*yglukhov joined #nim
02:53:10*yglukhov quit (Ping timeout: 250 seconds)
03:18:24*Jesin joined #nim
03:25:34*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
03:50:53*fredrik92 quit (Ping timeout: 245 seconds)
03:50:55*yglukhov joined #nim
03:55:08*fredrik92 joined #nim
03:56:32*yglukhov quit (Ping timeout: 256 seconds)
04:24:29*kulelu88 quit (Quit: Leaving)
04:53:54*adeohluwa joined #nim
04:54:41*gangstacat quit (Ping timeout: 260 seconds)
05:07:56*adeohluwa quit (Remote host closed the connection)
05:55:12*yglukhov joined #nim
06:00:22*yglukhov quit (Ping timeout: 250 seconds)
06:05:50*nsf joined #nim
06:46:18*chemist69 quit (Ping timeout: 245 seconds)
06:50:46*chemist69 joined #nim
06:53:55*sarlalia1 joined #nim
06:54:38*sarlalia1 quit (Client Quit)
06:58:21*yglukhov joined #nim
06:58:50*sarlalia1 joined #nim
07:04:30*yglukhov quit (Ping timeout: 250 seconds)
07:04:47*brechtm joined #nim
07:48:20*yglukhov joined #nim
07:48:36*yglukhov quit (Remote host closed the connection)
07:58:33*yglukhov joined #nim
07:59:39*Andris_zbx joined #nim
08:14:06*Trustable joined #nim
08:59:49*StarBrilliant quit (Ping timeout: 256 seconds)
09:11:15*StarBrilliant joined #nim
09:16:09*Sentreen quit (Read error: Connection reset by peer)
09:16:57*Sentreen joined #nim
09:25:51*nicanaca0 quit (Remote host closed the connection)
09:31:12*dmi0 joined #nim
09:31:29*couven92 joined #nim
09:43:52*Arrrr joined #nim
09:51:45*nicanaca0 joined #nim
09:54:07*bjz joined #nim
10:06:53FromGitter<endragor> > I cannot - I have not Windows ⏎ Seems to be a common misunderstanding when someone mentions VSCode ;)
10:08:37*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
10:08:52flyxwell they seriously could have come up with a better name
10:23:45*freddy92 joined #nim
10:24:16*bjz joined #nim
10:24:44*dmi0 quit (Ping timeout: 260 seconds)
10:27:04*couven92 quit (Ping timeout: 260 seconds)
10:29:38*fredrik92 quit (Ping timeout: 245 seconds)
10:34:01*fredrik92 joined #nim
10:34:26chemist69I agree, but it's certainly a great editor for coding in Python an Nim. I switched from Atom to it.
10:35:01*chemist69 quit (Quit: WeeChat 1.6)
10:35:15flyxyeah, I use it too
10:35:18*chemist69 joined #nim
10:35:30flyxI switched from TextMate
10:37:19*Salewski joined #nim
10:39:30SalewskiHas someone already tried profiling a Nim program? I tried callgrind yesterday, basically easy to use, but I get for some procs two entries. Still no idea why.
10:39:34Salewski1,200,091,516 /tmp//home/stefan/xchess/nim-chess/nim-chess_engine.c:quiescence_263040_3601934859 [/home/stefan/xchess/nim-chess/board]
10:39:53Salewski311,180,283 /tmp//home/stefan/xchess/nim-chess/nim-chess_engine.c:quiescence_263040_3601934859'2 [/home/stefan/xchess/nim-chess/board]
10:40:18cheatfateSalewski, have you used generics?
10:40:21cheatfatein this procs?
10:40:46SalewskiNo.
10:41:18*freddy92 is now known as couven92
10:41:36SalewskiAt least not myself, maybe somethink from lib modules?
10:41:59Araqwhat's the prototype of 'quiescence'?
10:43:08Salewskiproc quiescence(color: Color; depthleft: int; alpha0: int; beta: int): int =
10:44:37Araqthe optimizer split it into 2 functions, I guess
10:45:17SalewskiOh, great idea. Thanks.
10:50:22*bjz_ joined #nim
10:50:56*bjz quit (Ping timeout: 260 seconds)
10:55:17SalewskiBut I get also two entries for gcc option -O2 or -Os.
10:55:53Araqwell check the generated assembler
11:02:18*Snircle joined #nim
11:17:04*niv quit (Ping timeout: 260 seconds)
11:20:59*dmi0 joined #nim
11:26:22SalewskiThe S option seems not to work: gcc.options.speed = "-O0 -S -g -fno-strict-aliasing" # And google does not help. So is assembly generation for Nim explained somewhere?
11:26:43*bjz joined #nim
11:27:09*bjz_ quit (Ping timeout: 260 seconds)
11:28:14*couven92 quit (Quit: Switching to VPN)
11:29:04Araq-S always worked for me. put a syntax error in there and see if gcc.options.speed is actually picked up
11:29:06*couven92 joined #nim
11:34:16SalewskiWas picked up, I got with -S: stdlib_future.o: file format not recognized; treating as linker script
11:35:19SalewskiWas not sure if -S should work at all, will continue investigations. Maybe I can use objdump external program to get a listing from binary.
11:50:54FromGitter<moigagoo> Hello! I'm trying to write an ORM for Nim but facing difficulties. Hope you could help me. ⏎ ⏎ I need to have a way to define model field types. For example, a model "Person" has a field "name," which is a string of max length 100 and is required. So, I need it to be an object an attribute of which is a concrete value, not a type. I need something like this: ⏎ ```code paste, see link``` ⏎ This is of course wrong. But what is
11:50:55FromGitter... the right way to do it? [https://gitter.im/nim-lang/Nim?at=5819d31e0b10738c73fecd77]
11:52:00SalewskiBye, will try later again.
11:52:02FromGitter<moigagoo> I thought about defining a generic Field type and then defining concepts for each particular field kind, but this didn't work.
11:52:04*Salewski left #nim (#nim)
11:53:06*enthus1ast_ quit (Ping timeout: 250 seconds)
11:53:55*enthus1ast quit (Ping timeout: 252 seconds)
11:56:45FromGitter<moigagoo> I'm thinking that defining a type that consists of a single value is a viable workaround, but apparently you can't do that. Or can you?
11:59:29FromGitter<endragor> you can make a macro that would process types and their fields, supporting certain pragmas, e.g.: ⏎ ⏎ ```myORM: ⏎ type Name = object ⏎ value {.max: 100, required: true.}: string``` [https://gitter.im/nim-lang/Nim?at=5819d52149891fe7422e4a1b]
12:04:06FromGitter<moigagoo> Gee, I knew I was overlooking something clear and obvious. Couldn't believe a great language like Nim didn't have an elegant solution for my (quite trivial) problem :-) ⏎ ⏎ Thanks a ton, @endragor !
12:04:41FromGitter<moigagoo> This is exactly what I've been looking for.
12:09:28FromGitter<endragor> you’re welcome. one drawback of that is that such macros are not “stackable" as they have to be immediate. so you can’t have `myORM: jsonSerializable: andGiveMeYamlToo: type MyType = object`. Java/C# annotations work well for those scenarios
12:14:34*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
12:17:15*[CBR]Unspoken joined #nim
12:20:44*yglukhov quit (Remote host closed the connection)
12:23:04*yglukhov joined #nim
12:35:12*Arrrr quit (Quit: WeeChat 1.5)
12:46:15*brechtm_ joined #nim
12:48:12*gangstacat joined #nim
12:49:16*brechtm quit (Ping timeout: 250 seconds)
13:06:08*nsf quit (Quit: WeeChat 1.6)
13:12:50chemist69moigagoo: when you have the macro working, would you mind to share it here?
13:13:28chemist69I am still not ready to tackle them and would love see this example.
13:13:54chemist69I guess for your task a simple init proc won't fit your needs: proc initName(value: string): Name = result = Name(value: value, required: true, max: 100)
13:13:58*Snircle quit (Read error: Connection reset by peer)
13:14:33*Snircle joined #nim
13:16:07FromGitter<moigagoo> I've taken this variant into account, too, but it still isn't quite what I want.
13:16:11FromGitter<endragor> what do you mean by “processing” here, exactly? store what you need in a data structure defined in the orm module.
13:17:00FromGitter<moigagoo> I'm having huge difficulties explaining what I'm trying to achieve here, sorry.
13:17:42FromGitter<endragor> macros can produce code that stores data in run-time, when program starts to run. some data can also be stored in compile-time.
13:20:24FromGitter<moigagoo> I think the main problem is that I don't have a clear picture on how to do the task. That's why I can't explain it, and that's why I'm confused whereas there's no good reason for it.
13:21:32FromGitter<moigagoo> So, I'll spend a few more hours thinking about it :-) Maybe it'll come to me eventually.
13:21:34FromGitter<endragor> well start with defining the task :) proper problem statement should be the half of the solution.
13:21:46flyxmoigagoo: what about predefining a `type StringField[Max, Required] = object[val: string]` and then using it like `StringField[100, true]`
13:22:07flyxgeneric params are compile-time values, so this should be fine
13:22:32FromGitter<moigagoo> Wait, you can pass values as generic params?
13:22:49flyxer, sure. what do you think array[5, int] does?
13:23:03*chemist69 is frantically testing flyx code
13:23:12flyxI am, however, not sure if it works for booleans
13:24:10FromGitter<endragor> I don’t think you can. array[5, int] is a special thing
13:24:54flyxwell I would be sad if this doesn't work generally
13:24:58FromGitter<moigagoo> You can't: ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5819e929c28f8aa804b7100f]
13:26:10flyxthe link doesn't work for some reason
13:26:34FromGitter<moigagoo> I've deleted the messages seconds after posting it.
13:26:57flyxwhoever thought that would be a good feature for a group chat
13:27:23flyxso did you manage to get it working?
13:27:30FromGitter<moigagoo> Nope
13:27:46FromGitter<moigagoo> The syntax you proposed didn't work.
13:29:03FromGitter<moigagoo> I tried simplifying it, still without success: ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5819ea1f40419f802074b6d7]
13:29:34*confundus joined #nim
13:29:47FromGitter<moigagoo> If I replace Max with T and treat it as type, all works fine.
13:30:12FromGitter<moigagoo> But that's just regular generic type, not quite the thing.
13:32:22flyxthat's a shame
13:32:43*confundus quit (Client Quit)
13:33:43flyxwell I can tell you what I do with NimYAML. just have `type Name = object[val: string]` and then `template max(t: typedesc[Name]): int = 100`
13:34:16flyxyou can generate the template with a macro like `setMax(Name, 100)`
13:34:42FromGitter<moigagoo> How to you make it work? ```type Name = object[val: string]``` Is this valid syntax? I can't compile this one line.
13:35:06FromGitter<moigagoo> *do you
13:35:18flyxI just use this shorthand to fit it in one line
13:35:24FromGitter<moigagoo> Oh, ok.
13:35:27flyxjust break val: string into a separate line
13:35:48flyxit's derived from the tuple[...] notation which works, so I though object[...] may work too
13:36:42flyxanyway, the point is to generate templates that are callable at compile time on the type and return the desired values
13:38:10flyxwith some magic, you can even use this if you have an object which represents a whole table, i.e. `type Person = object \\ name: string \\ age: int`
13:38:45flyxand you can then do `setMaxLength(Person, name, 100)` or `setMax(Person, age, 100)`
13:39:17*brechtm joined #nim
13:39:57flyxwhich is what NimYAML does, e.g. for marking fields as transient (= do not serialize) and, as mentioned, setting default values
13:41:20FromGitter<moigagoo> Thanks for the detailed explanation! I'll try it.
13:42:26*brechtm_ quit (Ping timeout: 244 seconds)
13:42:45*libman joined #nim
13:43:10flyxyou can also generate these templates by giving the whole type into a macro and process declarative pragmas, which is kind of what endragor suggested
13:45:27flyxAraq: is general support planned for values as generic parameters?
13:46:52Araqstatic[T] ?
13:47:56flyxoh
13:47:58flyxlet me try that
13:50:41flyxmoigagoo, chemist69: this works: https://gist.github.com/flyx/8a928f1196b26b1658845ee1b52a39c4
13:51:22*niv joined #nim
13:51:35FromGitter<moigagoo> Cool!
13:52:51chemist69REEAAALLLYYY Cool! Thanks flyx!
13:53:35chemist69that one goes straight into my snippets collection!
13:55:40Araqcan you put this snippets collection online?
13:57:02FromGitter<moigagoo> +1
13:57:12chemist69most of them are pretty simple, since I consider myself a beginner Nim user.
13:57:41chemist69and the collection is not yet that large (but it's growing).
13:57:46FromGitter<moigagoo> Which makes it extremely useful to other beginners ;-)
13:58:09chemist69yeah, I saw that one coming ;) I will think about it.
14:01:34*niv quit (Ping timeout: 265 seconds)
14:02:57chemist69Araq: would it be a good idea to start a snippets repository centrally on nim-lang, where users can submit useful snippets, either for addressing a certain task or for implementing and idiom?
14:03:14chemist69*an idiom
14:03:39federico3a repo under github/nim-lang/... ?
14:03:44chemist69yes
14:03:48*enthus1ast_ joined #nim
14:04:49*enthus1ast joined #nim
14:05:35AraqA repo or a document with 'edit' button? :-)
14:05:42*vqrs quit (Ping timeout: 256 seconds)
14:06:03euantorIdeally it would be easy to search whatever it ends up being
14:06:13FromGitter<moigagoo> So a document :-)
14:06:51FromGitter<moigagoo> Don't know if it's relevant, but Rosetta Code is somewhat a library of Nim snippets http://rosettacode.org/wiki/Category:Nim
14:07:19*vqrs joined #nim
14:08:01FromGitter<moigagoo> But there collecting problem solutions, not idioms, so it's not a substitute for what @chemist69 proposes.
14:10:22chemist69also the problem set on rosettacode is limited.
14:11:50chemist69I had thought of small standalone programs with meaningful names that would be submitted by PRs. But searching is definitely a problem, then
14:13:28chemist69a document with an edit button that could even be part of the official documentation would be another option.
14:16:12chemist69I don't know if me putting some snippets online somewhere where nobody will find it will help very much. But it could be a start.
14:19:29chemist69new thought: put it on the wiki!
14:21:04Araqno, it needs to be a living document. I will come up with something
14:22:25AraqI'll patch the docgen to extract .. code-block:: nim snippets and make it part of the CI
14:22:43Araqwhen we link to it from the official site, we need to ensure the stuff keeps compiling
14:23:25*xet7 quit (Quit: Leaving)
14:25:22*xet7 joined #nim
14:25:52euantorI really like how Rust's compiler does that with examples in documentation
14:27:47euantorhttps://doc.rust-lang.org/beta/book/documentation.html#documentation-as-tests
14:28:23chemist69Araq: that sounds great and would be very useful, I think!
14:33:27flyxAraq: that will be cool. currently, I have the code snippets for NimYAML doc in own files to be able to test them and include those files in the rst
15:05:21*vlad1777d joined #nim
15:08:12vlad1777dHello to all. Are marking variable with star "*" and instruction (operator) export doing the same thing? Or there is some specific?
15:11:38vlad1777dAnd is here analog to goto operation?
15:12:53*desophos joined #nim
15:18:37*desophos quit (Read error: Connection reset by peer)
15:20:32*desophos joined #nim
15:20:42*krux02 joined #nim
15:22:07*UNIcodeX quit (Quit: Leaving)
15:24:04Araqvlad1777d: there is no goto and I don't understand your other question.
15:24:29Araq* is the export marker, syntactically a postfix operator except that Nim has no postfix operators in other contexts
15:30:24*nsf joined #nim
15:30:42*arnetheduck quit (Ping timeout: 256 seconds)
15:32:05vlad1777dAraq, I mean, are the """var a = "sadfdf"; export a""" and """var a* = "sadfdf"""" the same things?
15:32:43Araqno, export is only to export symbols in a foreign module
15:32:51*UNIcodeX joined #nim
15:33:25vlad1777dAraq, thank you
15:35:43pigmejhm, is nimsuggest now again part of nim ?
15:37:07Araqyes
15:41:52*maattdd quit (Read error: Connection reset by peer)
15:43:21pigmejthx
15:57:00*maattdd joined #nim
16:04:02libmanDoes advocacy discussion go in this channel or #nim-offtopic?
16:04:14Araqit's hardly offtopic
16:05:03*libman is very aware that so far I've contributed nothing but some mix of Nim advocacy and annoyance.
16:05:14*brson joined #nim
16:06:05libmanAs this channel grows, maybe a separate logged #nim-advocacy channel would be a good idea.
16:06:49Araqno, you also reported a bug
16:07:03Araqand we got a PR that fixes it :-)
16:07:14libmanI am wondering if Nim has any particular advocacy "selling points" for blockchain-based development.
16:10:00flyxwhat's „blockchain-based development“?
16:10:12libmanThere should be more to my future lifelong "Libertarian Software Philosophy" project than just nagging about permissive licenses... ;)
16:10:31libmanhttp://blockgeeks.com/guides/what-is-blockchain-technology-a-step-by-step-guide-than-anyone-can-understand/
16:10:48flyxI know what a blockchain is
16:10:49libmanAnarchist Apps.
16:10:57flyxI asked what blockchain-based development is
16:11:07flyxyou use a blockchain to develop something… in what way? what for?
16:11:57libmanNo specifics yet, but some top projects in this paradigm include Bitcoin, Ethereum, and IPFS.
16:12:21krux02"pacman-mirrors -g" actually does wonders
16:12:27flyxso you mean like development of software which uses blockchains in some way?
16:12:31krux02my update now ran in just a few seconds
16:13:01krux02sorry wrong channel XD
16:13:43libmanI probably used bad terminology with "blockchain-based development".
16:14:18krux02libman: blockchain is for me this bitcoin stuff
16:14:49flyxthe blockchain is basically a kind of distributed database
16:15:00krux02blockchain is to bitcoin what internet is to web.
16:15:23flyxI do not see how exactly Nim can be „good“ or „bad“ for implementing or working with blockchains
16:15:27libmanI actually never did any blockchain dev. I use IPFS extensively, but haven't yet done anything fancier with it than images, videos, and other immutable blobs.
16:16:41Araqmost decisions are made with your guts and afterwards justified with rational reasons
16:16:45libmanBut that's the direction I'll be going in moving forward. IPFS was sadly implemented in Go, with another implementation in NodeJS. Most coins are in C++. How would one persuade people that Nim is an ideal language for such projects?
16:17:13Araqskip the rational reasons altogether and just use Nim :-)
16:17:31krux02that nodejs guy probably forgot that there is a go to javascript cross compiler
16:17:39libmanI wanna persuade smart devs in my community to use Nim.
16:18:17krux02I think that nim can only shine, when it is used in an area where it truely is better than established languages
16:18:31flyxthen argue with general things about Nim. asking about „how is Nim good for developing blockchains“ is just far too specific to yield a sensible answer
16:18:59krux02flyx, or too general
16:19:10libmanIt's very hard for Nim to compete with Go. Go has a huge lead in copyfree crypto libs. And I can't really argue Nim's net performance benefits until it beats Go in TechEmpower.
16:19:34krux02nim is great for a specific style of development, not for specific problems
16:20:50libmanSpecific problems have specific needs: language features, libraries, etc.
16:20:59cheatfatelibman, because of go i'm not using ipfs and also i do not trust in it
16:21:11krux02libman: Honestly I think it would be great if nim and Go could be used interchangeably, like java and scala
16:21:24libmancheatfate: That's exactly what I was hoping to hear. :D
16:21:48krux02go has modules, and go module interfaces could be translated to interact with nim
16:22:03krux02so that in the end nim could benefit from the go ecosystem
16:22:44libmankrux02: I brought this up when Rust (and more recently Go for 2.0) talked about intermediate representation. I see "ecosystem fragmentation" as a huge problem in free software.
16:24:00krux02yes there should be some language independent modules
16:24:49libmanThat's a separate discussion.
16:25:46krux02But the problem with that is also, that as soon as you get too much into detail there, you end up with something like .net, where you are free to define your classes, but how classes are implemented and that you have to use classes is already decided for you
16:26:09libmanI'd love to learn cheatfate's Nim>Go advocacy arguments and vigorously spread them. (Programming projects will finally become a priority for me after the Nov 8 election.)
16:27:05cheatfatelibman, i'm also have private crypto nim library :)
16:27:06libmanI need to commit to a language, and I've gone back and forth between Nim and Go countless times over the past few years...
16:27:19krux02honestly, I think all features of go can be represented in Nim somehow, and when everything from go is represented in Nim, the step to automatically import Go modules into Nim would be just the next step
16:27:47krux02I don't go back to Go
16:27:52krux02it's neat, but that's it
16:28:41libmancheatfate: in my metaphysics, digital assets that aren't public and copyfree don't really exist. :P (joking)
16:28:55AraqI thought about a Go backend fwiw
16:30:11libmanLast night I wrote: "I think making Nim targets to PHP, Mono, LLVM, LuaJIT, etc is not a good use of developer time. C and JS/Node.js is enough. Also stdlib contains a lot of optimized code that still only works for the C target." -- https://archive.is/dgaZg#selection-1473.0-1481.96
16:32:40*fredrik92 quit (Read error: Connection reset by peer)
16:33:33libmanIf LLVM changes to a non-copyfree license, Go might eventually become the highest-performance copyfree Nim target...
16:34:27libmanIs Nim's syntax flexibility (i.e. vs Go) an asset or a liability for crypto?
16:35:26*krux02 quit (Remote host closed the connection)
16:40:55*libman is yet to justify my "weapons of choice" outlined on my non-serious resume - http://libman.org/resume/resume.pdf
16:44:20libmanWould Nim be a good competitor for https://en.wikipedia.org/wiki/Solidity ?
16:44:23Calinoumost people think flexible syntax is a bad choice sadly
16:44:35Calinou(see PHP)
16:44:44Calinou(but PHP has bad flexible syntax, not a good one :p)
16:45:10*Andris_zbx quit (Remote host closed the connection)
16:45:41federico3php does not exists
16:46:26libmanI coded in PHP for the better part of the last 20 years... :~(
16:47:41libmanIf flexibility is a liability, adding "strictness" settings to Nim should be easy.
16:48:46libmanAlthough I hope for a prettier syntactical approach than stuffing more {.crud.} into proc headers...
16:52:11Araqhow is PHP's syntax flexible? o.O
16:52:29Araqit even relies on fucking sigils
16:53:10Araqlibman: syntactic flexibility is just that. syntax != semantics
16:53:28Araqit's orthogonal to anything security related
16:54:43libmanIt's easier to slip an obfuscated mickey in some languages than others.
16:55:36Araqit's also overrated. Sure Nim is flexible but I can read random Nim code just fine and the parsing rules are clear enough. I cannot say the same about Perl, but maybe that's just my ignorance.
16:56:27Araqin practice dynamic vs static typing makes all the difference when reading code. IMO.
16:59:52*Matthias247 joined #nim
17:01:02Araqok, maybe C is an exception. It keeps up with surprising syntax that is actually used somehwere: struct x { } typedef;
17:04:11*nsf quit (Quit: WeeChat 1.6)
17:04:57vlad1777dPerl has awful syntax, as for me.
17:06:19vlad1777dPerson, who sees source code first time, if to give him Python's code - he could understand part of it, if to give him source in Perl - no.
17:09:44libmanNim's worst syntax idea for me is the {.pragmas.}. They fall into different categories. For example, some are settings (overwritng nim.cfg and `nim` command line) applied at proc level. It would be better to have a mechanism for overwriting ant setting at compile time on global, module, or local (proc) basis.
17:10:40libman*overwriting ANY setting
17:13:28flyxare you complaining about the syntax or the semantics?
17:14:32flyxsyntax is a bit strange, but semantics are pretty similar to most other pragma systems, and almost every compiled language has one.
17:15:02libmanWe should all spare Araq our syntax complaining. Everyone should just make their own Nim "skin". I've been pondering lots of crazy ideas for this.
17:15:50flyxthat does not sound like something worth investing time in
17:15:56flyxfor me, anyway
17:16:19enthus1astlibman what is "an obfuscated mickey"?
17:17:40enthus1astcloaked Mickey Mouse? :)
17:17:48libmanThe libman-flavored Nim would have much-uncluttered proc headings, with a keyword for setting proc-level settings and variables that can be overwritten by the proc caller. :P
17:18:11libmanenthus1ast: https://en.wikipedia.org/wiki/Mickey_Finn_(drugs)
17:19:41enthus1astwhat would we do without drugs :)
17:20:08libmanIn that context it meant writing a library that contains malicious code, like weakening the crypto.
17:24:23libmanMy Nim skin would also allow avoiding repetitive keywords, like = assignment operator defaulting to var, ≗ to let, and ≛ to const.
17:26:46*niv joined #nim
17:28:43libmanAnd prefixing assignment operator with : would mean this assignment is overwritable by proc caller (equivalent of proc argument with default value).
17:30:50libmanAnd * module-level identifier suffix would have the opposite meaning (marking it as private). But this is all a tangent - I'll write it up for the forum someday.
17:33:46libmanThis tangent was inspired by the idea that, if syntax flexibility is a liability, Nim just needs settings / pragmas to disable certain features.
17:35:25pigmejBlaXpirit: any idea why your nim-random fails with `proc randomInt[RNG, ](rng: var RNG; T: typedesc[SomeInteger]): T:type` on your example?
17:36:17BlaXpiritpigmej, more details please?
17:37:52pigmejBlaXpirit: I'm trying to compile your example https://github.com/BlaXpirit/nim-random#example
17:37:55*PMunch joined #nim
17:38:08pigmejhttp://ix.io/1BL8
17:38:32pigmejand that's the error output (except first line which should be my message but autopaste....)
17:42:37pigmejok works when I pass rng explicit
17:44:36BlaXpiritpigmej, i have no idea, everything seems to work
17:44:52BlaXpiritmust be a clash with standard library
17:46:08pigmejI had to modify your example like
17:46:11pigmejhttp://ix.io/1BLk
17:46:16BlaXpiriti didnt have to modify it
17:46:17pigmejit's only part but you get the idea for sure :)
17:46:20pigmejweird
17:46:33pigmej`Nim Compiler Version 0.15.2`?
17:47:14BlaXpirityes but i am not using nimble, so that's probably it
17:47:34BlaXpiritmaybe for me my library takes precedence but for you standard library takes precedence
17:47:45pigmejyeah it may be the case
17:47:47pigmejI'm using nimble
17:47:56BlaXpiritwelp that's a problem
17:48:07BlaXpiriti will have to rename the lib
17:48:15pigmejaaaaarandom?:D
17:48:30BlaXpiriti have no better ideas
17:49:28pigmejI wonder why I can import random.mersenne properly IF std lib takes precedence..
17:49:50BlaXpiritwell because there is no ambiguity i guess
17:51:09PMunchThanks for the help yesterday dom96 :) We were competing in an IoT challenge
17:51:21dom96PMunch: cool, how did it go?
17:51:25pigmejBlaXpirit: maybe...
17:51:27PMunchNim was actually surprisingly easy to get working on the RPi
17:51:45PMunchdom96, pretty good, placed second and won an RPi 2
17:52:05dom96PMunch: nice
17:52:14dom96PMunch: what did you make?
17:52:44PMunchWell, the competition was made up of "badges" that scored you points and were handed out for completing different goals
17:53:29dom96BlaXpirit: thank you for taking the time to maintain your library and help people who are having trouble with it. I know it sucks that the standard library now clashes with the name of it :\
17:53:33PMunchWe made a system were the RPi was serving a web-page. Then when you clicked a button it started reading pages off an NFC card and blinked the light once for every page.
17:54:21PMunchThat scored us the "useless solution" badge along with a badge for using multiple devices and multiple languages
17:54:28dom96hah
17:54:38dom96Sounds like a fun competition.
17:54:47PMunchYeah it was a lot of fun :)
17:57:15enthus1astPMunch where do you do such competitions?
17:57:36PMunchIt was a company that visited our university which organized it
17:58:04dom96PMunch: what company was it?
18:00:24PMunchA Norwegian company called Computas
18:15:17*Matthias247 quit (Read error: Connection reset by peer)
18:22:51*kulelu88 joined #nim
18:23:43*nsf joined #nim
18:28:27*maattdd quit (Remote host closed the connection)
18:35:03*brson quit (Ping timeout: 245 seconds)
18:45:28*enthus1ast quit (Ping timeout: 250 seconds)
18:45:38*enthus1ast_ quit (Ping timeout: 250 seconds)
18:54:28*Trustable quit (Quit: Leaving)
19:19:42*dmi0 quit (Ping timeout: 250 seconds)
19:31:21FromGitter<johnscillieri> Any suggestions on the best way to sum the fields of a tuple of floats?
19:38:09*brson joined #nim
19:39:29*niv quit (Ping timeout: 260 seconds)
19:39:55*libman quit (Quit: Leaving.)
19:40:15*libman joined #nim
19:46:12*qwertfisch quit (Quit: ZNC - http://znc.in)
19:46:49*qwertfisch joined #nim
19:56:22*bjz joined #nim
20:03:04*Trustable joined #nim
20:03:11*Trustable_2 joined #nim
20:03:28*Trustable_2 quit (Client Quit)
20:06:54*krux02 joined #nim
20:07:44krux02I know I asked this question in the past, but I do not remember if there was a solution to my problem.
20:08:15*abeaumont joined #nim
20:08:25krux02Is there a solution to the problem that the editor shows error messages for files that are meant to be included in a different context?
20:09:15krux02for example {.includedFrom "main.nim".}
20:13:13Araqkrux02: the compiler uses a comment for this
20:13:31AraqI mean in the compiler's source code we use comments for this
20:13:45Araqand the VIM plugin knows about them, but no other tool afaik
20:15:41krux02can the emacs plugin read those comments, too?
20:16:27Araqjohnscillieri you should have a seq of floats to begin with but you can use the fieldPairs iterator
20:16:31Araqkrux02: no idea
20:16:49krux02can you give an example of such a comment?
20:17:26krux02I would like to try it
20:18:27*dmi0 joined #nim
20:18:55*Salewski joined #nim
20:19:00Araq# included from sem.nim
20:19:15BlaXpiritthere are operations like "treats x and y as unsigned and adds them". what exactly is the difference between `+%` and `+` ?
20:25:17krux02Araq,it does not work, but thank you anyway
20:26:04krux02BlaXpirit: I asked the exact same question in the past. It is remains from the time, when nim did not have unsigned integers
20:26:40BlaXpiritkrux02, well even in that time, what is the difference between them?
20:26:54krux02cpu flags
20:27:12krux02for example there is an overflow flag that gets set on overflows
20:27:36krux02just most of the time nothing is done with it, but the program can be aware of it
20:28:03FromGitter<johnscillieri> Araq, thanks! I need the floats to have names but ill just move to a real object and use fieldPairs in a total proc.
20:28:14krux02for example as far as I know in Rust an overflow/underflow is an error
20:28:17BlaXpiriti do need operations which ignore overflows but it's a nuisance to use +% because it's defined only for signed types
20:28:29BlaXpiritI'm thinking about just ignoring overflows with a pragma
20:28:42BlaXpiritbut is there anything i need to be aware of?
20:29:39krux02I am not sure if I am telling the truth, but as far as I know, the overflow and underflow behavior of unsigned datatypes is a wanted behavior, and therefore not an error or something like that
20:29:52krux02meaning you should just use unsigned numbers
20:30:36krux02I think +% is nothing else than doing the unsigned operation on singed data, meaning casting to unsigend first and then doing + would be no difference
20:30:53krux02so it's completely not necessary anymore
20:31:39*planhths joined #nim
20:32:04BlaXpirittoUnsigned(T(0)) - (toUnsigned(T(0)) - toUnsigned(max)) mod toUnsigned(max)
20:32:12BlaXpirityeah.......... not looking good
20:32:25krux02what is T
20:32:30BlaXpiritany integer type
20:32:39BlaXpirit[T: SomeInteger]
20:32:45krux02what do you want to do?
20:33:10BlaXpiritfind the highest number divisible by `max`
20:33:22BlaXpiritthat fits into T
20:33:36*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
20:34:01krux02in what context?
20:34:21krux02for me that sounds like an exercise that should not be done in unsigned numbers
20:35:15krux02unsigned numbers are not for math, and one of the most common pitfalls, is to use unsigned numbers when you think your numbers will all be positive
20:36:14*dmi0 quit (Ping timeout: 268 seconds)
20:36:26cheatfatekrux02, natural arithmetic is a part of math
20:36:33cheatfateunsigned integers = natural integers
20:36:38krux02nope
20:37:11krux02there is a Natural type in nim, that that is by design (and good reason) not an unsigned integer
20:37:23cheatfatehttps://en.wikipedia.org/wiki/Natural_number
20:37:29AraqN is a subset of Z, unsigned int is not a subset of int
20:37:46krux02I know the subset relation
20:37:50Araqso every conversion between these two causes problems
20:37:56*shodan45 joined #nim
20:37:58BlaXpiriti'm not doing math, i'm working with bytes
20:38:13Araqkrux02: oh yeah, I'm just paraphrasing what you said
20:38:50krux02Araq: sorry, I misread the sentence, and I didn't realize it was you who wrote it
20:39:41krux02I should have said, "thanks, thats a very good point"
20:40:05cheatfatefor computer arithmetic signed int is unnatural :)
20:41:30cheatfateand unsigned int is not subset of int only because int has 1 bit less then unsigned
20:41:58krux02rule of thumb is: Use singed integers whenever you can, if you think unsigned fits better, it doesn't. You need to know that it fits better, and you need to have very good reason.
20:42:37Araqit doesn't matter why the things are as they are. The asymetry causes a whole class of errors for edge cases
20:42:58Araqas does the fact that abs(INT_MIN) is not representable.
20:43:23krux02cheatfate: that one bit of information is not worth the pain for all the edge cases and errors
20:43:25Araqhopefully soon we'll all use Unums
20:44:04cheatfateAraq, we will never use Unums
20:44:23Araqhardware is in the works already for them
20:44:38cheatfateAraq, yeah supercomputers
20:45:13Araqsupercomputers are tomorrow's desktops
20:45:23*irrequietus joined #nim
20:45:29ldleworktoday's mobile phones are yesterdays supercomputers
20:45:29Araqand the day after's cell phones
20:45:35krux02and all cryptography theory will be worthless as soon as QBits are available
20:46:29cheatfatekrux02, are you sure?
20:46:54krux02pretty much
20:47:16cheatfatekrux02, then please go and read something about postquantum crypto... maybe you learn something
20:47:43cheatfatealmost all modern symmetric crypto algorithms can't be broken with QBits
20:48:29krux02ok, maybe I am not up to date
20:48:44*adeohluwa joined #nim
20:48:57cheatfatehttps://en.wikipedia.org/wiki/McEliece_cryptosystem invented in 1978 with appropriate key sizes can't be broken with Qbits
20:49:03*PMunch quit (Quit: leaving)
20:49:57*PMunch joined #nim
20:50:11cheatfateso please dont tell 'all cryptography theory will be worthless`
20:50:51krux02ok
20:50:54krux02I take it back
20:51:12*maattdd joined #nim
20:52:16krux02sorry
20:53:37SalewskiAraq, for assembler listings: Option -S seems not to work with gcc 5.4, but option -save-temps seems to work.
20:53:44Salewskigcc.options.speed = "-save-temps -O3 -fno-strict-aliasing"
20:53:58*bjz joined #nim
20:54:01krux02cheatfate, but you are wrong with "int has 1 bit less then unsigned", it has the exact same amount of bits
20:54:20krux02it has the exact same amount of representable numblers
20:54:46cheatfatekrux02, yeah i know, but i must say `value bits`
20:54:57krux02the subset of ℤ is just shifted
20:56:05krux02I think the sign bit is primarily a value bit, too. It just has the property, that it can tell you the sign of a number
20:57:25krux02If it would be the sign bit primarily, I should be able to negate a number by flipping that bit, but that's not possible
20:58:18cheatfateLets stop this discussion about unsigned/signed... because currently here 2 against 1
20:58:31cheatfatewe can start when we have at least 3vs3
20:58:37*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
20:58:47AraqSalewski: alright. what does the listings tell you?
20:59:05krux02if we can convert you, we would have already three for the right side
20:59:53cheatfatekrux02, you will not convert me
21:00:13krux02apropos right side, in England the right side is the wrong side, and the right side is the left side.
21:00:53SalewskiAraq, have just done a test with a trivial test program to get assembler at all. Will investigate the chess program soon...
21:04:07cheatfateAraq, common Nim's eating all my memory :)
21:09:19*niv joined #nim
21:13:50*yglukhov quit (Remote host closed the connection)
21:18:17SalewskiAraq, I can see only one quiescence_264040_3601934859 in all the assembler files. See http://ssalewski.de/tmp/nim-chess_engine.s
21:18:38SalewskiMaybe a bug in callgrind.
21:19:31Araqmore likely a feature you don't know about :-)
21:19:40cheatfateSalewski, i dont this its a bug as i saw your report there was `quiescence` and `quiescence'2`, so i think `quiescence'2` is second path of call to this proc
21:20:35cheatfatei think this procedure is called from 2 places and callgrind calculates them as different values
21:20:56SalewskiI have already asked google about the '2 -- no results.
21:21:20Salewskicheatfate, what do you mean by second path?
21:21:43SalewskiAh, ok.
21:21:51cheatfatei mean func1->func2->func3->quiscence and func5->func6->quiscence
21:23:25SalewskiYes indeed, quiscence is called from alphabeta, and then quiscence calls itself recursively some times.
21:24:06SalewskiI have not expected that that is listed differently by callgrind.
21:24:31AraqSalewski: if you know where your program spends its time. run it in a debugger and press CTRL+C
21:24:38cheatfateSalewski, this recursion can overflow stack rewind algorithm...
21:24:59Araqdo it a couple of times and expect the stack traces. Works.
21:26:00Araq*inspect
21:27:41SalewskiAraq, I have not used debuggers in the last twenty years, so I have first to find out how to do it with Nim :-)
21:27:59Araq--debugger:native -d:release
21:28:03Araqgdb chess.exe
21:28:05Araqrun
21:28:37SalewskiOK, that is easy, thanks.
21:30:15SalewskiWill try it tomorrow, bye...
21:30:18*Salewski left #nim (#nim)
21:34:46*adeohluwa quit (Remote host closed the connection)
21:38:52*bjz joined #nim
21:43:08*irrequietus quit ()
21:46:12dyce_any idea how to build a osx executable from linux? perhaps https://www.darlinghq.org ?
21:47:44*aziz joined #nim
21:48:27AraqI wouldn't be surprised if Apple sues you for cross compiling to their sacred cow
21:57:28def-Araq: yep, a common approach is to use a vm, but posting instructions on how to do that will lead to a letter asking you to remove it
21:57:52dyce_apparently you can just pull an image from vagrant
21:58:53dyce_https://github.com/AndrewDryga/vagrant-box-osx
22:00:06*bjz quit (Ping timeout: 268 seconds)
22:02:16*shodan45 quit (Quit: Konversation terminated!)
22:03:08Calinoudyce_: OSXCross
22:03:28Calinouit's successfully used for Godot: http://docs.godotengine.org/en/stable/reference/compiling_for_osx.html
22:03:42Calinouin fact, with darling-dmg, you can even build for iOS (but not distribute...): http://docs.godotengine.org/en/stable/reference/cross-compiling_for_ios_on_linux.html
22:04:03*nsf quit (Quit: WeeChat 1.6)
22:04:25CalinouAraq: cross-compiling is likely legal, using a VM is not
22:04:40Calinouprovided you acquired the Xcode SDK legally, which is possible by having an Apple ID
22:05:46Calinouhttp://stackoverflow.com/questions/10335747/how-to-download-xcode-4-5-6-7-8-and-get-the-dmg-or-xip-file#10335943
22:06:07dyce_im pretty dissapointed with apple though (since the macbook announcement). if i could get a 2 more year from my macbook ill be happy. then i'll switch to cheaper hardware
22:06:20dyce_disappointed*
22:06:45*vg_ joined #nim
22:07:15Calinouyeah, no Vulkan support, no OpenGL past 4.1...
22:09:17*vg_ left #nim ("Leaving")
22:10:41*tinAndi joined #nim
22:13:21*planhths quit (Quit: Konversation terminated!)
22:14:18*yglukhov joined #nim
22:18:43*yglukhov quit (Ping timeout: 252 seconds)
22:20:35vlad1777dI thought that nobody uses Apple's devices. They're too expensive for their possibilities. For such price you could by better hardware from normal company.
22:21:55*enthus1ast joined #nim
22:24:51*adeohluwa joined #nim
22:25:45*Trustable quit (Remote host closed the connection)
22:26:07tinAndiapple devices are cheaper than android devices (apple - lifetime 4 years including updates) android ( max of 2 years if ever)
22:26:40tinAndiso apple is cheper per years, simple
22:26:46tinAndicheaper
22:29:47Calinouvlad1777d: MacBooks still have unmatched battery life and input devices (touchpad)
22:30:07CalinoutinAndi: keeping an iDevice 4 years must be painful still :P
22:30:14Calinoumost people probably don't keep it more than 2 years
22:30:27cheatfatecommon this is not a place for holy war ios vs android
22:30:31Calinoualso, with ROM flashing, you can update an Android phone for more than 2 years
22:30:45cheatfatestop this please
22:30:56tinAndifor the casual user androif is dead after two years
22:31:02tinAndiandroid
22:31:26tinAndiipad2 works after 4 years
22:31:49tinAndiandroid 4.4 is gone
22:31:58cheatfatetinAndi, please stop this
22:32:01tinAndiit hit he market in 2013
22:32:07tinAndiokay
22:32:07Araq#nim-offtopic
22:35:32*kunev quit (Ping timeout: 260 seconds)
22:37:43*kunev joined #nim
22:38:56*ofelas_ joined #nim
22:43:01*pregressive quit (Remote host closed the connection)
22:43:35*pregressive joined #nim
22:45:41*pregressive quit (Read error: Connection reset by peer)
22:45:45*pregress_ joined #nim
22:51:58*ofelas_ quit (Quit: Bye)
22:52:45*aziz quit (Quit: Ex-Chat)
22:56:29*adeohluwa quit (Ping timeout: 252 seconds)
22:57:48enthus1astcheatfate, is was able to detect and delete invalid utf-8 characters with 'validateUtf8' from unicode.nim
22:58:05enthus1astnow chrome happily eats my output
22:58:18enthus1asti was
22:59:19*pregress_ quit (Remote host closed the connection)
22:59:52*pregressive joined #nim
23:00:22*tinAndi quit (Quit: ChatZilla 0.9.92 [Firefox 49.0.2/20161019084923])
23:00:45cheatfateenthus1ast, but why you think that you have utf8 input? are you sure you have exactly utf8 input?
23:04:21*pregressive quit (Ping timeout: 260 seconds)
23:06:08dyce_would i be able to use something like macro or template (or maybe a custom pragma?) to add timers to my procs (stdout how long the method took)?
23:06:38enthus1astcheatfate, actually i'm not, windows cmd tells me it uses codepage '850' whatever this is...
23:06:45dyce_so i dont have to litter my code
23:06:53enthus1astit looks like a strange mix
23:10:14enthus1asti once had a similar issue with windows cmd, switching to a TrueType font was fixing it back then.
23:11:28vlad1777dIn manual is written: """type\n Node = ref NodeObj\n NodeObj = object""". How it can Node be a reference of NodeObj, if it was not created yet?
23:11:42vlad1777dNim's manual: http://nim-lang.org/docs/manual.html#types-tuples-and-object-types
23:18:37enthus1astvlad1777d strangely it compiles, the reason would interest me as well
23:30:43*dmi0 joined #nim
23:36:11*ftsf joined #nim
23:36:22*ftsf quit (Remote host closed the connection)
23:37:55*fredrik92 joined #nim
23:39:56*couven92 quit (Ping timeout: 260 seconds)
23:47:05vlad1777dStrange, it's in Ned program too: https://pp.vk.me/c638518/v638518447/899d/hSF7luXlJYo.jpg
23:48:47cheatfateenthus1ast, and this is main problem, nobody knows what encoding you have while speaking with cmd over pipe...
23:58:42cheatfatedyce_, try to look for nimbench