2,860 karma · joined Feb 27, 2013 (13y ago) · 3,465 submissions
comment 3y ago · link · parent
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
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 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
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
comment 3y ago · link · parent
comment 3y ago · link · parent
"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
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
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
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
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
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
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
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
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
The result is that I haven’t had a single bug in production for 5+ years. One even one.
Worth it!