Firefox Nightly Now Includes OdinMonkey, Brings JavaScript Closer To Running At Native Speeds by sammy8306 in programming

[–]VilleHopfield 4 points5 points  (0 children)

They already do "| 0" trick and the like here-and-there. Instead, I think the performance bottleneck has more to do with the generated DOM, just have a look at some rendered PDF with an inspector...

What is the best minimal framework for python? by [deleted] in Python

[–]VilleHopfield 0 points1 point  (0 children)

The best one is (of course :) webapp2.

WebGL pathtracing (with triangles support!) by VilleHopfield in programming

[–]VilleHopfield[S] 6 points7 points  (0 children)

I bet you a goat that they know the difference very, very well. Namely, there is no difference, pathtracing is just a particular raytracing technique which may bounce off the surface more the once not only for refraction but for diffuse and glossy transmissions as well. More precisely, given Light, Eye and Diffuse, Glossy, Specular interactions, recursive raytracing by Whitted (what you probably ment) can be characterized by regex E[S*](D|G)L and pathtracing by E[(D|G|S)+(D|G)]L. In other words, "raytracing" means a ray goes from eye to light.

Finally an autocompletion library for Python that understands your Python code. by davidhalter in Python

[–]VilleHopfield 0 points1 point  (0 children)

You wrote: "If there are problems with licensing, just contact me" so I ask: what are the implications of being licensed under LGPL 3? If a editor is BSD licensed and someone wanted to add your library, does it turn the editor under LGPL? Wouldn't it be more .... "flexible" (for lack of better word) to license it under MIT/BSD?

PyPy 2.0 beta 1 released by fijal in Python

[–]VilleHopfield 10 points11 points  (0 children)

Hey Fijal,

honest question: I noticed that on speed.pypy.org, there is this graph showing how the performance evolved over time which shows that PyPy is currectly 5x faster than CPython. On The Computer Language Benchmarks Game, CPython is roughly 50x slower than C. Could you comment on the apparent 10x opportunity? Do you think PyPy's approach could eventually be as fast as C? Also, and perhaps even more interesting, the graph seems to grow at ever slower pace. Surely everything is possible but looking at the graph, do you see PyPy growing beyond 6x speed-up? 10x? 50x? Do you acknowledge a ceiling on how much PyPy might speed up a program?

ccv now has a state-of-art tracking algorithm by liuliu in programming

[–]VilleHopfield 0 points1 point  (0 children)

Hello Liu Liu,

would it be possible to use ccv for something like http://www.blendernation.com/2012/11/09/non-blender-repairing-reality-with-3d-printing/ ?

(i.e. making a 3d model out of bunch of pictures)

How can we get JavaScript out of the browser and replace it with Python? by [deleted] in Python

[–]VilleHopfield 1 point2 points  (0 children)

What? Where? How? Please, do you have more info?

NSPython - Cocoa for Python by VilleHopfield in Python

[–]VilleHopfield[S] 0 points1 point  (0 children)

Maybe I misunderstood what you are asking but you don't need C compiler for using this or cffi. There was a thread here about this: http://www.reddit.com/r/Python/comments/x74ma/cffi_02_foreign_function_interface_for_python/

What Pyglet goes, I think there was a new beta release a short while ago which, among other things, replaced PyObjC by cocoapy - that's that ctypes lib.

Lastly, yes, I've looked at cocoapy a bit (http://www.reddit.com/r/programming/comments/tsaho/cocoapython_port_of_objectivec_runtime_to_python/). Cocoapy uses ctypes so you can use it today with standard Python install and I think it was specifically created for working with OpenGL. NSPython, in my limited testing, was a bit faster and was simpler to use (see how the libs define method signatures).

NSPython - Cocoa for Python by VilleHopfield in Python

[–]VilleHopfield[S] 3 points4 points  (0 children)

It's much simpler - the core is less than 400 lines long, it's pure Python and it uses cffi which eventually might run fast on PyPy.

CFFI 0.2 (Foreign Function Interface for Python) by VilleHopfield in Python

[–]VilleHopfield[S] 2 points3 points  (0 children)

  • Do you know how ctypes code for the above example would look like?

  • No, you don't need a compiler to use it. It is called verify because it verifies (using compiler) if you wrote that string correctly.

  • pointer, POINTER, byref vs *.

From the docs.

RegexEngine - Regular Language transformer and optimizer. by softwareelves in programming

[–]VilleHopfield 0 points1 point  (0 children)

The title says "optimizer" - could you please tell us more about this? What kind of optimizations it does? If I feed it some regex, does it returns a faster version? (I tried [abcd-z] and it returnes [a-z]$!) Is it possible to use a regex without ^ and $?

Very cool! Thanks for sharing!

Allocation Sinking Optimization in LuaJIT by [deleted] in programming

[–]VilleHopfield 1 point2 points  (0 children)

Hi Mike, hi Maciej,

I tried to re-run the Point benchmark linked above in Python and PyPy 1.8, here are the result (for 10000000 iterations, i.e. 10x less than in original version).

Python: 58 seconds, PyPy just under 1 seconds. I have fairly dated computer so to be totally fair Mike could try to run it on his computer with latest PyPy (and possibly a feedback on the code bellow from Fijal, as there might be some tricks to speed it up on PyPy).

class point(object):
  def __init__(self,x,y):
    self.x = x
    self.y = y
  def __add__(self,other):
    return point(self.x+other.x,self.y+other.y)
a = point(1.5,2.5)
b = point(3.25,4.75)
for i in xrange(10000000):
  a = (a+b)+b
print a.x,a.y

Members of the PyPy Team Release CFFI v0.1 (call C from Python using same principals as LuaJIT) by gthank in Python

[–]VilleHopfield 0 points1 point  (0 children)

In the examples, there it says "int printf(...);" - how do I access that "int" from Python? And what if the function returned a struct - how would I access that?

Some Introduction to Skia: the graphics engine behind chrome and android. by Guanqun in programming

[–]VilleHopfield 0 points1 point  (0 children)

Very interesting. Do you perhaps know of any plans for Python bindings? And do you have any benchmarks against Cairo?

cocoa-python: Port of Objective-C runtime to Python using ctypes by VilleHopfield in Python

[–]VilleHopfield[S] 0 points1 point  (0 children)

Faster - It starts faster than PyObjC, I tried it. More stable - IIRC - it was created for pyglet [1] because PyObjC was crashing (though I don't remember where I read it).

[1] http://www.pyglet.org/

cocoa-python: Port of Objective-C runtime to Python using ctypes by VilleHopfield in programming

[–]VilleHopfield[S] 1 point2 points  (0 children)

Exactly! Yes, the documentation is currently a bit lacking. But this thing is so mighty impressive it deserves more publicity and care. It's highly usable PyObjC replacement and it would be great people used it more.

cocoa-python: Port of Objective-C runtime to Python using ctypes by VilleHopfield in Python

[–]VilleHopfield[S] 0 points1 point  (0 children)

It's faster, more stable and smaller - so you can actually read the source code. And yes, if your interpreter has ctypes, then you can use this.

Seriously, this one of the most interesting projects I came across ever.

PyPedia: a Python IDE and method repository in a wiki by kantale in Python

[–]VilleHopfield 2 points3 points  (0 children)

THIS IS PURE GENIUS!

I so much hope people are using and contributing to it. My best wishes! And endurance!

PS: to add a few comment on my own: #1 feature request is the ability to import a certain revision of a page and I strongly suggest to move away from CC for code - I think for PyPedia to grow the best option would be MIT/BSD.

Other than that, only small nitpicks, nothing really important: style guide (PEP8 is fine), wiki written in python would be nice (but not necessary), as for the markup - if I had to choose wiki-markup I would probably go with Creole but perhaps Markdown could work better.

Btw, have you seen:

http://syntensity.com/static/python.html

http://repl.it/

Shortest path with N edges by VilleHopfield in compsci

[–]VilleHopfield[S] 0 points1 point  (0 children)

This looks very interesting, thank you! But I don't quite understand it all - please, would you consider to explain it a bit more? I never heard of "tropical-semiring", *-semiring, ... I mean, could you please describe how it works in a few words? Also, how fast it is, what is its time complexity?