HNHacker News
TopNewBestAskShowJobs

srhtftw

191 karma · joined October 31, 2022

submissionscomments
srhtftw··on Ask HN: How do you use userscripts?
I use Stylus to override design choice that don't work for me. Generally things like colors, fonts and hard-coded page widths. Sometimes I'll use Tampermonkey to alter content a bit.

Here is one I use to improve my experience on HN.

https://pastebin.com/JQY4cXfU

srhtftw··on A former Gizmodo writer changed name to 'Slackbot', stayed undetected for months

    NO SMOKING.  NO SPITTING.
    THE MGT.
srhtftw··on Pluto, a Modern Lua Dialect
You make a good point: since "pairs" returns all the values as it should, calling the table "corrupted" may be too harsh. It's been so long now I can't recall why the original code I found this problem in used "ipairs" instead of "pairs". It's simply not safe to use "ipairs" on a table containing a nil and the code that did that was wrong.

I think working with newer languages like Typescript have made me unsatisfied with languages like Lua which provide no clear way to prevent this sort of mistake, so I like that dialects like Pluto are showing ways Lua could be improved.

srhtftw··on Pluto, a Modern Lua Dialect
Just tried it online¹ to see how it deals with a long standing problem² I have with Lua and I'm pleased to see actual improvement in the form of a warning:

    script.pluto:1: warning: function was hinted to return string
    but actually returns nil [type-mismatch]
        1 | function foo(x: number): string 
          | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ here
Unfortunately the underlying table was corrupted when the code ran and only

    1 foo
was generated in the output. I would have preferred it to have refused to run at all (will need to look in the docs to see if there's a way to get that behavior with configuration). The purist in me wants more but the practical side of me appreciates that this is definitely an improvement over current Lua.

¹: https://pluto-lang.org/web/#code=function%20foo(x%3A%20numbe...

²: https://news.ycombinator.com/item?id=38030778

srhtftw··on JetBrains is introducing Amper, a new experimental project configuration tool
Sounds like something with similar goals as Hashicorp Otto¹

1- https://web.archive.org/web/20190506063632/https://www.hashi...

srhtftw··on Lua is a viable alternative for JSON
As I mentioned in a previous reply¹ to a post of yours, 15 years ago I hit one of Lua's many footguns when I mistakenly used Lua as an alternative to JSON. To my knowledge no version or variant of Lua has made any progress on addressing this issue.

Lua is nice in many ways but unless you have a pressing need for it I'd recommend sticking with JSON. If you really want executable configurations please consider a newer language like https://dascript.org or https://cuelang.org which provide better type safety.

1- https://news.ycombinator.com/item?id=38030778

srhtftw··on Lua Criticism Is Unwarranted
To me this is a serious flaw and I simply refuse to accept that it's beyond criticism. No language should allow its collections to be corrupted this easily. Especially when a key use of the language is configuring other software.

Fortunately there are other configuration languages available now besides Lua which provide type checking, so I remain hopeful that a future version of Lua or one of the newer typed Lua variants will eventually learn from those.

srhtftw··on Lua Criticism Is Unwarranted
I had the pleasure of working with Lua 5.1 back in the late noughties. For me it replaced Tcl whenever I wanted something I could configure above a C library. At the time I used it I found it quite nice but I'll also not forget the hours I wasted tracking down nil table corruptions which could have easily been caught by a type checker.

I had some hope that Luau https://luau-lang.org or Teal https://github.com/teal-language/tl would make things better but with the following example

    function foo(x: number): string 
      if x == 2 then return nil else return "foo" end
    end
    
    x = { foo(1), foo(2), foo(3) }
    
    for i,v in ipairs(x) do
     print(i,v)
    end
they produce no warning and sadly only print

    1 foo
When I was younger I might have put up with that sort of WTF but now that I have better options I try to stick to type checked languages where I don't have to.
srhtftw··on Bill Gates demonstrates Visual Basic (1991) [video]
> In 1990 we had drag and drop UI creation, double-click on the button and write the code behind it. Where did we go wrong?

Many of us grew tired of being locked in to Microsoft's platform, their simple yet stifling assumptions and their hostile behavior.

Those who walked away from Microsoft's Omelas went in a thousand different directions. While some grew tired of being pioneers and returned or found new walled gardens, others refused to trade their freedom for comfort or simplicity.

srhtftw··on Ask HN: What's the book that people in your field pretend to have read?
Perhaps it's because it's not my field that I found the After Piketty¹ collection of shorter essays easier reading.

1- https://en.wikipedia.org/wiki/After_Piketty

srhtftw··on Moving Marginalia to a new server
The article left me wondering about the cost of the new and old servers and the difference in their price/performance.
srhtftw··on Never write a database, even if you want to, even if you think you should
BerkeleyDB also improved on things like dbm¹, ndbm, qdbm and cdb.

> I would consider SQLite, itself 20+ years old now, the intellectual heir of BDB.

Indeed. I've worked on projects that only use the btree part of SQLite. If all you need is a btree it's a good place to start.

1- https://en.wikipedia.org/wiki/DBM_(computing)

srhtftw··on Ask HN: What entities out there provide open-source grants/funding?
The NLnet Foundation supports organizations and people that contribute to an open information society. It was influential in spreading the Internet throughout Europe in the 1980s. In 1997, the foundation sold off its commercial networking operations to UUNET (now part of Verizon), resulting in an endowment with which it makes grants.

https://en.wikipedia.org/wiki/NLnet

srhtftw··on Searchable Database of the 183,000 Pirated Books Meta, et al., Used to Train AI
> As for the line, I invite you to download books3 and try reading one of the books.

I'm not going to and I suspect anyone who values their time won't either, especially when my public library meets my needs. But the line I'm asking you to look for isn't the one around a single book - it's the aggregate value previously locked in hundreds of thousands of them now released by the power of research like yours.

Even if you don't agree, I hope you appreciate that authors whose works are protected by copyright will feel entitled to a share of that value. Most of them didn't write their works to further ML research.

> Would I do it again? ... that’s a tough question.

I am reminded of when I was young how accessing an unprotected computer wasn't in itself a crime. People like me hacked into systems mainly out of curiosity. Then the media started making movies about teenagers starting nuclear wars with dial-up modems. Then journalists jumped on the hype train to sell their books and convinced people hackers needed to be punished. Then some went to jail and we got things like the CFAA. In a few short years what might have been wrong but wasn't explicitly illegal became so.

You are clearly a smart and intellectually honest person but society often treats such people poorly - especially when confronted by scary new technology - and the tone of your answers are giving me serious Aaron Swartz vibes. There's a lot of money at stake here.

srhtftw··on Searchable Database of the 183,000 Pirated Books Meta, et al., Used to Train AI
I largely agree. I would also like to see more research into how to give authors incentives to license their works for transformative purposes such as training and ways to credit them when the results of inference draw disproportionately on a particular author's work.
srhtftw··on Searchable Database of the 183,000 Pirated Books Meta, et al., Used to Train AI
> I love ML for the sake of ML. I wanted to prove that individual researchers can contribute in a way that matters.

Sounds like someone so focused on "if they could" but not giving much thought about "if they should".

I don't want you or any responsible ML researcher to go to prison. Responsible researchers make mistakes, but responsible researchers also consider the consequences of their actions. How much consideration was given to those? And given everything you know now, where would you draw the line? At what point do the consequences of this sort of research become indistinguishable from theft? Suppose the research enabled the piracy of a high fidelity copy of a single author's work without their permission? Would that be wrong? What about ~2e5 low fidelity copies of who knows how many man years of labor?

srhtftw··on Imba – A friendly full-stack language
This looks interesting. Can this be easily embedded? Could I let my users do some minor customization of my app by giving them an Imba editing window?

Currently thinking about something like Workerbox https://news.ycombinator.com/item?id=33673047

srhtftw··on The Plan for InfluxDB 3.0 Open Source
Anyone evaluating them should be very cautious given their history. e.g. https://news.ycombinator.com/item?id=36657829.

I'm sorry to say I don't have much good to say about InfluxDB. I first considered them around 2015. I loaded about a week of logs from our OpenStack systems into it. It seemed to work so I included it in our set of internally supported systems and started going about the task of adding it to our backup schedule.

Well, perhaps things are different now but at the time the only way to do a full backup was to save the output from a command like "select * from *". Before adding that to a cron task I tried it from the admin console and quickly caused the server to OOM and die.

It was immediately clear to me that this wasn't a company that cared much about reliability since I was able to trivially crash it doing the only thing I could do at the time to backup my system. Obviously nobody at Influx cared about pesky things like backups or workload management, so I quietly decommissioned the system without incident and moved on to other things.

Some years later I watched Andy Pavlo interview their founder on one of the regular CMU database sessions. Andy was very critical at many points, effectively telling him "we told you this wouldn't work". I felt much the same way.

Influx looks very much like a company that may eventually build right thing after building everything else first.

srhtftw··on Skip the API, ship your database
> Because in the last 30 years I've not run into a situation where I needed to have clients execute SQL queries on tiny, static databases let alone still need to potentially update them also.

It was not uncommon in the early 2000's for applications targeting mobile professionals and sales types to work this way, except that instead of SQLite they used things like Notes¹, Jet² and MSDE³. By modern standards these would be considered "tiny mostly static databases" often not exceeding a gigabyte. Instead of connecting over the internet they used serial dial-up file transfer protocols to synchronize with a central database or a mainframe. People would typically download information in the morning, make updates offline and synchronize at the end of the day. A slow trickle of periodic bidirectional updates insured everyone had a reasonably fresh copy of the information they needed.

1- https://en.wikipedia.org/wiki/HCL_Domino

2- https://en.wikipedia.org/wiki/Access_Database_Engine

3- https://en.wikipedia.org/wiki/MSDE

srhtftw··on What's new in Emacs 29.1
Thank you for the recommendation. I will look into building my own tree sitter grammars using https://github.com/casouri/tree-sitter-module as you suggest.

Some time ago I followed this guide https://vxlabs.com/2022/06/12/typescript-development-with-em... and added this to my .emacs

    (use-package tree-sitter
      :ensure t
      :config
      ;; activate tree-sitter on any buffer containing code for which it has a parser available
      (global-tree-sitter-mode)
      ;; you can easily see the difference tree-sitter-hl-mode makes for python, ts or tsx
      ;; by switching on and off
      (add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode))
    
    (use-package tree-sitter-langs
      :ensure t
      :after tree-sitter)
Regarding C++, I tried a simpler experiment starting emacs with

   % open -n -a Emacs --args "-q"
and I think my C++ slowness issue is due to fontlock https://www.gnu.org/software/emacs/manual/html_node/emacs/Fo...

Even without a startup file, I can't open https://github.com/ASDAlexander77/TypeScriptCompiler/blob/ma... and scroll through the file unless I also manually do

    ESC : (global-font-lock-mode 0)
I'm sorry if I gave the impression I'm a regular C++ developer. I only use it occasionally. I just happened to remember finding myself unable to use Emacs for that particular file.
srhtftw··on Ask HN: Has anyone here learned COBOL for fun?
He never got the hang of programming but he did eventually transition into a nice job in finance at a small startup called Sun Microsystems.
srhtftw··on Ask HN: Has anyone here learned COBOL for fun?
Back in the 80's a friend and I took a COBOL course at a community college in the evening when we were in high school. Most students were much older than we were.

We wrote our programs on special pads of paper, transferred them to punch cards, gave our decks to operators who would run our programs on an IBM. Around a half hour later the operators gave us back printouts with the results of our runs. Most people didn't wait around but my friend and I would stay late so we could get more runs in. If we were nice to the operator they might bump our job up in the queue.

Most of the programs we wrote were very simple. Things you could easily do now with a few lines of a modern scripting language.

Our class's teacher was a professional COBOL programmer who had a day job working at a soda company. Some kind of emergency came up at his job half way through the course and he stopped showing up so we were left on our own for a few weeks.

Just before the end of the class the department head took over and told everyone they would need to implement a binary search on the final exam. This was way too hard for most of the other students but not a big deal for my friend and I. We were done in a few minutes.

I was also fortunate to meet another guy in the class who asked me to help him with some programs he had to write at his job. He was a soil engineer who wanted to move into a finance job but found the programming work difficult, so I spent a few hours a week tutoring him and writing programs with him.

Eventually I graduated and he ran out of work for me but by then we became good friends. While I can't say I got much out of of the COBOL class I'm glad I took it because if I hadn't I would not have met him.

srhtftw··on What's new in Emacs 29.1
> https://medium.com/really-learn-programming/setting-up-tree-...

The author made this story available to Medium members only. Sign up to read this one for free.

/sigh

srhtftw··on What's new in Emacs 29.1
For reference, here are my versions

    ________________ M-x emacs-version
    GNU Emacs 29.1 (build 1, x86_64-apple-darwin18.7.0,
    NS appkit-1671.60 Version 10.14.6 (Build 18G9323)) of 2023-07-30
    
    ________________ M-x describe-mode (for C++)
    Minor modes enabled in this buffer: Font-Lock Tree-Sitter-Hl Tree-Sitter
    The major mode is C++//l mode defined in cc-mode.el:
    
    Major mode for editing C++ code.
    Using CC Mode version 5.35.2
    
    ________________ M-x describe-mode (for ts)
    Minor modes enabled in this buffer: Font-Lock Tree-Sitter-Hl Tree-Sitter
    
    The major mode is TypeScript mode defined in typescript-mode.el:
    Major mode for editing typescript.
    
    ;;; typescript-mode.el --- Major mode for editing typescript
    ;; URL: http://github.com/ananthakumaran/typescript.el
    ;; Version: 0.4
    ;; Keywords: typescript languages
    ;; Package-Requires: ((emacs "24.3"))

    ________________ os
    % uname -srm
    Darwin 19.6.0 x86_64

    % sw_vers
    ProductName:        Mac OS X
    ProductVersion:     10.15.7
    BuildVersion:       19H15
srhtftw··on What's new in Emacs 29.1
I'm not really happy with the number of times I have recently had to resort to sending it SIGUSR2 to force it to stop whatever it's doing when I re-indent some code in a file of Typescript. It happens about once a day. When it does I quickly save all my work and restart. I haven't looked too closely at it yet but from what I've seen in backtraces I suspect there's a bad pattern match situation in there somewhere, like what you might get from the exponential behavior of a poorly written regex.

I'm also not happy about the fact that I can no longer open large C++ files like https://github.com/ASDAlexander77/TypeScriptCompiler/blob/ma... in C++ mode without scrolling becoming so sluggish as to be unusable. I either have to disable C++ mode or open them in an older version.

It's good that emacs is getting some long needed attention, but I'm sad the latest version isn't as usable for me.

srhtftw··on Ask HN: As a self-taught developer, what are your self-directed learning tips?
Make it run, make it right, make it fast, make it small.
srhtftw··on WD refused to answer our questions about its self-wiping SanDisk SSDs
> Please do not mistake this for me claiming that running this pool with three disks is anything other than a situation to remediate immediately.

About a decade and a half ago I setup a 48 drive Sun 4540 this way. The OS needed 2 dedicated drives on the first controller so I assigned two neighboring drives on that controller near the intake fans as hot spares. The remaining drives were organized into mirror pairs with each drive on a separate controller. The final root was a concatenation of the pairs.

This setup proved to be very robust. Although I left the company when financial troubles pushed the founders into a messy divorce, one of the founders asked me to come back a few years later after they restructured. The 4540 had been moved to a new colo but otherwise ignored because none of the admins knew Solaris or bothered to check the monitoring systems.

When I returned I discovered in the time I was away 4 drives had failed but ZFS/smf happily took two of the failed drives offline and replaced them with the spares. The two other failed drives left their respective pools degraded but functional. Replacing the failed drives was easy once they arrived.

Although neglected for years, none of the applications or databases that relied on that server ever suffered any downtime from the drive failures.

srhtftw··on TypeScript is surprisingly ok for compilers
I've been hoping to see alternative targets to JS for TS as well. WASM makes a lot of sense but TypeScriptToLua¹ also looks interesting.

1: https://typescripttolua.github.io

srhtftw··on Do you avoid the news? You’re in growing company
I spend too much time on HN to read or watch the news but when I do I generally limit myself to a quick skim of these sites

https://theconversation.com

https://en.wikipedia.org/wiki/Portal:Current_events

https://text.npr.org

https://www.newsminimalist.com

https://ground.news

https://sumi.news

https://www.freshnews.org

srhtftw··on How to pass a first-round interview
If someone asks me this I tell them about the time when I was working late and another engineer who happened to work a few desks away from mine broke our unit tests and tried to pressure me into committing a quick patch to fix them without testing it first so they wouldn't be late to a movie.

I explained I was new to the group, had no special understanding of the code they changed or the tests that failed and wasn't about to deviate from SDLC principles when there wasn't a compelling need. In my view committing an untested change was what caused the trouble in the first place and I had no confidence that the fix they wanted me to commit would make things better. I suggested that they simply revert their change and come back to it later when they had time.

This only made the other person more irritated. They raised their voice and continued to demand I do what they suggested and I continued to politely explain that while I was willing to help them work through the problem, review their code, examine the data or follow any appropriately documented procedure, I wasn't willing to violate proper engineering principles this way. Their shouting started attracting some unwanted attention and they decided to just pack up and leave. Later that evening another engineer reverted their change and everything was fine again.

My manager asked me how I felt about the incident the next day. I said that although their behavior was irritating, I didn't hold it against them. Even the best of people make mistakes when desperate or rushed. Their mind just wasn't in the right place at that time. They really just needed to get away for a bit. What matters is that we move on, try our best to treat each other with respect and remember that we're all part of the same team.

← PreviousPage 3 of 4Next →