HNHacker News
TopNewBestAskShowJobs

emidln

3,031 karma · joined November 7, 2011

I mostly use eBPF/C/C++ these days but I used to write lots of Clojure, Python, Java, and SQL, with smatterings of Lisp, Ruby, and Javascript where need be.

I'm attached to a tmux session. gdb is probably running in a split with vim.

My views are not necessarily those of my employer.

I live in the Chicago burbs, but I work in the loop. I'd love to buy you a tea, coffee, or a beer to talk about start ups, Clojure, C++, Lisp, Python, toolchains, Bazel or other tech.

github: https://github.com/emidln

bsky: https://bsky.app/profile/emidln.com

email: emidln@gmail.com

submissionscomments
emidln··on Exit interviews are a trap
I've given exit interviews on occasion and they've been generally beneficial as well. One kept the door open to return to the company a year later with the money I asked for and mandate to do the things I said I wanted to do when I left. The other helped the company after I left to course correct and bought me free drinks whenever I'm in a particular town. If I'm leaving it's likely just a business decision (whether informed by management, direction, or dollars) and there's no reason to close the door on future business (with that company, those coworkers, or investors) to revel in some spiteful comments.
emidln··on Reproducible Builds in January 2022
I admit I've never tried this, but the Linux kernel seems like just another C program. What's to stop me from installing GNU Make, GNU coreutils, gcc, and binutils cross compiled to target x86_64-linux-elf and bootstrap this? It doesn't sound especially useful, but it does sound like something that would be possible if you focused on it.
emidln··on Why Not Having a CS Degree Is Awesome (2019)
Several fields have tiered roles where bootcamps/community college programs are used to fill some of the roles. Several of these are now considered trades jobs, like electronics repair or certified nursing assistant. Depending on the regulations there might or might not be a path from community college program to an advanced role in the field without a college degree. In most of the world, you can't go from a CNA to an RN (Registered Nurse) or an MD with just experience.
emidln··on Hacking a VW Golf Power Steering ECU
Most ECUs have diagnostic messages that can read/write memory. This is often intended to be controlled by what "mode" the ECU is in (manufacturing/engineering/production/dealer-service), but these aren't always well tested or properly implemented controls. Fuzzing these leads to weird behavior and state machines with not-well-tested transitions. Whether you can reset these to a known state is ECU specific, and often will involve knowledge that isn't publicly known.
emidln··on Better SQL JOINs
This is a good use case for an AST-based query compiler which would allow construction of clauses in arbitrary order. Using HoneySQL in Clojure, I frequently would write:

  (-> (from [:cities :c])
      (join [:population :c] [:= :c.name :p.city-name])
      (select :c.name :c.pizza-rank :p.population)
      (order-by [:c.pizza-rank :asc]))
It's handy for a lot of reasons, but unless I had mostly static queries (changing just some where clause params), I would always seek out a AST library rather than attempt string building for a SQL use case.
emidln··on Hackerrank DMCA Notice
They are giving you javascript which executes on your machine in a browser you control. You can override those APIs do do whatever you want. In my teens, this would probably have served up goatse. Now it's likely to get a picture of a stick figure labeled with my name. They might get upset about defeating the webcam. They probably won't hire you. Whether you can afford to stand up to surveillance as the norm depends on your personal views and financial situation.
emidln··on Drunken-Driving Warning Systems Would Be Required for New Cars Under U.S. Bill
Sure, but my car doesn't offer any way of feedback so I can tell them it's broken now. Are they testing the weird intersection layouts found in my suburb of Chicago? Further, why doesn't the alert threshold vary based on whether there is an obstacle or vehicle in front of me (they already detect this for other functions)? It's possible that these problems are going to be solved, but the software that will be released on MY2026 will be largely finalized by 2023 (2024 at the latest) which is coming up fast. While I'd love to believe that all of the safety systems are built on the same modular software architecture and I'm going to get upgrades on my MY2026 (which basically only happen in govt-forced scenarios right now), I don't have a lot of faith in this. It would be really nice to see safety systems evolve over time to get better, but this hasn't been common in any ECU to date and I don't see it becoming common unless the government also mandates it along with their fancy surveillance.
emidln··on Drunken-Driving Warning Systems Would Be Required for New Cars Under U.S. Bill
I've been wondering what the newest and safest car I could own that doesn't report back or at least could have its reporting removed without bricking the vehicle. Do you have any specific vehicles in mind?
emidln··on Drunken-Driving Warning Systems Would Be Required for New Cars Under U.S. Bill
My current driver monitoring system (Subaru Outback 2020 with whatever bells/whistles were available) was distracting and wrong so often that I had to disable it. With it on it would try distracting me with flashing messages and beeps while I was navigating 6 way intersections where I live. It was constantly unhappy that I wasn't looking exactly straight forward out the main window. The worst was probably highways where there was nothing in front of my vehicle for a quarter mile or more but I needed to look over my shoulder extensively to be able to safely change lanes out of the right-hand lane into the busier left hand lane.
emidln··on From macOS to Arch Linux
I thought this was a dealbreaker until I installed an SSD in my laptop in the mid to late 00s. When my machine is fully graphical in less than 5 seconds, I just didn't care. My browser restored tabs, my editor restored everything, my desktop restored windows. It was a complete non-issue as long as the machine could cold-boot quickly. As an upside, my machine also no longer overheated if I forgot to long press the power off prior to putting it in my backpack.

I configured my current laptop to screen off on lid close and to shutdown after 5 minutes. I'm probably just weird.

emidln··on Xorg-Server 21.1.0
I successfully use X11 and its network and OS transparency daily. Macbooks don't have 2TB of RAM or schedule 256 threads at the same time.
emidln··on Which jobs most often pair together among married couples
Why is an expensive party important? You can certainly get married at a Church or at a courthouse for pretty cheap and a party isn't required, but even if it is, you can throw a decent party without thousands of dollars spent. I've been to many of them in small towns across the Midwest.
emidln··on Show HN: Python library to overload functions based on interpreter version
This isn't pretty, but it's possible:

  import sys
  if sys.version_info[0] < 3:
      print("Needs Python 3+")
      sys.exit(1)
  else:
      prog = r'''
  
  def help():
      print("Help: ...")
  
  def do_spam(*args):
      print("spamming")
  
  def main(args):
      match args:
          case [subcommand, *args]:
              return globals()[f'do_{subcommand}'](*args)
          case _:
              return help()
  
  if __name__ == '__main__':
      try:
          status = main(sys.argv[1:])
          sys.exit(int(status if status is not None else 0))
      except Exception as e:
          import traceback
          traceback.print_exc(e)
          sys.exit(1)
  '''
      compile(prog, '', 'exec')
      exec(prog)
emidln··on Ask HN: Solo-preneurs, how do you DevOps to save time?
I think you mean automation is very useful. I've worked in a lot of places where we had a single `make deploy` that could compile, test, upload the artifacts, deploy the artifacts to hosts, start the new services, and slowly transition the load balancer to point at the new instances while automatically backing out if error metrics started lighting up. This is just automation, it doesn't have to happen on every commit. Especially when working solo or on a small team, I might not want to maintain a lot of VCS branches and instead, just deploy when I feel it's ready. You have to do all of that stuff anyway, so if you later decide to hook it up to a VCS trigger, you're all set.
emidln··on Companies that use Lisp extensively
Why? The things people often list above language are table stakes. I wouldn't give up a high salary to work in Clojure for a low salary, but that's not a choice you have to make. I wouldn't give up interesting problems, fully paid insurance, a good team, 4+ weeks of vacation, etc but again I don't have to give up any of those to work in Clojure. The choice isn't some ideologically pure Clojure startup scraping by versus proper pay + benefits at a large enterprise.

If you're doing application development, it's nice to have a language that truly cares about backwards compatibility and interoperability with a common platform. It means I can focus on solving problems and not incidental complexity. I can easily hack Clojure from the comfort of a pom.xml if necessary.

I'm not working in Clojure right now because I found interesting work outside of application development, but when I was last looking in 2018, I could get roughly all of the things I wanted from a job and still hack Clojure from a CIDER REPL in Emacs all day.

emidln··on A Git Implementation in Awk
You don't have to in bash because you can just declare that your array is global inside your function. In fact, this is the default behavior.
emidln··on U.S. Tech Salaries Grow, but Not for Everyone
This depends on the org, but an org that insists on putting me through a timed algo test isn't a place I care to work for.
emidln··on U.S. Tech Salaries Grow, but Not for Everyone
You can also tell employers "no". I did it in the last round and of 6 companies that tried a leetcode-style interview, only 1 ended talks. I received offers from the other 5 despite not giving them a bullshit timed algo interview.
emidln··on Not -Werror considered harmful
This seems like your compiler toolchain definition should have been a part of your build system's graph. I do this exact thing, with -Werror on, and bumping to a new gcc version or clang version typically exposes new errors that will be blocking on gerrit until I fix the corresponding now warning code. Bazel makes this easy, but you can definitely do it with CMake or other systems too.
emidln··on Chip shortage leads carmaker Opel to shut German plant until 2022
TPMS works by calculating the RPM of the wheel and knowing the tire size and vehicle speed. Most TPMS setups don't know the actual pressure, they infer it.
emidln··on Shenandoah in OpenJDK 17: Sub-millisecond GC pauses
This is possible with a mostly Java application (assuming you're willing to venture into user-space network stacks with either a JNI bridge or shared memory with a C/C++/Rust). You only really people go out of their way for this when doing HFT or very high throughput networking apps.
emidln··on The number of legal chess positions estimated at 4.5x10^44 – proof games wanted
I've experimented with using factoradic (mixed radix) numbers to index into the combinatorial gamestates for Magic the Gathering.
emidln··on Receiving FLEXlm Error -88,309: System Clock Has Been Set Back (2020)
Cracking IDA Pro used to be part of the experience.
emidln··on Write an SQL query builder in 150 lines of Python
Parameters have zero bearing on whether you should dynamically construct SQL strings. If parameters can solve all of your problems, you don't have a dynamic SQL query, you have user-submitted values in a WHERE clause.

What can be parameterized depends wildly on the SQL database in question. I haven't used one that could parameterize table names (for use in dynamic JOINs or CTEs) and many cannot parameterize values outside of a WHERE clause. Dynamically selecting which function to call, clauses to add or subtract, and sort orders are just a slice of places parameters don't help.

In short, parameters alone do no eliminate the need for a query builder. A good query builder should appropriately parameterize values as the underlying database supports and hopefully uses a type system or validation to constrict the domain of values it uses to construct parts of the expression that cannot be parameterized.

emidln··on Write an SQL query builder in 150 lines of Python
I've written a lot raw SQL in the dialect my language supports. This is fine for static queries. When queries are dynamic (maybe they come from an admin panel or some other part with lots of optionality), static SQL isn't enough. You then get to do one of three things: ad-hoc string manipulation, rely on a query AST->compiler (like SQLAchemy's core or HoneySQL), or an ORM. ad-hoc string manipulation is a real security and reliability nightmare, and if you don't have a good standalone query AST to SQL compiler, an ORM is the next best thing.
emidln··on Google employees who work from home could lose money
Hedge funds and trading firms. Google doesn't pay the most.
emidln··on Amazon SQS is 15 Years Old
It's really not hard to pick a natural key to use for idempotency in your persistence layer. If you don't want at least once delivery, why are you picking SQS instead of some random ephemeral queue like NATS?

I second the parent post. I've billions of messages through SQS at a previous job and I can remember having issues with SQS availability exactly once (due to a systemic failure involving DyanmoDB where cascading failures took down almost everything (and all of our integrations) that would have hosed us completely if not for our durable-queue/s3-journal[0] at the edge). SQS is simple to use, does what it says, and has very good SDK support. A++++ Would build a business on top of again!

[0] https://github.com/Factual/s3-journal

emidln··on Installing Linux into a 286 laptop from the year 1989
Xenix (an official port of System 7) was available for Intel 286s from Microsoft. There were a number of Unix-like systems for 16 bit systems, and the Ancient Unixen were initially running on 16bit processors (notably the PDP-11). You can run 16bit unix in a simulator today.
emidln··on Data notation in Clojure
You can turn this feature off, either via a system property or by binding read-eval to false. e.g.

    ;; don't let randos launch missiles
    (binding [*read-eval* false]
      (read-eval "#=(launch-missiles!)"))
emidln··on Why did we ever think the first programming language didn't matter?
I've seen a lot of professional programmers pick up Clojure from varied backgrounds and come to write idiomatic functional Clojure. I don't actually know many people who use Clojure daily whose first language was a Lisp or an ML, everyone seems to learn Javascript, Python, or Java. Some of the older programmers learned assembler or C/C++ first.

Clojure really encourages data-oriented programming, similar to what you often find in Python codebases. Mutation isn't the default in clojure for common data structures, so writing your iterative code is just more work than writing functional code using the immutable defaults. Language design has a big impact here. That's not to say you can't write imperative mutation heavy code in Clojure, but you're either going to fight the language or build up your own utility libraries to do it. It's there, but it's rarely idiomatic and often seen as a performance tradeoff.

← PreviousPage 4 of 30Next →