1. 20

      Confusing naming. There’s already a rust project called warp, but it’s a web framework.

      1. 14

        Funny story: Warp (the terminal emulator) is actually listing warp (the web framework) as a dependency: https://github.com/warpdotdev/warp#open-source-dependencies

        1. 3

          What does God need with a Starship^W^W^W^W^Wa terminal need a web framework for?

          1. 3

            How else are you going to make a GUI? Surely you’re not suggesting something as silly as, say, using a GUI toolkit, the way they did in the stone age!

            1. 1

              I’d love to know as well but as of now Warp (the terminal emulator) is closed beta.

              1. 1

                @fasterthanlime has a nice video on why would you ever want to use a web browser for a random program’s GUI.

                1. 1

                  I appreciate the effort, but you’ve highlighted another generational difference: using a video to express a point that could hopefully, succinctly be made in the space of a few paragraphs, without requiring people to look at your face for ten minutes :)

              2. 2

                I assume that’s for the shared editing feature.

                1. 10

                  Not to mention OS/2 Warp!

                  1. 5

                    Not to mention the good ol’ Warp drive

                    1. 10

                      I’m worried I’ll confuse it with the original warp lines controlled by the original punch cards.

                2. 2

                  And OS/2 Warp.

                1. 5

                  I tried using the Vapor web framework on Linux, it seems to have a decent following for something that targets a non-Apple environment. It, and Swift on Linux, felt too immature at the time though, with some flaws like terrible compiler error messages and very bad compilation times. This was probably two years ago now though so things may have changed.

                  1. 4

                    One thing I’ve read over and over is “don’t store your files in a database”. I assume there are caveats, and times when this does make sense, but could anyone care to make the case for why this is a good or a bad idea in this particular scenario?

                    1. 16

                      In general: Storing files in the database generates a ton of IO load on the database server, which is usually already IO-bound. If your database is busy doing other stuff (unlike, say, IMGZ which doesn’t do anything else) that’s going to degrade performance.

                      On the flip-side, it’s terribly operationally convenient when you can backup a single database and actually have all your data, and having consistency between the data-store & the filesystem store is nice so you can’t refer to files that have been deleted / failed to upload / whatever.

                      1. 12

                        Generally, considerations for files are different than for other data. E.g. you almost never need to filter files by actual contents, or sum them, or do any of the other things databases are good at, you just want to be able to store them, retrieve them and delete them. If you saved everything in a database, it would be more expensive, just because of the type of guarantees that you need for data, which you don’t need for files.

                        That means you’d unnecessarily be paying all the costs that are associated with what we normally want to do for data, but not need any of the benefits.

                        1. 5

                          Sqlite did an analysis on this and found that for files under a certain size, it is actually faster to read them from a database (based on the database page size): http://0x0.st/iFUc.png

                          1. 4

                            It’s a bad idea in this scenario. But you’re not likely to care too much at very low scale.

                            One solid reason to care is that in PostgreSQL the maximum “row” size is 16KiB. If you go over that then “the next” 16KiB goes into what’s called a “TOAST” table, which has access characteristics similar to a singly linked list. (So, 1 request for a 64KiB row will cause 4 queries to the storage engine and so on.)

                            Other characteristics of the TOAST table is that it compresses on input, which can quickly saturate your CPU.

                            1. 2

                              Another way to say that is, “it will work, until it doesn’t.” Which is true of 100% of scaling problems. :-)

                              The nice thing about simple solutions is that they can be easier to adapt and extend later when needed.

                              1. 17

                                Scaling problems are for amateurs, if I get too popular for my architecture I’ll just disable the signup page.

                                1. 3

                                  But that’s one customer too late - who are you going to evict to get out of scaling problem territory?

                                  1. 14

                                    The one with the most images, obviously.

                            2. 4

                              You basically have three options with Postgres: you can put the file contents in the row, you can use the large object facility, or you can write the file to disk somewhere and store the path.

                              Putting the file contents in the row is simple, and is the only option that gives you for-free the notion that deleting a row will get rid of the content of the file. It has the disadvantages that others have discussed, although I don’t think TOAST is so bad for performance.

                              The large object facility is basically file descriptors in the database. You have to take extra care to remove them when you’re done with them, and most ORMs have poor support for it. I have never seen the large object facility used in the wild, and it’s not a tool I would reach for personally.

                              The third option is probably the best. The filesystem will always be better at storing files than your layer on top of the filesystem. But you have integrity concerns here (deleting a row does not cause the corresponding file to disappear), and you have to back it up separately from the database.

                            1. 6

                              As someone who has played with writing both an interpreted language and one that compiles via LLVM, I definitely second these! It’s fun, it’s actually not as hard as you’d think, and it gives you a much deeper understanding of how programming languages work.

                              1. 1

                                Do you recommend any resources for writing an interpreted language?

                                1. 3

                                  https://craftinginterpreters.com/ is linked in the article and is very, very good.

                                  1. 1

                                    Thank you!

                                  2. 2

                                    I didn’t work from it, but I have read some of https://interpreterbook.com/ and thought it was pretty good.

                                1. 1

                                  If I am allowed to mention something I’ve made that’s relevant without it seeming spammy, I use Exist, a personal analytics tool that allows a mood rating and short note each day alongside the core quantitative data like activity, productivity, and sleep metrics etc. It didn’t really start off as a journalling setup, and there’s a character limit, but I find it quite useful to have a journal of what I was doing (and how much of it) alongside how I felt then. On my most happy days I tend to write about special occasions that occurred, and seeing friends, which is probably not a groundbreaking discovery :)

                                  1. 1

                                    I used to have a good experience with Komodo IDE but have not used for a few years now (ironically I switched to Pycharm). Might be worth a look.

                                    1. 1

                                      Thanks, downloading it now. It seems a bit outdated though as the latest Python version it supports is Python 3.6.

                                    1. 4

                                      Any lobsters planning on putting a Librem 5 in their claws? Would love to hear more about it.

                                      1. 9

                                        I backed it, but I’ve been continually thinking about unbacking it. As much as I want to like what they’re doing, there’s a lot I’ve not been impressed with (e.g. poor release communication, their handling of the librem.one service); I’ve been on the fence. Even after reading this, I have no idea what year my device will ship in. It reads like they’re slipping deadlines again, but don’t want to come out and say that. We’ll see, I guess.

                                        1. 2

                                          Same on both counts. I also had a poor experience with a Librem notebook that I ended up returning; that soured me on their products in general.

                                        2. 11

                                          Ordered mine… looking forward to it.

                                          I guess I’m way too literal a person. I read licences. I read words and expect them to mean something.

                                          People have been trained if they see an “I Accept” button, you click it and carry on.

                                          It causes me mental anguish every damn time.

                                          I’m just not the sort of person who can blindly do that.

                                          I loathe “I Accept” buttons.

                                          I think a lot of people have a mindset “Purism is free software, it should be cheaper and higher spec’d hardware”,

                                          They forget usually phones are heavily subsidized by the network providers so they can lock you in and load you up with shitware and spyware and strap you down with EULA’s.

                                          Yes, the privacy part will be a very nice to have. I want that.

                                          But not nearly as much as I don’t want the lock in and shitware and spyware and EULA’s.

                                          Not nearly as much as I want to be able to tinker and improve and feed my improvements into the ecosystem.

                                          Not nearly as much as I want the acceptance and expectation from the people I pay my money to that…

                                          I AM gROOT!

                                          1. 3

                                            o/ here!

                                            Backed their crowdfunder back … when? 2017? I plan on redeeming one from one of the later batches, so the review will takes some time still. Until then, my Nexus 5 will do fine.

                                            1. 1

                                              o7 to you who still uses the Nexus 5. I used mine until late 2017 when I picked up a Pixel. I’m on a Pixel 3 now and can’t imagine using a N5 still.

                                              1. 1

                                                I’m still using mine. It, uh… works?

                                                I mean, it’s a mobile device, so I don’t expect it to be pleasant, but once I got ublock origin installed it became pretty tolerable.

                                            2. 1

                                              I pre-ordered one way back when they had the crowdfund. I find this tiered release rather confusing, TBH. But it’s good that they’re finally starting to ship!

                                              1. 1

                                                I pre-ordered a few months ago. I wasn’t sure I’d use it enough to justify the cost (I seriously doubt it’ll cover everything I want in a daily driver device) but I decided it was worth it, because it’s something I want to see exist, so given I can afford it, I should support it. The Google/Apple mobile duopoly we currently have isn’t a great situation, so more competition (even in a very niche form) is welcome. I’m still sad about the Palm Pre, to be honest!

                                                However, this shipping announcement really rankled. Another 6-10 months to get a phone with a case that fits? I appreciate that they’re offering to bump people down the list, and I’ll definitely take them up on it if needed, but it feels quite disingenuous to claim “we hit our deadline” with this sort of half-baked rollout. I’m considering asking for a refund and judging the final result before committing to it now.

                                                1. 1

                                                  I was moments away from putting down for one, but then I checked the specs on the modem and backed out. The set of supported LTE bands was spotty enough that I couldn’t see myself using this overseas or even on certain domestic carriers without constantly fighting reception issues.

                                                  1. 1

                                                    I preordered one at the beginning of the year and just got an email from Librem with effectively the same information as this blog post, promising more info in a few weeks.

                                                  1. 4

                                                    If you want an API for weather, I strongly suggest using Dark Sky: https://darksky.net/about

                                                    They’re not powered via ads, have a nice API, and appear to want to build something that lasts in a sustainable way instead of trying to profit.

                                                    1. 5

                                                      Why use that over weather.gov which is wholly free?

                                                      1. 7

                                                        For one thing, Dark Sky provides (almost) global coverage, which is useful for all of us folks who live outside the US (or have customers who do).

                                                        I use Dark Sky commercially and while it’s clearly more accurate in some places than others, it’s usually close enough. A few years ago I evaluated all the global weather APIs and it was the clear winner, I’m a happy customer.

                                                        1. 4

                                                          DarkSky has a lot more points of data like apparent temperature, humidity, wind speed and direction, UV index, and likely a whole lot more. And the API seems like it’s laid out in a slightly more readable way. Weather.gov seems to follow a more HATEOAS methodology where it links out to different API endpoints that contain the data you’re looking for, whereas DarkSky just gives you the data all at once when you request a certain location.

                                                          1. 3

                                                            weather.gov

                                                            Whooop. Almost posted a reply thinking you were asking about weather.com.

                                                            Truth be told I didn’t know weather.gov was a thing. DarkSky can apparently give accurate hyper-local results.

                                                          2. 3

                                                            Thanks a lot for the link. I have such a need for correlating wireless link quality/speed and weather, and needed something that works in France. :)

                                                          1. 13

                                                            This is great! I really like this style of explaining how the pieces fit together from the ground up. Every time I’ve tried to start a project in Phoenix (or Rails, or Django, …) in the past, I’ve been pretty overwhelmed by the sheer number of different moving parts that are simply scaffolded in.

                                                            1. 6

                                                              Agreed, this was super well written and easy to follow. I love the idea that each section links to a commit. I might steal that for my blog :)

                                                              1. 11

                                                                Thanks! I’ve got a whole pipeline that transforms a git log into an article formatted to work with my static site generator. I’m a big fan of the format!

                                                                1. 6

                                                                  I’d be interested in hearing more about that!

                                                                  1. 2

                                                                    I’d love to get an eyeball on that pipeline, seems really cool!

                                                                2. 1

                                                                  As someone else who recently generated a new scaffolded project with Phoenix (just to have a play around, I don’t know much elixir) and felt overwhelmed by all the moving parts, I wanted to chime in too and say I found this post very handy. Thanks :)

                                                                1. 6

                                                                  I recently experimented with reason and really liked it. One question, why not do what bucklescript does, but target go? (Basically fork bucklescript)

                                                                  I would guess that way you get ocaml and reason at once. Not sure how much work that would be though. Being totally realistic, I feel like that approach would be more likely to succeed, though also be less fun to do.

                                                                  1. 7

                                                                    That’s an interesting idea! Use bucklescript’s existing frontend and add a backend that targets Go. Could work.

                                                                    One of the reasons I chose to write Braid in Go was so it wouldn’t have any dependencies outside Go (and Go-related tooling). It seems neater, given I have a hard requirement on the Go compiler (once I get to the stage where it is invoked automatically as part of compilation).

                                                                    1. 4

                                                                      Btw, I really hope this succeeds, I think it is a great concept.

                                                                  1. 4

                                                                    I wish there could be an OCaml like syntax for Braid, to make it more similar to languages like OCaml, SML, Haskell, Elm and PureScript.

                                                                    1. 3

                                                                      I don’t, reason syntax is more natural for me, just from what I know before. The syntax means relatively little anyway.

                                                                      1. 1

                                                                        I did lean more towards ocaml-like syntax initially, but thought something more c-like would be an easier sell for Go developers. (Maybe that’s not much of an argument though, as a viable language doesn’t actually need to be anything like the one it’s built on…)

                                                                        1. 5

                                                                          It depends who your target audience is: if it is people who use Go and wish there were more functional concepts in their language of choice then it is most likely the most reasonable. If it is people coming from other functional languages, hoping to use the Go ecosystem and compiling into Go binaries, then an ML syntax would be more welcome.

                                                                          1. 1

                                                                            That’s a good point. Something to think about!

                                                                      1. 5

                                                                        I read the examples thinking, hey, this looks and works a lot like ocaml with different syntax — even the way it handles mutability is the same. And it turns out it is built in ocaml! Nice. I didn’t look further to see if it’s compiling to ocaml and then to wasm under the hood, but I wasn’t aware ocaml had a wasm target so perhaps it’s all just a coincidence.

                                                                        1. 3

                                                                          Congrats on the new project. Given you are the creator of the social site sublevel, which seems to still be alive, what was the impetus for going on to make this new one also?

                                                                          1. 2

                                                                            I guess I don’t know enough about CPU architecture as I can’t understand the reason behind this change. Could someone explain why Intel would want to increase so dramatically the number of cycles a pause takes? Is it meant to be an efficiency tradeoff that means fewer explicit pauses while waiting for locks?

                                                                            1. 8

                                                                              Indeed a timing change like this is normally due to power efficiency constraints or targets. I’d conjecture that in their internal evaluation benchmarks, Intel decided that this allowed their cores to more aggressively drop to a lower power state while seeing an acceptable performance loss (which is exactly what Intel’s docs say, shown in the article). It would seem that the .NET spinlock implementation was dependent on knowing the latency of pause instruction. I wouldn’t call this a hardware performance regression. It just looks like software didn’t support the hardware well yet, and soon there will be official support by MS. It’s still a well done exploration into the performance regression of that workload.

                                                                              EDIT: as someone pointed out in the HN thread, the change in cache configuration in Skylake is another possible (and probably bigger) motivation for changing the pause latency. He points out that specifically a dirty read from another core’s L2 has increased latency compared to previous gen’s dirty hit to the inclusive L3. I’d assume a shared hit wouldn’t be that much better.

                                                                              EDIT2: DVFS latencies are on the order of ms for Intel speed shift, orders of magnitude too large to be useful in this context. The “small power benefit” mentioned would just be the reduction in dynamic power from the reduction in spinning.

                                                                            1. 1

                                                                              You might be interested in sgo, a “Go dialect” that prevents nil errors by enforcing if thing != nil checks at compile time: https://github.com/tcard/sgo/blob/master/README.md

                                                                              1. 6

                                                                                As others have alluded to, this is the classic plight of early “Web 2.0” successes where they thought they could keep their service “free” by using advertiser support. Only when nobody cared and everybody was enjoying their free lunch Twitter among many others has started to clamp down.

                                                                                What I would LOVE to see is widespread acceptance of the idea that advertiser funding is a fatally flawed model. One way for Twitter to go with this is to offer a “pro” option which would be ad free and paid, and also allow full and open access to all of its APIs, including the ones they’ve nuked in recent years.

                                                                                One of the things that drew me to Twitter was its diverse ecosystem of users and clients because developers had free reign to innovate using their platform. Clearly the future for this kind of innovation lies with tools like Mastodon and Pleroma, but as I say above it’s not too late for companies like Twitter to make bold moves and fix the broken model before it destroys them.

                                                                                1. 2

                                                                                  I find the “pro” strategy appealing, but I can’t think of a big site that’s succeeded with it. I’ve seen a lot of sites try and it doesn’t really seem to last. I don’t have numbers available, but I suspect that advertising revenue substantially outweighs subscription revenue most of the time.

                                                                                  1. 4

                                                                                    Can’t remember where I heard it, but on some sites the value of a user (to advertisers) who would use a pro option exceeds what said user is willing to pay.

                                                                                    Not sure if true or not, but it has stuck in my mind.

                                                                                    1. 2

                                                                                      Yes, that’s what I was suggesting.

                                                                                      1. 1

                                                                                        Oh! This is super interesting for a completely different discussion I’ve been having recently. Can you do me a favor and try to find out where you got that?

                                                                                      2. 2

                                                                                        I did some googling wondering if I could find some real data on this and failed. Flickr comes to mind, which was in fact quite successful and is still much loved despite having been bought by that roving dumpster fire that is Yahoo, and recently SmugMug.

                                                                                        1. 1

                                                                                          This is not at all an apples-to-apples comparison, but The Guardian (a newspaper/media co) now makes more from subscribers than from advertising. It’s a far cry from saying “this model works!” (the same article notes they still posted a loss) but I think it’s promising.

                                                                                        2. 2

                                                                                          What I would LOVE to see is widespread acceptance of the idea that advertiser funding is a fatally flawed model. One way for Twitter to go with this is to offer a “pro” option which would be ad free and paid, and also allow full and open access to all of its APIs, including the ones they’ve nuked in recent years.

                                                                                          This may be an unpopular opinion, but I don’t think social networks offer enough value for enough people to pay in the “pro” model. It might work on a small scale, but I don’t think it can work for a network as large as Twitter.

                                                                                          1. 2

                                                                                            You may be right. That would have me leaning towards the idea that behemoths like Twitter will need to go full on closed system draconian advertising for everyone and no third party anything, which will drive away the minority who really care (who should likely be seeking safe harbor in open networks like Mastodon at this point anyway.)

                                                                                            I personally feel that if someone could make a Mastodon or Mastodon-like server simple enough to deploy that grandma could do it, Mastodon would really take off in a big way.

                                                                                        1. 2

                                                                                          I didn’t know the language supported adding type annotation to functions… that’s neat!

                                                                                          1. 2

                                                                                            They were added in Python 3.5 I think. There’s no way to enforce them at runtime, unfortunately, they’re essentially just “type hints” that can be read by tools like Pyre to point out type errors.

                                                                                            1. 1

                                                                                              You can enforce them at runtime with decorators from third party libraries, for example enforce. It’s similar to how you can’t enforce them at “compile” time either; instead, you call mypy.

                                                                                          1. 5

                                                                                            Does the FB post come with a link to somewhere else? It would be nice, out of principle, not to try to open an FB link in vain.

                                                                                            Most likely login nag and tracking cookies…

                                                                                            1. 5

                                                                                              I know what you mean. The docs are at https://pyre-check.org/.

                                                                                            1. 4

                                                                                              I’ve really missed Tab Groups and the ability to hide groups of tabs since Firefox 57, so this is welcome news. I use tab groups like workspaces for different tasks, and there hasn’t really been a good alternative way to manage this since the upgrade.

                                                                                              1. 2

                                                                                                Yes! I’m a heavy tab user. Getting TabGroups back would be the best news about Firefox I could hear. Nothing else has collectively improved my experience with Firefox as much as losing TabGroups has been detrimental to it.