1. 1

    Wow. At first glance this thing crushes the ~$30 Teensies I’ve been using for my home brew phone project. Amazing.

    1. 2

      I’m not sure how it “crushes” a $20 Teensy 4.0 with five times the clock speed, dual issue full Thumb2, FPU, four times the RAM, …

      Cheaper, yes. Better documentation, yes. Better capability – not even close.

      1. 1

        Ooh, what’s this phone project?

        1. 2

          I wrote up a few updates on this project if you’re still interested in reading about it: http://zacstewart.com/2019/06/17/im-making-a-phone.html

          1. 1

            Thanks!

      1. 6

        I’m making a cellphone from scratch. It’s probably a stretch to say “scratch” because I’m using lots of premade components, and not making my own silicon, but it’s pretty fun nonetheless. I just finished up adding mic and speakers and making it run entirely on battery power. So far it can

        • make and receive calls
        • list and read SMSes on the SIM
        • compose and send SMSes

        It’s all on a breadboard right now, but I’ve started working on PCB designs in Kicad. Learning that stuff for the first time is fun. I want to get a batch of them etched and assembled. After that I have to learn Fusion360 or something to design the case.

        I’ve been posting updates on Scuttlebutt. I’ll try to link some here later.

        1. 2

          Please do post again about it. It sounds like an interesting project. Any plans to “go bigger” with it? Like, make some semblance of an official project, make a website, a github repo, release firmware source code, seek hardware partners, etc. etc. I only ask because there is definitely a niche for a really “open” phone. Other projects have come and gone, or are only in Europe (not North America).

          1. 2

            I do have a repo of the firmware. Not sure if I’m aiming for the “open” angle or the “less distracting” angle yet, but probably the latter. Open hardware is pretty hard to achieve. I know very little about what my cellular module does when I’m not looking. It’s manufactured by a Chinese company for instance, and I’m not sure I want to scour the earth for an open source replacement for all of these parts.

            1. 1

              I finally got around to republishing my homebrew phone stuff on my site if you’re still interested in it! http://zacstewart.com/2019/06/17/im-making-a-phone.html

          1. 18

            Does anyone else see this as a sign that the languages we use are not expressive enough? The fact that you need an AI to help automate boilerplate points to a failure in the adoption of powerful enough macro systems to eliminate the boilerplate.

            1. 1

              Why should that system be based upon macros and not an AI?

              1. 13

                Because you want deterministic and predictable output. An AI is ever evolving and therefore might give different outputs for given input over time. Also, I realise that this is becoming an increasingly unpopular opinion, but not sending everything you’re doing to a third party to snoop on you seems like a good idea to me.

                1. 3

                  Because you want deterministic and predictable output. An AI is ever evolving and therefore might give different outputs for given input over time.

                  Deep learning models don’t change their weights if you don’t purposefully update it. I can foresee an implementation where weights are kept static or updated on a given cadence. That said, I understand that for a language macro system that you would probably want something more explainable than a deep learning model.

                  Also, I realise that this is becoming an increasingly unpopular opinion, but not sending everything you’re doing to a third party to snoop on you seems like a good idea to me.

                  There is nothing unpopular about that opinion on this site and most tech sites on the internet. I’m pretty sure a full third of posts here are about third party surveillance.

                  1. 2

                    Deep learning models don’t change their weights if you don’t purposefully update it.

                    If you’re sending data to their servers for copilot to process (my impression is that you are, but i’m not in the alpha and haven’t seen anything concrete on it), then you have no control over whether the weights change.

                    1. 2

                      Deep learning models don’t change their weights if you don’t purposefully update it.

                      Given the high rate of commits on GitHub across all repos, it’s likely that they’ll be updating the model a lot (probably at least once a day). Otherwise, all that new code isn’t going to be taken into account by copilot and it’s effectively operating on an old snapshot of GitHub.

                      There is nothing unpopular about that opinion on this site and most tech sites on the internet. I’m pretty sure a full third of posts here are about third party surveillance.

                      As far as I can tell, the majority of people (even tech people) are still using software that snoops on them. Just look at the popularity of, for example, VSCode, Apple and Google products.

                  2. 2

                    I wouldn’t have an issue with using a perfect boilerplate generating AI (well, beyond the lack of brevity), I was more commenting on the fact that this had to be developed at all and how it reflects on the state of coding

                    1. 1

                      Indeed it’s certainly good food for thought.

                    2. 1

                      Because programmers are still going to have to program, but instead of being able to deterministically produce the results they want, they’ll have to do some fuzzy NLP incantation to get what you want.

                    3. 1

                      I don’t agree on the macro systems point, but I do see it the same. As a recent student of BQN, I don’t see any use for a tool like this in APL-like languages. What, and from what, would you generate, when every character carries significant meaning?

                      1. 1

                        I think it’s true. The whole point of programming is abstracting away as many details as you can, so that every word you write is meaningful. That would mean that it’s something that the compiler wouldn’t be able to guess on its own, without itself understanding the problem and domain you’re trying to solve.

                        At the same time, I can’t deny that a large part of “programming” doesn’t work that way. Many frameworks require long repetitive boilerplate. Often types have to be specified again and again. Decorators are still considered a novel feature.

                        It’s sad, but at least, I think it means good programmers will have job security for a long time.

                        1. 1

                          I firmly disagree. Programming, at least as evolved from computer science, is about describing what you want using primitive operations that the computer can execute. For as long as you’re writing from this directions, code generating tools will be useful.

                          On the other hand, programming as evolved from mathematics and programming language theory fits much closer to your definition, defining what you want to do without stating how it should be done. It is the job of the compiler to generate the boilerplate after all.

                          1. 1

                            We both agree that we should use the computer to generate code. But I want that generation to be automatic, and never involve me (unless I’m the toolmaker), rather than something that I have to do by hand.

                            I don’t think of it as “writing math”. We are writing in a language in order to communicate. We do the same thing when we speak English to each other. The difference is that it’s a very different sort of language, and unfortunately it’s much more primitive, by the nature of the cognition of the listener. But if we can improve its cognition to understand a richer language, it will do software nothing but good.

                      1. 2

                        I built a DIY mobile phone using a Teensy and it was a delight to work with. Makes me want to build something else. https://www.pjrc.com/teensy/

                        1. 36

                          Honest question: why should I care it’s written in Rust? I keep seeing these posts of new software and the authors highlight its “written in Rust.” I’ve never before seen such an emphasis on the language rather than the features it offers.

                          1. 34

                            I care that it isn’t written in C/C++. Memory safety catches a lot of security bugs. And language communities have different cultures, so knowing the actual language can be a signal as well.

                            1. 17

                              Okay, but in that case, it would be cool if the submission at least highlighted some of the neat use cases for which the language is relevant. E.g. if the description would at least mention an example – a particular module that’s very easy to get wrong in C, but Rust is particularly suited to, the way e.g. Julia is so well-suited for writing a FEM program. Or a “this module would’ve been 600 lines of inscrutable C but look how neat it is when you have explicit lifetime management features baked in the language”.

                              If there’s none of that, but it’s just a very good program, that’s great (even better, in fact) – but at least let’s talk about that. Is it remarkably fast, in which case can we have some benchmarks? Is it super secure, as in, has anyone tried to do even an informal review, it’s cool that it’s written in Rust but what I’d really like to know is if someone checked it to make sure that attempting to view an attachment called /dev/null; rm -rf ~ won’t nuke my home folder, which is a far more straightforward exploit than anything involving memory safety.

                              Better – hell, best yet – if it’s none of that, and the author just wrote a cool program and wants to share it with everyone else and wants some feedback. Great, but can we at least get that? Hey, fellow lobsters, here’s a thing I made, it’s super early, it won’t be big and professional like Outlook, do you like it? Would you like to send in a patch? What do you think about X?

                              Otherwise it’s just another program written in Rust. I get it’s cool but hundreds of programs get written in Rust every day.

                              As far as security bugs are concerned, if being written is C would be a red flag, what colour would you say is best ascribed to the flag raised by a tool whose installation script – which you’re supposed to curl straight into bash, of course – downloads an unsigned archive and `sudo mv’s the stuff in it into $PATH ;-)?

                              1. 8

                                I believe 4 out of these 5 would’ve been unlikely if mutt and libraries were written in rust, for example:

                                https://www.cvedetails.com/vulnerability-list/vendor_id-158/product_id-274/year-2018/opov-1/Mutt-Mutt.html

                              2. 10

                                Any GC language is memory-safe.

                                1. 4

                                  Which is why written in Go is also a popular thing, and deserves to be. People want single binaries and fast, safe programs but for whatever reason they also want to pretend there’s no reason to care what language something is written in.

                                  1. 3

                                    Apart from the fact that garbage collection brings its own issues (although probably none that would affect a mail client), Rust offers much more than just memory safety.

                                  2. 2

                                    What is the most likely security attack surface for a email client?

                                    1. 10

                                      Untrusted input: message body, attachments, headers; protocol implementation (tls negotiation, authentication)? [ed: and in particular string handling and path handling]

                                      1. 2

                                        This is a great argument for making MUAs just deal with MH/Maildirs and leaving the server interface to existing programs (mbsync, msmtp).

                                        Not only do you sidestep a good chunk of problems you mentioned - no worries about protocols, network, etc - you also are likely to fit into existing workflows. And it engenders trust: honestly, I’m unwilling to try software that speaks to my mail server. I risk anything from a bug inconveniencing me to something more malicious. Keep it local and I’m not as worried.

                                      2. 2

                                        HTML & images mostly

                                        1. 1

                                          If you want to support it, html display.

                                      3. 29

                                        I really have trouble understanding why people ask this. What’s so hard to understand about folks caring about which language a program is written in? There are literally oodles of reasons why it might be relevant. For example, if the title of the post were, “email client written in Zig,” it would actually attract my interest more than the current title. I would probably wind up spending some time reviewing the source code too. But if the title left that out, I probably would have skipped right by it.

                                        1. 2

                                          Yeah, I agree that the underlying tech can be interesting and makes sense in some cases to be in the title. We’re all hackers lobsters here, right?

                                          I’m a little surprised you’d show so much interest in Zig. I think of you as one of the “gods of rust”. Are you interested in a “keeping tabs on the competition” sort of way? Or is there some use case that you think Zig might shine more than rust for? In other words: are you interested in ideas you can bring to rust, or because you’re evaluating or interested in using Zig in its own right?

                                          1. 5

                                            No, I’m legitimately interested in Zig. I’ve always loved the “simplicity” of C, for example, for some definition of simplicity. (That one can cut a lot of different ways.) It’s also why I really like Go. And I think Zig is taking an interesting approach to memory safety and I’m very interested to see how well it work in practice. I’m also quite interested to see how well comptime does and how it balances against readability and documentation in particular.

                                            But I haven’t written a single line of Zig yet. I’m just following it with interest. I’m also a Zig sponsor if only for the amazing work that Andrew is doing with C tooling.

                                          2. 2

                                            I think “written in [L]” makes sense, if the fact that it was written in a language is interesting. If a more complex program is written in APL, it is interesting because APL is know to be diffucult. If something is written in C89 is is interesting because that will probably make it very portable. If something is written in Zig, it might be interesting because a lot of people are not familiar with it’s strengths and weaknesses in real world systems. If something is written in Go, it might be interesting because it provides a easy static binary that can be installed without a big fuss.

                                            Most of the time, I’m not surprised about Rust because why shouldn’t you be able to write a CLI tool in Rust? It has been done over and over again. If writing something in Rust has practical advantanges (”… written in Rust making it 4x faster”, “… written in Rust avoiding 90% of all security issues”, …) then it might be interesting.

                                            1. 14

                                              One aspect of that is that what is “interesting” varies from person to person and from time to time. Just as an example, I know I would be more interested if the title were “written in Zig,” but I’m sure there are plenty of others that would be less interested because of it. And that actually makes the “written in Zig” part of the title useful. Because it lets people filter a bit more, even if it means it’s less interesting.

                                              More to the point, “interest” is just one reason why “written in [L]” makes sense. It’s not the only reason. As others have mentioned, some programming languages tend to be associated with certain properties of programs. Whether that’s culture, barriers to contribution (for some definition of “barrier”), performance, UX and so on. Everyone here knows that “email client written in C” and “email client written in Rust” likely has some signal and would mean different things to different people.

                                              I truly don’t understand why people are continually mystified by this. It’s like the most mundane thing in the world to me. Programmers are interested in programming languages and how tools are built. Who woulda thunk it.

                                              To be clear, this doesn’t mean everyone has to be interested in the underlying technology 100% of the time either. So I’m under no illusions about that. Most of the users of my software, for example, not only don’t care what language it was written in, but probably don’t even know. I’d even bet that most of my users (via VS Code) not only don’t know what language their “find in files” is written in, but probably haven’t even heard of Rust.

                                              But we’re on a tech forum. It self selects for nerds like us that like to talk shop. What a surprise that we would be interested in the tools used to build shit.

                                              Apologies for the minor rant. This is just one of those things that pops up over and over on these forums. People are continually surprised that “written in [L]” matters to some people, and I guess I’m just continually surprised that they’re continually surprised. ¯\_(ツ)_/¯

                                          3. 11

                                            Personally I care because I am trying to learn Rust and projects like this are nice to explore and figure out stuff.

                                            1. 6

                                              I’m not sure either. I do occasionally see the “written in Go” or “written in Crystal” or “written in pure C99”, however.

                                              1. 4

                                                This was a trend 5 years ago with Python I feel, now it’s a trend with Rust. In case of Python, in my experience, it boiled down to “we improved the UI massively (compared to existing alternatives) and our error handling is nonexistent”, while with Rust it’s more likely to be “we’re obsessed about efficiency and everything else is secondary” ;)

                                                In practice, the “in X” is likely a call for contributors, not the users – as a user, when I see “it’s written in X” I assume that it’s probably got no real upsides aside of that, as if writing it in X was the whole point.

                                                1. 3

                                                  It makes it interesting to me because I’m interested in Rust, so I’d like to check out the source and learn something!

                                                  1. 3

                                                    As an email client for users, it isn’t interesting at all (no disrespect to the creator). But, as an expression for the possibilities of an up-and-coming language, it is useful. This post has the same similar feel to a “hello world” for a new language.

                                                    1. 2

                                                      People still writing new software in C in TYOOL 2021 also like to brag online about their choice of language. I don’t get it.

                                                      1. 2

                                                        I first thought “written in Rust” seems boisterous, then rethought and realized it’s beneficial specifying such, not just in boistering, but as an example for folks wanting to learn.

                                                        1. 2

                                                          Well,one reason to care is to make sure they don’t fall victim to the RIIR question from the Rust Evangelism Strike Force. (Have you considered rewriting it in rust?) (https://transitiontech.ca/random/RIIR).

                                                          (Note: this is a joke. You probably don’t care about rust and nor should you, but the author does.)

                                                        1. 32

                                                          My site is at https://bernsteinbear.com. I get very polarized responses :)

                                                          1. 12

                                                            I think your site’s chill and classic!

                                                            1. 2

                                                              Thanks ^_^

                                                            2. 6

                                                              I love this! Its theme is very similar to the Oil shell site. Super clean.

                                                              1. 3

                                                                There’s a little comment in the CSS that says that the navbar was heavily “inspired” by oilshell :)

                                                              2. 3

                                                                Linux/Desktop (1920x1080, 16:9)/Chromium with uBlock

                                                                I really like this one. After reading a few of the “Compiling a Lisp” articles, I also copied a few design cues to my personal site. I’m sorry I cannot say more, it’s just easy to read and easy to navigate. If I had to try to say something it would be that the entire site is a bit too narrow, and that it might be better to use more semantic HTML5 tags instead of custom div classes?

                                                                1. 1

                                                                  Is your current website the one everyone is complaining about? I think it’s great.

                                                                  1. 2

                                                                    Everybody is exaggerated, it was just one comment that caught my attention. But other than that, I don’t think it’s to surprising considering it’s inspiration ^^.

                                                                  2. 1

                                                                    Hm, interesting. Do you have any reading on this that you recommend? My HTML knowledge is at least 10, if not more, years out of date.

                                                                    1. 2

                                                                      I’m not expert either, I just check if I can use a semantic tag, when applicable. AFAIK the main advantage is that web readers /scrapers can properly parse what’s the site and what’s is just the header/footer (if you enable lobste.rs “article preview” feature, you’ll notice the difference).

                                                                      1. 1

                                                                        Oh, neat – thank you. I have some open graph data and some other metadata, but this might help.

                                                                  3. 3

                                                                    Your site has no bells or whistles. It is a site. It has text. The text is the main focus. There is no fluff. It loads instantly. It is glorious.

                                                                    1. 1

                                                                      Glad you like it :)

                                                                    2. 2

                                                                      I like the nav bar, the contrast, and the no-frills aesthetic, and the style choice of serif font works.

                                                                      Despite broadly agreeing with high-contrast text, I think the background could be a touch lighter (maybe just going from lobste.rs to your site is hard, especially since I’m in a light environment right now).

                                                                      Mostly, though, some breathing room would really help, especially with the bullet points; the line spacing between one single-line bullet point to the next is identical to the line-spacing between lines in a single multi-line bullet point. Everything just blurs together and only a small dot on the side helps me distinguish between bullets.

                                                                      Increasing the font size could also be a big help for people with impaired vision.

                                                                      1. 2

                                                                        I added some list item spacing. Thanks for the tip off.

                                                                        I also reduced the text contrast a little bit with some not-quite-black and not-quite-white.

                                                                        1. 2

                                                                          Nice one. The bullet points are a lot easier to read now.

                                                                          The lightening of the background does help, too, but I’m also in a dark environment now (albeit with the same bright screen).

                                                                          I wasn’t even saying about darkening the text, but the muting there does help as well. I think overall you’ve struck a good balance between high contrast (light clashing with dark) and low contrast (words blending into the background).

                                                                      2. 2

                                                                        I love it! Looks great on both my desktop and phone, and it isn’t weighed down by big images or fonts.

                                                                        1. 1

                                                                          Oh, that is good to hear. I do not regularly check up on how it looks on a phone, despite half my visitors using phones.

                                                                        2. 2

                                                                          For me it’s missing only one thing, which is to support dark mode via a CSS media query. I’d love to see just how brief a dark mode implementation can be, and your site is the perfect test subject.

                                                                          1. 2

                                                                            I brought back dark mode, new and improved. Can you let me know what you think?

                                                                            Re: brevity: the longest part is the syntax highlighting.

                                                                            1. 2

                                                                              Functionally it looks nice and readable, and should be pleasant in a dark room. Warm fireplace colors were a good choice for syntax.

                                                                              You could stop there; it’s a nice upgrade! If you want more critique:

                                                                              If any of the colors are off, it’s the links in dark mode. In light mode visited links stand out a little less than unvisited, which is desirable. In dark mode, the unvisited links are diminished against black and the visited stand out. I might try brightening the blue and dimming the purple a bit.

                                                                              Finally, check the link colors on the same dark screen as the syntax colors. The syntax colors give a cozy character to the site, but the link colors establish a different kind of environment, such that when you first reach a syntax block, the warmth is a surprise. I think the link colors would need more saturation to fit in.

                                                                              1. 1

                                                                                Thanks for the in depth reply! When I next find the energy to CSS I’ll take a look.

                                                                            2. 1

                                                                              Someone made one but there was something slightly wrong about pre tags in headers that weren’t legible (?), so I reverted it. It was pretty simple so if you’re interested you’re welcome to revive that patch.

                                                                            3. 2

                                                                              Academic style - I like it. Loads in 106ms from Frankfurt which is pretty nice :)

                                                                              1. 1

                                                                                Grüße aus den Staaten!

                                                                                1. 2

                                                                                  I don’t really live in Germany (or understand german for that matter), but when I run https://tools.pingdom.com/ , I use Frankfurt since it has the best ping to Norway :)

                                                                                  1. 1

                                                                                    Oh, lol. That’s “greetings from the US”

                                                                                    1. 2

                                                                                      Greetings from Norway :D Or rather; Beste hilsener fra Norge :)

                                                                              2. 2

                                                                                Nothing wrong with your site. It is a perfect example of what the web was originally created for: Sharing information.

                                                                                1. 2

                                                                                  I really like it. Text-heavy instead of the modern white peace overload with big images that everything leans towards now.

                                                                                  1. 2

                                                                                    Kinda like your website, eh? And you are a cyclist too! :D

                                                                                  2. 2

                                                                                    Clean, elegant styling, simple design, focus on the content (text). Clear links to different parts and an rss feed. Couldn’t make me happier.

                                                                                    1. 1

                                                                                      Glad you enjoy!

                                                                                    2. 2

                                                                                      The way you separated the series on the /blog is something I want to steal.

                                                                                      1. 2

                                                                                        Oh man the implementation is such a hack. If you use Jekyll, please don’t look! :P

                                                                                        1. 2

                                                                                          I am in Python land, so I could not get it even if I looked. :)

                                                                                          1. 1

                                                                                            What do you use to generate your blog? I am considering moving off Jekyll.

                                                                                            1. 2

                                                                                              I use Lektor. It is based on python, so slower to generate the pages locally, but my reasons are listed in this post - why I chose Lektor. See the Why Lektor section.

                                                                                      2. 2
                                                                                        1. 2

                                                                                          The bulleted list under “I like making things” is a little crowded, but otherwise, I love it!

                                                                                          1. 2

                                                                                            And to think I just removed some things :P Do you mean the length? Or the density of links? Or…?

                                                                                            1. 2

                                                                                              I should have mentioned that I’m on mobile. The density of the links is part of it. I think inserting an empty line between list entries would make a world of difference. You could take it further by increasing font size and line spacing. The bullets also make it look like the text is being physically squished into the right side of the screen so it may help to replace them with faux bullets (e.g. asterisks)?

                                                                                              I don’t know, this feels like such a small point, and it’s all about highly personal preferences. Your site is great!

                                                                                          2. 2

                                                                                            I really like this one; it’s clean and simple, and it works great with me.

                                                                                            1. 1

                                                                                              Glad you like it!

                                                                                          1. 1

                                                                                            I’d love to see this ethos gain traction. Whenever I’m traveling in a low/no connection region, I’m so grateful to the iPhone apps I have installed that remain useful. My expectation is always that they will be about as useful as a web browser with no connection. Most things are just a thin client. Often you can’t even access things like “messages” that could have easily been stored client side.

                                                                                            Shoutout to Pocket and maps.me. Anyone have offline-friendly favorites?

                                                                                            1. 1

                                                                                              I believe

                                                                                              var _ I = (*A)(nil)
                                                                                              

                                                                                              would save you an alloc all together.

                                                                                              1. 2

                                                                                                While that is theoretically correct, it turns out that

                                                                                                var _ I = new(A)
                                                                                                

                                                                                                is compiled away, so there is no alloc to remove.

                                                                                              1. 17

                                                                                                I wish this much thought was given to millisecond-level input lag more often. I can’t be the only person who makes decisions about apps and websites based on this simple metric. Little details like Personal Capital’s iOS app needing to finish it’s startup login animation before presenting me with TouchID, the sluggish input of Electron apps, etc. drive me nuts.

                                                                                                Sure, there were frequent BSODs, hard freezes, etc. back in the 90s/00s, but I don’t remember feeling like every single program I used felt “spongy” like they do today. Things felt snappy and responsive.

                                                                                                1. 15

                                                                                                  “Software is getting slower faster than hardware is getting faster.” - Niklaus Wirth

                                                                                                  1. 7

                                                                                                    Input buffering was also better back in the day. I would frequently type ahead of slow programs, confident that all my characters would eventually end up on screen. I do not have that confidence any more.

                                                                                                    1. 6

                                                                                                      I consider anything without a working input buffer completely broken. There’s nothing more infuriating than a computer that’s slower than a human and requires the human to back off and retry.

                                                                                                    2. 4

                                                                                                      I still think that Mac OS 7 was pretty much the perfect system. Yeah, yeah, no memory protection, no pre-emptive multitasking; but for sheer [em]getting shit done[/em] it was so much less clunky and [em]gluey[/em] than modern systems.

                                                                                                      1. 3

                                                                                                        Sometimes, it does feel like we have traded all the different types of crashes for a generally slower world.

                                                                                                        1. 4

                                                                                                          If that’s really the trade-off that was made, then it might’ve actually been worthwhile.

                                                                                                          1. 1

                                                                                                            I don’t know about that. I do think it’s nice that we can develop things faster now. But shouldn’t we then modularize them so we can make a more efficient implementation of the more critical parts? GitHub started doing this with Atom, but as of this writing it’s nothing more than a toy project.

                                                                                                            In essence, I don’t believe we have to choose between fast development cycles and having any efficiency whatsoever. I think if we actually plan it out carefully—rather than relying on hype-driven development—we can write our software quickly & messily in a dynamic/scripting language, and have it work right away; but then slowly start making it more efficient.

                                                                                                          2. 2

                                                                                                            I think we’re traded hardlocks for softlocks. I don’t think we’ve notably improved crashes/faults overall.

                                                                                                            • hardlock = crash and burn, computer locks up.
                                                                                                            • softlock = page fails to load in browser. “I’m sorry please try again later”. Even better: “logic bugs”, including when pages/features don’t work because they have been misplaced in the latest update.

                                                                                                            A lot of this comes from moving to higher level frameworks (native software) and platforms (web browsers).

                                                                                                        1. 13

                                                                                                          This is more like architect or engineering choices, not really what you’d normally consider CTO stuff.

                                                                                                          1. 7

                                                                                                            Depends on the size of the startup. CTO can also amount to basically a team lead of a few devs, or possibly the entire dev team.

                                                                                                            1. 3

                                                                                                              Yeah, just another case of words meaning different things to different people. 👍

                                                                                                              1. 2

                                                                                                                Then why call yourself CTO?

                                                                                                                1. 4

                                                                                                                  When the team is 1 person, you’re t he CTO of yourself!

                                                                                                            1. 2

                                                                                                              Seems like a new p2p messaging app pops up every year. I wish you luck but I can’t see it even passing tox which is fairly unusable.

                                                                                                              1. 25

                                                                                                                Agreed, but it’s fun to work on.

                                                                                                                1. 23

                                                                                                                  THIS is the mentality I admire. Every time I come up with a new project and want to show it off, I’m inundated with “yeah, but X already exists! Why would you make another one?” Because it’s fun! Because I want my own! Because I want to write code!

                                                                                                                  Keep it up, it’s a cool project.

                                                                                                                  1. 12

                                                                                                                    Thank you! Having my own project like this to refactor and perfect allows me to stay sane in the business-focused “it ain’t broke” environment of the real world.

                                                                                                                  2. 8

                                                                                                                    I love this mentality and that’s why I wrote my own p2p chat app too.

                                                                                                                    The most fun part was learning how to punch through firewalls, building messaging on top of UDP, and encryption.

                                                                                                                    Learning is best done through doing.

                                                                                                                    Question , what encryption does your chat app use?

                                                                                                                    1. 3

                                                                                                                      None whatsoever 🙊. All messages are transmitted in the clear right now, to obvious peril. Another goal I’d like to hit is implementing end-to-end encryption I’m interested in using libsignal, but don’t know enough about it to know if it’s applicable in a p2p protocol like this.

                                                                                                                      1. 2

                                                                                                                        I’d like to see yours too if you want to share.

                                                                                                                        1. 1

                                                                                                                          I haven’t worked on it in like a year, though recently started doing some C++17 revamp. It’s called Fire★. It’s interesting that you chose GTK, any reason to pick that over something like Qt?

                                                                                                                          1. 1

                                                                                                                            None other than that the Rust bindings looked mature and are easy enough to work with. I actually started by wrapping it with Swift and making an iOS app. I made some progress but it was pretty hard to maintain the Swift wrapper, wrapping a C interface, wrapping the actual library.

                                                                                                                            Fire(star) looks pretty cool. Next time I have some free time with my laptop I want to play around with it.

                                                                                                                            1. 2

                                                                                                                              Interesting, hopefully the Rust people will get decent Qt bindings. Qt is pretty damn great. If you ever do play with Firestr, PM me your ID and I’ll send you mine.

                                                                                                                    2. 3

                                                                                                                      what’s wrong with tox?

                                                                                                                      1. 3

                                                                                                                        Nothing that I know of.

                                                                                                                        1. 2

                                                                                                                          Last I saw which was a little while ago, It didn’t work well at all on mobile because you need a constant connection to the network which drains your battery and data real fast. Matrix looks a lot more promising for real use.

                                                                                                                          1. 1

                                                                                                                            does matrix have video chat?

                                                                                                                            1. 1

                                                                                                                              It does. It has almost all the features of things like discord and slack but they need to be polished more and sped up.

                                                                                                                          2. 1

                                                                                                                            Doesn’t Tox have occasional developer drama every so often?

                                                                                                                          3. 1

                                                                                                                            Can you clarify what Tox is and, more importantly, why you think it wouldn’t pass?

                                                                                                                            I think you mean “be better than Tox [another messaging system], which has its own usability problems”.

                                                                                                                            1. 2

                                                                                                                              Tox is another P2P messaging system. The Qt client is a little wonky, and I remember having issues when trying to do group chat. Beyond that, it was really nice to use, and the voice chat functionality was surprisingly great. The last time I used Tox was maybe 2014 so maybe it’s changed since then. I think the main thing Tox has going for it ahead of other P2P systems is that it’s relatively popular and well-known.

                                                                                                                          1. 5

                                                                                                                            Though the PROTOCOL.md is fairly light on details, it sounds a lot like S/Kademlia (PDF), is this by design or just a coincidence?

                                                                                                                            Basically it’s the same idea that BitTorrent uses for the Mainline DHT (Kademlia), but with a “Secure” addition which uses IDs that are generated from a public key of the node rather than randomly.

                                                                                                                            1. 3

                                                                                                                              Very much by design. Then chat layer is built on top of a networking layer that is basically a DHT of nodes. I based this part of the project on the design of the Mainline DHT outlined in BEP 5.

                                                                                                                              The network layer is self-bootstrapping, and self-healing. It provides a minimal interface to send a “packet” to any address in the network. It only guarantees that it will deliver that packet as closely to the intended recipient as it can. All the relaying, message acknowledging, etc lives in the chat layer on top of that.

                                                                                                                              Glad you could recognize the design. Thanks for looking!

                                                                                                                              1. 2

                                                                                                                                Very cool. I’m enjoying reading through the code. Good work. :)

                                                                                                                                1. 1

                                                                                                                                  Hope you update PROTOCOL.md once it stabilizes, would be fun to write a compatible client in another language. Chat apps are fun.

                                                                                                                                  1. 1

                                                                                                                                    Definitely. I’d like to get a JS version of this out there, using websockets instead of UDP, so that nodes can run in the browser.

                                                                                                                                    1. 3

                                                                                                                                      Do you mean WebRTC?

                                                                                                                                      That’s kinda the challenge that IPFS has (which also uses an S/Kademlia variant). They have WebRTC nodes in their JS implementation, and normal TCP nodes for the Go implementation, and bridging the two is tricky as there’s basically no full implementation of WebRTC aside from the C++ one.

                                                                                                                                      One fun tangent if you’re into it (something I looked into a few years ago): The IPFS DHT is actually fairly liberal with the kinds of nodes it’ll interface with and messages it’ll pass around. You might be able to graft onto it. (I chatted with the team about this idea, they were not opposed as long as the foreign clients were well-behaving.)

                                                                                                                              1. 18

                                                                                                                                Even still, I wanted to share it because I’ve pushed really hard to get it to a minimally useful state to force myself to finally “finish” one of my ridiculous side projects.

                                                                                                                                I can relate to that. Congrats on getting this far!

                                                                                                                                1. 7

                                                                                                                                  Thank you.

                                                                                                                                1. 4

                                                                                                                                  Very cool, is there an explanation anywhere for how node addresses get mapped to IP addresses and what happens if those change?

                                                                                                                                  1. 6

                                                                                                                                    Each node keeps a routing table of other nodes at varying “distances” from itself (distance being the XOR of their addresses). It’s more complicated, but basically, that table works like a hashmap mapping addresses to IP.

                                                                                                                                    Nodes are regularly announcing themselves to one another. When a node that you already have in your routing table announces itself to you, you update its IP.

                                                                                                                                    Edit: thanks for checking it out!

                                                                                                                                  1. 1

                                                                                                                                    I usually have a pet project going on. Right now I’m working on a decentralized messaging protocol in Rust. Previously it was a Gameboy Z80 emulator.

                                                                                                                                    Not being at the computer all weekend is also good. This year I’m mostly bicycling. I ride ~50-60 miles a week right now. A social ride for fun and making friends, and a training ride where I get my miles and climbing in, both at night during the week. When it’s not too hot, my gf and I usually go for a longer ride with some friends on the weekend.

                                                                                                                                    I’m usually reading a book, and there’s usually an episode or two of a TV show squeezed in on weekends.

                                                                                                                                    1. 3

                                                                                                                                      I’m working on a Kaggle competition. The goal is to classify pictures of plankton to determine ocean health.

                                                                                                                                      I’ve gotten a decent start using an SVM classifier on cropped, resized images, plus their FFT as features. I’m a little discouraged by how long the algorithm took to run (around 8 hours, I think) on my MacBook.

                                                                                                                                      I’d like to iterate faster, but simpler models aren’t doing very well. Adding more features isn’t feasible because of how long it’s taking to run. Not sure what my next step should be: dimensionality reduction, or learning to parallelize. I’ve never made the jump to doing “big data.” I work on problems that can be done on my MacBook, so I’m not sure where to go in that direction.

                                                                                                                                      This is one of two problems I run into when I work on these problems. The other is that I extract all the features I can think of, augment the data in any way I can think of, validate several models and go with the best, and finally optimize hyper parameters. After doing that, I don’t know where to go, but I’m still only in the top 30% on the leader board at best.

                                                                                                                                      1. 4

                                                                                                                                        sigh STI rears it’s ugly head. That’s not to say I don’t like this solution… I do. It’s nice and simple. I’m just always a bit wary when it’s introduced.

                                                                                                                                        Anyway, there’s a bit of refactoring I would do. I would change:

                                                                                                                                        # in ApplicationController#current_user
                                                                                                                                        AnonymousUser.find_or_initialize_by_token(anonymous_user_token).tap do |user|
                                                                                                                                          user.save(validate: false) if user.new_record?
                                                                                                                                        end
                                                                                                                                        

                                                                                                                                        to something like this:

                                                                                                                                        AnonymousUser.safely_find(anonymous_user_token)
                                                                                                                                        

                                                                                                                                        and push the find_or_initialize_by_token and save(validate: false) into the model.

                                                                                                                                        1. 1

                                                                                                                                          Moving the user lookup/create into the model is definitely a nice refactor. You’re right about STI—it usually gets ugly when you use it without necessity. I mostly went with it for clarity of demonstration. I personally prefer using roles to denote user traits.

                                                                                                                                          1. 1

                                                                                                                                            Of Rails' open bugs, about half are ActiveRecord, and STI (from my rough estimate) are about a third of those.