Better HN
topnewbestaskshowjobs
Log inSign up

pathsjs

472 karma · joined Sep 17, 2014 (12y ago) · 223 submissions

Submissions

comment 10y ago · link · parent

Yeah, I have seen this for small periods of time. Anything longer and to avoid the battery drain the shutdown is used.

This is why I mentioned hibernation. Standby is ok only for a few hours at most on laptops.

comment 10y ago · link · parent

Of all the non technical people I know, exactly zero know that hibernate even exists as an option. Everyone just switches off the pc when done.

comment 10y ago · link · parent

They really lost me at "Caching computations". It should be clear that the benchmark is NOT the quickest way to compute Fibonacci numbers. The reason why it is included at all is that - without caching - computing Fibonacci numbers this way involves an exponential amount of computation, so it is easy to get long running times. Using a cache invalidates the point of doing the benchmark at all!

comment 11y ago · link · parent

Shameless plug: the design of this seems really similar to my own library paths.js. In both cases, the starting point is observing that nowadays people usually already use some framework to manipulate the DOM, so what is actually needed is some way of computing some description of shapes starting from the data (and suitable accessor functions). see https://andreaferretti.github.io/paths-js-demo

comment 11y ago · link · parent

Until you have to write a recipe...

comment 11y ago · link · parent

"honestly can't even guess what problems can be addressed with something like this"

The problem is that OS package managers install things globally. This is a nightmare when developing, because

* it makes much more difficult to handle multiple versions

* as a consequence, it makes difficult to keep libraries updated, because package authors try to be conservative in what libraries they include in an operating system targeted at non-developers (in particular, latest versions of libraries are always lagging behind upstream)

* it makes it hard to be sure that what you build on one computer will be reproducible on another one

* even in the case where you know which dependencies you need (and you don't forget something just because you had already installed it), there is no simple way to document how to install them in such a way that the next user will be able to install everything with a single command

* it requires root access when it is clearly not needed

comment 11y ago · link · parent

This is great! I really, really hope it takes off! C is in dire need of a package manager that can handle dependencies well. OS package managers do not allow multiple versions, and it is extremely difficult to get reproducible builds, because every project has available whatever is installed globally on your machine.

I have used sbt, nimble, leiningen, maven, npm, cargo, conda, and while each of those has its own issues, I would take any of them when working with C.

I have tried biicode, that was showing some promise, but it seems it is not gaining traction...

comment 11y ago · link · parent

Obligatory quote by Erdos: Suppose aliens invade the earth and threaten to obliterate it in a year's time unless human beings can find the Ramsey number for red five and blue five. We could marshal the world's best minds and fastest computers, and within a year we could probably calculate the value. If the aliens demanded the Ramsey number for red six and blue six, however, we would have no choice but to launch a preemptive attack

comment 11y ago · link · parent

For instance, interfacing with c in factor works like this. You have an internal dsl that allows you to express what the signature of a c function is. It is designed to look like a function declaration in c, but it is actually valid factor. And... that's it! You can now call that function, and some meta programming drives from that pseudo signature all the information to translate values back and forth

comment 11y ago · link · parent

I am not only saying that one needs to write things differently in Cython. I am arguing that the whole language needs to be designed differently, to take into consideration the presence of types. This includes adding features to recover the lost dynamism, such as interface or macros, and modifying the standard library to a style that best suits a typed language. Just grafting types onto Python is not enough

comment 11y ago · link · parent

I will try to give my 2 cents. As you correctly state, Cython is in effect another language.

Now, a core principle in the design of Cython is to be as much as possible source compatible with Python, which is a language without static types. This is not a very good principle for me - I would rather work in a language that is not literally identical to Python, but has its own design. Adding static types often requires to do things slightly differently. In Nim a find a very principled and well designed language, and PyMod seems a great to tool to make interoperability with Python easy.

comment 11y ago · link · parent

It's not that tensors are particularly hard to reason about. It's just that the way they are represented as multidimensional arrays hides very well the fact that they are element of a tensor product (hence tensors). Natural operations like, well, the tensor product are often not even available.

comment 11y ago · link · parent

> Tensors are the future; matrices are going to look so old in a few years.

I am honestly curious about this point of view. Is there any example where actual multidimensional tensor have any relevance? What I mostly see around is just standard linear algebra operations on matrices and vectors lifted to higher-dimensional tensors point-wise (for instance applying a certain operation to all 2-dimensional subtensors of a given tensor).

I never saw the need for modeling matrices in terms of tensors - the latter seem just more complex to use and usually tensor operations (like symmetrization, antisymmetrization, wedge products...) are not even available in libraries

(And by the way, both matrices and tensors are now more than one century old...)

comment 11y ago · link · parent

I will have a look, but I cannot promise anything. There are a lot of things that I want to do and only so much time... :-)

comment 11y ago · link · parent

No, it is right like that. In linalg, * on vectors is the scalar product. I have designed linalg to agree with mathematical conventions, rather than numpy conventions.

comment 11y ago · link · parent

Numba is a great technology, but I find it still a little disappointing.

The way I see it is this. Python is not a particularly fast language, but has evolved a big ecosystem of scientific libraries. Now people are running into the language limitations, hence the development of various tools to compile parts of Python - either AOT or JIT - with PyPy, Numba, Cython, Numexpr and so on.

The problem is that all these tools (save from PyPy, which is just a different interpreter) introduce their ow sublanguage, slightly incompatible from one another. For instance, both Numba and Cython have to infer types, but their type systems are not equal.

Nim does not have the reach of Python ecosystem, but it is a solid language, that manages to combine well the speed of C and the simplicity and flexibility of Python.

I would rather start from a solid foundation and add libraries on top of it gradually, rather than start from a developed ecosystem and add a host of tools that try to fix the inherent limitations of the platform.

Hence, in the short term it is great that the projects created by Continuum exist, but eventually I would like to have something a little more consistent

comment 11y ago · link · parent

I certainly hope so. It is of course the biggest missing element in sight, but I do not think we will see anything before 1.0 comes out

comment 11y ago · link · parent

The fact is that all these options are more complex than just using Nim.

Cython is certainly great, but still Python objects and C structs differ, and you have to keep in mind the difference. Same for C functions and Python functions. And if you use the dynamic features of Python, you do not gain much in efficiency, because Cython does not have static dispatch, hence it has to rely on runtime checks.

In a way, Cython is its own language, and it is not a particularly powerful one. The help you get from types is limited, as many things will just have type object. At this point, I just prefer to use Nim, which is friendly enough, and has overloading, generics, macros and many other features.

comment 11y ago · link · parent

I certainly would be happy to know about it when it comes out!

I would rather avoid the double ecosystem in the long run, but it would be a great thing to have until the Nim ecosystem grows.

comment 11y ago · link · parent

I only compare it to python because of the use case. Actually, if you read the post, I also consider Lua and other languages.

Still, I think, the similarity in syntax can help. If there is one thing that python got right, in my opinion, is its straightforward syntax, and that helps saving brain power for something other than parsing

comment 11y ago · link · parent

I have lived in Paris, and it was the most crowded place I have been. The price of housing has gone through the roof and the municipality has passed at least two regulations in the past few years - the first one putting bounds on the rents of apartments up to 13m^2 and the other one banning the rental of apartments below 9m^2!

I live in Milan now and the density seems close to optimal for my taste

comment 11y ago · link · parent

Spent right? Implementing a protocol to coordinate transactions (if it is possible at all, depending on the various backends you work with) to get what you could have already done in your database?

comment 11y ago · link · parent

I did not check it myself, so I cannot tell, but this is what I have heard most often.

Still, it was just to highlight the fact that there is a certain degree of subjectiveness when evaluating whether something constitutes a proof

comment 11y ago · link · parent

As a former mathematician, I found it quite entertaining :-)

Plus, not only I would not find absurd the claim that a proof is simply "an argument that convinces someone who knows the subject." I actually agree with it!

For an egregious example, look at Perelman proof of Poincaré conjecture. According to a few experts, it is a complete proof, and it is just a matter of sketching out the details. According to Yau, it is more like a plan of attack, and the actual proof is due to his students.

We are talking about two field medalists talking about one of the most famous problems in mathematics and disagreeing whether something constitutes a proof

comment 11y ago · link · parent

It depends on the language. For instance in Scala you can simulate collections of fixed size as in https://github.com/milessabin/shapeless/blob/master/core/src...

Then, at runtime, you can cast an unsized list to a sized list giving - say - a function List[A] => Option[Sized[List[A], N5]] that will fail if the list is not of size 5. From then on you can go on letting the compiler keep track of lengths.

Of course, this does not work at all if you have no clue what size your input will have

comment 11y ago · link · parent

Uh? Scala is not gradually typed, and in fact does not have these problems at all... :-?

comment 11y ago · link · parent

Amen to that.

comment 11y ago · link · parent

It currently does not have a REPL, and that is its main limitation right now. I think it is still suitable for more complex workflows where you would not do it in the REPL anyway - think training a large neural network. I hope something will come after 1.0 is out...

comment 11y ago · link · parent

I am not quite sure. Let me be more specific.

Dask requires you to encode computations as a graph explicitly, essentially forcing you to write an AST manually. This means that you are sidestepping the normal language mechanisms to encode program flow, and doing so is essentially incompatible with anything else. Moreover, it does not use numpy arrays - it uses its own internal format that you can convert to a numpy array when needed as explained the overview: http://dask.pydata.org/en/latest/array-overview.html

Numba is another cool project, but - again - it deviates from the mainstream Python. Not every Python function is compilable by Numba, and arithmetic is fixed-size. This means that existing Python code may or may not be compilable by Numba, and even if it works one has to carefully check that arbitrary precision arithmetic is not used. So, it is nice when it works, but is little more than a way to write C-like code with a Pythonish syntax (in which case I greatly prefer Nim, that has actual dispatching on types, generics and so on).

Blaze is in a strange position which I do not fully understand. Apparently it uses Numpy arrays, but at the same time the Numpy author states it should be a Numpy replacement: http://technicaldiscovery.blogspot.it/2012/12/passing-torch-...

Numexpr requires you to write your code as strings, so it is essentially a separate interpreter. It is nice that it is fast, but it does not play with normal Python code.

Not a single project of these works on PyPy, which is the only fast interpreter for non-numeric Python code, nor on Jython, which is the only multithreaded Python interpreter.

Do not misunderstand me: I enjoy Python for many things, and internally we use it a lot. But I am frustrated that a lot of effort seems to be dedicated to fix things at the language level starting from a powerful library ecosystem, where I would like to see something solid at the language level that evolves libraries instead

comment 11y ago · link · parent

Yes, there are a few open-source projects that you can check on our github :-)
1
45678