Hacker News new | past | comments | ask | show | jobs | submit | pieterbreed's comments login

What the author did is cool in a social sense; lispers go on and on about homoiconicity, which here means that the original lisp code is data. The author uses this property by reading this code/data and transforming it into text, that represents syntax-full code. It is "cool" because it demonstrates the value of homoiconicity.

However; it's not cool in a technical sense. The result is not homoiconic any more. Code that had a cool property has been turned into code that does not, and the result looks like every other syntax-full blub language. The result destroys value.


If the semantics are exactly the same as clojure, can you give me a specific example of what value is lost? Surely the semantics must be different for there to be a loss of tangible expressivity of the language?


the lisp text representation is not lisp data. Nor is it code. It's just a textual representation of the homioiconic abstract code/data.

A different textual encoding does not affect the homoiconicity


(foo (bar (baz 1)))

is equivalent to

foo

  bar

    baz 1
Its still homoiconic

they can still, and in the case of the linked project, probably are turned into the exact same data structure.

I get your objection insofar as whats the point? Youre transforming a language that does a thing well into a language that does a thing less well than another language. But on the other hand different approaches make things easier to reason about.

sometimes the shell approach of baz 1 | bar | foo may make more sense. sometimes it might be a map, sometimes a for loop.

So in that sense, a DSL for python type, scripting makes sense.


I'm sorry if I touched you on an ouchie.

> Its still homoiconic

> they can still, and in the case of the linked project, probably are turned into the exact same data structure.

What you are saying means it is not homoiconic any longer. If you print out the parsed representation of lisp code, you get back the same lisp code. If you print out the parsed representation of this whitespace code, you get back the lisp code (data) also. But this is different to what you fed into the parser.

The point of homoiconicity is that the data structure representing the code is the code itself. There's no syntax, it just represents itself. It's super simple. A programming language with syntax cannot be homoiconic. This is complexity.

> I get your objection insofar as whats the point?

"Easy" IS an argument to choose something over something else, but "simple" is a better, stronger argument. Parens syntax is simple. Whitespace syntax is easy, iff you come from/is familiar with a python-style background.

We are debating some obscure thing. The point is the argument :) I hope you have a great day.


> I'm sorry if I touched you on an ouchie.

In case you're not a first-language English speaker: the wording here implies that they're having a childish emotional reaction to what you said, which (if intentional) is an entirely inappropriate method of discourse, especially when all they did was give a very reasonable and level-headed critique of your definition of homoiconicity (that it's a property of the internal representation, not the external syntax).


>What you are saying means it is not homoiconic any longer. If you print out the parsed representation of lisp code, you get back the same lisp code. If you print out the parsed representation of this whitespace code, you get back the lisp code (data) also. But this is different to what you fed into the parser.

I don't know if we're talking past each other here.

lisps internal representation of (foo (bar (baz 1))) is not literally just that.

it is a linked list, generally (?).

An indented version of the above:

foo

  bar
  
    baz 1
is exactly the same, as is the tcl version:

foo{ bar{ baz{ 1 }}}

The structure describes the data.

you can turn that internal representation back to a lisp list, or you could turn it into json or tcl or whatever.

Homoiconicity also means, as I understand it, that foo would appear the same regardless of whether its built in.

in C for example you have to care whether 'for' is a built in language construct.

you can't do

foo( int i = 1 ; i < x; i++) {}

the language doesn't allow it.

if lisp had:

(for ((= i 1) (< i x) (++ i)) .....)

then that would be homoiconic, and you could make it look like C with a front end, and it would end up as the same internal structure.

It would be more complicated to turn that internal representation into the C like syntax, but it isn't impossible.


> If you print out the parsed representation of this whitespace code, you get back the lisp code (data) also. But this is different to what you fed into the parser.

First, Lisp is not homoiconic by that definition either. If you read "( + 1 2 )" as a Lisp object then print it, you'll get "(+ 1 2)", which is not the same string.

We understand that difference in sexp whitespace to be superficial, and superficial can be technically defined, but it's a difference. If you accept that superficial differences are allowed within the definition of homoiconicity, you can define the difference between indententation syntax and sexp syntax to be superficial too, if you want.

Second, it's not true that what gets printed has to be the Lisp representation. It depends which print function you use. Homiconicity requires the reader and printer match. If you write a different reader, to accept a different syntax, then you need to use the corresponding printer.

If you print_with_new_syntax (a function name I've made up), you get back the original code in its indentation-based form, which makes the pair read_with_new_syntax + print_with_new_syntax homoiconic in the classical Lisp sense.

There may be superficial differences, such as if you put in "baz 1 " and get out "bar 1" (missing a space), or "baz" followed by "1" indented on the next line, but as noted above, Lisp sexps have this characteristic too.

(Then consider "(+ 1 #-t 2 3)" which in a Lisp that supports #- evaluates to 4. Read that and print it, you'll get "(+ 1 3)", which isn't a superficial difference any more.)


"Homoiconic" means that a program's definitions are stored in a textual form which can be re-edited at run time. Bash is homoiconic because you can type "set" to see all the function definitions in source code form, and edit them via copy-paste. Line numbered BASIC interpreters are likewise homoiconic. The program is held in memory in lightly tokenized form; any line of it can be recalled and edited.

That's how the originator of the term "homoiconic" defined it.


Sexpressions are syntax for linked lists. You can encode a linked list in other ways and as long as you have a reader and printer for it , you could implement lisp on top of it , and it would be homoiconic.

As a very simple example: replace the () with []

As a slightly more complex example: json. (With support for symbols if necessary but that’s orthogonal—you get the idea)

And from there we can go to: yaml.

Lo: we have a white space sensitive homoiconic language :)


But it's not itself, it's an array of characters. It's AST can be represented as simply as a recursive list data structure (with a head and a tail), but I think this is a bit over-mysticized.


macros still work yo

my text editor represents sexprs as pixels, macros still work when src is viewed in GUI editors too, regardless of font, and even when i have my glasses on


Give it a rest.


As a dvorak typist HJKL as a concept is dead to me.


I feel like it should have been jkl; anyway.


OP will be sleeping in, eating at the pub nextdoor, looking at Table Mountain on the way back home and playing Dave the Diver in the afternoon.


One of my users apologised for having an AZERTY keyboard. The people out there suffer us.


Emacs or vi?


Logic fallacy.

No shortcuts = cumbersome ⇏shortcuts = easy to use


If i knew my post would do well on hn I would have posted it here myself. Well played.


> That is more than 10^77, pretty close to the estimated number of atoms in the observable universe, 10^80

Ugh. My pedant-bone is itching... That's not "pretty close" at all. There's a universe of distance between 10^77 and 10^80.


They are close enough that the relationship between them is graspable to the human mind, if the numbers themselves are not. Take the unimaginable 10^77, put it in a box. Now imagine a thousand boxes. That's 10^80. Of course a thousand times an unimaginable number is astronomically bigger on a linear scale, but if you just look at the relationship between the two numbers it's imaginable.


lol yeah - before posting I was trying to convince myself not to post, and what yous dais was exactly my counter "narrative".

But still; Between 10^3 and 10^77, that 77 OWNS


in logarithmic closeness


Welcome to life.

Don't worry though. Everything will be OK.

(The things I'm about to say is/are true for me. So is most of what everyone else here is saying. While it's good that you are asking your peers for help, the answers you will get won't make "sense" until you discover them for yourself. (Like the A-HA moment when you finally grok a mathematics proof or a famous algorithm). This will require effort from you.)

The facts of the matter are simply this:

- Your life is unique the same way that everyone else's is. - Your journey is not the same as anybody else's. - You are a whole person. - You have all the tools you need. - :)

The answers you seek are of a spiritual nature and you need some kind of spiritual process to discover them. I can recommend Buddhism, Toaism or even the Yogic disciplines/technologies. What they all have in common is an insistence that one needs to meditate, daily...

(Meditation, loosely, is learning how to accept and acknowledge thoughts that are uncomfortable.)

Good luck!


I agree that there is a spiritual growth component here. As another response said, go find someplace to volunteer and help others. Do this doing something you love, even if you think you are not that good at it. For example help code.org, black girls code, FIRST robotics etc.

In terms of HN and how smart people are here: Remember there are a lot of people that participate in HN and the experts and sometimes so called experts come out and respond to the posts in their knowledge domain. So some of these people do know a lot more about a topic than most of us.

I read HN almost daily and don't understand most of the topics and responses. It doesn't bother me at all. If it bothers you you might want to stop for awhile.

I'm 62 and was miserable working at a bank/financial institution. I quit and started working at a university (web services) and volunteering in STEM education of K12 students 9 years ago today. I felt stupid at the bank until I left and realized the people that were above me were clueless. Clueless people promote clueless people. So my biggest advance in my journey started when I was 53 years old.

Now I'm in a much better place. Take care of yourself. Exercise, moderate your vices (if you have them) and give back. Be grateful for what you have and journal that every day until you think in terms of gratitude as your new mental model. And yes meditate and give prayers of thanks for what you have.

You have taken a big step asking for help.


There is a rumor going around in the South African Air Force that the South Africans with the help of the Israeli Air Force (who had big ties in the bad old days) figured out a way to shoot the SR71s down. It had to do with a technique called storm-climbing (which was novelized by Wilbur Smith in 'Eagle in the Sky') where a normal fighter aircraft would go full-tilt with maximum weight in a downward trajectory, flatten out the dive, dump excess weight, and start climbing vertically. This way the pilots would get to an altitude where the missiles could get a successful lock, which in this case was far higher than the 'normal' ceiling for these aircraft. From this height they could then fire off the missiles. I'm not at all sure if they ever attempted it, but I'm pretty sure they didn't succeed. Still in interesting thing to hear :)


That storm-climbing maneuver sounds really cool!!! Do you have more detailed info on that? Other than Wilbur Smith's novel, that is.

It reminds me of that classical optimal control problem in the 1960s: the U.S. Air Force wanted to find the fastest climb for its F-4 Phantoms (so they could reach their operational ceiling ASAP to intercept Soviet bombers). The optimal path was counter-intuitive: first climb, then dive, reach supersonic, climb again. Sounds crazy, but they could reduce the climbing time dramatically that way!


I've actually noticed that behavior myself when screwing around in X-Plane with the F-4E; I take off at low-speed, high AOA to gain a few thousand feet, and then drop the nose at full afterburner to use both the engines and gravity to go transsonic, at which point the F-4 can accelerate faster, and maintain a higher angle of climb without losing velocity, due to the "lower" drag at supersonic speeds.

I had figured it was perhaps a weird characteristic of the simulation's breakdown of airframe components, but if that's how things worked in the real F-4's, that just gives me that much more respect for the physics simulation in X-Plane. No wonder it's FAA certified :)


The seminal paper in which these findings were published:

BRYSON, A.E. and DENHAM, W.F., "A steepest-ascent method for solving optimum programming problems," Trans. ASME. J. Appl. Mechanics, June 1962, pp. 247-257.

I can't find a PDF copy anywhere. It sucks. If you want to read a non-technical paper on it, try this one: http://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=00506395


Well, I don't have any material on it but you can see that it makes sense from a mechanical physics point of view. Load up a craft to maximum possible weight (with ballast even) Then fly as high and is fast as you can (during which you build up the maximum achievable potential and kinetic energy) then during a dive build up as much speed as you can (during which you convert your potential energy from the weight and height of the craft into more kinetic energy) as you level out, you dump the excess weight and start climbing. Since you now have less weight but the same kinetic energy, you are free to take your craft higher than the height from which it started to descend.


Yes, your explanation makes sense. That's what I thought. Nonetheless, I was interested in more in-depth technical info... some technical papers / reports on it would be interesting. By the way, have you heard of the pop-up maneuver?


no! please elaborate! :)


The pop-up maneuver's goal is to minimize exposure to enemy fire. Imagine that you're flying an F-16 over enemy territory and that you want to hit a nuclear power-plant with a couple of JDAM's. Since the target is certainly protected by lots of AAA and SAM's, you want to drop the bombs as far away as possible from the target. In other words, you definitely do not want to fly over the target, as that will most likely get you shot down.

You can use the pop-up maneuver then. You fly low and fast to avoid radar detection and AAA fire. When you get close to the target you climb at 45 degrees, roll 180 degrees (you are now flying inverted), prepare the JDAM's to be deployed. You then pitch up and when you are at the top of a parabolic flight path, you release the JDAM's. The inertia build-up during the ascent will make the bombs go faster and farther. Once the bombs are deployed, you fly low again.

There are some technical papers on this. It's heavy math: optimizing flight paths is not exactly a trivial problem ;-)


This sounds very much like something the SA Air Force did with their mirages in the Bush war of the 70's and 80's.

BTW - There is a book written about the history of the Mirage in the SAAF called 'vlamgat' (lit. fire/fiery - behind/ass). Try http://www.saairforce.co.za/reviews/33/vlamgat-cd.

Anyway. In this book, which is written by an ex-pilot, a maneuver is described which sounds very similar to the pop-up. The aircraft also approaches the target at low altitude, then pitches up. As the pilots pull up on the stick they release their bombs, but continue climbing up and away. The bombs (old fashioned, dumb bombs) would then fly in a parabolic trajectory like you'd expect and land somewhere near the target ;)

If I remember correctly this tactic was actually used in combat with surprisingly effective results. I say surprising because nobody believed you could actually hit a target with a bomb that flies in a trajectory with a horizontal length of a few 100 to 1000 meters and was released on the pilot's 'gut' feeling...


The biggest problem I see with intercepting a SR-71, is not getting another plane up to the same sort of altitude but getting the plane in the right piece of the sky, taking the wikipedia stats as an example, Mach 3.2 (2,200+ mph, 3,530+ km/h,1900 knots+) at 80,000 ft (24,000 m), if your interceptor take 2 minutes to get up to 80,000 ft, even doing some sort of zoom climb your aiming at a point 73 miles in front of the SR-71 position at take off, and I would expect the real world time to be longer from detection to interceptor at altitude. So you could only do it with a large radar network to track the SR-71 plus airbase in front of the current flightpath.

Then even if you did launch a missile it would not have an easy job of hitting the target


The SR-71 used something similar to go supersonic,

'After take off and the top up the Blackbird will perform a manoeuvre called the Dipsy Doodle, here it passes mach 1 by a climb to 33,000ft followed by a sharp dive to allow the aircraft to traverse high drag transonic range without using a lot of fuel. The aircraft will then climb to at least 60,000 ft.'

http://www.historyofwar.org/articles/weapons_blackbird.html


Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: