HNHacker News
TopNewBestAskShowJobs

wkornewald

1,122 karma · joined January 23, 2010

Working on a declarative, synthesizing, AI-based programming language (Ensody). Interested in PL design, AI, server automation, end-to-end encryption.

https://www.ensody.com

https://github.com/wkornewald

https://github.com/ensody

https://bitbucket.org/wkornewald

submissionscomments
wkornewald··on Why Python?
I've implemented a Python-inspired syntax for JavaScript which supports multi-line lambdas. This is what it looks like:

http://bitbucket.org/wkornewald/pyvascript/src/tip/pyvascrip...

It would look better with syntax highlighting, but I'm not sure if the code stays readable enough with multi-line lambdas.

It also becomes more ugly once you want to use lambdas within dicts or lists: http://bitbucket.org/wkornewald/pyvascript/src/tip/tests/tes...

The problem here is that

return x,

could be either a lambda returning the tuple (x,) or the dict/list item separator, so the separator must be put on a separate line.

I'm sure something like this was already proposed, so what were Guido's objections against it? I suppose it's not possible to make multi-line lambas readable enough?

Maybe we need more powerful IDEs that go beyond editing text in a "stupid" text field and instead work directly on the AST and use other visual hints like boxes around functions/lambdas, etc.

wkornewald··on Canvas rider, an innovative HTML5 game
Damn you, I've lost the whole morning on trying to master this game! :)
wkornewald··on Omega - Language of the Future
Regarding "to each their own": Programmers aren't necessarily the best source for an objective view on productivity. This here is a nice example of CS students claiming subjectively which programming style they found easier, contrasted by a more objective comparison of the actual number of bugs in the code in each programming style: http://lambda-the-ultimate.org/node/4070

Studies like this tell me to never trust the opinion of a developer about programming languages and programming styles. In some cases not even my own. ;) Of course in this case we had not very experienced developers, but if we look at what expert developers often claim and how widely opinions differ I often have the impression that expert developers' fundamental opinions about programming languages aren't much better than that of a student.

wkornewald··on Omega - Language of the Future
Of course I want to have secure code. However, do I have to write 100% of my code in such a verbose language in order to guarantee security? I don't think that any security expert would claim that. It's sufficient if the relevant parts of the system and the communication protocols between your components provide a secure foundation. Writing all of your code in a verbose language would be total overkill and a huge waste of effort. So, in the end a combination of both systems might be the solution. The issue here is that this news post is about "the language of the future". It's definitely far from the language of the future. If at all, it might be a small component of the language(s) of the future (and even for that it should better improve on readability). There's just too much research going into verifiable systems and language theory and by far not enough research into making the majority of our code more expressive and reusable from a very practical point of view.
wkornewald··on Omega - Language of the Future
Reading code like that makes me want to puke. So, he wants to increase productivity by making us think about and write theorems in addition to our normal code (don't underestimate the time you invest in this), making our code even more static and less reusable in the hope that the reduction in time for bug hunting and testing will make up for the time invested in thinking about and creating more complex code? Hard to believe. Do those language designers create this stuff to show off how intelligent they are or just for the sake of having fun or are they seriously trying to make development easier? I can't imagine building a website with this. But then again, maybe those languages are designed for satellites, space shuttles, and simulations (i.e. where correctness is far more important than productivity)? Well, I think most of us have to make a compromise between productivity and correctness. It's the same as having 100% code coverage. Nice in theory, but it makes refactorings and development too costly and still doesn't guarantee that your software is 100% correct. Here's a nice post if you still believe 100% code coverage is the ultimate #1 goal of your project: http://blogs.msdn.com/b/cashto/archive/2009/03/31/it-s-ok-no...
wkornewald··on PyvaScript - Python inspired syntax for your JavaScript browser code
Exactly. The less mode/context switching you have to do the less stupid syntax mistakes you can make. We made this because we use Python for server-side code and we also want the same language for browser-side code.
wkornewald··on Goodbye Tokyo Cabinet, hello PostgreSQL
That guy has no clue how to use a non-relational DB (he even admits it) and he uses a DB that is wrong for his task and wonders why it's so hard.

The only point he makes is that the APIs for non-relational DBs are much too simple and limited, so you end up building lots of code on top to do the most trivial things.

What we really need is a way to generate indexes or materialized views on these DBs in a standardized way (see CouchDB, for an example).

wkornewald··on MongoDB backend for Django-nonrel released
Well, it's impossible to support absolutely everything of QuerySet. Also, it's likely that Django's official NoSQL support will be nothing more than what you get with this backend, so I'd say you can not actually call this a backend. :) In fact, this backend already provides more features than App Engine provides natively! So, you can actually get very far with it.

Indexing is planned for a later phase and we'll implement it in a way that is reusable between nonrel backends. In particular, this will be a separate optional module. The Django team probably will only support features that are the DB provides natively and that map to QuerySet (IOW, no map/reduce or other DB-specific features for which no SQL equivalent exists). By moving the indexing features into a separate module we can have the best of both worlds. Beginners don't get disturbed by automatically created indexes and advanced developers can achieve higher productivity because they can understand the automatically generated indexes.

wkornewald··on MongoDB backend for Django-nonrel released
Is anyone interested in helping with some other backend? For example, SimpleDB or CouchDB would be the next great candidates.
wkornewald··on Writing a non-relational Django backend
Well, instead of thinking about normalization you now have to think about denormalization. It's just the other extreme. This isn't really a philosophical decision. Either you want to have an abstraction layer that takes care of these things for you or you want to write your code manually. I prefer the abstraction because it gives me more time to think about the problems that matter.
wkornewald··on Writing a non-relational Django backend
If you want to work on this bigger ORM refactoring I'm available for mentoring help with the App Engine backend (most probably others, too) and with non-relational DB concepts in general (if you need/want my help there). Like I said, we initially wanted to do something along the lines you suggest, but we couldn't really justify the significantly increased amount of work compared to the current approach. If you think it's worth the effort then please go for it.

In any case, the final nonrel backend API won't be much (or any) different from what we have now, so if someone wants to write a backend, please do so.

wkornewald··on Writing a non-relational Django backend
Great! Let's continue the discussion on the django-nonrel discussion group: http://groups.google.com/group/django-non-relational
wkornewald··on Writing a non-relational Django backend
Now, here comes the surprise: That's exactly what we want to emulate with Django nonrel. It's exactly the feature set we badly want to have. This is the reason why the SQLQuery/SQLCompiler stuff fits so well (though, you're right, we're only using a fraction of SQLCompiler's code, so we could actually implement a simplified base class which is used by both, but we can discuss this later on the django-developers group).
wkornewald··on Writing a non-relational Django backend
It's for creating an abstraction layer that allows to write portable apps and that provides a much more powerful API than boring hashmaps (as you might have noticed, lots of APIs for those DBs try to get away from the hashmap representation). How often have you written manual denormalization code or manual in-memory JOIN code? How often did you manually keep track of counters? What are you trying to achieve with that, anyway? You're "manualating" features you get for free with SQL. That's waste. It's something you shouldn't have to do. It can be automated and that's our long-term goal.

These DBs are like writing with Assembler just to get more speed (or scale in this case). The point is, you can use a high-level language (here, Django's ORM plus a few "optimization" specifications) to achieve the same result much faster and in a portable way.

For anything that goes beyond the ORM's features we can still provide MapReduce and other mechanisms, but again with a higher-level API. Do you really believe 10 years from now we'll still be using hashmaps to access those DBs? (just trying to provoke some thought; I don't really believe that you think that way)

wkornewald··on Writing a non-relational Django backend
First of all, we have a few modifications in Django itself that make Django more flexible. What exactly are you thinking of that we're missing?

Regarding SQLCompiler: Maybe the name is just misleading? We had several attempts at this problem and one of them was a complete refactoring of the ORM as you try to suggest here, but in the end we had to face the facts: We'd reproduce pretty much the same functionality that's already there. It would just be named Query instead of SQLQuery and it would take a huge amount of effort to get there. So, we decided instead to reuse as much of the code that just happens to be named "SQLSomething" as possible. And IMHO this is the best of the approaches we've taken. It's simple and it works really well, as you will soon see for yourself. Then we'll talk again.

BTW, we also tried to work with the Django team, but in the end it was all discussion with the hidden message "show us that it works". That's what we are doing now.

wkornewald··on Writing a non-relational Django backend
We need help to get official Django support for non-relational / NoSQL DBs. Currently, we only have an App Engine backend and a half-finished MongoDB backend. We have to demonstrate to the Django team that our approach works with a wider variety of DBs. If we achieve that goal Django would have a way to write portable code for a lot of DB types. We'd also have the foundation for much more powerful features like automatic denormalization. Please help us find backend contributors.
wkornewald··on Things to know for NoSQL Django coders
Guys, we need help with more backends! Apart from App Engine and MongoDB we'd love to have SimpleDB, CouchDB, Redis, and many more. If you want to see native support for your backend please get involved: http://groups.google.com/group/django-non-relational
← PreviousPage 3 of 3