Wikipedia:Reference desk/Archives/Computing/2018 January 7

= January 7 =

HDR TVs and Relaxation
Before going to sleep, I like to veg out for an hour or two watching TV to. Newer TVs now have higher dynamic ranges which means brighter brights. Does anyone know if these new HDR TV's brightness makes it more difficult to relax? A Quest For Knowledge (talk) 10:39, 7 January 2018 (UTC)
 * Isn't it the blue light that makes it harder to sleep (according to some) https://www.scientificamerican.com/article/q-a-why-is-blue-light-before-bedtime-bad-for-sleep/ ? Many pc monitors have a blue light filter mode, but I am not sure if that is also a feature on modern TVs. Have you tried reading a book? Probably more helpful on your quest. &#40;&#40;&#40;The Quixotic Potato&#41;&#41;&#41; (talk) 10:48, 7 January 2018 (UTC)
 * According to https://sleep.org/articles/is-it-bad-to-watch-tv-right-before-bed/, all modern screens put out some blue light, so watching TV is probably going to make it harder to get to sleep.OldTimeNESter (talk) 14:01, 7 January 2018 (UTC)


 * In case it wasn't clear, my question is whether HRD TVs are worse for relaxation than non-HDR TVs. I already know that I can fall asleep watching my regular TV.  I'm wondering if I can still fall asleep watching an HDR TV without having to spend a couple thousand dollars to find out.  A Quest For Knowledge (talk) 16:39, 7 January 2018 (UTC)

Are all languages compiled into an abstract syntax tree?
Is the Abstract syntax tree a necessary step in every compiled program? That is, would every compiler necessarily generate something akin to it when going from source code to machine code? --Hofhof (talk) 20:28, 7 January 2018 (UTC)
 * It's not a question of the language, but of the compiler design - for some simpler languages, you can do pure syntax-directed translation. But I'd say that for serious languages and compilers, translation via an intermediate stage akin to an AST is the standard approach. --Stephan Schulz (talk) 08:06, 8 January 2018 (UTC)
 * It's certainly not necessary. I doubt QuickBASIC created a tree before compiling to an executable as the language was simple enough to just go line by line. Joepnl (talk) 00:16, 11 January 2018 (UTC)
 * As Hofhof and Joepnl said, it's not necessary -- you can check this excellent book: "Let's Build a Compiler" by Jack Crenshaw that implements a Turbo Pascal compiler that produces Assembly code directly, without using an abstract syntax tree or any intermediate representations for that matter:

Our compiler, in fact, is  what we might call a "pure" compiler. Each time a construct is recognized, the object code  is emitted IMMEDIATELY. (That's one reason the code is not very efficient.) The interpreter we'll be building here is a pure interpreter, in the sense that there is  no  translation,  such  as "tokenizing," performed on the source code. These represent the  two extremes of translation... --129.45.127.206 (talk) 20:29, 12 January 2018 (UTC)