r/programming • • Oct 31 '15

Fortran, assembly programmers ... NASA needs you – for Voyager

http://www.theregister.co.uk/2015/10/31/brush_up_on_your_fortran/
2.0k Upvotes

660 comments sorted by

561

u/puradox Oct 31 '15

"Although, some people can program in an assembly language and understand the intricacy of the spacecraft, most younger people can't or really don't want to"

Exactly what I was thinking.

588

u/Uhrzeitlich Oct 31 '15

First day on the job: "Hey guys, let's rewrite all this code in Go!"

513

u/kairos Oct 31 '15

Screw go. Javascript goes in the browser, the server and space!

21

u/Distarded Oct 31 '15

In space no one can hear you undefined.

→ More replies (57)

28

u/[deleted] Oct 31 '15

First day on the job: "Hey guys, let's rewrite all this code in Go.js!"

FTFY

9

u/meowtasticly Oct 31 '15

Think you're looking for GopherJS

→ More replies (1)

139

u/klug3 Oct 31 '15

Yeah, its probably more common among EE grads to program in assembly than CS people.

161

u/SmoothB1983 Oct 31 '15

In my degree assembly was mandatory for CS. It was a lot of fun and was a huge assist in understanding how my assembled code would work. You are right in that a lot of my colleagues never touched it and thus lack basic knowledge of how compiled code actually works.

105

u/klug3 Oct 31 '15

Well, most CS people do it as assignments or whatever for a course or two. Whereas in EE there are at least a few areas where assembly is used a lot as part of the job.

→ More replies (41)

13

u/[deleted] Oct 31 '15

We had a mandatory compiler course where we built an assembler to turn (a subset of)MIPS assembly code into binary, and (a subset of)C++ code into assembly.

I promptly forgot just about everything I learned about MIPS after, and haven't needed it much since, but the understanding of what is happening and how different languages are compiling or being interpreted was invaluable.

15

u/klug3 Oct 31 '15

MIPS is actually pretty sane when you compare it with say x86.

→ More replies (11)

19

u/jjmc123a Oct 31 '15

Which architecture? There is no such thing as "assembly" actually. I've done x86, Motorola 8600, macro (DECs assembly), Modcomp, SEL, and control data assembly and they are all quite different (CDC is very weird, you load a register with and address and another corresponding register automatically contains the value).

I've also done Fortran; really though, all NASA has to do is find some programmers and train them in the technology.

I'll say it again. The languages are not where the knowledge lies. It lies in the application structure and the library used by the environment.

→ More replies (2)

7

u/hellnukes Oct 31 '15

I just graduated information systems and computer engineering last year and I also had to learn assembly! It was one of my favorite projects by far. Had to create a game with a tank and some aliens with minimal ai (basically move to player). I learned so much about everything computer related during that project that I wouldn't otherwise.

We were given an in-house simulator written in java called PEPE in which you could basically simulate a CPU, memory, screen etc and wire it directly to the interrupts and CPU ports and etc, and you basically just loaded the assembly directly in the CPU and went to work. I thought every cs course had this too as it was basically my only serious low level project where you really got to see what happens down there.

→ More replies (8)

25

u/[deleted] Oct 31 '15

CS Undergrad here, currently taking Comp. Organization and Architecture. Every single assignment thus far has been using Mars 4.5 MIPS simulator to program in assembly. It's actually so much fun!

39

u/xienze Oct 31 '15 edited Oct 31 '15

When I was in undergrad I did an assembly course, but we targeted x86. And yes, it's fun when the assignments are short and focused. In the real world though? No thanks.

15

u/Sean1708 Oct 31 '15

I'm genuinely amazed that people used to write entire programs (even operating systems) in assembly. Obviously they weren't as complex as modern ones, but still...

→ More replies (6)
→ More replies (8)

7

u/[deleted] Oct 31 '15

Also mandatory in my CS degree, learnt ARM assembly for the first 2 years and IA32/x86 and RISC-1 this year. Along with creating a microprocessor in 2nd year using Xilinx. I can't believe some CS courses don't teach low level concepts, its seems to be a fundamental skill to have.

4

u/klug3 Oct 31 '15

Well most good places do, at mine Compilers, OS and Organisation were compulsory courses. Most people don't choose to do anything more advanced though. In EE its the other way around, lots of people get into it, as its lucrative.

3

u/mosburger Oct 31 '15

I was an EE grad and my first job out of college was writing firmware for disk drives in assembly and C. I'm a web developer now, but perhaps I should go "back to my roots." Hmm...

→ More replies (7)

53

u/Berberberber Oct 31 '15

The thing is, for most programmers today (young and old), hardware interfaces and even machine instructions are simply interfaces to other, more complex computational units. Modern x86 code, whether 32- or 64-bit, is actually run via a microcode simulator on top of an unspecified RISC hardware instruction set. Drives and other devices are operated by their own processors and RAM and only pretend to be dumb to the operating system. Learning and using assembly today is a great way to understand how computers worked in the 1980s, which is increasingly unimportant for working with modern machines. About the closest most desktop or even mobile developers get these days (I recognize that embedded systems are a different beast, but their numbers are comparatively small and getting smaller as compilers get better) is probably CLR IL or JVM instructions - which, again, is remote from the hardware.

tl;dr There are fewer programmers with a low-level understanding of hardware because because it's increasingly harder for them to do so.

17

u/im-a-koala Oct 31 '15

Yep. Even those small microSD cards you put in your phone, the ones the size of a fingernail - they actually have an ARM processor complete with wear leveling inside. Yep, an entire chip with a CPU and RAM and flash... all embedded into that tiny microSD card.

See this blog post for an example.

→ More replies (1)

19

u/d4rch0n Oct 31 '15

Increasingly harder, and increasingly unimportant to be a good developer. I agree.

There might even be more of a calling to learn assembly in security than development. There's always going to be a need for reverse engineers to break apart malware or find vulnerabilities. I wouldn't be surprised to know if people working with ASM is more common in security than in development now.

3

u/crowbahr Oct 31 '15

Yep. I remember taking my cs micro architecture classes learning machine code on a mainly cisc with a few risc commands von newmann microprocessor and thinking 'cool, I'll never ever use this'.

Maybe that'll change though. My love of space might be strong enough for me to learn Fortran.

→ More replies (1)
→ More replies (8)

5

u/bikeboy7890 Oct 31 '15

I absolutely love embedded assembly projects. Getting timing right is a cinch with it. As long as a display isn't needed that is.

Where do i sign up?

2

u/Hiddencamper Oct 31 '15

Shit I would love to work on that

I learned fortran when I started working at a nuclear plant so I could maintain our plant process computer because it was all written in fortran.

There are young people who would love to work on this stuff.

2

u/the_rabid_beaver Oct 31 '15

I must have the spirit of the 80s neckbeards, I love assembly code.

I've never tried Fortran though, so that's on my TODO list of legacy languages to learn.

11

u/Myrl-chan Oct 31 '15 edited Oct 31 '15

16 here, and I'm really interested in assembly, I have an OS project (goal is to be fully modular) though, I'm planning to make further extensions in Haskell.

Edit: Does anyone want a link to it?

Edit2: Link: https://github.com/Myrl/MyOOS

I'm not good at making makefiles, if anyone can provide a better makefile, I'd be glad, as of now, that's the best I can do.

The kernel itself is just an elaborate module loader. I made a VGA module for "printf debugging."

Edit3: The reason why I still haven't made anything is because I choked at the memory allocation. It's the chicken and egg problem all over again, and it's even worse with 64-bit. Let me do a breakdown of what happened.

32-bit: Paging is not mandatory for a working 32-bit system, but it's more or less required for a sane system. So I more or less need paging. Next question: How do I allocate memory for the paging system? I had 2 solutions for this. Use low memory, or use the module memory. Okay, things are solved, until I remembered, "wait, my goal was 64-bit."

64-bit: ENTERING 64-BIT REQUIRES PAGING. This more or less broke some modularity, since I need paging set up to enter 64-bit, and that means that I must set up paging on the kernel rather than the modules, or at least an identity page to the first few MBs of RAM. I still don't have a clear solution for this.

3

u/d4rch0n Oct 31 '15

Well, I'm 31 yo here, and I wrote tic-tac-toe in assembly. You got nothing on me.

3

u/czipperz Oct 31 '15

Fixed your Makefile. See pull request.

I'm 16 as well

→ More replies (3)
→ More replies (9)

3

u/earslap Oct 31 '15

Exactly what I was thinking.

I understand the "can't" part but don't really understand the "don't want" part. I can't imagine a capable hacker who wouldn't jump into the opportunity of handling communications code with the Voyager, provided they are given a wage to handle all their responsibilities. It should be no problem because we're not talking about a candidate pool of thousands upon thousands people here so it is pretty specialised work.

18

u/mtxppy Oct 31 '15 edited Oct 31 '15

don't really understand the "don't want" part

Here are some reasons why I won't apply:

It's old hardware which usually annoying to work with.

You have very tight parameters due to the critical nature of the code, which are usually annoying to work with.

You have a lot of oversight, which is usually very annoying to work with. Especially after exposure to tech, which preaches the use of autonomous teams with full authority over their platform.

The salary is low compared to tech.

The career prospects are low compared to tech (unless actual space aliens turn up).

Not everyone finds space exciting. For me it's a useful place to go to mine new materials or dispose of waste, and as a backup in case we break Earth, but it's not really exciting in itself.

NASA is US Government. Sure, they aren't the NSA, but it's still part of the same family. I don't dislike the USA, and I don't dislike Americans, but the government and its "agencies" cause me issues, especially when they are actively trying to sabotage the secure systems I am trying to build.

→ More replies (5)
→ More replies (1)
→ More replies (7)

119

u/[deleted] Oct 31 '15

Well, they can't use Python because it needs whitespace. Space would be just too dark for it.

17

u/misplaced_my_pants Oct 31 '15

Just use Solarized dark.

7

u/HoldMyWater Nov 01 '15

I assume NASA prefers Space to Tabs.

55

u/Jafit Oct 31 '15

How do they get the punchcards up to the spacecraft?

35

u/MrBester Oct 31 '15

Pigeon post.

13

u/[deleted] Oct 31 '15

Enough delta v and even pigeons can become interstellar astronauts

→ More replies (2)

2

u/msthe_student Oct 31 '15

MySpace posts

159

u/16807 Oct 31 '15

Not just any Fortran...

Fortran 77

143

u/dynetrekk Oct 31 '15

The probe was launched before 77 I think. So more likely fortran66 with significant vendor extensions.

51

u/JohnShaft Oct 31 '15

Vendor extensions? WTF are those in the 70s?

137

u/bradrlaw Oct 31 '15

Nightmares... Nightmares is what they are

→ More replies (3)

24

u/perlgeek Oct 31 '15

For example identifier with more than six characters were a vendor extension :-)

→ More replies (2)

18

u/klug3 Oct 31 '15

Well, that's the most common one people usually know.

55

u/16807 Oct 31 '15

Most Fortran I've worked with was 95. 77 is just used for legacy code. Actually, I was wrong - voyager was earlier than 77.

8

u/klug3 Oct 31 '15

I have mostly seen academic code, though given that my sample size was like 5 projects, I might have been a bit hasty in drawing the conclusion that Fortran 77 was still the most commonly used dialect.

→ More replies (5)
→ More replies (6)

3

u/socrates_scrotum Oct 31 '15

Yeah, if it was an earlier version that would be a bigger problem.

3

u/Sean1708 Oct 31 '15

Only when they're working on legacy code. A lot of modern numerical software is done in Fortran 95 because, as I understand it, it still tends to produce faster software.

7

u/Rhodysurf Oct 31 '15

Hahah that number is the key

2

u/corporaterebel Oct 31 '15

Fortran 77 is pretty darn popular, probably runs on most (if not nearly all) mainframes and mini's.

→ More replies (3)

117

u/rpgFANATIC Oct 31 '15

Normally the group wisdom is "If you're a good enough engineer, it doesn't matter what language you use. You'll be able to pick it up in a month or two."

I guess that doesn't apply for assembly and Fortran

10

u/rebelyis Oct 31 '15

Like any language, Fortran has its quirks, but if you're comfortable with programming in general, you can pick up Fortran with little difficulty. I know nothing about assembly though.

FYI every physics major at my university (SUNY Stony Brook) has to take a "programming for scientists and engineers" which teaches C++ and Fortran. Because when it comes to serious computational efficiency, supposedly nothing beats Fortran. Or so my professor said.

16

u/zeissikon Oct 31 '15

I guess they are asking for Fortran IV or Fortran 66 skills here. Punched card formats. 72 characterrs per line. With COMMONs (fair enough), non recursive functions, SAVEd data in between calls, implicit typing of course, 5 character variables, CAPS only, specific labellized formats far away in the code, stupid way to do character operations, typed functions (DSIN instead of SIN...), lot of labels, reversed if - then-else...(code you cannot cut and paste), hardwired DATA at the beginning, global variables, files without names (only numbers or magnetic tapes) and...(this is Haloween) computed GOTOs, mixed with EQUIVALENCE statements. Several variables pointing to the same memory location to save RAM. This is really awful. I used it once, still remembers. I should apply.

Fortran 77 is already usable, and Fortran 90 is like C.

→ More replies (1)

8

u/SirRevan Oct 31 '15 edited Nov 01 '15

The reason is because Fortran is so basic. There isn't a whole lot of different syntax and tricks. You basically are forced to reinvent the wheel to do the most menial of tasks. Which also makes you make your code more personalized for its application versus the many functions in Java or c++ which try to be broad.

3

u/notadoctor123 Nov 01 '15

supposedly nothing beats Fortran. Or so my professor said.

This is still pretty true. Fortran compilers are insanely optimized. You can take a look at some benchmarks here. For a lot of things important to numerical simulation, Fortran outperforms C++.

→ More replies (4)

16

u/[deleted] Oct 31 '15

assembly is very easy (well it was for me) as long as you already know the basics of programming (loops, conditions, etc) because they are not their in asm. What I did was spend about 1-2 months writing simple C programs and then disassembling them, then 4 more months writing asm starting with a bootloader and slowly worked my way up to switching to protected mode, writing a basic vga driver and started messing with files.

tl;dr Asm is just as easy as any other language, once you understand that all languages just write it for you.

29

u/[deleted] Oct 31 '15

Very easy, you say? Takes six months to learn, after already having a good foundation, you say?

5

u/[deleted] Oct 31 '15

not impossible, you say?

fixed that, xD

→ More replies (1)
→ More replies (2)
→ More replies (2)

2

u/tmarthal Nov 01 '15

That's somewhat true - except for numerical software (which this most likely is); a 'good enough' programmer usually can't figure out why things are the way that they are. Like, they can write down the equations on what is happening : N_X = .850903*x/180.0 + SHARED_CONSTANT/132712440.018 or whatever - like, what do those numbers mean? What is N_X supposed to be?

An analogy would be if someone encountered the sqrt optimization that Carmack wrote in 'real' code - would you know how to debug it? or how would someone figure out what it does? Well, that's what uncommented control systems for legacy spacecraft look like.

→ More replies (38)

377

u/SchrodingersRapist Oct 31 '15

I always dreamed of working for NASA!

Fortran, assembly

...I don't think I wanna work at NASA that badly >.<

87

u/thiosk Oct 31 '15

but this is your big chance tho to "accidentally" change its name to V'ger!

51

u/SchrodingersRapist Oct 31 '15

Still 1:2

Pros:

First contact with the Borg is enticing

Cons:

Fortran

Assembly

6

u/[deleted] Oct 31 '15

It is known that real programmers do string processing in Fortran, after all.

7

u/kdelok Oct 31 '15

Strings or character arrays? :(

→ More replies (2)

15

u/SirRevan Oct 31 '15 edited Nov 01 '15

Oh come on Fortran isn't that bad. You ever code in cobalt? Or jovial. Those are languages that seperate the men from the old men. Edit: whoops replace cobalt with COBOL

→ More replies (5)

2

u/[deleted] Oct 31 '15

fortran's kinna a pain in the ass but nothing wrong with assembly, it can't be worse than x86's bastard abortion of an assembly language

3

u/terrkerr Oct 31 '15

There isn't much interesting work at NASA that isn't going to be very specialist in one way or another, and none that isn't on something we'd now consider out-of-date. Something doesn't get into space until it's had at least 10 years of stable use in the wild. Preferably more.

125

u/[deleted] Oct 31 '15

is there a job link? I legit want to apply for this

2

u/msiekkinen Oct 31 '15

Seems like there's more than one fortran job out there still.

0

u/[deleted] Oct 31 '15

[deleted] — view deleted comment

88

u/TheDeza Oct 31 '15

They should advertise for a web developer :|

0

u/[deleted] Oct 31 '15

[deleted] — view deleted comment

32

u/DrLeoMarvin Oct 31 '15

I make 30% less than I should working for a state university, but dude, the benefits are fucking amazing and totally worth it.

42 days paid time off a year

matched 403b (extra $3k/year)

flexible schedule, I take a couple afternoons off a week to watch my daughter an save child care expenses, I come in at 9 or 9:30 most days, if I have a doc appointment I'm only expected to work 5 hours and not use sick leave. And so much more.

No micromanagment

Job security

→ More replies (6)
→ More replies (27)

8

u/Mazo Oct 31 '15

They need to add a vacancy for a web designer.

→ More replies (5)
→ More replies (10)

88

u/Borne2Run Oct 31 '15

It'd be one hell of a resume pad.

55

u/CartmansEvilTwin Oct 31 '15

"During my time at XY I worked on webscale Python applications in the retail industry. At NASA I worked on the most remote probe in history of mankind. Then I wrote a Go! to JS compiler for Google."

61

u/pembroke529 Oct 31 '15

Finally this old gristled coder has a calling.

Where do I send my resume?

19

u/urbanek2525 Oct 31 '15

Me too. I'm looking at the 68 K of memory and thinking that it would be kind of fun to write a program (again) where I had to count bytes of memories. This gristled coder remembers writing programs with the 'compact' memory model for DR DOS 3.0.

It would be like programming a DEC PDP-11 (which was just a teeny bit before my time).

Nostalgia, probably a lot better than reality.

9

u/Milumet Oct 31 '15

I'm looking at the 32 K of memory and thinking that it would be kind of fun to write a program (again) where I had to count bytes of memories.

Still done today — with microcontrollers.

→ More replies (2)
→ More replies (6)

2

u/Patman128 Oct 31 '15

You only need 25 years of experience programming space probes to get in!

→ More replies (1)

29

u/scrimsims Oct 31 '15

I remember my mum learning Fortran when I was a child! I learned binary as a little girl because she had to take me to class with her when she couldn't get a sitter. She just retired at 62 after 30+ years as a programmer. She's my inspiration! I forwarded her the article -but sadly, I think she may be more interested in making stained glass than code now.

3

u/[deleted] Nov 01 '15

Thought the same about my mom, she's already passed the stained glass phase. Now she's traveling the world and I doubt her next stop is Pasadena.

27

u/Jeras Oct 31 '15

How big is the Voyager team now-a-days? I'm a little surprised that they haven't had a younger team of engineers shadowing the retirees the past few years to transfer knowledge and keep what is left of the project operational. That might be limited by funding though...

I wonder if they're still pushing code updates to the probes or if the development needs are for the earth based systems.

23

u/MadelineCameron Oct 31 '15

They mention having to be able to work with 68KB of memory so I'd presume working with the probe as well.

16

u/ashishduh1 Oct 31 '15

I don't think you understand the situation at NASA. My sister started working for what was the largest NASA contractor 7-8 years ago. That company has now folded.

6

u/[deleted] Oct 31 '15

how would pushing code updates actually work? can anyone explain this? does the 68kb memory device recompile the new code and do a hot redeploy in memory?

5

u/msthe_student Oct 31 '15

Presumably you compile on earth and send the new binary to be flashed.

→ More replies (6)

3

u/robertbieber Oct 31 '15

My guess is they probably have a hard time paying competitive salaries. Anyone have an idea what they're looking to pay someone to maintain these things? Personally I'd love to work on that kind of a project all things being equal, but leaving a really well paid job to work on technologies I might never find another gig using is a little bit of a hard sell, however interesting the technology might be in its own right

21

u/mutatron Oct 31 '15

From the original article this one is talking about:

Both spacecrafts are "very healthy for senior citizens" Dodd says and they have enough power left to run for another decade, though beyond that the future is uncertain. To try and prolong their lives, a new engineer would have to help figure out a way to make a sort of "energy audit" from afar, check to see the energy requirements of remaining instruments, and help institute shutdown procedures that make the most of what's left of the onboard energy.

It's hard to imagine that being a full time job for a decade.

23

u/HorseyMan Oct 31 '15

NASA is very methodical about things like this. If you make a mistake, it is a long trip to go out and push the reset button.

10

u/funbike Oct 31 '15 edited Oct 31 '15

It's hard to imagine that being a full time job for a decade.

Sure, but there are a lot of big projects one could do:

  • Tests to determine energy cost for each instruction type
  • Emulator ( w/profiler for testing code's energy use
  • Optimize Fortran's code generator for best energy conservation
  • Functional Tests, Unit tests, integration tests. Some in software, some with real hardware
  • Continuous Integration
  • Rewrite code wherever necessary to optimize energy use
  • Tests for startup and shutdown sequences
  • Collection and analysis of various runtime metrics
  • LLVM backend for more modern language support
  • Documentation and open sourcing of projects for bigger public interest

EDIT: added some more bullets

31

u/backtowriting Oct 31 '15

I'm surprised. Many of us physicists still use FORTRAN as our primary language. In my field, practically all the code is written in FORTRAN.

72

u/vanderZwan Oct 31 '15

Yes, but

physicists

code maintenance

Choose one.

10

u/[deleted] Oct 31 '15

you'll always find kids happy to do the latter with blind enthusiasm.

→ More replies (3)

2

u/Slippery_John Oct 31 '15

I hear it's really common in the Math world

→ More replies (6)

43

u/scalablecory Oct 31 '15

I can see Fortran being rare, but assembly? There's still got to be a lot of us who do assembly.

82

u/kozukumi Oct 31 '15

It is assembly for some custom built GE CPU from the 70s. We are not talking about some well known ARM or x86 assembly. It would also require expert knowledge of hard system limitations and ways to optimise code for that limitations.

29

u/vanderZwan Oct 31 '15

TBF, from what I understand assembly can be more fun to program in for CPU's from the seventies than for modern ones: it was expected that humans would do the assembly coding, so the instruction sets were more human-friendly too (relatively speaking).

In my own limited experience, Z80 on the graphical calculator was a lot of fun to play with.

21

u/[deleted] Oct 31 '15

For, there's no pipelining and cacheing, so you can say exactly how long a set of instructions will take, instead of giving some probabilistic estimate.

→ More replies (1)

18

u/SquireOfFire Oct 31 '15

x86 assembly

Yuck. I bet that custom GE CPU from the 70s would have a nicer assembly language.

14

u/kozukumi Oct 31 '15

No doubt but chips in the 70s were designed for humans to write the assembly whereas these days x86 assembly is there mostly for compiler writers. No sane person would write a whole program in x86 assembly :P

→ More replies (6)

5

u/nerd4code Oct 31 '15

IMHO x86 is stupid but fun because of all the nurfty tricks one can do.

→ More replies (6)

4

u/hungry4pie Oct 31 '15

What's wrong with x86 assembly, and how did x86 become the standard of pc's? (Genuine question btw)

→ More replies (5)

8

u/killerstorm Oct 31 '15

Fortran isn't rare either.

5

u/notyouravgredditor Oct 31 '15

Exactly. It's very common in scientific codes. Most numerical libraries are still based on Fortran code. Fortran 90 is a very powerful language.

0

u/[deleted] Oct 31 '15

[deleted] — view deleted comment

47

u/aiij Oct 31 '15

We can still communicate with voyager. It doesn't need to run unassisted.

You just need to be really really really careful not to brick it.

Which hopefully means not only writing assembly, but being able to show it is correct before shipping it.

→ More replies (5)

8

u/KnowsAboutMath Oct 31 '15

I work for a U.S. government laboratory. Fortran is common here, and at other federal labs. You'd be surprised how much of the behind-the-scenes technical/science/engineering work of the U.S. government is powered by code that is 30, 40, or even 50 years old. In fact, expertise in Fortran is so common here that a lot of new code is written in it as well.

ETA: For example, a few weeks ago, I was working on some code that relied on a Fortran linear algebra library originally from NIST. The header comments dated it from 1966.

8

u/terrkerr Oct 31 '15

Something like 80% of financial transactions worldwide still get processed by a COBOL system at some point. Plenty of PDP-11s and other decade old systems are still out there in the wild doing very important things.

I'm not surprised in the least to hear that.

7

u/pengusdangus Oct 31 '15

Serious question here--don't we write compilers that write better assembly than we do? I understand it is helpful thinking at that level and sometimes coding at that level for optimizations, but I was under the impression that compilers do some things that a normal programmer's intuition can't accomplish.

18

u/AlotOfReading Oct 31 '15

Compilers can be better than humans, but only for very short code with very good input and for problems that aren't too complicated on simple architectures. And even this is a fairly recent thing. Skilled humans could generally produce "better" code for nearly every problem until quite recently. I didn't start seeing modern compilers prevail in real world problems until around 2011.

For whole program optimization, humans are miles ahead of any compiler. Even in the best current case with skilled humans using procedural languages (which leave many optimization steps to the programmer), humans are able to leverage their direct knowledge of the program domain to write programs a compiler could never "think" to produce. Assembly programmers doing intense optimization will often use code that breaks normal sanity checks in carefully designed ways. Moreover humans are often able to change the problem domain, an optimization that compilers will never have access to.

Even where a compiler can beat humans, we can plagiarize freely. Compilers can't (yet) start optimization sweatshops to steal human code back.

Compilers are also limited to the optimizations written in by the compiler authors. Programmers are free to pick up new techniques that may apply only to a few domains or rely on hardware quirks. In one case for me, I was using a SH3 platform without a DSP. Hardware multiplication was implemented with a terribly slow 1 bit shift and add loop. GCC liked to unroll loops for speed (particularly on -O3), but if you were clever you could beat it for the most common inputs (and only slightly worse in general). Most languages aren't expressive enough to encode these domain specific hacks, so compilers can't use them.

→ More replies (2)

8

u/mtxppy Oct 31 '15
  1. Yes. 2) This spacecraft is 1970s technology and can only receive new code updates via a radio link. You're not exactly going to go out where with a USB and completely replace the software with a nice, new system.
→ More replies (1)

5

u/Hiddencamper Oct 31 '15

You need to recall that older machines were so constrained that every line of code and every resource mattered. You needed no padding or extra stuff sometimes just to fit your software on a chip or in memory. And you needed to optimize cpu usage. It was very different compared to today where memory and cpu are essentially expendable.

→ More replies (1)

2

u/YRYGAV Oct 31 '15

Compilers are very powerful. And most of the time, will do a better job than writing assembly if your goal was to churn out something that works.

However, they generally can't write the absolute best code. That can only happen from humans pouring time and energy into understanding the problem, and writing it from a perspective that compilers don't have. A compiler is just translating what you wrote in one language to a different language. Humans can incorporate knowledge of what the actual problem is, and how best to approach it.

This is especially important in embedded systems like a space probe where you must optimize every resource available at the same time. The code itself can't be too big, it has to use a set amount of memory, etc. Those are difficult problems to ask compiler to tackle.

On top of all that, NASA wants code that they 100% know what it does. Not C code that was translated and hopefully works like expected without any odd edge cases happening.

→ More replies (8)

6

u/shaggorama Oct 31 '15

I'm positive that this is someone's dream job.

14

u/mutatron Oct 31 '15

Ha! It would be for me, but I think they want someone with an active TS/SCI clearance. I got my start doing Fortran in space sciences, and currently am working on a web application project. But I'm 59, and while technologies like Zend and Angular are great, I wouldn't mind coasting into retirement hacking on Voyager code in Pasadena.

Anyway, I've connected with them through LinkedIn, we'll see what happens. They're only looking for one guy, though.

5

u/alysurr Oct 31 '15

Good luck!!!

→ More replies (2)

6

u/rosicruxi Oct 31 '15 edited Oct 31 '15

NASA laid off their more senior and Fortran bearing engineers and project managers years ago in a several great purges (or cancelled contracts on, as they mostly went through USA for the past 40+ years).

I have(had) a NASA-heavy family, most of my friends and family who worked for them are now in completely different careers having nothing to do with aeronautics or space, so I say, Good Luck!

5

u/WhisperSecurity Nov 01 '15

the manager of NASA's Voyager program Suzanne Dodd said the retirement of the last original crew member has left the space agency with a shortage of people capable of communicating with the 40-year-old craft.

My father is one the original crew. They laid him off when the project wound down. He is old, but still very much alive. They cannot be looking too hard, since they haven't picked up the phone and called him.

3

u/Odinuts Oct 31 '15

I'm actually studying FORTRAN this semester and I've been wondering why we're studying a language that's practically dead right now. Well, this feels nice.

5

u/terrkerr Oct 31 '15

Fortran and COBOL both are 'dead' in that nobody is really starting any new projects in it, but huge, extremely important things are still running it and the world in general. There's not a huge job market for it since there's not much new development, but someone has to maintain these codebases and since there's such a small pool of competent devs out there looking for that work, and many that are out there will be retired inside 10 years, it's a lucrative market.

3

u/baldhippy Oct 31 '15

There is a linked article on this page about the raspberry Pi, which would have so much more power than this spacecraft. What a great time to be alive.

3

u/Aveach Oct 31 '15

As a young person I actually prefer working with embedded systems programming and assembly level stuff. Obviously I have a lot to learn but I find it very interesting. Just my two cents on the whole younger people thing.

10

u/golgol12 Oct 31 '15

Fortran was my first language. Actually, TI-85 was. Fortran was the first language I was formally taught in school, because I was in physics in collage. Found out I was better at the programming than the physics and switched to a CS degree. For a while after college and before I knew what it was, I thought people talking about 4chan were referring to Fortran. I was very confused.

If I wasn't in video games, I would work at Nasa. I like working with low level code. I'd trade "how do I serve this companies website to a million people" for "how do I make this executable fit in 68k so Nasa can operate a deep space probe" any day. Probably the first thing I would do is make a C compiler replacement and translate everything to that. Fortran not built for this type of thing, and it's easier maintenance.

35

u/Kommenos Oct 31 '15

Probably the first thing I would do is make a C compiler replacement and translate everything to that. Fortran not built for this type of thing, and it's easier maintenance.

Based of what I've read from NASA reps, this is exactly why they wouldn't hire you.

7

u/Niles-Rogoff Oct 31 '15

Exactly, they only have 68 kilobytes of memory or something

→ More replies (2)

13

u/[deleted] Oct 31 '15

yup, a lot of NASA's program's depend on physics; and them being right.
When it comes to complex math fortran is the tool for the job.

4

u/funbike Oct 31 '15

LLVM backend would be better.

However, remember that code correctness would be their #1 priority. Adding new tech to replace proven old stable reliable tech will earn you a walk to to the door.

2

u/bloodguard Oct 31 '15

The last Fortran and Macro-32 (yay Vaxen) projects I worked on were contracts to fix legacy systems for a government agency. They do love to hold onto crusty systems.

If the pay wasn't so crappy compared to what I'm making currently I'd probably consider it just for bragging rights.

→ More replies (1)

2

u/noodle-face Oct 31 '15

I have to write assembly at work sometimes... They'd have to pay me much more to do it full time

→ More replies (2)

2

u/kyle2143 Oct 31 '15

Why exactly do they still need to communicate with Voyager? I didn't know that it still sent any data back. And if it does, what is it sending back? I didn't really think there was anything new that could be done to it.

5

u/mutatron Oct 31 '15

The original article has the answers to those questions.

2

u/logicalmaniak Oct 31 '15

Voyager is probably halfway to becoming V---ger by now. That's why NASA will send some Fortran programmers back in time to reprogram Voyager before it starts, so it's nicer to Captain Kirk.

2

u/IronRule Oct 31 '15

Man fingers crossed that my Java/C# skills are needed by NASA in 30 years

→ More replies (4)

2

u/mutatron Oct 31 '15

https://experienced-jpl.icims.com/jobs/search?ss=1&searchKeyword=voyager

Search Results

Sorry, no jobs were found that match your search criteria. Please try other selections.

2

u/senatorpjt Oct 31 '15 edited Dec 18 '24

screw scale edge late squash detail memorize aloof swim offer

This post was mass deleted and anonymized with Redact

2

u/nyrol Nov 01 '15

Wow I'm 26 and love assembly. I do most coding challenges in a random assembly language because I actually enjoy the challenge of hardware limitations (like having one 8-bit register) and seeing how many clock cycles I can shave off. 68k of ram is a little more than I'm used to (I usually work with 32k of ram) but I'm sure that'd be a lot of fun.

2

u/[deleted] Nov 01 '15

Would be this different if they used lisp instead?

3

u/Mizar83 Oct 31 '15

Fortan is still routinely used in astrophysics and astronomy, both for small codes and for big, high performance hydro simulations.

I find difficult to believe that NASA does not know that and cannot hire some of those people for the (presumably small) programming team for Voyager

5

u/randomguy186 Oct 31 '15

Does NASA know it? Sure. Does the one guy who gave the interview that lead to this article know it? Obviously not. I find it easy to believe that some mid-level manager doesn't know about all the software development that NASA is doing.

5

u/Mizar83 Oct 31 '15

They should really stop with all this "ancient", "cold-war era", "dated" language.

Fortran evolved, a lot of people are still using it, so also the mangers should be informed of this fact. C is not much younger, but I don't hear it referenced as a dead language all the time

→ More replies (1)

4

u/MashedPeas Oct 31 '15

I've done both FORTRAN and COBOL but I doubt they are going to move the job to where I live.

23

u/NaSk1 Oct 31 '15

Gotta be something wrong with you if you're not ready to move for a job at NASA

18

u/binarytree Oct 31 '15

There are plenty of better jobs than working at NASA for a software engineer. I can only imagine how annoying it is to work there. Don't forget: it's still a government job.

10

u/indrora Oct 31 '15

Have had a few friends who've had internships or worked at NASA.

It's a dance. At first, you're not sure what all the moves are. You mimic the others and watch. You eventually fuck up and someone helps guide you through the moves.

NASA defined systems engineering, which doesn't care the exact process you do, so long as you take the time to document and plan what you are doing. These processes have to produce things which will work for years. As a result, many of them look like what AT&T was doing -- AT&T was under the impression that their hardware would be possibly untouched for a hundred years and designed for that.

→ More replies (2)

5

u/[deleted] Oct 31 '15

It's not like you get to go into space. You have some unique and interesting challenges but, as the link says, it's in 40 year old hardware and software. I can see that turning a lot of people off.

18

u/[deleted] Oct 31 '15

Such as family?

→ More replies (4)
→ More replies (1)
→ More replies (5)

2

u/[deleted] Oct 31 '15

ELI5, what is assembly?

2

u/[deleted] Nov 04 '15

Okay, computer's read binary. 1's and 0's that make up any number you can think of using base-2. In order to make this quicker, some Computer Scientists came up with hexadecimal. Base-16, in which most processor "operands" use. So assembly is really just a markup for hexadecimal values that represent things the processor does. Using these "operands" you can move memory, communicate with hardware, or really do anything a computer can do.

Assembly is usually only written nowdays by people who write compilers (as high level languages output assembler), people who write operating systems (like Linux, Windows, etc) or optimizers. As it's one-to-one with the computer (each line of assembly language is one thing the processor does), it's really not efficient to write anything but the lowest levels of an operating system in assembly.

TL;DR Assembly is a human readable version of "machine code"

2

u/AnotherSmegHead Oct 31 '15

Oh my... I... I know some BASIC... is.... is that still useful? ;n;

3

u/devilpants Oct 31 '15

Only if it's Atari basic.

1

u/registrant Oct 31 '15

I know IBM 360/370 Assembler.

1

u/ILikeLeptons Oct 31 '15

i thought the voyager's processors were CDP1802's?

1

u/Tim018 Oct 31 '15

Space cowboys... for programmers

awesome

1

u/thegreatgazoo Oct 31 '15

Why wouldn't they use C? It compiles pretty neatly down to assembly and would be a lot easier to debug, troubleshoot, and document.

7

u/mutatron Oct 31 '15

It's already written in Fortran and assembler, there's not much upside to converting that to C. The assembler parts are probably just fiddly bits to connect with Fortran, so it's not that much assembler code, and what there is of it has been working for 40 years. C would just spew out some assembler code you'd have to go over with a fine tooth comb anyway.

→ More replies (1)

1

u/Killer_Tomato Oct 31 '15

I got an internship at jpl simply for knowing basic idl at the earth science division. Didn't do any actual programming but got a resume booster.

1

u/[deleted] Oct 31 '15

This sounds like something that would be up Steve Wozniak's alley.

1

u/Xuttuh Oct 31 '15

If they'll employ Australians, hit me up.

1

u/SmokingChrome Oct 31 '15

I wonder how NASA reasons about this.

1

u/mk_gecko Oct 31 '15

FYI: Assembly program: The program asks for a number, and then prints out the following 10 numbers.

http://quarkphysics.ca/programming/prog_ex.htm

Will NASA hire me? (It looks like this page was written in 2009)

1

u/dada_ Oct 31 '15

We're finally gonna get them back from the Delta Quadrant?

1

u/foldo Oct 31 '15

While we are at it. Does anybody know of a good site/way to learn (ARM) Assembler online?

Im in first year of college and we are learning assembler, but most of the time I feel like I have no clue what Im doing.

1

u/tt23 Oct 31 '15

Fortran has old roots, but is certainly not ancient. https://en.wikipedia.org/wiki/Fortran#Fortran_2015

→ More replies (2)

1

u/altheitalian Oct 31 '15

No, thanks. I am sure at S.H.I.E.L.D. they use more recent technology

1

u/microfortnight Oct 31 '15

I feel wanted!

(1985 B.Sc. in Computer Science)

1

u/whydoismellbacon Oct 31 '15

I'm sure someone over at 4Chan can help with 4tran.

1

u/AMMJ Oct 31 '15

I know Fortran and Basic...it's my time to shine, bitches!

1

u/fzammetti Nov 01 '15

Ah! Finally, all those years of late nights coding crack intros and demos on the C64 when I was a kid plus the one Fortran class I took in high school because for some crazy reason they offered a class in it is gonna make me rich! Who'da thought THAT mix of experience would be the thing that could get me as close to space as I'm ever likely to get!

(if I didn't already know I couldn't deal with the type of rigidity NASA demands I'd seriously be sending in my resume right now)

1

u/Wetbung Nov 01 '15

As an ancient embedded developer, that sounds like fun. I love writing in old assembly languages on very limited hardware.

1

u/betterbarsthanthis Nov 01 '15

I last used FORTRAN in 1978. Punch cards.

→ More replies (1)

1

u/[deleted] Nov 01 '15

I took fortran in college, around 94. It was a dead language then, taught by an oriental guy who didn't speak much english and what he did speak was unintelligible.

Yeah I failed.

1

u/MaxSwagger Nov 01 '15

Damn I used to use those languages on good old VMS systems. NASA here I come.

1

u/cybelechild Nov 01 '15

I always wanted to work for one of those space people. Too bad I don't know Fortran and am just an ordinary sucker :(

1

u/maddentim Nov 01 '15

What has always impressed me with programmers of this era is the ability to do so much with, in today's terms, so little in resources.

as well as the ability to command a machine with just around 68KB of total memory.

1

u/NewAnimal Nov 01 '15

I think ill send them my resume just to give the HR a good laugh. they probably need it.

1

u/Yidyokud Nov 01 '15

What kind of assembly? Intel, AT&T? I'm coming. Probably they meant machine code tho based on the article. And that's a whole other thing lol...

→ More replies (1)

1

u/newoldwave Nov 01 '15

I coded both languages about 40 years ago, but doubt if I can remember most of it. This situation sounds like the typical FUBAR I have seen made by corporate managers.

1

u/mszegedy Nov 01 '15

Assembly's fine, FORTRAN can go suck a cock (although I hear it's not actually bad once you're used to it). I wish Voyager had been a LISP machine instead, that's one ancient programming language I'd love to maintain code for

1

u/g4m3c0d3r Nov 01 '15

I don't understand this. Why not just write a back-end to GCC designed for Voyager's CPU? Modern compilers will out optimize an old FORTRAN compiler. Then you have the pick of the very large C / C++ community of programmers, litter. I mean, I've programmed in FORTRAN 77 and 6502 & 68K assembly, and I'd much rather just use C.

1

u/StephenColbert46 Nov 01 '15

A lot of code at NASA is still in Fortran. Too many lifer engineers who learned it once and then used it forever. And updating the code is time consuming and difficult, so nobody does it.

1

u/efrique Nov 01 '15

I did both (several varieties of each) way back when... and then 15 years+ later did okay off it because there weren't too many people around who could fix fortran code.

But I got sick of fixing other people's shitty code after a while. Haven't done any for nearly 20 years now

1

u/ConjurorTF Nov 01 '15

They really need to look to the old school demoscene (which is still very active). Demos are 100% assembly and involve cycle exact programming of custom processors as well as the usual collection of low powered 8/16/32 bit CPUs on very low memory systems.

1

u/Tobblo Nov 01 '15

Damn, I should have learnt fortran instead of cobol.

1

u/greydalf_the_gan Nov 01 '15

Fortran... shudders

1

u/[deleted] Nov 01 '15

Any programmer fluent in a procedural language from the C family can understand Fortran in a few days -- it's not a big, complex, or tricky language. It's not like they are searching for Navajo speakers, it's just another computer language.

Finding programmers who can read and write assembly, and especially work with limited resource hardware is harder, since any programmer under 40 years old has likely never been exposed to limited memory or simple CPUs.

I used to do this kind of programming, though not for NASA, it's an order of magnitude simpler than trying to get a simple web application to work. On the other hand the code must be correct, so there's a level of QA and testing that most programmers have never experienced, because a to-do list or connecting to the FourSquare API is not mission-critical to anyone.

1

u/oh-just-another-guy Nov 01 '15

I've never coded in Fortran, was probably born 10 years too late for that. But I always get nostalgic when I think of the late 80s, early 90s days of assembler, C, GWBASIC, DOS TSRs, Peter Norton's book, the early boot sector viruses, etc.

1

u/webauteur Nov 02 '15

When aliens finally contact us, they will use Fortran, only no programmers will be left to understand the message. That would make a great Star Trek movie!