1.  

    Reminded me of another assembly EDSL: for Z80 and embedded in Haskell, (blog post about it) however it does not have register allocation.

    1. 2

      But please don’t overpost and overvote mainstream popsci sites and news about rocketry, like on famous orange website. Physics related to computational technology is ok, I think (semiconductors, maybe quantum things) and physics related to human-computer interactions (optics, sound, etc).

      1. 19

        I’m already having nightmares about opening AMP emails in mutt.

        1. 8

          you wait until they announce their partnership with Slack.

          1. 1

            Introducing R.Mutt — a fork of Mutt with AMP support and Material Design UI, rewritten in Dart.

          1. 1

            Even page of this blog post has top and bottom junk panels taking 1/5 of page height and constantly sliding in and out when scrolling. And this is not a porn site, this is main blog of Google. What a time to be alive. Time to install mutt and lynx to be able to read and write text again.

            1. 6

              “One language, one IDE, one build system (built in into IDE), one workflow” is killing “native” apps. You can’t even compile cocoa app without XCode (which is quite crappy IDE), you can’t build cocoa apps on Linux CI, you (almost) can’t write cocoa apps in python/ruby/js. And now you should buy signing certificate from Apple. “Native” apps are feasible only if you are huge company like Google, or if you are targeting only Mac.

              (I think GTK and Qt apps are not considered “native”)

              1. 1

                In Windows 95, the code generator got crazy and used the esp register as a general-purpose register.

                BitBliting with pop instruction when stack pointer is pointing to sprite data was popular on ZX Spectrum (example of use of push and pop for double buffering, another example for sprites).

                1. 4

                  So many layers of complex technology created only to circumvent Apple’s political restrictions. Why they still ban JITs and GCs in 2018? And this is on “devices of future” intended to “replace desktop computers”.

                  1. 4

                    Because technically, JITs are very easy to exploit; and politically, it makes it easy to build parallel ecosystems.

                  1. 1

                    I would use fixed time step for simple games. Making everything depend on dt may be more complicated for beginners, IMHO.

                    1. 1

                      My issue with fixed time step is that you either multiply everything with a constant anyway (at which point dt isn’t any more difficult to use), or you specify velocities in unnatural units, such as pixels per frame (which is super unintuitive to think about). Or am I missing something?

                      1. 1

                        At least dt will always be 1000/60. With variable (and unconstrained) dt, every game logic code part should be able to handle any values of it. For example colision detection should be able to handle large dt caused by long frame skips: you no longer can just pos += dt, then check if entity collides with something — entities may pass through walls, etc.

                        One of options is to limit dt to some maximum value instead of making it fixed.

                        Lots of large AAA games are ok with variable timestep, however. AFAIK, Quake uses it. Seems that bug with impossible mission in GTA 4 on fast PCs is related to this. Quake III, however, has only rounding issues due to variable time step.

                        The next post will be using box colliders with raycasts.

                        In this case variable time step will not make things more complicated, I think.

                        (I’m not an expert in games and I never written even finished platformer, just tried to do that).

                    1. 4

                      This bug happened for me too at 8 December (found my tweet about it), seems in 10.13.2, but I don’t know after what action ps stopped responding until reboot.

                      10.13’s quality is very poor :(

                      1. 1

                        Mac OS has C-b, C-f, C-p, C-n keys working as cursor keys almost everywhere out of the box. Not so convenient, however. I wonder from where these keybindings inherited, the same keybindings are used in Emacs.

                        1. 1

                          They’re mnemonics: back, forward, previous (line), next (line). I recognize them from Emacs.

                        1. 7

                          BTW, C is simple, but I still can’t write something more than Hello World (or GTK window with single button) in it. Unlike C, I think if you know Rust, you already know how to write programs in it.

                          1. 5

                            I feel like I know Rust well enough but when I try to do some things they can take more time than I expected due to borrow issues cropping up, and I am comfortable with unmanaged ownership generally. Most of this comes down to using the language on a periodic enough basis that it is not quite second-nature.

                            As a result I’m reluctant to use it unless I know exactly what I want to write in it, mostly because my time is limited and I’m worried I’ll get stuck. At the same time I really like the resulting code. It’s just a matter of shifting perceptions and expectations for what one gets done in a given coding session.

                            1. 1

                              Doesn’t Rust have optional, reference counting? A few people deep in the borrow-checker vs full GC language threads on HN drop in saying you can do checked references in Rust. If so, that means times where borrow-checker is hard dont necessarily imply ditching Rust for that project: could just ditch the borrow-checker until better at it or not at all if it’s throwaway project. Then, recommendation becomes use Rust with borrow-checker for full benefits but reference counting for most.

                              Also, these plus veterans’ solutions might form a corpus of sorts for helping people figure out how to get things through borrow checking. The posts on linked lists come to mind. Another benefit is testing alternative schemes for checking pointers to see over time what usability improvements are available.

                              1. 13

                                Rust has a ref-counted type. https://doc.rust-lang.org/std/rc/struct.Rc.html

                                Also, boxing (heap-allocating) data structures moves you back from a borrowing situation to an ownership situation, which is generally easier.

                                I recently made an advanced workshop with Servo people and the general gist was: most values that travel far within the program should be handled through owned data. The veterans solution is: don’t borrow for too long :). This is intuitive: borrows are pointers and pointer structures get harder with each layer, so does the lifetime situation.

                                I wish I had a good example at hand quickly, if I find one, I’ll blog about it.

                                1. 2

                                  Thanks for the tip. That already makes some sense to me similar to concept of avoiding action at a distance. You might still want to keep developing the idea further, though, since folks keep tripping up on this stuff.

                                2. 1

                                  As a newbie I came across to that advice couple of times but my impression is that if I use reference counting or similar approaches instead of borrow-checker, I am afraid to end up with a code that is not designed with borrow-checker in mind.

                                  With all toy projects I tried, I find myself changing things a lot between my first attempt of designing an API and clearing up all borrow-checker newbie mistakes.

                                  In that regard, so far, I wasn’t able to end up with good designs and still don’t feel comfortable with ownership idea at all.

                                  1. 4

                                    As a newbie I came across to that advice couple of times but my impression is that if I use reference counting or similar approaches instead of borrow-checker, I am afraid to end up with a code that is not designed with borrow-checker in mind.

                                    Hm, so. In the end, the borrow-checker is a validity check. Not needing the borrow check at certain places is not avoiding it. People feel like a cheat for not using a language feature, but that’s really not the case.

                                    With all toy projects I tried, I find myself changing things a lot between my first attempt of designing an API and clearing up all borrow-checker newbie mistakes.

                                    In that regard, so far, I wasn’t able to end up with good designs and still don’t feel comfortable with ownership idea at all.

                                    It’s part of learning a language (and not to be understanded) to come to good designs. I generally recommend starting with a bad/mediocre design and than refactoring. I have projects I rewrote 4 or 5 times to learn. I can get a couple of hints there, though.

                                    • Defining your own types is very powerful
                                    • APIs in Rust have to cover three context cases: owned, borrowed, mutably borrowed
                                    • You rarely have to take Rc and similar in signatures. Pretty often, you can use them and then pass them into functions that just take a plain borrow. You need Rc to get the data across your program.
                                    • There’s usually a layer in your program that distributes data between components and then parts that do work and calculations. A sharp seperation here helps a lot, as borrowing/ownership problems usually show at the edges of the components.
                            1. 5

                              I had high hopes for this thing. But then it starts dubbing things “functional” or “reactive” without even explaining what that means.

                              It does not give an overview of what these frameworks are supposed to achieve in general, nor an overview of their architecture.

                              It’s not useful at all. This, while still lacking, at least gives some useful information: https://mithril.js.org/framework-comparison.html

                              1. 2

                                Moreover, ReasonML is listed in frameworks, but it’s a programming language. (Elm is language too, but at least it contains JS framework in its standard library).

                                1. 1

                                  Indeed, and it would be nice to start seeing more people include compile to Js languages as well. For example, I thought this comparison was interesting https://medium.freecodecamp.org/a-real-world-comparison-of-front-end-frameworks-with-benchmarks-e1cb62fd526c

                                1. 6

                                  They mention bitcoin, but can it still be mined with GPUs? I thought after specialized ICs for bitcoin/sha256 appeared, mining it with GPUs became highly unprofitable.

                                  And if not, are these GPUs used for ethereum? Found this site and I never heard about almost all coins listed there.

                                  1. 9

                                    Ethereum, Monero, etc.

                                    Everyone just says “bitcoin mining” meaning cryptocurrency mining in general, because “bitcoin” is easy to say and more people are aware of the word I guess.

                                    1. 4

                                      No, it hasn’t been viable to mine Bitcoin with GPUs for a long time. Most newer cryptocurrencies are “ASIC resistant” which essentially means they’re designed so you need a GPU to mine them.

                                      1. 3

                                        It’s correct to put “ASIC resistant” in quotes, because that really only refers to the hash function used by Bitcoin. Any hashing function can be implemented in hardware via an ASIC if the economics motivate it.

                                        This has already happened with Litecoin and Ethereum, I believe.

                                    1. 4

                                      Unpopular opinion: Could be seen as a good opportunity to stop “gaming”.

                                      1. 10

                                        Uninformed question: What’s bad about “gaming”?

                                        1. 11

                                          I can only really speak from my own perspective, and that is that I regret to have wasted hours upon hours of my life on games, playing them instead of doing schoolwork or learning something productive, and most of the time being frustrated because of them, since I didn’t play them because they were necessary fun, but because they were made to addict people. Since I decided to stop “gaming” (which I radically distinct from playing games from time to time. Being a “gamer” is a commercial identity!), my life has drastically improved. Now my case might not the usual one, but I still argue that less video games would help everyone. I have had friends who socialized to a minimal degree, since for the most part they could just play games, and avoid being human. Furthermore, I’ve experienced games changing the way people concive of their surrounding world, to the worse I believe. In other cases, video games supplement the failures of the predominant worldview.

                                          All of these things, not to mention the toxic “gamer “”“community””””, have lead me to have a strong anti-“gamer” stance. I know that most people won’t agree with me, and it would be wierd if they would. Nevertheless, I defend the view.

                                          1. 8

                                            Depends on what your goals/aspirations in life and how easily the comfort zone of gaming might keep you from achieving them. Many will require hard work or high-friction activities we prefer to avoid. That on top of some dollars that people were about to sink into a high-end, graphics card among other things.

                                            If that doesn’t apply, then this supply-side problem is just blocking expanding on a harmless hobby. At that point, next question is whether they can adapt that hobby to not needing a high-end, graphics card still having fun? Or are they a slave to the man only enjoying what comes with mandatory hardware updates? Or could they switch to a different hobby entirely while still enjoying life?

                                            Why are some of these gamers so mad about graphics cards if they’re in control of their mind and lives?

                                            (Just screwing around. Gamers don’t take me too seriously. Then again, I like building jokes on top of kernels of truth. Hmmmm.)

                                            1. 3

                                              Sure there are people who escape reality, but I’d think that people with severe problems managing their lives couldn’t afford expensive hardware.

                                              Even if they overspend on it, it’s not a problem with games or hardware, those are just substitutes for alcohol or drugs or Instagram or TV or whatever.

                                              I haven’t really played shooters or strategy games in a long time, but I’ve understood these games are good for developing reflexes and thinking. As long as they’re not abused like crystal meth.

                                          2. 3

                                            That’s opportunity to manufacture more GPUs, therefore make them cheaper and improve them further. Games will have benefit from this too.

                                            1. 1

                                              People who really like games will just not upgrade and deal with it or play old games. Or consoles. Last year I played a ton of games and I don’t have a gaming PC. I played 3DS, Vita, and PS4. Also IIRC none of the currently popular PC games demand a lot of graphical power.

                                            1. 1

                                              meh, this is really a cat and mouse game. just test it like:

                                              if (navigator.webdriver || navigator.hasOwnProperty('webdriver')) {
                                                console.log('chrome headless here');
                                              }
                                              

                                              And there goes the article until the author can find a way to bypass this now…

                                              1. 6

                                                The point of the article is sort of that it’s a cat and mouse game. The person doing the web browsing is inherently at the advantage here because they can figure out what the tests are and get around them. Making the tests more complicated just makes things worse for your own users, it doesn’t really accomplish much else.

                                                const oldHasOwnProperty = navigator.hasOwnProperty;
                                                navigator.hasOwnProperty = (property) => (
                                                  property === 'webdriver' ? false : oldHasOwnProperty(property)
                                                );
                                                Object.defineProperty(navigator, 'webdriver', {
                                                  get: () => false,
                                                });
                                                
                                                1. 1

                                                  Yet there are other ways that surely make it possible for a given time window, like testing for a specific WebGL rendering that chrome headless cannot perform. Or target a specific set of bugs related only to chrome headless.

                                                  https://bugs.chromium.org/p/chromium/issues/detail?id=617551

                                                  1. 1

                                                    Well, eventually you just force people to run Chrome with remote debugging or Firefox with Marionette in a separate X session, mask the couple of vars that report remote debugging, and then you have to actively annoy your users to go any further.

                                                    I scrape using Firefox (not even headless) with Marionette; I also browse with Firefox with Marionette because Marionette makes it easy to create hotkeys for strange commands.

                                                    1. 1

                                                      Even if there were no way to bypass that, don’t you think that you’ve sort of already lost in some sense once you’re wasting your users’ system resources to do rendering checks in the background just so that you can restrict what software people can choose to use when accessing your site?

                                                      1. 3

                                                        If headless browser is required to scrape data (and not just requesting webpages and parsing html), then website is already perverse enough. Noone will be suprised more if it would also run webgl-based proof of work before rendering most expensive thief-proof news articles from blob of malbolge bytecode with webgl and logic based on GPU cache timing.

                                                        1. 1

                                                          You’re paying a price, certainly. But depending on your circumstances, the benefits might be worth the cost.

                                                  1. 6

                                                    I’d like Rust to get to the point where I can use an OS package for cargo/rustc and it works for a long time. I have not used Rust much but in the little bit I have I still have to go back to something like rustup because things are so in flux.

                                                    1. 2

                                                      Ruby is old and stable language and yet it’s common to use similar tools: rbenv/rvm/ruby-build, at least on dev machines. OS package systems have limitations. At least programs written in Rust should be packageable and deployable without having to compile Rust runtime/standard library on production server.

                                                    1. 13

                                                      Still outweighs stress for commuting to office and sitting in noisy and uncomfortable environment. Offices are usually creepy and dirty in my city, sometimes out of reach of public transport routes. Bad lighting, constant noise of drill in neighboring rooms (where short-living companies come and go), cockroaches, sewerage smell, dirty overloaded toilets. Colleagues fighting for better place to sit, opening and closing windows and turning on and off air conditioner. Constant feeling of surveillance.

                                                      After working remotely, I don’t want to work at office anymore.

                                                      1. 2

                                                        Can I ask what city you’re working in?

                                                        1. 1

                                                          Saint Petersburg

                                                      1. 3

                                                        Of particular note, this affects you if you have disabled Defender. Not limited to “bad” AV software.

                                                        1. 2

                                                          So, if I have no antivirus installed at all, updates will be disabled?

                                                        1. 3

                                                          Good start… now what about templating alternatives like Telegram’s Instant View? Millions of links being sent over IM every day are being rewritten into new templates created by a third party. Sure, it addresses the speed / mobile accessibility concerns, but it’s also very heavy-handed backend processing that’s a black box to users.

                                                          1. 3

                                                            We are currently running a $315,000 competition to create Instant View templates for news websites and blogs. Everyone is welcome to participate.

                                                            That’s a lot of $s for something which is run by… who exactly again?

                                                            1. 1

                                                              Google AMP doesn’t exist to solve backend issues, though. That’s a separate concern, I’d say.

                                                              1. 1

                                                                Before clicking your link, I was unfamiliar with Telegram and Instant View, so take this with a grain of salt…

                                                                Isn’t this just another version of the same thing? Doesn’t an Instant View prevent clicks to the host domain?

                                                                And, conversely, isn’t this all a consequence of business models riddled with terrible ad networks? Dropping AMP or Instant View or any other scraper/viewer doesn’t fix that weakness.

                                                                1. 2

                                                                  More like mix of Facebook’s Instant Articles and Reader Mode from Safari/Firebox (also Pocket). It doesn’t require special markup to put on webpage but it has crowdsourced rewrite rules that remove cruft from webpages. It loads processed webpages from their server though, unlike Reader modes.

                                                                  At least Telegram leaves links posted to chat as is, looking like links, with underline, leading to original URL, and adds “Instant view” button alongside, which looks like button and opens instant article popup.

                                                                  BTW, their rule language is crappy.

                                                                  1. 1

                                                                    Telegram is/was important in the recent Iran riots.

                                                                    For example: https://www.politico.com/magazine/story/2018/01/01/irans-telegram-revolution-216206

                                                                    Unlike Twitter, millions of Iranians use Telegram in their everyday lives—around 40 million monthly users in a country of 45 million overall online users, according to the latest ITU statistics.

                                                                    1. 1

                                                                      To my understanding it is - just a different content/service provider that wants to create a platform to give the same experience to its users. There are some differences in the implementation by telegram and the effort that needs to be put by the sites developers, but it is still served by cache that is kept on their servers. In this point you’re getting a good experience loading, say, Medium articles in Telegram - but you don’t get the same experience outside of it.

                                                                  1. 4

                                                                    And yet the same people from Medium and HN tell everyone that desktop is dead and you shouldn’t consider learning how to make desktop apps. Yes, desktop app development sucks, with C/C++/ObjC and no sane cross-platformness. It stuck in 80s. Everyone is gone to gold rush of web apps, PaaSes, mobile apps, blockchains and superintelligent killer robots.

                                                                    1. 2

                                                                      C/C++/ObjC

                                                                      here’s the thing: there are loads of other programming languages that have FFI to call C functions (Python, Ruby, anything on the JVM, anything on the CLR, JavaScript via node, others), and if you can do that you can work with ObjC (and, with some bridging, C++). So the choice is not “JS to use Electron, C to use native”.