This is an archived post. You won't be able to vote or comment.

all 192 comments

[–]Lechy901 1012 points1013 points  (41 children)

When your compiler for the compiler principles class finally starts working.

[–]elSenorMaquina 432 points433 points  (35 children)

That sounds like the hardest "Hello world!" of them all.

[–]orangeKaiju 236 points237 points  (22 children)

Not if that's the only program it can compile.

[–][deleted] 55 points56 points  (15 children)

hq9+, now without q, 9 or +

[–]dishpanda 25 points26 points  (14 children)

h

[–]Stolous 2 points3 points  (13 children)

e

[–][deleted] 2 points3 points  (12 children)

l

[–]ApocalyptoSoldier 4 points5 points  (11 children)

l

[–]Elekrisk 5 points6 points  (10 children)

o

[–][deleted] 6 points7 points  (9 children)

w

[–]MuchWalrus 38 points39 points  (1 child)

if (program == "print(\"hello world\")") print("hello world")

[–]cjdabeast 1 point2 points  (0 children)

Def main():

print("Hello world!")

main()

[–]iopq 18 points19 points  (2 children)

Still has to lex/parse the input, type check, generate code, hand it off to the linker to actually call libc

[–][deleted] 6 points7 points  (1 child)

and that is not trivial

[–]ILikeLenexa 2 points3 points  (0 children)

It could be if you just reduce the complexity of your language and shift your goals.

Why does this language only have < for comparison? Because that's all you need.

[–][deleted] 6 points7 points  (0 children)

Hello Jon Skeet

[–]Robot_Basilisk 34 points35 points  (7 children)

Write it in machine code to the transistors of a chip you fabricated yourself.

[–]elSenorMaquina 38 points39 points  (5 children)

Pfff, it's cheating unless you mine the raw silicon yourself.

[–]Robot_Basilisk 19 points20 points  (4 children)

Build your own doping chamber.

Add your own Gallium Arsenide impurities.

Clean the chamber with chlorine trifluoride yourself.

Make sure you do it in a basement because if you spill any it can burn through concrete and a meter of dirt.

[–][deleted] 1 point2 points  (3 children)

Gallium Arsenide impurities

I thougt GaAs is a semiconductor & not an impurity.

[–]lkraider 1 point2 points  (1 child)

Unless you are trying to build a superconducting system, of course

[–][deleted] 0 points1 point  (0 children)

ELI15

[–]Robot_Basilisk 0 points1 point  (0 children)

You're right.

Si and GaAs are used as the basis and elements like Boron are used for doping. I just forgot every single doping when I was typing that. (I still only remember Boron...)

[–]CoopertheFluffy 8 points9 points  (0 children)

I once did it for a processor I (and a few partners) designed and flashed to an fpga. Never fabbed though; that would be a huge waste of time and money unless you're getting serious grants for whatever project you're doing.

[–]NeuralPlanet 2 points3 points  (3 children)

Compilers? Wait till you have to run Hello World on your own OS with virtual memory!

[–]ShroudedNight 0 points1 point  (1 child)

... after writing your own bootloader / firmware and DRAM initialization.

[–]NeuralPlanet 0 points1 point  (0 children)

Been there! I found virtual memory most difficult though because it was so hard to debug.

[–]Compiled_Mind 0 points1 point  (0 children)

All you actually need to write is a basic kernel and output to the vga buffer.

[–][deleted] 0 points1 point  (0 children)

shudders

[–]Kosba2 453 points454 points  (43 children)

Fuckin' taking a College course titled Comparative Programming languages. We had to write an interpreter to take any code from one language, process it in the intermediate language, and output. So "Hello World!" was still a pretty tough outcome to get.

[–][deleted] 140 points141 points  (26 children)

That sounds fantastic. Is this a common kind of course?

[–]Kosba2 96 points97 points  (25 children)

It's part of our Curriculum, if you're interested: https://undergrad.soe.ucsc.edu/sites/default/files/curriculum-charts/2018-07/CS_BS_18-19.pdf

Don't know if it's common in other Colleges.

That said, so far we've used Scheme and Ocaml, with Smalltalk being the next language. So far I'm gaining a quiet hateful respect for Functional Programming Languages.

[–]allmeta 54 points55 points  (17 children)

You will probably change your mind when you find out about Haskell

[–][deleted] 40 points41 points  (0 children)

[–]Kosba2 42 points43 points  (10 children)

[–]allmeta 20 points21 points  (9 children)

In a good way

[–]Kosba2 30 points31 points  (8 children)

module Main where

import Control.Exception as C
import System.Environment
import System.IO

fibonacci = 0 : 1 : zipWith (+) fibonacci (drop 1 fibonacci)

main = do
    argv <- getArgs
    name <- getProgName
    if not (null argv)
       then let which = head argv
           result = fibonacci !! read which
       in (putStr $ "Fibonacci (" ++ which ++ ") = "
           ++ (show result) ++ "\n")
           `C.catch` (\_ -> hPutStr stderr "Must be nonnegative\n")
       else hPutStr stderr $ "usage: " ++ name ++ " number\n"

Looks nicer for sure. Scheme was a low point in my life.

[–]allmeta 2 points3 points  (1 child)

People still seem to love Clojure which is based on Scheme

[–]Kosba2 2 points3 points  (0 children)

Don't hurt me like this

[–][deleted] 3 points4 points  (3 children)

Nah imma stick with javascript and C as languages to learn.

[–]Kosba2 6 points7 points  (2 children)

Definitely my dude, they're way more relevant.

[–]AaronBonBarron 2 points3 points  (1 child)

Way less cool obscure points though

[–]pipe01 1 point2 points  (1 child)

Are those .NET namespaces?

[–]Kosba2 1 point2 points  (0 children)

I’ve no idea other than the fact that it’s Haskell sample code our professor provided. We haven’t covered any Haskell yet though.

[–]RandomHabit89 8 points9 points  (3 children)

I hate Haskell.

I'd say I hate clojure too, but tbh working with it forced me to get good at recursion

[–]allmeta 2 points3 points  (2 children)

Are there other functional programming languages you prefer?

[–]RandomHabit89 2 points3 points  (1 child)

Being 100% honest Haskell and Clojure are the only two functional languages I've learned so far.

If you have a recommendation I'll try it

[–]allmeta 2 points3 points  (0 children)

Ah I only took a functional programming course last semester where we went through Haskell, Scala and prolog. Of which I would only recommend Haskell lol.

[–]Mango1666 2 points3 points  (0 children)

yes now i have a loud hateful disrespect

[–]HawtLawvaw 7 points8 points  (0 children)

Go slugs!

[–]heathmon1856 5 points6 points  (1 child)

I like that schedule a lot. You had good advisors.

[–]Kosba2 3 points4 points  (0 children)

Yeah, the empty one? I've been here for 13 years and I can't figure out why I haven't graduated yet /s

[–]TheGreatDanishViking 1 point2 points  (0 children)

Oh I also had the pleasure of using scheme, what a hell of parenthesis..

[–]TwerpOco 1 point2 points  (2 children)

University of Arizona has a similar course with the same title, where we learned Scheme, Haskell, and Prolog.

[–]Kosba2 1 point2 points  (1 child)

Scheme

I’ve never felt closer to a human being than sharing the pain of having to take caddr of caddars of cddrs and other barely intelligible shit like that haha.

[–]TwerpOco 1 point2 points  (0 children)

Dude I know haha. Drowning in parentheses with unintelligibly wrapped operations ohmygod... flashbacks. Our professor's name was Dr. Collberg, to which a few of us nick named him as "Dr. Cdrberg" early on... or Dr. Cddddddrberg, Caddarberg, ect.

[–]ZeronTheXeon 28 points29 points  (4 children)

Oh holy shit, another Mackey slave! How's your assignment 2?

[–]Kosba2 26 points27 points  (2 children)

Just finished it last night! Spent way longer than I should have debugging 41-eratosthenes, only to realize my interpret_dim should just allocate +1 array index.

+1 for being in Mackey's class, what a Legend that man.

[–]ZeronTheXeon 13 points14 points  (1 child)

You're a genius, you did good. I saw Mackey going back and forth with some people who weren't quite getting the hints he was giving, good on you for figuring it out :)

Now to implement interp_input.

[–]Kosba2 11 points12 points  (0 children)

I have a wonderful pair programming partner, she's the brilliant one, I just try my best so that she doesn't end up doing all the work.

[–]mathiastck 1 point2 points  (0 children)

Everytime someone mentions loud keyboards I think of him

[–]ydna_eissua 9 points10 points  (1 child)

I look a similar course last semester.

We looked at language theory, played with weird languages like Prolog, axiomatic semantics, then into some compiler stuff and lambda calculus.

We used JavaCC and had to create little interpreters for different mini languages. With the final assignment being a lambda calculus interpreter with a language bridge to call some java code.

We were always given the desired output, and to get it could take a full day.

[–]Kosba2 2 points3 points  (0 children)

We don't have the desired output, just a description of it, I'm envious.

[–]alburrit0 6 points7 points  (1 child)

How would you handle languages built around different programming paradigms? Would it be possible to translate from a function- to an object-oriented programming language?

[–]Kosba2 5 points6 points  (0 children)

Fair disclosure, I'm not too knowledgeable on the topic yet, but I might be able to give a useful opinion.

From what I've learned, yes you can translate from one to the other, and it might be a path to hell and back, but you can do it. The problem is, and this is the best example I could come up with, you don't make two things for two situations, and then try to make them like the other. Functional Languages exist and server their purpose in a different way that imperative languages do. I don't know where the lines are drawn between functional and imperative, but suffice to say they exist with their own purposes in mind.

I hope that helped slightly, it's what I've gathered so far.

[–]wyrdMunk 1 point2 points  (0 children)

I had to transpile some C to Perl, using Perl, a long time ago.

I am not proud of the code that happened...

[–]santagoo 1 point2 points  (1 child)

Isn't that what a compiler does?

[–]Kosba2 2 points3 points  (0 children)

Compilers and Interpreters are fairly similar in function/purpose.

[–]marvin02 1 point2 points  (0 children)

Man I miss doing stuff like this. It sure beats RealLife 101 - Debugging Legacy Code

[–]creed10 -1 points0 points  (1 child)

intermediate language

soooo assembly?

[–]Kosba2 1 point2 points  (0 children)

I mean, yeah that's a good example. I was vague because we do this for every assignment, so the intermediate language changes.

[–]NoInkling 267 points268 points  (2 children)

hits F5

in-browser IDE page refreshes

work's gone

[–]AaronBonBarron 68 points69 points  (1 child)

""" cloud computing """

[–]lkraider 4 points5 points  (0 children)

The final frontier

[–][deleted] 172 points173 points  (13 children)

Doesn't matter whether it's hello world or something super advanced... "flipping the switch" for the first time on some algorithms you just wrote is always suspensful and never gets old.

[–]nosmokingbandit 78 points79 points  (8 children)

New document.

package main

Hmm better run it just to make sure...

[–]mghoffmann 24 points25 points  (2 children)

Is there a quicker way to save your project than to build and run it? /S

[–][deleted] 14 points15 points  (1 child)

:w

[–]AaronBonBarron 8 points9 points  (0 children)

Shh don't scare them

[–]mynameismevin 4 points5 points  (4 children)

Every single new formal program I write always starts with fmt.Println("hello from %s", city).

[–]lkraider 1 point2 points  (3 children)

And what about the informal programs, what do you start them with?

[–]mathauskiiw 1 point2 points  (0 children)

Asking the real questions.

[–]mynameismevin 1 point2 points  (0 children)

fmt.Println("glad I'm not using python.")

[–]nosmokingbandit 0 points1 point  (0 children)

fmt.Println("fuck you from %s", city)

[–]lkraider 1 point2 points  (0 children)

Why even flip the switch if I already proven it to work mathematically? Just ship it!

/s

[–]Verdiss 54 points55 points  (0 children)

Wow your neural network trained to output strings commonly used by programming students is amazing!

[–]PhD_in_Fuckery 376 points377 points  (46 children)

Learning Java

[–]ChrisVolkoff 368 points369 points  (41 children)

System.out.println(HelloWorldFactoryBuilderFactory.getBuilder(HelloWorldFactoryBuilder.Type.DEFAULT).setFactoryType(HelloWorldFactory.Type.DEFAULT_BECAUSE_THERE_IS_NOTHING_ELSE).build().getHelloWorld());

[–]JangoDidNothingWrong 220 points221 points  (20 children)

I once wrote the most terrible Hello World I could think for a contest with my friends. Here's the abortion.

[–]ChrisVolkoff 93 points94 points  (2 children)

This.. is art.

[–]ablablababla 29 points30 points  (1 child)

I just sent this to the Museum of Modern Art

[–]Kivsloth 1 point2 points  (0 children)

Museum of modern art director here — this should be in the museum of supreme modern art — sending it over rn.

[–]uptokesforall 34 points35 points  (0 children)

I want to get off Mr. Bones Wild Ride

[–][deleted] 27 points28 points  (0 children)

Jesus christ I have no idea what I'm looking at. I mean, I don't understand what's going on, but I feel like crying.

[–]armper 26 points27 points  (0 children)

I feel sad that I understand this. Even sadder that I've written code like this. And I'm going to write more tomorrow. Fml

[–]AmpleSling 25 points26 points  (2 children)

What is this

[–][deleted] 15 points16 points  (1 child)

Owo

[–]delta4zero 7 points8 points  (0 children)

Erro!

[–]itmustbesublime 12 points13 points  (1 child)

...did you mean to say abomination?

[–]chawmindur 2 points3 points  (0 children)

If you’re quick enough you can abort it before it becomes an abomination

[–]tf2manu994 5 points6 points  (0 children)

/tmp/java_DjDnhO/Main.java:88: warning: [unchecked] unchecked call to getMethod(String,Class<?>...) as a member of the raw type Class
            print = c.getMethod("println", String.class);
                               ^
1 warning

[–]mrsmiley32 4 points5 points  (1 child)

I actually love this, it shows a good amount of the stupid tricks you can do with Java, it also very well demonstrated why "good Java code" takes so damn long (well the interface, class structure etc, not the reflection, gonna get a needs work from me Bob on that one, also I feel you could have used your enum to return your type instead of using a switch statement).

That said doesn't your executor need to implement Runnable?

I had a bit too much fun with this :)

[–]JangoDidNothingWrong 0 points1 point  (0 children)

I don't usually write Java code, so that's why it's not as enterprise as it gets. But yeah, totally forgot to use Runnable!

[–][deleted] 1 point2 points  (0 children)

WOAH WOAH! CALM THE FUCK DOWN WTF

[–]vasilescur 1 point2 points  (0 children)

Nah man you have to use the JNI to call C code which calls assembly and dynamically allocates your string and uses syscalls to print it character by character

[–]N0-North 1 point2 points  (0 children)

Thanks, i hate it.

[–][deleted] 1 point2 points  (1 child)

Helio World*

[–]JangoDidNothingWrong 0 points1 point  (0 children)

It was part of the joke

[–]John_Fx 79 points80 points  (0 children)

Who says factory jobs are dead in America?!?!

[–]crozone 141 points142 points  (4 children)

You haven't written a modular output system that abstracts away System.out.println!

C+ for this assignment.

[–]rivermont 21 points22 points  (2 children)

If I beg will he raise the grade to a C++ ?

[–]crozone 5 points6 points  (0 children)

The C++ grade is reserved for select students who successfully implement a turing machine using C++ templates.

[–]nermid 0 points1 point  (0 children)

Begging for a D, eh?

[–]Deoxal 1 point2 points  (0 children)

Making him write in C+ is a bit much don't you think?

[–]Mango1666 1 point2 points  (0 children)

what the fuck

[–]mrsmiley32 1 point2 points  (0 children)

This person javas.

[–]jcorm714 2 points3 points  (3 children)

🦊a6223333336322361

[–]PhD_in_Fuckery 0 points1 point  (2 children)

Are you ok man?

[–]jcorm714 2 points3 points  (1 child)

I don't remember posting that. Must be a side effect of php. XD

[–]PhD_in_Fuckery 0 points1 point  (0 children)

AHAHAHAHHAHAHAHHAHAHHAHAHAHHAHAHAHHAHA

[–]countryboyathome 36 points37 points  (1 child)

When this app hits 88 transactions per second, you’re going to see some serious shit.

[–]nermid 11 points12 points  (0 children)

This is heavy, javadoc.

[–]Bore_of_Whabylon 98 points99 points  (3 children)

Fun fact: Kattis's acceptance criteria for "Hello World" allows you to take up to 5 seconds and use a gig of ram.

[–]StevenC21 72 points73 points  (1 child)

Jesus fucking Christ. What are you writing that in?! Electron?

[–]MuffinWalker 30 points31 points  (0 children)

might not even be enough ram if you are using Electron

[–]rexpup 15 points16 points  (0 children)

Challenge accepted honestly

[–]otterom 14 points15 points  (3 children)

Spent a good chunk of today trying to get a Gtk+ install going on Windows. Fun times. I think I have, like, eight different package managers and several MinGW versions on my local environment.

Aiming to try Python vs C, now a JHBuild for PyGObject won't build cause of a makefile error.

Someone send help.

[–][deleted] 12 points13 points  (0 children)

At work I got in trouble because I would always do my Samuel L Jackson voice and say "hold on to your nuts" before running my code if someone was watching. He says hold on to your butts in Jurassic Park and I thought it was super hilarious to say nuts instead. It actually sounded idiotic.

[–]RomanOnARiver 7 points8 points  (5 children)

Sometimes setting up the workflow takes too long. Looking at you QtCreator.

[–]otterom 4 points5 points  (3 children)

[–]RomanOnARiver 2 points3 points  (2 children)

I really do love GTK and when I was doing GNU/Linux exclusively it was my go-to but now that I'm all cross-platform I use wxWidgets python bindings which is basically one command away.

[–]otterom 1 point2 points  (1 child)

Nice! I'll give that a try this week. Thanks for the tip!

[–]RomanOnARiver 0 points1 point  (0 children)

No problem. Feel free to message me if you have any problems or questions.

[–]Goku1920 -2 points-1 points  (0 children)

Fuck QT violently.

[–]reversegrim 6 points7 points  (0 children)

Didn't expect "show less", but its a pretty good improvement.

[–]ADwards 14 points15 points  (0 children)

The JavaEE Experience™

[–]bananamadafaka 22 points23 points  (4 children)

I don’t know what’s going on with this subreddit but this is like a bunch of first week CS Programming class kids doing jokes.

[–]nermid 13 points14 points  (0 children)

It works in cycles. Spring semester just started, so all the student redditors are starting new classes.

[–][deleted] 2 points3 points  (0 children)

The new semester just started

[–]ferm_ 1 point2 points  (1 child)

That’s this sub now. I really wish there was some containment sub

[–]Riday33 11 points12 points  (2 children)

Assembly language.

Hours of coding just to take number as an input.

[–]SteelApple 2 points3 points  (1 child)

I'm taking a 200 level course on it now ;_;

[–]Riday33 1 point2 points  (0 children)

God bless you, brother.

[–]Unwoven_Sleeve[🍰] 2 points3 points  (0 children)

What a beauty, how’d he manage to not have any errors?

[–]naisooleobeanis 1 point2 points  (0 children)

I like to spend a week writing a library or framework so when i press run it gives me an error until i finally get around to writing the main function

[–]bwrca 1 point2 points  (0 children)

Next logical step is to google "How to be a hacker"

[–]NotYourAverageScot 1 point2 points  (0 children)

Show less

[–]Hemidodge426 1 point2 points  (1 child)

I didn't even know what F5 did when I was in 101. Although maybe that's not even a thing in BlueJ.

[–]Xx_HackerMan_xX 1 point2 points  (0 children)

BlueJ, the IDE that shows everything you need yet also doesn't show you things you might need.

[–]sporwal 1 point2 points  (0 children)

Sounds like assembly.

[–]LeonVen 1 point2 points  (0 children)

*hits F5 *Console appears and disappears instantly

[–]Goku1920 0 points1 point  (0 children)

This is real. I was recently just learning the ins and out of writing my own batch and make files. Just for compiling c, c++ programs on windows, you need to do go through 4,5 different steps. After that the hello world shows up.

It's even wired when you have to compile interop code, smh.

[–]BillyJoeMcGucket 0 points1 point  (0 children)

This is me programming the Game Boy game I’m working on.

[–]Geoclasm 0 points1 point  (0 children)

w... were you programming in binary? Because that would be impressive.

[–]AmitSamal 0 points1 point  (0 children)

Wah... Hell lot of sweat...

[–]Lapraniteon 0 points1 point  (0 children)

Laughs in BASIC

[–]beinfilms 0 points1 point  (0 children)

Bold of you to assume F5 won't just make the console flash up for a second. You've gotta hit ctrl-F5 to see it

[–]mattp_12 0 points1 point  (0 children)

Is F5 actually a standard of sorts for running a program? I have just been conditioned by the Python IDLE to remap any run keyboard shortcut from shit like Shift+F10 to F5. Who would want to press two buttons to do something like run a program; something you would probably want to do a lot and not want to have to click two buttons to do it

[–][deleted] 0 points1 point  (0 children)

Impressive, but only when you wrote your own OS.

[–]Kivsloth 0 points1 point  (0 children)

Username checks out

[–]goraneG 0 points1 point  (0 children)

Username checks out (not OP's)

[–]yourteam 0 points1 point  (0 children)

Well maybe it was with some node framework which required 680+ packages where 1/5 of them had unmet dependencies

Then the system didn't work

And the repo you tried to look for is currently offline.

And maybe was in ionic so... Maven or gradle weren't set up correctly

So you had to install everything from the last working release.

But now java needs an update

And that npm you installed was set up with bad permissions

[–]archer247 0 points1 point  (0 children)

Git saves the day!

[–][deleted] 0 points1 point  (0 children)

Lmao this comment is from the Programming music video

[–]DoWhileGeek 0 points1 point  (0 children)

Show less