For the best experience on desktop, install the Chrome extension to track your reading on news.ycombinator.com
Hacker Newsnew | past | comments | ask | show | jobs | submit | history | 6Typos's commentsregister

Going offtopic, but...

>We have an optimizing compiler for spreadsheets

What is even a compiler for spreadsheets? In spreadsheets you still have an AST, or is it a different structure? Is there any fundamental property of spreadsheet code that enables specific optimizations?


It's more that it necessitates certain optimizations, rather than enabling them.

You need to figure out how and when to merge expressions, when it's worth it to extract a loop where the same expression needs to be compiled as two or three variants, because there are invariants between all but two or three of the invocations. You also must decide which collections you want to create out of the reference soup, when you can alias/discard collections and values, how to hoist predicates (for IF and SWITCH), when you can avoid type coercion. For small workbooks, just using tagged unions in a 2D array, plus a string pool, will suffice, but our sheets are so big that we can't afford that.


Why are you using DCGs for turing_//2? Genuine question, because I implemented a TM interpreter in Prolog, using "normal" predicates, and I can't see where they help you in this case

PS: I learnt how to use DCGs thanks to your website, thank you!


That's a justified question! I'm using DCG (semicontext) notation here analogously to monads, mostly to benefit from having to keep track of fewer explicit arguments that need to be passed around.

In this concrete case, using them explicitly is certainly not bad and may even be preferable. However, suppose I now introduce a new argument in order to implement iterative deepening:

    turing(Ls, Name, Tape0, Rs) :-
            phrase(turing_(Ls, s(q0), Name), [[]-Tape0], [_-Rs]).

    turing_([], final, _) --> [].
    turing_([_|Is], s(Q0), Name) -->
            state(Ls0-Rs0, Ls-Rs),
            { right_symbol_rest(Rs0, Symbol0, RsRest),
              tm(Name, Q0, Symbol0, Q, Symbol, Action),
              action(Action, Ls0, Ls, [Symbol|RsRest], Rs) },
            turing_(Is, Q, Name).
Then this notation, in my opinion, already makes it a bit easier to think about the rule, since it only uses 3 arguments instead of 5 or more, and the tape is simply passed along implicitly.

An iterative deepening version of the machine provides the important benefit that infinite branches of the computation cannot block others that lead to (nondeterministic) succcess. For example, suppose I add the indefinitely looping machine:

   tm(loop, q0, 1, s(q0), 1, right).
   tm(loop, q0, b, s(q0), b, right).
and then define:

    tm(loop_or_plus1_or_id, Q0, S0, Q, S, A) :- tm(loop,  Q0, S0, Q, S, A).
    tm(loop_or_plus1_or_id, Q0, S0, Q, S, A) :- tm(plus1, Q0, S0, Q, S, A).
    tm(loop_or_plus1_or_id, Q0, S0, Q, S, A) :- tm(id,    Q0, S0, Q, S, A).
then we now get solutions via iterative deepening, whereas the original machine loops without reporting any solution:

   ?- length(Is, _),
      turing(Is, loop_or_plus1_or_id, [1,1,1], Ts).
   Is = [_3790],
   Ts = [1, 1, 1] ;
   Is = [_3790, _3796],
   Ts = [1, 1] ;
   Is = [_3790, _3796],
   Ts = [1, 1] .
Iterative deepening is an asymptotically optimal search strategy under very general assumptions. Thank you for the kind words!


> Galileo was executed by the Inquisition,

Was only arrested at home, for 10 years (but wrongly convicted)

> Once they identified the heliocentric model to be against their dogma they supressed and punished anyone who advocated heliocentric notions

I recommend reading [0], particularly:

> as in astrology the theory of eccentrics and epicycles is considered as established, because thereby the sensible appearances of the heavenly movements can be explained; not, however, as if this proof were sufficient, forasmuch as some other theory might explain them.

So, the Ptolemaic model was used because it fit the observations well enough.

On the other hand, the Copernicus work was (indirectly) used in the construction of the Gregorian calendar.

Furthermore, when Copernicus introduced is theory in 1543, the book was dedicated to the Pope.

The Galileo affair was made by enemies of Galileo who used the Inquisition to prosecute him. That was wrong, but it was certainly not the whole Catholic Church.

[0] Summa Theologica, I, q.32, a.1 ad.2

Link: http://dhspriory.org/thomas/summa/FP/FP032.html#FPQ32OUTP1 (under reply to objection 2)

[edit: formatting]


>> Galileo was executed by the Inquisition,

> Was only arrested at home, for 10 years (but wrongly convicted)

My mistake obviously. I was trying to say “Galileo was tried by the Inquisition. The point was that the Church had jurisdiction over academia and had the power to enforce its dogmas by force if necessary.


> I recommend reading [Summa Theologica], particularly...

You want me to read Summa Theologica? What for?


What the parent is saying is that it is useless to buy a new iPad, because he already has a Chromebook. If iOS 11 brought XCode, then he would buy a new one, because it would have one more important feature (XCode).


>Actually, banning encryption apps may be good for privacy, because you never know if the app maker made some backdoors in their encryption method and he already sells your information to somebody.

IMHO, the answer to this lies in Open Source + reproducible builds/compilation. Not in banning/not using apps that promise privacy.

If what you're trying to achieve is awareness about the possible false sense of security (when not appropriate), then the answer is educating people about it.

EDIT: Typos/Grammar.


I also use this setup.

In fact, ChromeOs acts as a Window Manager, because it deals with how each application is organized in the screen/ shown to the user; in this setup, no Chrome Apps are used (only programs from chroot are used)

tl;dr: It can be thought as a WM, although it isn't one


Excuse me, I'm a bit confused by your answer.

Are you saying that Assembly is more implicit than Rust or C++?

What do you use to measure "implicitness"?


I'd interpret to mean that borrow checking for example can to be explicitly demanded in rust code, whereas in assembly a lot of the safety is manually assured and often enough only implicitly in the code.

> > Think of RollerCoaster Tycoon being written almost entirely in assembly in '99 by a single programmer. You'd have plenty of incentive for implicit standards

On the other hand you could say that it's the rust compiler source that is rather explicit about the mechanics and the game code would be explicit only by extension.


Scottish independence from UK


One of the issues that is never talked about when dealing with substitutes of well-stablished interfaces is if the new standard covers all the other use cases.

In particular, I doubt of the usefulness of the Touch Bar in a low level environment, e.g. if you are dropped to bootloader.


Running that gave:

  >>> open(b'test-\xd8\x00.txt', 'w').close()
  Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  TypeError: embedded NUL character
So yeah, TypeError

Edit: Formatting


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search:

HN For You