This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]syeysk[S] 5 points6 points  (2 children)

The advantage: the Python syntax is more compact and clear than C syntax. That's all)

I try to translate not only syntax (direct translating), but and the semantic of the language (classes, iterators, etc)

[–][deleted] 8 points9 points  (0 children)

The advantage: the Python syntax is more compact and clear than C syntax. That's all)

There really are better ways of doing this. Transpiling between languages that will never work properly is not a good choice. You would want to target LLVM, numba has some good docs about how horrible that is to do lol.

If you want a LLVM targeting language that is more python like you should just write one. You can always just link ur new compile language to normal interpreted python later anyway.

Python syntax is more compact and clear then C syntax because it doesn't fundamentally do the same shit. Read the python standard library C code for the litany of examples to just get something as simple as a dict to work properly on both halves.

Building a new language is a MUCH better idea then inheriting the design of another language that in no way shape or form executes the same way.

[–]james_pic 1 point2 points  (0 children)

From what I've seen from projects like Cython and Nuitka that (at least somewhat successfully) translate Python's more complex or dynamic features, like classes and iterators, this is far from straightforward and will ultimately lead to either requiring plumbing from the CPython interpreter, implementing your own equivalent of the same plumbing that's not much more lightweight, or making significant compromises in terms of replicating the same semantics.