TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

VOC: A transpiler that converts Python bytecode into Java bytecode

121 pointsby Lofkinover 9 years ago

10 comments

skrebbelover 9 years ago
&gt; <i>The Vereenigde Oostindische Compagnie (VOC), or Dutch East India Company, is often considered the be the world&#x27;s first multinational corporation. ...</i><p>Ah, trivia time! The VOC also had the world&#x27;s first entirely privatized army. The &quot;monopoly&quot; cited in the README basically included a license to kill. Think &quot;Google Armed Forces&quot;, but then scarier. The army was mostly used to keep a grumpy unpaid workforce &quot;motivated&quot;, to keep the spice coming, and thus to keep that lovely 18% annual dividend payout reality.<p>Basically, the VOC made current evil multinational corps (e.g. the oil companies, monsanto, blackwater, etc) look like cute cuddly charities.<p>That said, it&#x27;s been centuries, not sure getting worked up about the name makes sense now. It&#x27;s a compiler, not a guidebook about how to traffic humans. I just thought the README section made the VOC seem a &quot;little&quot; awesomer than they were.
评论 #10287766 未加载
评论 #10288675 未加载
评论 #10287566 未加载
fijalover 9 years ago
So well, one interesting question as to why this is at the top of hackernews is - do people not know about jython? Jython does exactly that - it compiles python into java (I think it emits bytecode and not Java source, but don&#x27;t call me on that) with a lot of runtime so it can support proper semantics. It has been around for over a decade now too and it supports full python (with usual caveats)
评论 #10288233 未加载
评论 #10287411 未加载
Animatsover 9 years ago
How are the differences in the execution model handled? The defining quality of Python execution is that anything can monkey-patch anything at any time, using &quot;setattr()&quot;. This means the obvious implementation has dictionaries for everything, and optimizers, as in PyPi have to work very, very hard.<p>So what did they do here? Is every object a dictionary to the Java runtime? That&#x27;s easy enough to do, but no gain over CPython. Did they weaken the ability to modify objects so they could map to Java objects? That gets a performance win, as with Shed Skin, but a lot of Python code won&#x27;t work. They&#x27;re probably not doing all the stuff PyPi does; that&#x27;s hard and took a decade of work by many people.
drxzclover 9 years ago
Did they really have to drag the Dutch east India company into this by using that logo? It&#x27;s going to make things... complicated around here.
评论 #10287050 未加载
评论 #10287049 未加载
评论 #10287349 未加载
评论 #10287265 未加载
pacalaover 9 years ago
This can be very useful. I wonder what the plans are for supporting C apis, given that a lot of Python core libraries depend on C, in my neck of the woods numpy and scipy being the first contenders. There are long running projects <a href="http:&#x2F;&#x2F;www.jython.org" rel="nofollow">http:&#x2F;&#x2F;www.jython.org</a> and <a href="http:&#x2F;&#x2F;www.jyni.org" rel="nofollow">http:&#x2F;&#x2F;www.jyni.org</a>, which, to the best of my knowledge, have not yet managed to fully support Python C extensions on the JVM.
评论 #10287250 未加载
评论 #10287140 未加载
empyricalover 9 years ago
They also have an in-browser bytecode runner: <a href="https:&#x2F;&#x2F;github.com&#x2F;pybee&#x2F;batavia" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pybee&#x2F;batavia</a>
hristovover 9 years ago
That is called a compiler.
评论 #10286939 未加载
评论 #10286933 未加载
alexanderdawover 9 years ago
Can someone give a valid reason for wanting this? I&#x27;m kind of confused as to why mixing and matching python and java source with some central compiler would be useful.
评论 #10287194 未加载
stuaxoover 9 years ago
Cool does this work on android ?
评论 #10289089 未加载
shuriover 9 years ago
performance?
评论 #10287141 未加载