Re: Opengl vertices

2016-07-30 Thread Krux02
I do recommend to use the GLvectorf3 type from the OpenGL. There is nothing inherently wrong with that type, but there is also almost no benefit in using it, because it's just an alias for an array. There are not typica vector operations like dot product or cross product defined. I recommend to

Re: Go-lang like interface

2016-07-30 Thread Krux02
@jangko what do you mean with simulated inheritance? In Go you can have an [embedded type in a struct](https://golang.org/ref/spec#Struct_types). That means your struct has all methods, that the embedded type also has. This is effectively pretty much like multiple inheritance. So what simulated

Re: Go-lang like interface

2016-07-30 Thread jangko
surprisingly, this Go like interface is very similar with what I have implemented when creating high level wrapper for Chromium Embedded Framework in [nimCEF](https://github.com/jangko/nimCEF). in my experience, Nim macro not only capable simulate Go like interface, but also interface + simulat

Re: Dynamic Object Type Fields

2016-07-30 Thread OderWat
+1 to what Krux02 said. If you use Nim like that you don't gain very much over Python. It will not be faster (as Nim and Python both need the work to be done at runtime) and you won't avoid errors and lose easier reasoning and refactoring possibilities because the compiler can't check the types

Re: Dynamic Object Type Fields

2016-07-30 Thread Krux02
Ok, I get the problem here. At first I thought you would need an interface object to interact with languages like Python, where you do not know the fields. But you what you actually want is to treat Nim like as if it is Python, and all I can tell you that is a bad idea, and don't do that. You sh

Re: Dynamic Object Type Fields

2016-07-30 Thread everlast
@flyx I guess it's not NEEDED because I can just store it in a table but after using Python year after year it just seems like something natural. The "solution" based on posts above is: import tables template `.?`*[T](a: T, f: untyped): untyped = a[astToStr(f)]

Re: What's the Best Way to Start a Server, Receive Data, Stop the Server, and Return the Data?

2016-07-30 Thread moigagoo
@dom68 @OderWat The use case is pretty simple: I just need to upload a docx file to Google Drive from a CLI tool. The tool was originally written in Python with PyDrive, so the whole API interaction layer was hidden. I also thought about keeping the server running the whole time, but this looks

Re: db_mysql return column name as well?

2016-07-30 Thread OderWat
I would like to use [MonetDB](https://www.monetdb.org) in production as our use case is heavily depending on mysql / mariadb just because it's MyISAM tables are so fast. PostgreSQL and a lot of other DBs I tried faint already on importing the data and are magnitudes slower in querying them. But

Re: What's the Best Way to Start a Server, Receive Data, Stop the Server, and Return the Data?

2016-07-30 Thread OderWat
I thought the same @dom96 but I did not post it because obviously a running server is one attack vector more in a system if you otherwise can be "closed". My [Hubic2SwiftGate](https://github.com/oderwat/hubic2swiftgate) is a program which does something similar: The the whole server is used to

Re: Dynamic Object Type Fields

2016-07-30 Thread flyx
This is not possible by design. type test* = object Here, you declare an object that has no fields. var t = test() Here, you instantiate this object. `t` has the type `test`. var t.name = "kek" The compiler now looks at `t`'s type an

Re: What's the Best Way to Start a Server, Receive Data, Stop the Server, and Return the Data?

2016-07-30 Thread dom96
What sort of application are you planning to use this in? I have a feeling that it would make more sense to simply keep the server running instead of shutting it down and restarting it for each request.

Re: Go-lang like interface

2016-07-30 Thread Krux02
@bpr I never said that monomorphization is a harmful language feature. I just say that someone needs to be aware of it, and that in some contexts this monoporphization is in fact a bad thing. But in c++ it actually is harmful, because the way c++ deals with templates is, to create all required

Re: type equality with unused generic types

2016-07-30 Thread jxy
With an extra indirection, the following code compiles and runs fine type G[N:static[int]] = object v: int A = G[1] B = G[2] type F[U] = object v: U X = F[A] Y = F[B] static: echo(A is B) echo(X is Y) proc p(

type equality with unused generic types

2016-07-30 Thread jxy
I'm having trouble upgrading my old code that worked under v0.13. The following snippet no longer works under v0.14.2. type G[N:static[int]] = object v: int A = G[1] B = G[2] static: echo(A is B) proc p(x:A) = echo "A:",x.v proc p(x:B) = e