Testing candidate's mettle S02E03
-
@accalia said in Testing candidate's mettle S02E03:
Politics scares me.
It enrages and disgusts me. I'm trying to give up the elevated blood pressure and teeth-grinding though, so I mostly stick to the cartoons pages, recipes and sports now. (Fuck! I'm reading the sports pages…)
-
linux$ cat foo.awk
#!/usr/bin/awk -f/^Product name/ { next; }
/^=====/ { next; }{
i1 = NF-2;
i2 = NF-1;
price = $i1;
wt = $i2;
wtt = wt;
if($NF ~ "kg") {
wtt = wtt*1000;
}
if(wtt > 750) {
print price "\t" $0;
}
}linux$ head -n2 data.txt;< data.txt ./foo.awk |sort -nr|sed -e 's/^[0-9\.\t]*//g'
-
@Arantor said in Testing candidate's mettle S02E03:
The whoosh badge will be tremendous. The best whoosh badge ever.
It'll be HOOOGE. (?)
Even if it's from Chaiyna.
-
@Lorne-Kates said in Testing candidate's mettle S02E03:
@Arantor said in Testing candidate's mettle S02E03:
@dse I should build a language, it'd be tremendous, the best language. I'd make the best language. The best. And it'd be tremendous. It'd be so good, and it'd only cost 4 man years to build. I know some people, some good people, we'd build it in less than 8 man years. Ask Sean Hannity, he'll tell you we know some good people and how we could build it in less than 10 man years.
We're going to build a walled garden around your language's context. It'll be a great walled garden, the best. And we'll use your language's compiler and CPU resources to enforce it.
We need this walled garden. When your language is sending it's interprocess communications, it's not sending it's best. They're sending communications with lots of problems. They're sending malformed packages. They're bringing buffer overflows. They're bringing command injections. They're bringing malware. They're rapists. And some, I assume, are validated packages.
Sounds like your language is JS to me...
-
@Dreikin All I want to know is, how much work did it take to produce that mockup? Or did you take a SE page and modify the HTML before screenshooting?
-
@pydsigner said in Testing candidate's mettle S02E03:
@Dreikin All I want to know is, how much work did it take to produce that mockup? Or did you take a SE page and modify the HTML before screenshooting?
Just modified an existing page. I didn't even change all the text, so you can figure out which one it was.
-
@pydsigner said in Testing candidate's mettle S02E03:
Sounds like your language is JS to me...
Make America Ghostery Again.
-
@Lorne-Kates said in Testing candidate's mettle S02E03:
Make America Ghostery Again.
Not that kind of candidate!
-
@dkf said in Testing candidate's mettle S02E03:
Provided it is interpreted, you can write a language in a lot less than 4 man-years. Compiled implementations — especially if optimising and going to native code — take a lot more work to write.
Implementation is not so difficult. I had an assignment to make a compiler for a subset of Java, with static typing, polymorphism - the example code was the given test for OO features (I didn't make a GC for it but some people did, at least ref-counting).
It took less than a week full-time (hard to calculate because you always have other courses).
My compilation target was LLVM which then can make machine code for a broad set of architectures and also performs its own optimizations. Other students chose to target x86 assembler so that was also possible.
(can send you the code if you are interested)Targetting JVM is even easier because it maps nearly 1-1 with Java, so its rather like cross-compilation.
On the other hand, designing a programming language that brings new value to the rather saturated space of languages and has a chance of being practically used is a tremendous challenge that requires knowledge, experience and creativity and there is no guarantee of success even if you spend years on it.
class Node { Shape elem; Node next; void setElem(Shape c) { elem = c; } void setNext(Node n) { next = n; } Shape getElem() { return elem; } Node getNext() { return next; } } class Stack { Node head; void push(Shape c) { Node newHead = new Node; newHead.setElem(c); newHead.setNext(head); head = newHead; } boolean isEmpty() { return head==(Node)null; } Shape top() { return head.getElem(); } void pop() { head = head.getNext(); } } class Shape { void tell () { printString("I'm a shape"); } void tellAgain() { printString("I'm just a shape"); } } class Rectangle extends Shape { void tellAgain() { printString("I'm really a rectangle"); } } class Circle extends Shape { void tellAgain() { printString("I'm really a circle"); } } class Square extends Rectangle { void tellAgain() { printString("I'm really a square"); } } int main() { Stack stk = new Stack; Shape s = new Shape; stk.push(s); s = new Rectangle; stk.push(s); s = new Square; stk.push(s); s = new Circle; stk.push(s); while (!stk.isEmpty()) { s = stk.top(); s.tell(); s.tellAgain(); stk.pop(); } return 0; }
-
@Adynathos said in Testing candidate's mettle S02E03:
It took less than a week full-time (hard to calculate because you always have other courses).
Since you had the language spec and it was a simple language to do (all the types up front, static meanings of things) then yes, that can be done fairly quickly. Adding non-trivial reasoning in the language front-end adds quite a lot of work.
designing a programming language that brings new value to the rather saturated space of languages
That's very non-trivial, actually.
and has a chance of being practically used
And that's actually pure luck.
-
@cartman82 said in Testing candidate's mettle S02E03:
@Johan_B said in Testing candidate's mettle S02E03:
I'd like @cartman82 to come back and tell if both of us would have gotten the ball rolling.
You mean if you'd have passed the test? Well, duh. I'm sure anyone here would.
I wouldn't, I've never worked with files. Or compilers. Or computers, for that matter.
-
-
@dkf said in Testing candidate's mettle S02E03:
chance of being practically used - And that's actually pure luck.
It is but you must first give it a chance.
For example, make it easy to use existing libraries / use your code from different languages. Like what Scala does by running on JVM.
-
@Adynathos said in Testing candidate's mettle S02E03:
make it easy to use existing libraries / use your code from different languages
That's a design decision that is both wise and usually ignored by people designing their first language. ;)
-
@cartman82 Only if you work left to right! If you count from the right, the (interesting) columns are in fixed positions.
-
I'll do it tomorrow at work. Cause it sounds nicer than work. A lot nicer. More interesting. Fun. Even.
Filed under: hate fixing bugs. Too much bug fixing those past 4 months. Fucking work. Should go fuck themselves.
-