darwinrlo / public

0 stars 0 forks source link

Software Engineering #3

Open darwinrlo opened 4 years ago

darwinrlo commented 4 years ago

Static analysis in GCC 10

(It'd be pretty awesome if these comments looked up the title of a pasted link and provided the option to replace the link text with it -- just like in Coda.)

darwinrlo commented 4 years ago

Real Not Complex

darwinrlo commented 4 years ago

Fabulous adventures in coding: Eric Lippert's blog

Hello and welcome to my blog! I’m Eric Lippert; I design and implement developer tools at Facebook.

Before starting at Facebook in February of 2016, I worked on C# static analyzers at Coverity; before that I was a Principal Developer at Microsoft on the C# compiler team and a member of the C# language design team. In my sixteen years at Microsoft I also worked on the design and implementation of VBScript, JScript, Windows Script Host and Visual Studio Tools for Office. I was also once on the ECMA committee which standardizes the JavaScript language.

darwinrlo commented 4 years ago

It seems that the proliferation of software engineering interview prep products has increased the depth of the field and consequently raised the bar at top companies like Google and Facebook. This is good for the profession.

darwinrlo commented 4 years ago

The Hardest Program I've Ever Written

I work on the Dart programming language. Part of my job is helping make more Dart code, readable, idiomatic, and consistent, which is why I ended up writing our style guide. That was a good first step, but any style guide written in English is either so brief that it’s ambiguous, or so long that no one reads it.

Go’s “gofmt” tool showed a better solution: automatically format everything. Code is easier to read and contribute to because it’s already in the style you’re used to. Even if the output of the formatter isn’t great, it ends those interminable soul-crushing arguments on code reviews about formatting.

Of course, I still have to sell users on running the formatter in the first place. For that, having great output really does matter. Also, I’m pretty picky with the formatting in my own code, and I didn’t want to tell users to use a tool that I didn’t use myself.

Getting that kind of quality means applying pretty sophisticated formatting rules. That in turn makes performance difficult. I knew balancing quality and speed would be hard, but I didn’t realize just how deep the rabbit hole went.

I have finally emerged back into the sun, and I’m pleased with what I brought back. I like the output, and the performance is solid. On my laptop, it can blow through over two million lines of code in about 45 seconds, using a single core.

darwinrlo commented 4 years ago

Discover the best YC advice for startup success

darwinrlo commented 4 years ago

Ask HN: Computer Science/History Books

Really great recommendations for non-technical books!

darwinrlo commented 4 years ago

Possible alternative to algebraic data types.

Define a class Result<T>. T is the type of the object that is returned. Methods should return Result objects.

Another possibility is for the result of function call to be

The disadvantage here is that the code deviates from mathematical expressions.

Functions that evaluate mathematical expressions could be a type of function within the language.

Scala is truly the next iteration. Though I haven't looked into Clojure or Kotlin at all.

darwinrlo commented 4 years ago

Effective C: An Introduction to Professional C Programming

darwinrlo commented 4 years ago

Writing an OS in Rust

I like the blogging system that the site owner is using.

Also, this is intriguing:

The first step in creating our own operating system kernel is to create a Rust executable that does not link the standard library. This makes it possible to run Rust code on the bare metal without an underlying operating system.

darwinrlo commented 4 years ago

The mindset you bring to a situation is very important. A mindset that is not a match for the situation will lead to negative emotions that, at best, need to be addressed, adding unnecessary friction. At worst, they are counterproductive and block you from achieving your goals.

darwinrlo commented 4 years ago

I can't just read. I need to be seeking to do something. It could be taking notes -- putting things into my own words -- or even just finding things to underline (extracting takeaways).

(This comment made it into the wrong place. I'd like to be able to move this to another issue. When comments are moved between issues, the links to them should be preserved.)

darwinrlo commented 4 years ago

Brilliant: Learn to think

darwinrlo commented 4 years ago

I don't think we need operator syntax (a op b) for operations (which are just functions). I think method call syntax is just fine (a.op(b)). Though I can see the argument for prefix notation ((op a b)), such as used in Lisp, in which case I would personally prefer brackets over parentheses ([op a b]). Even better would be just Op[a, b]) -- in fact, it'd be pretty sweet to be able to take a list and apply an operator to it.

I get the desire of infix operators for arithmetic expressions, e.g. 1+2. But I still think prefix notation is better, i.e. (+)[1, 2].

For things that are not operations, such as relationships (which return a boolean value), the infix operator notation makes a lot of sense. Example: a isSiblingOf b. For more than two values, prefix notation still makes sense, i.e. areSiblings(a, b, c). Even if it's just two values, areSiblings(a, b) would make more sense than a areSiblings b -- the pattern here seems to be bidirectional relationships. For relationships (as opposed to operations), I prefer parentheses over brackets. :^)

As much flack as it gets, I do like using postfix and prefix unary operators for incrementing variables, e.g. ++i and i++.

I like camel case for variable names. For functions, I'd actually prefer capitalized names, e.g. Oldest(darwinLo, johnnieLo). Though I like camel case for names of boolean functions, e.g. areSiblings(a, b).

I don't like implicit order of operations. Everything should just be parenthesized.

I'd love to be able to specify a graph declaratively.

Node a, b;
Relationship isParentOf, isChildOf;
a isParentOf b implies b isChildOf a;
a isParentOf b;
if b isChildOf a
  Print("Hello!")  // should print!

(I like semicolons when you're adding something to the state, such as declaring a new variable or adding a relation.)

Even something like:

type Node;
Node a, b;
Relationship isParentOf, isChildOf;
BiRelationship areSiblings;
a isParentOf b iff b isChildOf a;
a isParentOf b and a isParentOf c implies areSiblings(b, c);
Node a, b, c, d;
a isParentOf b;
a isParentOf c;
a isParentOf d;
areSiblings(b, c, d)  // returns true

I do like distinguishing between expressions and statements. Statements should end in a semicolon.

There are two types of if-else structures actually. Sometimes, they're control structures. Sometimes, they're expression evaluators.

x isParentOf b implies b isChildOf a

The following is added.

a isParentOf b b isChildOf a

And a relationship can be queried: a isChildOf b is an expression that returns true or false.

The primitive values are very important.

This could be the DSL I need to work on my LeetCode solver.

You can express the recursive substructure (the optimal substructure as the case may be), and the code will generated for you, memoization and all.

type Box(width: Int, height: Int, depth: Int);  // A type is an interface.

class Box implements Box {  // A class is an implementation.
}

Relationship <Element> isElementOf <Set>;
e isElementOf l;
a isElement b iff a contains b;  // iff can be used to define synonyms.

I don't like getters and setters in Java. Better would be preprocessors and post-processors for properties.

I like the idea of inheritance without subtyping. Maybe have an inherits keyword.

Idea: Ranges can also be specified for a given type.

TODO Define a list recursively.

<List> :=: <Head> :: <Tail: List>

Idea: Keywords are bolded. If it's not bolded, it's not a keyword.

We need to do something about comments. Comments should not be part of the source text. They should be done by the editor. They should collapsible. You should be able to add comments to lines. But you should also be able to annotate specific sub-expressions.

For an editor, something like Workflowy would be great. So you can collapse and expand code. You can add comments. Maybe Lisp is better suited for an editor like Workflowy.

I like Python's use of whitespace. I don't like Java's braces. It should be indents, not spaces.

Why are we still coding up recursive algorithms by hand?

I do like this construct.

x = 3 if y = 5;

I think Scala has this.

I do like the use of colons in one-liners, e.g. if x == 4: x += 1. And I do like omitting the return keyword whether in a one-liner or not, e.g. if x == 4: x + y. The value of the last expression of a function body is what is returned.

I wonder if programming languages should support subscripts, superscripts, and so on.

darwinrlo commented 4 years ago

I'm really digging the addition of unsigned integers to Java.

darwinrlo commented 4 years ago

An expression can be a subtype of LanguageConstruct. The language object can be computed at runtime. For example, a function can be computed and returned. Then it can be applied to the expression next to it.

Functions should be "first-class" values. That is, we should be able to pass them to and return them from functions. Objects should also be first-class values.

For some types of problems, functions are the way to go. For others, objects are the way to go.

For some types of problems, expressing something declaratively is the way to go. For others, expressing them procedurally is the way to go.

darwinrlo commented 4 years ago

A DSL for problems that can be solved recursively.

Excellent test cases

The system should automatically infer that an array is sorted.

isSorted

The system can think ahead and see if an array being sorted would help with the algorithm.

darwinrlo commented 4 years ago

Linux Academy

Experience interactive courses in AWS, Google Cloud, and Azure and master the tools that shape technology.

darwinrlo commented 4 years ago

You can represent summations pretty easily in Scala or Python, e.g. sum([i+1 for i in range(0, 5)]).

darwinrlo commented 4 years ago

Completing the square

darwinrlo commented 4 years ago

10 Things I Hate About PostgreSQL

darwinrlo commented 4 years ago

The Phoenix Project

darwinrlo commented 4 years ago
darwinrlo commented 4 years ago

Lean Book: The Hitchhiker's Guide to Logical Verification (HN)

darwinrlo commented 4 years ago

Product Management

darwinrlo commented 4 years ago

Software Engineering

darwinrlo commented 4 years ago

Security

darwinrlo commented 4 years ago

Computer Science

darwinrlo commented 4 years ago

Artificial Intelligence

darwinrlo commented 4 years ago

How Bochs Works Under the Hood

darwinrlo commented 4 years ago

Kaleidoscope: Implementing a Language with LLVM

darwinrlo commented 4 years ago

Python is pretty good as pseudocode. I wonder if Julia is even better.