Better HN
topnewbestaskshowjobs
Log inSign up

terminalcommand

1,673 karma · joined Sep 27, 2013 (13y ago) · 683 submissions

Corporate lawyer with a passion for computers.

Software design and implementation should be a joyous art, a kind of high-level play. If this attitude seems preposterous or vaguely embarrassing to you, stop and think; ask yourself what you've forgotten. Why do you design software instead of doing something else to make money or pass the time? You must have thought software was worthy of your passion once...

To do the Unix philosophy right, you need to recover that attitude. You need to care. You need to play. You need to be willing to explore.

Submissions

comment 4y ago · link · parent

From my conversation with lispm above, I discovered that each binary SBCL produces includes the compiler as well. This is what is meant by incremental compilation I get it.

When I first heard the term incremental compilation, I thought of a process like going through the ast couple of times and evaluating expressions. This wasn't what it meant. Now it makes sense. You include the lisp compiler in each binary. For parts you cannot evaluate at compile time, you compile at runtime, just like a JIT.

comment 4y ago · link · parent

REPL is the interpreter isn't it? When you type the code into sbcl you are using the REPL which is the interpreter.

Try running sbcl without the REPL and produce an executable binary file. Maybe the binary representation changes into something with dynamic dispatch?

comment 4y ago · link · parent

You are dissasembling inside the interpreter. Interpreter already reads, evaluates before generating the assembly code. How does EVAL work if the entire program is compiled AoT?

comment 4y ago · link · parent

How can you evaluate a complex macro at compile-time if you are doing AoT compilation? Lisp macros are not like C macros where simple substitution would suffice, they need to be evaluated.

I found my exact question on stackoverflow: https://stackoverflow.com/questions/7072980/how-do-you-compi...

The answers on SO are still not clear to me, some people say the macros can be evaluated at compile time, some say that the runtime needs to include some kind of interpreted to run macros. Some say incremental compilation is key to understand how macros get evaluated at compile time.

I will run experiments on this.

comment 4y ago · link · parent

Thank you, I didn't know about the jsr instruction. I always imagined forth does this somehow with jmps.

Another main difference from true compiled code is that your entire program consists of subroutine calls. There are no inline instructions and a main function.

I've got a lot of reading to do on this. "Indirect jsr", I'll experiment with this.

Okay I'm convinced, forth is not interpreted when it's compiled to threaded code :). There is no main loop that reads instructions and dispatches them dynamically, the program flow is linear with subroutine calls stacked under each other.

comment 4y ago · link · parent

I am not saying lisp is not performative. I am still not sold, I will make my own experiments and report back.

comment 4y ago · link · parent

I want to look at it to understand. But my guess is that this happens at runtime, doesn't it. If this happens at runtime, this means runtime evaluates the macro, lisp function is generated, generated lisp function is compiled and used.

comment 4y ago · link · parent

Forth's homoiconicity seems to be disputed: https://wiki.c2.com/?HomoiconicityClassification

comment 4y ago · link · parent

I know that lisp compilers compile compute heavy trivial functions directly to machine code. But how is the output of a program containing a lisp macro for example. Let's say define a lisp macro don't call it and generate its assembly. What is the machine code output? This is the part I'm speechless about.

"The logic inside that helps dispatch based on the dynamic types at runtime" is the interpreter part IMHO. Plus you need logic to add the metaprogramming elements that require you to change the code after it has been written.

We need to generate an example of something we can't do in C, something which requires evaluation at runtime.

comment 4y ago · link · parent

This is exactly what I'm talking about. Go is a statically typed C-like compiled language. It can convert the code much or less in its entirety to machine code. Lisp and forth on the other hand cannot, I think. They need some kind of interpretation at runtime to function so dynamically. If this is not the case, please prove me wrong. The distinction between compile time vs run time bugs me a lot.

I think it is easier to say forth is closer to compiled. I can kind of imagine each user defined word being translated into assembly. With lisp I am speechles.

comment 4y ago · link · parent

That is true, but some sort of a runtime bordering on being an interpreter needs to exist doesn't it. Because my brain cannot comprehend how you can do metaprogramming with macros etc. with static code.

My opinion was that the compiled lisps precompile as much as possible (calculations etc.) into assembly and leave bits they can't compile intact, that's what make them fast.

comment 4y ago · link · parent

What is the difference between a runtime and an interpreter? I still believe forth is interpreted. Forth uses a small set of functions in assembly as its runtime/interpeter.

Your quote looks like its about bootstrapping the Forth ecosystem. After writing fetch and store operations in native assembly, you can bootstrap the forth system that is logical. This is the way Chuck Moore first used Forth anyways. He had no interpreter/compiler back than, he wrote some functions to aid him circumvent assembly and make his code portable. It is genius, but I think it's still interpreted.

You can compile python to bytecode and run it in python's vm, does this mean your python code is compiled. IMHO no, it is compiled for the python vm and python vm interprets it. Same thing applies to Forth.

Forth is interpreted, even if you compile and package it in a standalone executable binary.

comment 4y ago · link · parent

Forth is still interpreted. Forth's genius is that it's interpreter is so tiny that it fits as a runtime.

comment 4y ago · link · parent

In homoiconic languages like lisp I think you'd need more flexibility than vectors.

What if you need to remove an item for example, do you need to shift all remaining items to keep order or mark the removed section with Xs so that the cursor jumps to the next data item.

You need to be able to randomly access bits and pieces to form a network.

comment 4y ago · link · parent

Nah, I don't agree with this. Lisp is inherently dynamic, there is much more going on than just automatic garbage collection.

To achieve the same-level of expressiveness in C you need to craft an interpreter, dynamic memory allocation doesn't cut it.

I once wrote a simple linked list library in C to achieve lisp like functions, things got complex very quickly. I still dream of writing a garbage collector for it and evolve it to a lisp like state.

Like Greenspun said, I believe any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp.

comment 4y ago · link · parent

I haven't come across him. He may have preceeded my time and abilities at that time:). I hanged around in ceviz.net during middle school, I guess around 2008-2010. Before that I was to small to write code. My parents had bought me a Javascript book and teach yourself c++ from Herbert Schildt from a local bookstore. Javascript book was easy, C++ book was hard :). So I abandoned the book shortly after learning cin, cout, iostream and Ali was there to help me out write some programs. I still remember this. I had written a basic calculator in c++, insert number 1, insert operator, insert number 2 kind of something. Ali wrote to me why don't you write it so that it doesn't require you to enter seperate inputs. That question lingered on my mind for a long time and led me into learning about parsing and writing interpreters years later.

comment 4y ago · link · parent

Go Ali! When I was a little kid trying to get my feet wet with programming, Ali used to write on a Turkish programming forum, ceviz.net. He used to patiently answer all my questions. Since then I learned English and got out of touch with the Turkish community. I am surprised to see him on HN!

comment 4y ago · link · parent

Public investors may not be getting any benefit, because the private investors have already IPOd at a ridiculous stock price. Private investors usually have non-trading shares. The way the scheme works is that if they find the stock price to be right, they convert their non-trading shares into trading shares and profit more. This way the stock price doesn't increase much. They basically dilute the amount of public shares for profit.

They don't give any thought to public investors such as you and me.

comment 4y ago · link · parent

Contact the Information Commisioner's Office for them to investigate. Regulatory authorities are the only viable defense we have against conglomerates such as Amazon.

comment 4y ago · link · parent

This makes me mad as a minimed user. I can't even get data out of my pump (a 754) because minimed does not sell the reader in my country. The 600 models are the top-off the line models that cost $$$.

Medtronic shouldn't be able to get away with just saying, turn off remote bolusing to be secure. I hope they get a class-action suit.

Background: Medtronic is a money-hungry company. I've been using their insulin pumps for 15 years. Over the years the quality of their infusion sets dropped, they no longer provide a cap (the thing you put on to close the catheter before you shower) with each infusion set, rather than they put only one cap in a 10x bag. The infusion sets started to fail after 2 days (the default timespan is 3 days), whereas it used to last 4-5 days before.

comment 4y ago · link · parent

Management gets fat bonuses for reaching profitability targets, investors are happy.

comment 4y ago · link · parent

Sorry, I think you are mistaking stock price and profits. ETFS' performance is based on stock prices. Game companies still continue to make millions in profits. Stock price is not a reflection of profits.

Hiring a recent college grad and working him 12+ hours a day with no rest is IMHO exploitation.

This is why we have labour laws in the first place. Employers have too much power and influence. Offer a college grad the chance to work on games and above average pay, you get him on the hook. What you are not saying to him is that you'll overwork him breaching labour laws. I gave him a job, he wanted it, if he doesn't like it, he can leave is not sufficient to make it ethical nor legal.

Please read this insider story on how brutal the working conditions are: https://ea-spouse.livejournal.com/274.html

I cannot comment on the comparison with Bundesliga footballers, because I have no experience in working a physical job. I am a knowledge worker.

comment 4y ago · link · parent

Isn't it exploitation to benefit from programmers'/designers' love of gaming? Labour laws are there for a reason. I believe it is a basic human right to work reasonable hours and rest.

Game development companies are making millions in profits, what stops them from hiring 2x the workforce so that each can work 8 hours a day 5 days a week instead of 12 hours x 6? The demand in the field is obvious.

I personally would prefer ethically coded games if such a category existed. I get no fun from playing a game from a company that I know exploits people. Maybe that is the reason why indie games are so popular.

comment 4y ago · link · parent

Alternative opinion here, 30 years ago games/software were much simpler. I assume we did not have conglomerates like Rockstar and EA who pushed their employees beyond their limits. Game industry is notoriously known for exploiting programmers.

Imagine being a SWE working 12+ hours a day 6 days a week getting no rest. I might have accidentally coded something like this so that I could go home a couple of hours earlier.

comment 4y ago · link · parent

Aren't primates at least similar to humans? We're both mammals, have similar physical characteristiscs. Why shouldn't cloning people work?

I come from a law background so I am not familiar with the science. I've heard biological goods such as stem cells, eggs, spermia etc. are becoming very valuable and they are not very protected. I suppose underground groups could easily get they're hands on whatever they need. Securing illegal goods from a physician doing IVF on humans could be all they need.

comment 4y ago · link · parent

I'm not saying thet can't have a good social life, but it is harder and later in life. Aspergers you met probably spent years learning social cues.

comment 4y ago · link · parent

Coding capability is not everything, the asperger programmer probably has serious problems in social skills, social life. Let people be. If you're neurotypical aim for management, earn more code less.

comment 4y ago · link · parent

My objection is this, the fact that he may be autistic has nothing to do with his behaviour. This kind of labeling would hurt autistic people.

If he were the tech lead I do not think he would steal work, he'd just delegate it. I think OP and the 10x programmer are peers and they are in an unhealthy competition.

comment 4y ago · link · parent

I suspect writing bad code with poor documentation has nothing to do with autism. I'd suggest don't treat him different than any other employee.

If he steals work he steals work, less to be done by you. If he crashes and burns, so be it.

comment 4y ago · link · parent

Hello,

Thank you very much. You're right I should find a way to flourish as an adult. But it's hard. I thought after getting married I'd split the chores I wouldn't feel lonely but it could be even harder that's true.

I live in Turkey, it's in the middle of eastern/western cultures. High earning people want to move out quickly as westeners do, middle/low class people usually don't move out until they get married. My parents live in a family apartment. My grandparents, aunts etc. live in separate flats but in the same apartment. I'd very much like a similar arrangement :).

Turkey is also experiencing a super high inflation right now around 80% p.a. per the official numbers. Housing prices have risen more than 140% during the last year and more than 100% the year before that. So I also have financial worries about the future.

Maybe it would be better if I can get the cheaper family flat. I would feel more secure knowing that no one would evict me or raise my rent. I will also be able to save more.

Thank you again for your comments. I gained some clarity, I will continue to try adapting to living alone.

1
567
23