Better HN
topnewbestaskshowjobs
Log inSign up

deterministic

2,860 karma · joined Feb 27, 2013 (13y ago) · 3,465 submissions

Submissions

comment 3y ago · link · parent

That is excellent. It distracts them from interrupting the people who do the real work with pointless meetings and other bureaucratic nonsense. The fewer managers a company has, the more effective and productive it is in my experience (30+ years).

comment 3y ago · link · parent

I am a developer. I use state machines all the time.

I have even written code generators that auto generate hierarchical state machines. Because they are really useful for managing complex logic.

comment 3y ago · link · parent

I would recommend starting with Idris. It has all the power of a typical theorem prover but feels like a cool programming language. It also has a great book to bring you up to speed: “Type Driven Development”.

It will blow your mind.

comment 3y ago · link · parent

Theorem provers are used all the time to prove new things in computer science. A few examples: CompCert, SeL4 etc.

comment 3y ago · link · parent

Thanks for doing the interview Kevin. I have learned a lot from your articles and interviews over the years. Especially how different the math I care about (computation) is from the math that mathematicians care about (structure).

It is great to see that with Lean/mathlib computer scientists and mathematicians have found a way to work together and benefit from the insights and skills of each other.

So please continue doing what you are doing. I believe it will long term have a massive positive impact on both computer science and mathematics.

comment 3y ago · link · parent

Thanks! I just listened to it. What a great interview.

It made me realise yet again that the math used by computer scientists is usually different from the math used by mathematicians. Because what computer scientists care about (computations and proofs) is very different from what mathematicians care about (structures and proofs).

Which means that computer scientists often choose a different foundation for the mathematics they use. Set theory is but one possible foundation. However other foundations (based on type theory for example) are more useful for computer scientists. Resulting in a different flavour of mathematics. And things that are proven to be true in one foundation isn’t necessarily true in another foundation.

However it is all still math. Just different flavours of math based on different foundational axioms.

comment 3y ago · link · parent

I wrote a hierarchical state machine generator years ago that did all of that by simply calling an interface when entering/leaving/staying in a state (tick). Recursively calling the interface when pushing/popping a hierarchy of states. I used it to implement a commercial game. It worked great! It did everything I needed (and more) without having to mix source code in the spec files.

I also implemented a code generator that I am using at work to generate C++/Java parsers from the same (BNF style) spec file. Again without adding source code to the spec files. The generated parsers are used in production and has been for years. The generated code is super clean. With a clear separation between the generated code and the code using it. It would be easy to generate (say) Typescript as well without touching the spec files.

But of course there might be scenarios that you need that I have never needed where embedding source code is necessary. I just haven’t seen any situation where that is required in my 30+ years career.

I always write my own code generators by the way. It’s great fun, it’s easy, and I can make it perfectly fit what I need. And it makes other developers think I am some sort of genius because they don’t know how easy it is :)

comment 3y ago · link · parent

Woman can be bullies too you know.

comment 3y ago · link · parent

To code generation writers:

I highly recommend not having source code in the specification file and instead generate an interface that is called by the generated code.

It allows you to use the same specification file to generate many different languages. Something I need all the time at work (C++/C#/Java/Typescript).

I ended up having to write my own code generators to do this since all the generators I looked at also copied the (really bad) Yacc/Bison/ANTLR/… design choice of having source code in the spec files.

comment 3y ago · link · parent

Simply writing down the steps involved to solve a problem and then breaking the steps into smaller and smaller steps until they are ridiculously simple (as in “pickup the mobile phone” and “call #”) often helps me getting things done when I have way too much on my plate and/or the problems I am facing are too overwhelming.

comment 3y ago · link · parent

I was told a surprisingly simple but deep definition of what Software Architecture really is:

It is the interface/protocols between the components.

comment 3y ago · link · parent

I don’t know what people are complaining about. The amount of quality entertainment available today is breathtaking. From Breaking Bad to The Wire to excellent series from France, Denmark etc. the choices are amazing! Just don’t watch the super hero crap (except The Boys of course!)

comment 3y ago · link · parent

"Comment1": "This is the first comment"

"Comment2": "This is the next comment"

or

"Comments": ["Here is one", "Here is another!"]

or

"Comments": { "Name": "This is the name of the customer", "Age": "This is the age (0 to 1000) of the customer" }

or

"Values": [ {"Name":"Age", "Value":"20", "Comment":"This is the age of the customer"}, {"Name":"Name", "Value":"Mr. Foo Bar", "Comment":"This is the name of the customer"} ]

The only limit is your imagination.

comment 3y ago · link · parent

Not really. The author is comparing the code size of Sectorlisp with full Lisp implementations.

So the author either has to claim that Sectorlisp is a full Lisp implementation, which is clearly not the case, or acknowledge that he/she is comparing apples to oranges.

comment 3y ago · link · parent

> Lisp code is written in a simpler notation than ASTs, it's written as nested lists of objects.

That is exactly what a simple AST is: A tree structure representing the semantics of the code you wrote with no syntax info.

> Hierarchical data-structure: the s-expressions are based on nested lists of arbitrary data. Like symbols, numbers, strings and many others.

This is exactly what AST’s do as well. Whether it contains the semantics of Lisp code or (say) C code.

> S-expressions are no abstract syntax trees, since they capture no syntax information about the meaning of the symbols.

This is a misunderstanding. AST’s capture semantics not syntax. You can pretty print AST’s into a different semantically equivalent syntax if you want. That is what some compilers do: Lisp syntax -> AST -> C syntax.

> That gives an extra degree of freedom: the input to the Lisp evaluator is not an AST (either read or generated by a parser), it's just nested lists of symbols and other objects.

This is not correct. The input to Lisp macros are runtime data structures. Not syntax. Different Lisp interpreters/compiles use different runtime representations. Typically linked lists.

The nodes in the linked list typically have a lot of additional information like type information, column/line data for error reporting etc.

> That means for example that Lisp macros accept code in an arbitrary syntax.

Nope. As I said above, macros accept runtime data. You need to clearly separate syntax from semantics/runtime in your head to understand what is really going on.

> For example this is valid Lisp code when LOOP is a macro and implements its own syntax.

Macros are runtime code executed during the parser stage. It has nothing to do with syntax. Other languages execute macros the same way. That’s why I said above that macros aren’t unique to Lisp.

> The s-expression does not encode basic information like what the meaning of the identifier is.

That is correct. You can define different semantics to the same S-expression.

However for the S-expression to be interpreted as Lisp you need to use the Lisp semantics to run it.

I use S-expressions all the time for configuration files etc. However I use a different semantics. So the S-expression might look like Lisp but it isn’t Lisp in those cases.

> An AST would encode what the construct is: operator, variable, class, ... Lisp s-expressions don't do that.

Nope that is not true. A typical AST for Lisp would have the following semantics categories:

List, Symbol, Integer, Float, String.

That’s it. There aren’t many. That’s what makes Lisp so easy to implement. In other languages you might have 20+.

That’s exactly what I mean when I say that the Lisp syntax directly represents the AST. And no other language does. That is the one feature that makes Lisp unique.

comment 3y ago · link · parent

That makes sense. It is only about 1k of C code and it seems to have everything you need to use it in practice. Including macros.

Its interesting that Altair Basic is 10 times smaller than Tiny Lisp. Basic obviously doesn’t have the features (macros etc.) that Tiny Lisp has. But it looks as if it has what is needed to write practical (console) software.

It wouldn’t surprise me if Forth would be the champion when it comes to minimum implementations.

comment 3y ago · link · parent

I don’t agree. AST-as-syntax (the S-expressions) is the thing that makes a language a Lisp. Everything else (macros/non-typed/GC/Lambdas/REPL/…) is available in other languages.

Note that it is AST-as-syntax that is important. Not the concrete S-expressions syntax. You could use XML or JSON to write the AST-as-syntax instead and you would have a Lisp. However S-expressions are much more concise that XML/JSON.

comment 3y ago · link · parent

You are absolutely correct. Being “smart” is not enough. The way I think about it is:

Competency = IQ * Experience

This is why you will often see less intelligent but more experienced developers outperform higher IQ less experienced developers. And why high IQ developers with 30 years of experience in many different software development areas are so valuable to a company/team.

comment 3y ago · link · parent

Because 99% of “cybersecurity folks” that I have dealt with in the past were incompetent bureaucrats or (worse) consultants who had zero clue on how to actually make systems secure.

All they did was to email checklists full of demands for specific tech or protocols to be used that either was completely unnecessary, actually wouldn’t work for our project, had publicly known security issues, and/or would not make the system more secure. They almost always had no clue when I asked them for the threat model they were basing their demands on.

Don’t get me wrong. I am sure that there are competent “cybersecurity folks” out there. I just haven’t met a single one in my 30+ years career. YMMV of course.

980.

Day in the Life of a Japanese Game Designer(youtube.com ↗)

1 points · by deterministic · 3y ago · discuss

comment 3y ago · link · parent

Heh have you actually worked with lawyers? They are paid by the hour and will do whatever it takes to increase the number of hours as much as possible. And the end result will be a contract so convoluted and muddy that they again will have to be hired to interpret their own work if there ever is a dispute. Lawyers is a racket.

In a previous company we realised that it was cheaper and way faster to hire a lawyer than using external lawyers. The difference in results was night and day.

comment 3y ago · link · parent

Here is what you do:

When you are ready to release the next version of your software, you simultaneously release 50+ “cracked” versions of the software on as many pirate sites as you can find.

The trick is that the “cracked” versions of the software is actually just demo versions that will stop working after some time and prompt you to buy the real thing.

You also add comments to pirate sites on all really cracked versions of the software claiming that the cracked software erased your hard disk, that the software is trying to black mail you, that it was cracked by interpol to catch pirates etc. etc.

Of course using hundreds of different user names to hide the fact that it is really your company doing it.

And you of course reuse “real” pirate names and claim that those other users are fake and/or police traps.

And even better: use an AI to automate all of this. Make it really expensive and frustrating to try and get a cracked version of your code.

You are welcome.

comment 3y ago · link · parent

It was enjoyable reading the code. And yes it is Lisp. But without (for example) basic integer/float types and operations. So you can’t do (+ 1 2).

And yes you can of course implement math Peano style by using lists to implement numbers. But it would be impractically slow.

You also can’t directly read/write memory, making low level hardware IO impossible.

Please don’t get me wrong. This is not a criticism of the work at all! I love it! I just want to point out that a lot more code is needed to have a minimum practical Lisp.

So I wonder if anybody has implemented a minimum practical Lisp that basically gives you the operators C gives you? Given that you could in principle implement a Linux like OS.

comment 3y ago · link · parent

I never write unit tests. However I have written more than 1000 end-to-end system tests for one of the very large C++ libraries I am maintaining. And I am generating an additional 9000 regression tests from large customer examples using the library.

The result is that I haven’t had a single bug in production for 5+ years. One even one.

Worth it!

comment 3y ago · link · parent

Yaml is the complete opposite of what you want: a simple specification language. JSON is the gold standard to measure against. However one step better IMHO is S-expressions.

comment 3y ago · link · parent

I am not a fan of LISP but I use S-expressions all the time for configuration files, dumping data etc. It is simple yet infinitely flexible.

comment 3y ago · link · parent

“Comment”: ”This is a comment that is optional and ignored by code”

comment 3y ago · link · parent

Air Traffic Control Systems. Avionics. Nuclear Power Plants. Not your average web app.
1
323334
116