Performing goto in Nim

2022-02-27 Thread reneha
If nothing helps, you could also see if throwing and catching an exception works. In the posted example you could throw an exception at "from here" and catch it at "here we go". But abusing exceptions like this is very bad style and should only be used as a last resort.

linux moving to C11

2022-02-26 Thread reneha
Well, yeah, stronger type checking would be worth it. Maybe Linus would do the switch if he know how to keep the programmers from using the other features of C++. As I remember it, Linus didn't want C++ because because the programmers could be tempted to do "OO model crap".

Setting up a Nim foundation

2021-10-21 Thread reneha
Note that _Gemeinnützigkeit_ is not the same as non-profit. A Verein has to be non-profit to be registered but for being _gemeinnützig_ it has to have some charitable purpose. I doubt that supporting the development of a programming language is a charitable purpose under German tax law.

Setting up a Nim foundation

2021-10-21 Thread reneha
A Stiftung (foundation) is basically some amount of money dedicated to some purpose whereas a Verein (association) is a group of people pursuing some purpose. A Verein is usually democratic but it doesn't have to - the by-laws can restrict the participation of members to a great extent but not

SQLite getRow data changing

2021-03-01 Thread reneha
The SQLite 3 interface has a call sqlite3_column_int() which returns a column value of a result row as an int. So if one calls this function from Nim the result should be available as an int, not a string. (Just reading the API documentation, didn't try it myself)

SQLite getRow data changing

2021-03-01 Thread reneha
The Nim db_* database wrappers always return column data as strings. If you want to get an int from an INT column you either have to use parseInt() or you must use a different interface.

ANN: NimternalSQL, an in-memory SQL database library for Nim

2020-12-16 Thread reneha
Prepared statements are now supported.

ANN: NimternalSQL, an in-memory SQL database library for Nim

2020-12-13 Thread reneha
Currently NimternalSQL does not provide prepared statements. This might be a problem for Ormin. IMHO they don't provide much benefit when the database is in-memory. But if they are needed for interoperability it should be not a big deal to add prepared statements.

ANN: NimternalSQL, an in-memory SQL database library for Nim

2020-12-09 Thread reneha
It would be an interesting undertaking to design a "Nim Query Language" which can be embedded using macros. To support existing DBMSs it would have to be implemented on top of SQL.

ANN: NimternalSQL, an in-memory SQL database library for Nim

2020-12-06 Thread reneha
The [in-memory database library](https://github.com/rehartmann/nimternalsql) I've been working on during the recent months is now on Github. Persistence is provided through snapshots. For the future I'm planning to add the ability to restore data from a transaction log. Tables are implemented u

Why is the implicit `result` so widely used?

2020-11-21 Thread reneha
If there's a number of conditions to be checked before a proc does any actual work, then having to use if-else is cumbersome. But in this case it's quite likely that exceptions are being thrown instead of returning error values.

What Nim projects are you working on?

2020-10-22 Thread reneha
I'm working on an in-memory SQL database in pure Nim. It's in a too early stage yet for a public repository.

Localized sorting library?

2020-10-17 Thread reneha
An alternative would be to call strcoll() from the C standard library. Of course this works only if the encoding of your locale setting matches the encoding of the strings passed to strcoll(). This used to be a problem on Windows which did't support UTF-8 locales. But now Windows 10 seems to sup

(Non-)polymorphic iterators

2020-09-20 Thread reneha
I noticed that iterators cannot be polymorphic. I can work around this using checking the type using _of_ , but this feels a bit like a hack. Why can't iterators be polymorphic? Is there a more elegant workaround? Did I miss something?