Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
zanellia
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
31.
▲
by
zanellia
5y ago
sure I use valgrind and gdb too - still hard to argue that a segfault is pleasant to debug though?
32.
▲
by
zanellia
5y ago
That's quite cool. Maybe the whole thing can be rewritten in Julia too at some point. I just know too little about Julia to judge.
33.
▲
by
zanellia
5y ago
Python to ASM would actually be really cool and would guarantee performance gains for small matrices, but it would require quite some implementation effort. Not sure about WASM.
34.
▲
by
zanellia
5y ago
I'd say that's possible in principle - definitely not there at the moment though (and not even planned).
35.
▲
by
zanellia
5y ago
For what it counts, I have developed code for this kind of applications exclusively in C for ~5 years (let's say 20% of my working time). I still think that debugging a segfault that you could have avoided is not very productive and th
36.
▲
by
zanellia
5y ago
Not sure how easy it would be to make the code generated by Pythran standalone, i.e., no dependency on the Python runtime library. Any Pythran expert? :)
37.
▲
by
zanellia
5y ago
Thanks for the suggestion. Until now it's been a lot of discussion with friends and colleagues and much less actual collaboration on code writing - I might have drifted into bad practices.
38.
▲
by
zanellia
5y ago
I would disagree on "easier" :) Ever spent half a day debugging a segfault?
39.
▲
by
zanellia
5y ago
Fair enough - it's blurred I'd say. I see C as a lower-level, and yet still high-level, language, if compared to Python :)
40.
▲
by
zanellia
5y ago
Personally, I think Julia is great - just don't know it well enough to write a package that takes Julia ASTs and generate C code from them :) There could totally be a Julia implementation of the main idea behind prometeo (Julia per se
41.
▲
by
zanellia
5y ago
hahaha thanks!
42.
▲
by
zanellia
5y ago
fair enough - could not cram "embedded" into it :)
43.
▲
by
zanellia
5y ago
"A program that translates between high-level languages is usually called a source-to-source compiler or transpiler" from https://en.wikipedia.org/wiki/Compiler .
44.
▲
by
zanellia
5y ago
I think many people who have at least once first prototyped a numerical algorithm in a high-level language (say Python, Julia, MATLAB?) and then implemented it in C, can relate to the experience of transitioning from error messages of the
45.
▲
by
zanellia
5y ago
yep, that's right.
46.
▲
by
zanellia
5y ago
The point of prometeo is not to obtain a "performant Python". Python is used merely as a host language for an embedded domain specific language. You could do the same thing with any other language with a mature library for AST ana
47.
▲
by
zanellia
5y ago
I think most HPC people would disagree with this statement. State-of-the-art HPC code is still written in ASM (see e.g., https://github.com/xianyi/OpenBLAS ) [that's what Intel is doing too]
48.
▲
by
zanellia
5y ago
fair enough :p I might change it in the future.
49.
▲
by
zanellia
5y ago
Unfortunately, I think that writing a transpiler for general Python programs might be rather difficult without resorting to approaches used, e.g., in Cython/Nuitka. Among other things, computing the worst-case heap usage could be quite
50.
▲
by
zanellia
5y ago
> Soo... it takes Python syntax and produces a C program, with no links back to Python - is that right? It uses a strict subset of Python, so that Prometeo programs are valid Python, but not necessarily the opposite. Is that fair? yep &g
51.
▲
by
zanellia
5y ago
Right, that's indeed the main reason I could not simply use Cython or Nuitka (or Julia?). The Python runtime library will do all kinds of non real-time/embedded friendly operations such as garbage collections, memory allocation&#x
52.
▲
by
zanellia
5y ago
For the time being, it targets single core/thread applications only.
53.
▲
by
zanellia
5y ago
That's correct. I'd say one of the fundamental differences between the two lies in the fact that the code generated by prometeo does not depend on a runtime library (which is somewhat fundamental for embedded applications, e.g., e
54.
▲
by
zanellia
5y ago
Hi all, prometeo is an experimental modeling tool for embedded high-performance computing. prometeo provides a domain specific language (DSL) based on a subset of the Python language that allows one to conveniently write scientific computin
55.
▲
Show HN: Prometeo – a Python-to-C transpiler for high-performance computing
(github.com)
166 points
by
zanellia
5y ago
|
140 comments
56.
▲
by
zanellia
6y ago
In my opinion there is some potential there. Especially exploiting the increasing integration of typing-oriented features (i.e. type annotations) and the interest in using those to carry out static analysis (e.g. in mypy, but also Facebook&
57.
▲
by
zanellia
6y ago
That's quite interesting. I guess one could try to do something even cleaner than this https://github.com/dry-python/classes using type hints only and code transformation based on Python ASTs (see e.g. https:
58.
▲
by
zanellia
6y ago
Indeed, I guess much of the type annotation stuff would be much easier with type hints from Python 3.6+ ( https://docs.python.org/3/library/typing.html ), plus it might add some level of compatibility with recently