Better HN
topnewbestaskshowjobs
Log inSign up

PythonicAlpha

1,352 karma · joined Nov 1, 2013 (13y ago) · 986 submissions

Submissions

comment 11y ago · link · parent

There is also an other reason for not wasting "a single byte":

Branches are the only Jumps with condition. So, when you have a far destination that is more than 127 bytes away, you have to do that:

   want to do:
            BCS far_dest

   Have to do:
            BCC no_jump
            JMP far_dest
    no_jmp: ...
So, when you wasted to many "single bytes", you may end up up adding 3 Bytes and at least 3 cycles to your conditional jumps.

comment 11y ago · link · parent

Ok, on 6502, you might be right (if your numbers are correct). But the 3 cycles might have been, because a decision according flags had to be made -- so a newer processor could have made an unconditional branch faster.

comment 11y ago · link · parent

That is correct. Also, when you see, how much space was available. On Commodore, the Basic had to fit into 8k+ (together with the "Kernel" it had 16k of Rom and the Kernel needed ~7k) -- so space was really scarce -- a bigger ROM would have made the computers more costly.

comment 11y ago · link · parent

That is right. The JMP is a jump, because it takes a full 16bit address. Branches where all relative (-128 .. +127 bytes relative to current PC). I am not sure, but it also is very probable, that branches are faster -- at least the processor had to fetch one byte less. That should be the other reason, that newer processors had the unconditional versions.

That was one hacking thing in these days: finding flags that are guaranteed to be set or cleared to use as condition for a branch instruction. I remember, that I always tried to avoid JMPs.

comment 11y ago · link · parent

Some days ago, we only had 64kb main memory to squeeze our applications into ... that was also a great experience. The old times come back?? ;)

comment 11y ago · link · parent

That is the only valid response to such an attack. With different responses, the terrorists win.

comment 11y ago · link · parent

I think, it was just one top feature of the first standard C library. It made printing a lot easier. In standard Pascal or Modula 2, you still had to print every single data type with its own special "WriteX" statement. Even there was a distinction between "WriteString" and "WriteLine", the second wrote a string and added a Newline after it (I am not sure in the moment, if it really took a string or just wrote the NL). In printing to screen, some languages of those days where really spartan.

comment 11y ago · link · parent

Yes, Henry Ford also was one of the big business man in history, that realized that also his well-being was depending of the well-being of his workers. But since that time, the shareholder value has taken over the government.

(Edit: Tried to correct my bad English, sorry!)

comment 11y ago · link · parent

I liked Modula 2 much more than Pascal or C. (for those, that don't know it:) Modula 2 was the successor of Pascal from Niklaus Wirth. It had cleaner syntax and many other good features. Its successor, Oberon, was object oriented. [1]

But the culprit (and that belongs to all Pascal descendants, as it seems (at least until Modula 2)) was, that the libraries where not very helpful. The standard libraries for Pascal (not the extended ones from Borland Pascal or others) and from Modula 2 where a pain to work with and did not cover the developer needs. I guess, that was one reason for the downfall of Pascal -- some niches (eg. Borland Pascal) where successful, but they lacked the broad covering. C had it all: A syntax, that was popular by many, because it could be typed fast (not everybody will agree that it is an advantage) and a library that covered everything you needed. Also with printf it had a neat solution (according to that time) for a problem, that was really cumbersome to deal with in Pascal or Modula 2. Also you could write C code for one machine and port it rather easily to another, because the libraries had nearly the same API.

I account some good part of the initial success of C to the standard C library. After that it was just a question of publicity.

Also one mistake of Wirth might have been, that he took different names for his languages. I guess, the languages would have done a little better, if he called it Pascal2 or Pascal++ and after that Pascal++15 or so .... but that is the other problem: Good engineers are usually bad marketeers.

[1] http://en.wikipedia.org/wiki/Modula-2

comment 11y ago · link · parent

The "one size fits it all" notion of malloc/free/realloc is just wrong. When you want optimal allocation performance, you can't get around specialized allocators of various sorts for various needs.

comment 11y ago · link · parent

Yes, I implied that. But of course, when you do so, you create an own "flavor" of Python, that will not be understandable for others.

comment 11y ago · link · parent

More discussion would really help here.

I think, in some cases, spaced allocation will come (nearly) for free, since with 64bit addressing, there is enough space reserve (most processors can only use a fraction of this space as physical RAM). The other point is, that with the use of MMUs and a proper spacing (regarding the MMUs page size), the gaps come nearly "for free".

But I think, that needs very careful thought, to make it right and not unnecessarily introduce new tradeoffs, as you very talking about.

What you should not do, is use such spacing for small allocations. An other point would be, to inform the allocator, that it is likely/unlikely that a reallocation will be done ... in most cases, such information is available.

comment 11y ago · link · parent

Trying to avoid self in Python is just no good idea. You just break one basic convention of Python just because you don't like one thing in Python.

I would recommend to the author of the article one of those things:

  (a) either find a programming language, where you like everything (I guess, unlikely)

  (b) or write your own programming language
After some years in the business, I have learnt, that every programming language has its own "hell".

Some hells are hotter, some are relatively mild. When you try to avoid every hell, you will end up writing your own programming language ... and be very lonely for the rest of your computer-life.

Pythons oddities are one of the mildest I have found yet, IMHO.

comment 11y ago · link · parent

That is right. But till now, I could use a simple Google acount (not G+) to login for example at Stackoverflow.com.

In future the button will change from "G"-Login to "G+"-Login. As somebody else stated, Google said, that a normal Google account will suffice in the future, but alone the wording and the new button will alienate people.

comment 11y ago · link · parent

From this Link:

https://developers.google.com/accounts/docs/OpenID#shutdown-...

and from common sense.

BTW: Maybe you should also read my full post, before answering.

comment 11y ago · link · parent

   The final problem is that not many people will write a full implementation of
   it other than the big players like mozilla itself or Google or Microsoft.
   And the latter two don't have a ton of incentive to do so.
When I see such a proliferation (I looked at one architecture image of OpenID.connect and was shocked) than I am reminded of SOAP and I again think, that one reason might be, to hold smaller players at bay -- and to give the bigger players an advantage. For Facebook, Amazon or an other big internet company, it is really easy to even implement a big stack of software with complicated architectures and many features -- but for a four people start-up it is a big problem.

comment 11y ago · link · parent

What me frightens a little with this move (OK, I acknowledge that OpenID2.0 is deprecated and should be updated to something new), is that Google talks only about "Google+ Signin". And OK, as I read in previous discussion, Google will also in the future support logins from people with normal eMail account.

Still, I am worried, since Google does not clearly communicate these facts, but when you look at their communications, you read only about "Google+ Signin" and you have to search to find that you do not need Google+ but just the new protocol OpenID connect.

I don't like to see such communications from a company, that once claimed (long, long time ago!! Do you remember Google?) "Don't be evil".

It is OK, when they move away from an old protocol, but it is not OK, when they (and it very much looks that way to me!) use it as vehicle to market their products. Google has troubled people enough with forcing G+ on them -- so I even find it more troublesome, how they do it now (as it seems to me currently).

I fear, Google is still hunting after Facebook and is by the way inheriting its bad habits.

As I see now, they also want that a new button is used -- something with G+ on it. I see, they really lay the pressure on the people -- many people will think, that they need a Google+ account to use this feature (even if not required). I would say, Google you are going to hurt yourself!

I myself, was thinking about using a "Login with Google" button in my application ... but now, with things changed, I will think twice, before I do such a move!

comment 11y ago · link · parent

He is right.

He is right about premature optimizations and also right about craftsmanship.

Many performance problems stem from bad overall design decisions, bad abstractions and bad data structures (summarized: craftsmanship). I always wonder, how fast today's processors have become and how slow they get with today's software.

One of my first computers had 64k of memory and a processor that was so incredible slow compared to today's processors, that it is unbelievable. And still, they made so many good software with it. In today's programs the resources of this computer would not suffice for the idle loop.

Also the first Unix computer that I worked on, had only 8MB of memory and had X11, LaTeX and many other stuff!

It was a long way down the road of abstractions, that today's computer could hardly live with 1GB of memory and 1GHz processor (2 cores, please, please!) for basic usage.

The real art in computer science is, to know where to optimize -- to use your time most effectively.

comment 11y ago · link · parent

I would like to have a vim-clone, that also can handle embedded images.

Just a wish.

comment 11y ago · link · parent

I think, that is a rather complicated question. You should also take into account how accessing other data is affected by large blobs that reside in the same database. For example: you have a table with large data blobs and other tables with conventional relational data. The blobs will take a lot of the cache size away from the other data. Also by increasing the database size, you will have potential longer access times, at least when you use spinning hard drives.

So, several things to think about (make cache bigger, how much grows the overall db size) that can change the database behavior.

Of course those numbers can give some directions, but since only the blob data was taken into account, it can not give full information.

I personally would most of the time prefer smaller db sizes, at least, on edge cases. Relational databases are great for structured data -- unstructured data is not their specialty.

comment 11y ago · link · parent

Of course! Excuse my bad English!

comment 11y ago · link · parent

Is it really the same (really asking)?? Sometimes there are subtle protocol changes, when something is standardized -- and as much I understand, HTTP/2 took a while ...

comment 11y ago · link · parent

I think, it is because language fights are not appreciated so much here.

comment 11y ago · link · parent

Thank you very much for the answer!

To clarify for my mind:

Can I than use H2O to connect to a web-browser via HTTPS and H2O is routing the same request upstream via HTTP to a web application server? (that of course would suffice for me).

comment 11y ago · link · parent

Looks very promising!

I am not so much into web-servers (yet), but I found this in the feature list:

  reverse proxy
    HTTP/1 only (no HTTPS)
Are there any plans to add also HTTPS-support for reverse proxy? Since I have to include a secondary (Tornado) web-server unto my stack for dynamic pages.

It also puzzled me, that https is not supported, but in the benchmarks I found a part: "HTTPS/2 (reverse-proxy)". As I said, I am not so much in Web-servers and https/2, but that was a little confusing.

comment 11y ago · link · parent

I really like the idea, that it compiles Python but is (99,9%) compatible to CPython -- since so you can still use the many C extensions (I don't want to do my projects any more without my own Python extensions written in C).
1
171819
33