HackerTrans
TopNewTrendsCommentsPastAskShowJobs

timfi

no profile record

comments

timfi
·last year·discuss
In general, I find that compilers, transpilers, etc. are all just "interpreters", which conceptually just boil down to a given input being "re-interpreted" into a new representation. Thus, what we commonly call interpreters re-interpret programs into results, compilers just re-interpret into an executable, transpilers into a different language, etc.
timfi
·last year·discuss
[flagged]
timfi
·2 years ago·discuss
Imho this is a non-issue. Python's max-function isn't limited to numerical values, but can consume iterables of anything with a defined order, i.e., things that implement the appropriate hooks in the Python data model. For such inputs, returning anything but an error (or the optionally provided default value) doesn't make much sense.
timfi
·3 years ago·discuss
A while back I attempted to write a brainfuck interpreter in Python with similar restrictions. It was great fun!

https://codegolf.stackexchange.com/a/206450
timfi
·3 years ago·discuss
Sometimes this may be the case but not so much here. Firstly the mention the version they used and, secondly, OtterTune are a startup based around automatic DB steup/schema optimization founded by folks from CMUs DB group, they most certainly know what they are talking about here.
timfi
·3 years ago·discuss
From my personal experience, David Beazley's Talks/Tutorials on the matter are very enlightening.
timfi
·3 years ago·discuss
A good starting point might be Hy [0]. Its claim to fame is being a LISP embedded in Python.

[0]: https://github.com/hylang/hy
timfi
·3 years ago·discuss
This is not strictly true. Python expressions are in fact Turing complete. For example, you can implement an entire Brainfuck interpreter [0] in a single expression.

[0] https://gist.github.com/6bab3480ab439f0e98f18d88750d3b38
timfi
·4 years ago·discuss
It may be "close[r] to the data", but be ware Python UDFs usually still have context switches between the python interpreter and the query executor. If these pile up — as is the case if you fire off queries in, say, a loop — you will still see lousy performance. There is currently research under way, to optimize UDFs and other forms of computations over database resident data. For Python, for example, you can checkout the python to SQL compiler [0] and associated demo-paper [1] we produced for this years Sigmod. (Disclaimer: as you may have noticed thanks to that " we", I'm an author on that paper.) Though it may only support a limited subset of Python, one can already do alot with just that.

[0]: https://apfel-db.informatik.uni-tuebingen.de [1]: https://db.inf.uni-tuebingen.de/publications/2022/Hirn-grust...
timfi
·4 years ago·discuss
Not to nitpick, but do you mean the pattern matching statement when you are talking about "sum types"? Because as far as I'm aware Python doesn't have " proper" algebraic data types.
timfi
·4 years ago·discuss
In situations like this you could use `git stash` instead of completely deleting it.
timfi
·4 years ago·discuss
To be quite honest: I don't think there is anything along those lines. But if want to tackle it I recommend looking for PDF copy of Types and Programming Languages by Benjamin C. Pierce. It contains all necessary typing rules — barred the whole inference magic — be it System F, ADTs or Records.

EDIT: Oh and also contains the reduction rules ofcourse! Though the book assumes you now how to read inference rules. ;)

EDIT: I just found an official PDF source: http://basics.sjtu.edu.cn/~xiaojuan/tapl2016/files/Types+and...
timfi
·4 years ago·discuss
This looks cool. If you want to delve deeper intob symbolic computation you can have a look at sympy [0]. It seems to be the "defacto standard" when it comes to Python libraries for this.

0: https://www.sympy.org/en/index.html
timfi
·4 years ago·discuss
This may seem like a minor nitpick but it's something that popped out at me: italisizing a font shouldn't add or remove serifs. There is a reason why Unicode defines both sans- and serif versions of italics.
timfi
·5 years ago·discuss
Iirc the argument bind this would be along then lines oft precendes. I.e., you didn't defend your TM against person A so why are you sueing person B.
timfi
·5 years ago·discuss
I don't know when Portugal started this, but in Germany there is at least the concept of a "grüne Well" (literally a green wave). Simply put: if you drive at the speed limit you won't get any red lights. Sadly the german administration barely makes use of this as it doesn't make them any money...