HN user

lambda_cube

902 karma
Posts8
Comments41
View on HN

no languages with mutable state that I know of offer concurrent integer and concurrent structs

Java does for integer http://docs.oracle.com/javase/8/docs/api/java/util/concurren...

You can find similar classes in the java.util.concurrent.atomic package. http://docs.oracle.com/javase/8/docs/api/java/util/concurren...

I'm not sure what requirements you have for a concurrent struct, but Java has classes to atomically manipulate int and long fields of a class.

I'm not arguing your general point (in fact, I agree with it), I'm just supplying some extra information of a language that you apparently don't know.

It probably does, it's just an unintuitive interface. Read the explanation on the page by clicking the question mark (or read my explanation here on HN in response to the now deleted comment).

I know, I had trouble with that as well, but then I read the explanations you get if you click the question mark in the upper right corner. I will try my own explanation here.

Type your answer in the box, if you type 2 or more characters, there will be an auto complete list of matches.

If nothing happens when you choose an answer, then it's wrong.

When you choose the right answer, it will immediately switch to the next question.

If you don't know the answer you can click Forfeit or press Esc. To get rid of the correct answer that pops up when you do so and go to the next question, you have to press Esc (I didn't find a way to go to the next answer just by clicking with the mouse).

If you hover that button with your mouse pointer you can read the following explanation:

Send three "heap-minimize" notifications in a row. Each notification triggers a global garbage collection followed by a cycle collection, and causes the process to reduce memory usage in other ways, e.g. by flushing various caches.

If you view the page with Firefox version <= 22, that paragraph is blinking, very easy to notice :-) (annoyingly easy!)

I know that the release notes still says Firefox Beta when I submit this, but my browser just updated itself to version 23. The beta release notes usually are pretty accurate when it comes which features will be in the next stable version.

I believe the new baseline compiler is included in this release as described here:

https://blog.mozilla.org/javascript/2013/04/05/the-baseline-...

If that is the case it's the most interesting new feature for me, but I'm a compiler guy :-)

Well, what kind of book has a collection of recipes? A cookbook, right? :-)

I haven't used any edition of the Python cookbook, but I've used the Perl cookbook and it's just like you described. I have also heard and read that the O'Reilly cookbooks are known (famous even?) for being the kind of books that you described.

I don't think it's regional. I'm in Sweden and if I visit the Flash install page with IE I get Chrome as pre-selected and if I visit with Firefox I get the McAfee add-on. (And when I'm using Linux, as usual, there are no extra applications installed.)

I don't think you should have to do neither convincing the IT department nor refunding them. One part of their organization chose to order the Java applet solution from you and another part of their organization chose to uninstall Java. The fact that they ordered a solution that they can't use isn't your fault. If they want you to use your time to work out a solution with the IT department how the applet can be used securely I think they need to pay you for that time (charge per hour for that, if the IT department is stubborn they have to pay more).

Flash 11 released 15 years ago

I noticed I got the Swedish URL. I tried to find an international or English URL, but I couldn't find it, I hope you get English text anyway.

When I just visit that page it suggests that I download version 10.3.183.10, but if I choose to download for another OS or browser version 11 is available for Windows, Mac OS X and Linux. 64 bit version for Linux is finally stable.

You can also have a look here: http://www.adobe.com/software/flash/about/ where version 11 is listed as the current version.

Version 11 isn't available from the Adobe Yum repository yet, I will probably wait for that before I try it.

> The note is really about the best way to specify a range/sequence of integers, not why we start from 0 as an index.

Dijkstra deals with what index start with as well, but it comes out as a consequence of which bounds to choose for a range, so it's rather short.

From the article:

When dealing with a sequence of length N, the elements of which we wish to distinguish by subscript, the next vexing question is what subscript value to assign to its starting element. Adhering to convention a) yields, when starting with subscript 1, the subscript range 1 ≤ i < N+1; starting with 0, however, gives the nicer range 0 ≤ i < N.

Java 7 15 years ago

It didn't. Several people point this out in the comments.

Ok, the PyPy FAQ says: "Yes, PyPy has a GIL. Removing the GIL is very hard. The first problem is that our garbage collectors are not re-entrant."

Is it really necessary for the GC to be re-entrant to run the interpreter in parallel? Couldn't you have the interpreter running in parallel and then when there is a need to run the GC you have a global GC lock that prevents all threads from running - a stop the world GC. The application runs for a longer time than the GC, right? So it would be a win and a step in the right direction? I believe the early Java mark and sweep GC was like that, and then later Sun developed several different kinds of concurrent and parallel GCs.

> Official PyPy Status Blog

Oh I read that every time they write something. :) But I started reading it in late 2010 and I haven't gone back to the archives, I guess it's time to do that. Thanks for the links.

Yes, you are right that the OS can schedule two Python threads to run at the same time, it's just that one of them will only run a few instructions and then block, just not any Python instructions. I hadn't really thought that through thoroughly, thanks for pointing it out.

Ah, I see now what you meant with constant locking. I interpreted your words as "constant" as in happening all the time as would be the case with fine grained locks instead of one long-lasting, global lock.

He's not saying that. He's saying that the GIL isn't a limitation to certain kinds of application, the kinds that Python usually is used for. The kinds of applications where the GIL would be a limitation, Python also has another limitation: slow performance, and performance is usually the reason to run things in parallel.

With PyPy the performance will get better, and they also have a GC, so that hinder is removed. I don't really know if PyPy has a GIL, I would guess that they don't.

> I dont' understand. Isn't this going to happen if you have multiple threads running even if the GIL is blocking them from running?

I don't think it would. If there is a GIL (Global Interpreter Lock) only one thread of the process can be scheduled to run at any time. As the poster (Sturla) says, Python threads are native OS threads so they should be scheduled by the OS kernel (right?). A good scheduler would use affinity scheduling and schedule all threads of the Python program on the same processor/core every time to get benefits from cached data and code. I believe modern kernels (Linux, MacOS, Solaris, probably Windows as well) use this kind of affinity scheduling, so if we're lucky the Python process gets scheduled on the same processor every time and there will be no need any cache synchronization.

> I'm not a hardware expert, but I'm not sure how constant locking would prevent cache synchronization just because they weren't truly running in parallel.

I'm not sure if you misunderstood the mail. The constant locking would only be used if they were running in parallel.

Anyway, if you have a GIL you don't need that kind of locking described in the mail. You only need to do explicit locking on shared data structures when you read or update the contents of those data structures. If you have reference counting, threads that run in parallel and no GIL you would have to lock even if you are just assigning a reference to such a data structure to a new variable. If you have a GIL you are certain that only one thread at a time are updating the reference count. That is indeed what the GIL is, one coarse lock for all data (and the interpreter) instead of fine grained locks for every data structure.

(I don't know Python very well, I just answer from general knowledge of computer architecture and language implementation. But I've read about the Python GIL several times, since it's the most discussed GIL of any language.)

Hi Paul. Since you are, maybe you can shed some light on how the rewrite actually happened? Was it the comb-over syndrome that raganwald described in a sibbling comment to yours or was it a more conscious decision?

Yes, if it's true, it is (it's PG's assessment). But since they wrote an interpreter for Lisp in C++, they couldn't have been that afraid, at least not all of them. I guess that's what they "gained", that only a few adventurous of the engineers at Yahoo "had" to learn Lisp and the rest could continue program in C++.

Thank you Reginald. You always make me think, more reliably than any other writer about software. You pose interesting questions and have interesting viewpoints and discussion related to those questions. I hope you feel proud about this ability, because you should.

I also appreciate that you have chosen to publish your writing more in a blog format just like on http://weblog.raganwald.com instead of the GitHub experiment, I never really got into reading your stuff there.

As for the question posed, I believe I'm biased towards invention. I would prefer to work in a research department in a company or in a small company that have a business idea (partly) based on research. I hope I'm wise enough to avoid NIH, that is not really inventing anyway, so it's not as much fun as real inventing. (Working in a university seems to come with too much bureaucracy for my taste, but I do like the teaching part.)

That depends on what you want to do. If you want to do things with text, especially transforming text, Perl is IMO opinion better at that task. Perl has been the scripting language for me, but I'm thinking of changing to Python because of NumPy, SciPy and the libraries for numerical analysis and scientific computing. Python seems to be better than Perl in that area. This is a library issue whereas when it comes to text processing it's more of a language thing.

I think Perl and Python have a lot more in common than differences when it comes to what they are good at. If you know one scripting language, you don't gain as much when you learn the next. My recommendation is to learn something different, C, Haskell, Lisp or Prolog for example. That would make you think in different ways.

Also, chromatic (a Perl developer) gives a very balanced answer in a sibling to my answer, so I won't repeat what he said.

Whatever you can do in one Turing complete language you can also do in all other Turing complete languages. The point isn't what you can do, the point is what tasks are easier, simpler or faster to do in one language compared to another language, while also respecting how hard the language is to learn to get to the point where can can do what you want (easily).

I would prefer to use Perl over bash/awk/sed since Perl is good at the same things and more and has alot more libraries.