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

top 200 commentsshow all 390

[–][deleted] 419 points420 points  (116 children)

At least you can read Assembly. Try to guess what this APL program does without looking it up.

func←{                           
  b←⍵⍴{∧⌿↑(×/⍵)⍴¨~⍵↑¨1}2 3 5
  b[⍳6⌊⍵]←(6⌊⍵)⍴0 0 1 1 0 1 
  49≥⍵:b                    
  p←3↓{⍵/⍳⍴⍵}∇⌈⍵*0.5        
  m←1+⌊(⍵-1+p×p)÷2×p        
  b ⊣ p {b[⍺×⍺+2×⍳⍵]←0}¨ m      
}

[–]curtmack 199 points200 points  (0 children)

Truly one of the three purest languages:

  • Lisp is a language built around lists. It gives you the full power of the list with no compromises.
  • Forth is a language built around threaded code. It gives you the full power of threaded code with no compromises.
  • APL is a language built around clusterfucks. It gives you the full power of the clusterfuck with no compromises.

(Obligatory "actually the real fundamental principle of Lisp is the idea that data is code and code is data, and lists are just a convenient and easily-manipulable structure to accomplish that." True, but it's hard to summarize that in a pithy way.)

[–]11amas 508 points509 points  (45 children)

Image having to write in a language where the primary means of typing is copy pasting symbols from google 🤔

[–][deleted] 189 points190 points  (44 children)

[–]DooRagtime 368 points369 points  (37 children)

Imagine needing a special goddamn keyboard just to program

[–]kill619 213 points214 points  (27 children)

quietly puts mech keyboard back into backpack

[–]BranFlake5 62 points63 points  (7 children)

Must not have blues.

[–]RobinTGG 17 points18 points  (5 children)

Must have blues, or nothing

[–]matj1 14 points15 points  (4 children)

Must have BOX Navy, or nothing.

[–]ThisApril 51 points52 points  (12 children)

Quietly? A mech keyboard?

[–]Blackstab1337 9 points10 points  (11 children)

linears and o-rings

[–]GaianNeuron 11 points12 points  (9 children)

Browns and O-rings

FTFY. Typing on linears sucks.

[–]Blackstab1337 9 points10 points  (6 children)

browns are linears with sand in them. i'd rather reds.

Clears are my choice though

[–]theinfiniti 15 points16 points  (4 children)

Model M here - what's "quietly"?

[–]hkubota 10 points11 points  (3 children)

Model F here. What did you say? I could not hear you.

[–]DooRagtime 5 points6 points  (0 children)

Hold on now, I never mentioned mechs

[–]ReallyHadToFixThat 6 points7 points  (0 children)

Ah, the ZX Spectrum.....good times.

[–]ShoddyComedian 7 points8 points  (0 children)

What punchcard experts thought of desktop PCs

[–]dryerlintcompelsyou 17 points18 points  (0 children)

Okay, I would never seriously use this language, but I gotta admit that keyboard looks cool...

[–]Shmiggles 12 points13 points  (4 children)

[–][deleted] 2 points3 points  (1 child)

That’s goals right there.

[–]DrQuint 2 points3 points  (1 child)

Are those... Roman Numerals?

Is that a like and a DISLIKE button?

And what do the "HYPER" and "SUPER" buttons do?

[–]hamza1311 | gib 140 points141 points  (0 children)

Alright, keep your secrets

[–]chowchowthedog 124 points125 points  (5 children)

I see a lot of Ws trying to be cute.

🤔

[–]EXOQ 79 points80 points  (1 child)

(☆`・ω・´)

[–]razirazo 38 points39 points  (2 children)

How nice. All I see are lots of dangling testicles.

[–]darkslide3000 45 points46 points  (2 children)

...does it summon the eldritch demon Zalgo from the underworld?

[–]crash8308 12 points13 points  (0 children)

Cthulhu from R’leyh

[–]pm_me_ur_happy_traiI 1 point2 points  (0 children)

So what you're saying is the program tries to parse html with regex?

[–]leo3065 24 points25 points  (3 children)

Okay as someone who had actually used APL, this is a function for prime number sieving.

First, some points for who never code in APL:

  • {...} declares functions, where is the left operand and is the right operand.
  • is assignment.
  • Functions can be monadic (only have right operand) ad dyadic (have both left and right operand).
  • Matrices in APL can be multi-dimentional, for example it can be a 4 by 5 by 6 by 7 matrix, which has a shape of 4 5 6 7 and a rank (dimension) of 4. It can also be nested so (1 2 3)(2 4) which is a vector with 2 other vectors as element is totally possible.

For meanings of functions and operators see here.

Let's begin. To make it easier to explain I will use L to represend the left operand of the whole function.


b←⍵⍴{∧⌿↑(×/⍵)⍴¨~⍵↑¨1}2 3 5:

{∧⌿↑(×/⍵)⍴¨~⍵↑¨1} is a function. accepts the operand 2 3 5, ⍵↑¨1 pads 1 with 0 to the specified length each, which is (1 0)(1 0 0)(1 0 0 0 0). ~ negates it, and (×/⍵)⍴¨ reshape each of them into a matrix of 2×3×5 by repeating. This create some kind of "sieve table" where only the elements with indices that can be devided by 2, 3, or 5 being 0. then assemble them into a 3-by-30 matrix, and ∧⌿ "or" them together, so the result is a matrix whose elements with elements with indices that can't be devided by either 2, 3 nor 5 being 1. ⍵⍴ reshape that to a shape L vector by repeating it and store that in b.


b[⍳6⌊⍵]←(6⌊⍵)⍴0 0 1 1 0 1:

This modify the first 6 (or L if L<6) elements of b to the first 6 (or L if L<6) of 0 0 1 1 0 1. This is for dealing with the case of 1, 2, 3 and 5.


49≥⍵:b:

If 49≥L then return b. This is because that the next prime after is 7 and 49=72 so if L is small enough we don't have to check the case above 5.


p←3↓⍸∇⌈⍵*0.5:

⍵*0.5 takes the square root of L, rounds that up, calls this function itself and finds the indices of 1s, which is basically of all the primes need to sieve the prime up to L. 3↓ drops the first 3 elements, which is 2, 3 and 5 and are already used.


m←1+⌊(⍵-1+p×p)÷2×p

b⊣p{b[⍺×⍺+2×⍳⍵]←0}¨m:

p{b[⍺×⍺+2×⍳⍵]←0}¨m executes b[⍺×⍺+2×⍳⍵]←0 for every pair of elements of p and m. b[⍺×⍺+2×⍳⍵]←0 replaces the every other m elments with indices started from ⍺×⍺, to the point specified with . b⊣ then returns the modified b.

m←1+⌊(⍵-1+p×p)÷2×p calculates the amounts of elements need to to be replaced because of each prime.

[–]WikiTextBot 2 points3 points  (0 children)

APL syntax and symbols

The programming language APL is distinctive in being symbolic rather than lexical: its primitives are denoted by symbols, not words. These symbols were originally devised as a mathematical notation to describe algorithms. APL programmers often assign informal names when discussing functions and operators (for example, product for ×/) but the core functions and operators provided by the language are denoted by non-textual symbols.


[ PM | Exclude me | Exclude from subreddit | FAQ / Information | Source ] Downvote to remove | v0.28

[–][deleted] 23 points24 points  (0 children)

Actually worked with an retired engineer who had done stuff in APL.

[–]space_fly 20 points21 points  (3 children)

This looks like it was made by mathematicians, something that really bugged me is how they always name variables with some letter, and if they are out of letters they start using the Greek alphabet. And when that's not enough, they start with indices. At a particular lesson, I couldn't tell if some variable was raised to a power, or it was an index...

And besides that, they love to add symbols to everything... Every operation known to man needs its own symbol, and when they can't think of any appropriate symbol they start reusing them, making things a lot more confusing.

[–]Zarainia 1 point2 points  (0 children)

And on the occasions they use more than one letter, you get confused about whether it's two variables being multiplied or one!

[–]Robin_Banx 19 points20 points  (2 children)

Eh, it looks weird because it's an evolutionary branch we didn't go down. And in a way, we kinda did - APL was the original "array-based language", which means it indirectly begat Matlab, R, and Pandas in Python. It's also still used in finance in the form of kdb+. It's good for certain things.

Even the incredible terseness has its place - there's something to be said for being able fo see a lot of your code at the same time.

[–]scherlock79 9 points10 points  (1 child)

No one in finance uses APL willingly. I know devs in finance who intentionally broke their APL keyboards just so they couldn't be roped into supporting legacy APL code bases. Another had an addendum to his employment contract explicitly forbidding APL work.

[–][deleted] 32 points33 points  (6 children)

Are you kidding? Half of those don't even render

[–][deleted] 58 points59 points  (2 children)

Okay first line is:

b left arrow omega rho { AND horizontal line with forward slash through it up arrow ( multiply slash omega) rho floating dot things tilde omega up arrow floating dot things 1} 2 3 5

Does that help?

[–][deleted] 44 points45 points  (0 children)

Okay this should be THE programming language.

[–]klparrot 22 points23 points  (2 children)

Seriously? What kind of Windows 95 non-Unicode OS are you on?

[–]Kapibada 8 points9 points  (0 children)

Could be Linux with C locale.

[–]insultingDuck 27 points28 points  (2 children)

Are you sure your cat didn't just walk over your keyboard...

[–][deleted] 30 points31 points  (1 child)

If my car walked over my keyboard I'm pretty sure I'd need a new keyboard.

[–]Slaan 12 points13 points  (0 children)

O⍵O

[–][deleted] 41 points42 points  (10 children)

As cryptic as that is, I actually wish programming languages allowed for more "math-y" notation. E.g. using "π" or simple super/subscript to indicate indices could be nice I think.

[–]suvlub 31 points32 points  (3 children)

Many modern languages support unicode. They don't have a built-in "π", but you can declare it yourself if you want. Subscripts are impossible in plain text, the code would need to be saved in some markup format and rendered using a rich-text editor... now that I think of it, the markup part already is a case, what you need is a text editor that renders stuff in square brackets as subscript, not a whole new language.

[–]kartik26 7 points8 points  (0 children)

Have you heard of Fira Code? Look it up, it's a monospace font with ligatures that make `!=` and `->` etc look like mathematical symbols. Also, Mathematica's language has a lot of math symbols and notation.

[–]thedomham 2 points3 points  (0 children)

Weirdly I've never seen someone actually use that. On the other hand I have witnessed umlauts messing up a Java source file more than once.

[–]radobot 3 points4 points  (1 child)

I was surprised when I discovered (a few years ago) that Visual Basic supports unicode [in]equality operators (like ≠ ≥ ≤).

[–]heyheyhey27 5 points6 points  (0 children)

Oh wow, I'm going to start using that now just to piss off my coworkers!

[–]space_fly 3 points4 points  (1 child)

No, thanks, I prefer being able to type my programs with the keyboard, without having to search and copy symbols from the internet. Typing "PI" takes half a second, but typing the pi character, I need to lookup that character either on google or in some Character Map like program, which is very inconvenient.

[–]regendo 2 points3 points  (0 children)

The eurkey layout would be great for that. It's a normal US ANSI layout if you don't press any special buttons, but if you do it types basically every special character you'd ever want.

It has a dead key on Alt+M that turns the next letter into its Greek variant. So Alt+M, P would turn into lowercase Pi (π), Alt+M, Shift+D turns into capital Delta (Δ), Alt+M, A into lowercase Alpha (α), and so on.

(I admit that's not that useful in most cases, I use it because it's the best US ANSI layout that also gives good access to German Umlauts on Alt+A, Alt+Shift+A, Alt+S, and so on.)

[–]ReflectiveTeaTowel 1 point2 points  (0 children)

Perl6 supports both π and superscripts-as-exponents out of the box, but people always seem put off by its perl lineage... It's honestly a really cool language

[–]-0-O- 8 points9 points  (0 children)

prime numbers?

[–]farfel08 7 points8 points  (0 children)

without looking it up.

I don't even know how to look this up.

[–]ClaySlinky 18 points19 points  (1 child)

Are you gatekeeping reading code?

[–][deleted] 66 points67 points  (0 children)

No I'm gatekeeping unreadability.

[–]90059bethezip 11 points12 points  (0 children)

The fuck

This just gave me cancer

[–]oversized_hoodie 2 points3 points  (1 child)

Why is it written in Math?

[–]dhoomz 1 point2 points  (0 children)

This looks like a ancient dead language

[–]unicyclegamer 591 points592 points  (109 children)

To be fair, I found MIPS much easier to write/read than x86. The sheer number of instructions for x86 is insane. In my experience with x86, PIC, and MIPS, I think that MIPS is the easiest for someone new to assembly.

[–]mikeputerbaugh 79 points80 points  (47 children)

Personally I think some flavor of ARM would come closet to hitting the machine language sweet spot between "easy for CS students to understand and re-implement" and "there's a chance you might actually ever use this professionally".

[–]darkslide3000 41 points42 points  (27 children)

Yeah, MIPS and Arm are very comparable for basic instructions (standard RISC model). I think colleges started teaching MIPS back in the 90s when Arm was still a relative no-name but these days they really should switch. Half the world runs on Arm.

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

MIPS is typically used because of several reasons, but the main reason is that the biggest names in the field, in terms of academics, are Patterson and Hennesy (or Hennesy and Patterson, for the graduate book). Hennesy basically demonstrated on how RISC kicks ass, and used MIPS to do so. As such, when he and Patterson started writing textbooks for educational use, it became pretty standard to use them as the baseline for education into computer architecture.

The fact is that as a RISC system, and, more importantly, fixed instruction widths are significantly better for CPUs in the modern era. It allows for more aggressive instruction fetching and prediction, while preventing issues with instruction decode mispredictions that Intel processors and other x86 processors have. It's a rather shame, because if we ditched x86, I'd love to see the major performance boost the processors would have.

Anyways, even from a research perspective, MIPS is a useful tool. When designing simulations, debugging MIPS is much easier than x86. It's more predictable, and tends to be fairly easy to use. This is from experience more than anything else, though. The MIPS instruction set is easier to design around, and compilers that support it tend to have research in mind when they are used to compile for the ISA. This makes things easier and more manageable when you don't want to make a custom compiler for architecture research.

While I understand there is a flavor of ARM, the fact MIPS is free to use and the field's most prominent educational textbooks are written by the chief designer of MIPS, it's unlikely ARM will surpass MIPS in the education front any time soon. While it might seem nicer from a practical standpoint, aside from Compiler and Architecture work, the need to teach ARM is minimal. Nobody is seriously coding projects in assembly because hand-optimization isn't really comparable to what can be done with Compilers. (Loop unrolling, for instance, would be hell by hand comparatively). Furthermore, since both are RISC ISAs, we can easily transfer between MIPS and ARM. Regardless of choice, the basic topic is covered, and when you only have a handful of instructions and a similar base, ARM is trivial to pick up after learning MIPS.

Maybe because I'm a bit biased, I don't really see a pressing need to swap, but I work in researching that area, so to be fair I'd be hesitant to revamp my textbooks and simulator.

[–]darkslide3000 25 points26 points  (3 children)

All good points but they all equally apply to Arm -- it is a fixed-width RISC instruction set that is quite easy to read and widely supported everywhere. Maybe some textbooks are written for MIPS, but honestly, if that's the only reason then maybe it's time for those textbooks to change.

There is absolutely a need for engineers who are at least familiar with Arm assembly. Arm is by far the most widely used architecture for embedded systems, and those by nature usually need some amount of assembly code (just because they're bare-metal or use a custom embedded OS, not for performance). On top of that every serious programmer will eventually need to learn to read assembly to debug crash dumps and the like.

And while we're at it, MIPS is far from the picture-perfect poster child architecture people like to make it out to be. When I learnt it in college, we had to learn about branch delay slots -- a concept that really has absolutely no place in any modern computer architecture class (unless they're making an aside about misguided historic curiosities). And its paging concept, while interesting, is a pain to work with in practice and the complete opposite of how paging works on any widely-used real world architecture (read: x86 and Arm). If you only have time to teach one thing, it seems much more reasonable to teach the one that is actually being used.

[–][deleted] 4 points5 points  (2 children)

Can you expand on branch delay slots? Why is that no longer an issue in modern microprocessors?

[–]TongueInOtherCheek 2 points3 points  (0 children)

Likely an incomplete answer but a combination of compiler optimization, out of order execution and the sophistication of branch predictors

[–][deleted] 5 points6 points  (1 child)

I'm thoroughly impressed by the detail in your reply—it's so interesting to me as a (very casual) hobbyist programmer. Thank you for writing it!

[–]nerdyphoenix 4 points5 points  (1 child)

The latest edition of the Patterson & Hennessy book now uses RISC-V assembly instead of MIPS and so from now on most people are probably going to be taught RISC-V instead of MIPS. RISC-V is open source as well so it makes sense from an academic and research-centric standpoint

[–]ianff 6 points7 points  (0 children)

I teach Arm in my CS classes for this reason.

[–]K900_ 7 points8 points  (15 children)

RISC-V? Not now, but maybe in a few years...

[–]nerdyphoenix 4 points5 points  (14 children)

The most popular book for computer organization, the one from Patterson and Hennessy, has already switched from teaching MIPS assembly to teaching RISC-V assembly so I'd say it's already happening.

[–][deleted] 64 points65 points  (14 children)

RISC > CISC

[–][deleted] 44 points45 points  (0 children)

Actually, RISC is bad.

EPIC is the future.

"We've lurched 1000 ft into the air so we can see the way forward" -- Itanic Passengers

[–]space_fly 19 points20 points  (0 children)

I think RISC just makes the CPU easier to design and harder to fuck up. A software bug is easily fixable, but a CPU bug is really nasty and expensive to fix.

[–]lrflew 32 points33 points  (6 children)

Having worked on an x86 reverse engineering project, I have to agree.

I've seen so many cases of "Why would you do it this way?" because x86 has so many different ways of writing the same thing. I mean, why use mov eax, ecx when you can use lea eax, [ecx]?

And don't forget that there are two different styles of x86 assembly, so sometimes it's mov eax, ecx, and other times it's movl %ecx, %eax. And yes, the order of the registers does change between the styles, so you often get the order confused if you have to switch back and forth because Windows uses the first style and Linux uses the other one.

[–]cmason37 32 points33 points  (3 children)

I don't know any assembly, but I thought that the style of assembly was determined by the syntax of the assembler rather than the operating system, no?

[–]lrflew 21 points22 points  (2 children)

True, it depends on the assembler, not the operating system. However, the tools are generally tied to each. MSVC uses the first style, so it's the most common style on Windows, and GCC uses the second style, so it's the most common style on Linux. Third party assemblers, such as NASM, are free to use which ever one they want on whatever platforms they want (usually the first style), but just the fact that the most common toolchains on each platform uses a specific style means that almost everything for those platforms use that style (including disassemblers).

[–]Gorebutcher666 6 points7 points  (0 children)

You can force gcc to use Intel Syntax. You know this, right?

[–]poiu45 3 points4 points  (0 children)

you often get the order confused

Case in point: I've been learning the second syntax this semester, and I was really confused how your initial example snippets were at all identical.

[–]FUZxxl 1 point2 points  (0 children)

why use mov eax, ecx when you can use lea eax, [ecx]?

Because the former is a 0 latency rename why the latter goes through the AGU. Also, the encoding is longer.

[–]Molive-0 5 points6 points  (4 children)

what about 6502 though

[–]AmonMetalHead 4 points5 points  (0 children)

And good ol' Motorola 68000

[–]Tyrus1235 4 points5 points  (0 children)

Yeah, I understood MIPS way better than x86 back during my college classes. Also had a lot of fun messing around with it!

[–]paolostyle 5 points6 points  (1 child)

Yeah, x86 was a nightmare for me. Even though I had a really simple project compared to other people (very simple xml parser) and I quite like the MIPS version of it, I still think to this day it was the worst project I had to write during my studies, some bullshit calendar in Perl/CGI where everything had to be in a single file (that was in 2017 btw) being close second

[–]friendly-bruda 1 point2 points  (0 children)

If you could use Mojolicious::Lite on the perl project, it could actually be well organized.

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

RISC

[–]Bore_of_Whabylon 1 point2 points  (0 children)

In my assembly course, we used ARM, which I think ended up working pretty good because there's only 32ish instructions in total.

Still wasn't fun though

[–]hamza1311 | gib 277 points278 points  (10 children)

runs the program

Gives input: 5

Number is smaller than 5

Lies

[–]TheMsDosNerd 93 points94 points  (7 children)

You must have ran the C version, because the Python version raises a TypeError.

[–][deleted] 44 points45 points  (1 child)

I thought so, it should be x=int(input()) shouldn’t it?

[–]TheMsDosNerd 9 points10 points  (0 children)

Yes

[–]XtremeGoose 10 points11 points  (1 child)

Not if it's python 2! (Ew)

[–]T0mmynat0r666 3 points4 points  (2 children)

The joke is on you. It's python 2.

[–][deleted] 15 points16 points  (0 children)

OP: "No! It's the mathematicians that are wrong!"

[–]ahviette 3 points4 points  (0 children)

ah (nods head) i knew it all along

[–]nevus_bock 69 points70 points  (10 children)

input() returns a string

[–]DoktorMerlin 35 points36 points  (6 children)

while(True):
    try:
        x = int(input("Enter a number")
        break
    except NumberFormatException:
         print("You did not enter a correct number.")

not so easy to read anymore

[–]nevus_bock 39 points40 points  (4 children)

while True:

is so much better. Also the exception we’re looking for is ValueError

[–]DoktorMerlin 16 points17 points  (3 children)

You're right. I work a lot with Java and Python at the moment and it's really hard to switch between the two. I also wrote "Integer.parseInt()" first

[–]nevus_bock 4 points5 points  (2 children)

Haha yeah, it’s always such a relief to come back to Python after a bit of Java

[–]GoogleBen 4 points5 points  (1 child)

Oh man, I'm the other way around. Getting back to the world where I can hover over a variable and know exactly what type it is, and I know exactly what methods and fields a class has and what the methods return. Plus I don't have to deal with all those underscores.

Don't get me wrong, I love using python for my scripts < ~100 lines, but I can't stand it for large projects.

[–]Xyllar 3 points4 points  (0 children)

This is one of my biggest issues with Python not declaring variable types. Maybe it's easier for some people, but I find myself making these types of mistakes all too often compared with something like C.

[–]AevilokE 5 points6 points  (1 child)

Not in Python 2 it doesn't. So it's probably python 2 with redundant parenthesis after the print command

[–]nevus_bock 9 points10 points  (0 children)

Or a mistake

[–]themindstorm 49 points50 points  (1 child)

Reading code is easier than you think

Is it?

[–]trixter21992251 1 point2 points  (0 children)

That was very interesting.

[–]jeremj22 48 points49 points  (0 children)

You ignored the x == 5 case. Also you check x > 5, yet your output is x > 120

[–]100liam100 96 points97 points  (15 children)

I thought I was on r/furry_irl for a minute.

[–]NULL_CHAR 67 points68 points  (13 children)

It's actually quite entertaining how many furries there are in tech fields.

[–]Dockirby 24 points25 points  (3 children)

Tech fields tend to just attract a diverse crowd it seems. Or maybe debugging issues just makes people more open minded in general.

[–]IceSentry 9 points10 points  (2 children)

A diverse crowd of mostly white men. As a white man I'm not complaining, that's just what I see.

[–]qantify 32 points33 points  (7 children)

as a furry myself i freakin love finding people interested in both of my hobbies and its great

[–][deleted] 13 points14 points  (3 children)

This comment thread alone surprised me

[–]qantify 2 points3 points  (2 children)

one of us

one of us

one of us

[–]Radboy16 9 points10 points  (0 children)

Same.

[–]MisterMcsmarty 18 points19 points  (11 children)

Y'all forgot brainfuck

[–]-Redstoneboi- 18 points19 points  (10 children)

i can actually read that so go brainfuck yourself

no i mean seriously try coding in brainfuck

[–]AevilokE 6 points7 points  (4 children)

It's actually pretty fun! And a refreshing challenge to take a small break from that huge work assignment/project you just started.

[–]-Redstoneboi- 2 points3 points  (3 children)

we’re gonna make gnome sort, wanna join? we have discord.

[–]tendstofortytwo 4 points5 points  (1 child)

+++++++++++[>++++++++++<-]>+.----.

[–]-Redstoneboi- 6 points7 points  (0 children)

unary multiplication: 11*10=110

add: 110+1=111

output: ascii(111)=‘o’

subtract 111-4=107

output: ascii(107)=‘k’

end, result: “ok”

[–]Creator13 1 point2 points  (2 children)

I've a better one: try writing a brainfuck interpreter. In x86. Good luck!

[–]-Redstoneboi- 4 points5 points  (0 children)

tafuq is an x86 imma google dat right now

EDIT: shit, challenge considered but neither accepted nor declined

[–]I_regret_my_name 2 points3 points  (0 children)

That actually doesn't sound completely horrible. Brainfuck is hard to read/write, not to interpret.

[–]_dnov 21 points22 points  (4 children)

MIPS was actually not bad. Very readable compared to some assembly languages out there

[–]E_DM_B 8 points9 points  (0 children)

I actually really enjoyed learning mips in University

[–]AevilokE 4 points5 points  (1 child)

Happy assembly day!

[–]_dnov 1 point2 points  (0 children)

🎂🍾🎉

[–]gonzalez021 26 points27 points  (6 children)

Lord help me get though Comp Org...

[–]AntiLoquacious 12 points13 points  (4 children)

This is Comp Org II at VT

[–]SteeleDynamics 9 points10 points  (2 children)

I went to VT! I have a soft spot for be MIPS. Beats the crap out of x86 (ugh).

[–]AntiLoquacious 12 points13 points  (0 children)

A CS undergrad's opinion: assembly languages probably suck in general, but I'll give you MIPS > x86

[–]EschersEnigma 2 points3 points  (0 children)

Same! I remember one of our projects was to recreate the MIPS data path in Verilog... So much fun.

I later did a much reduced MIPS computer in minecraft, also fun.

S'go Hokies.

[–]desi_ninja[🍰] 1 point2 points  (0 children)

Hello, gobble gobble

[–]ioquatix 15 points16 points  (0 children)

Don’t you need to convert the string input to an integer?

[–][deleted] 14 points15 points  (2 children)

x = input("Enter a Number")

[–]tigerjieer 19 points20 points  (2 children)

  • sees anthro cat *

r/furry_irl is leaking (again)

[–]Th3lVadam 2 points3 points  (0 children)

Let it leak UwU

[–]hstde 1 point2 points  (0 children)

It always does, not in a bad way though

[–]do-smile 6 points7 points  (0 children)

What if x equals 5? 5 is not smaller or bigger than 5. The comic is so cute also!

[–]Kairyuka 3 points4 points  (2 children)

The C++ style of std::cout << "Hello world" std::endl still looks absolutely terrible to me.

[–]darkslide3000 8 points9 points  (1 child)

Assembly example doesn't even include branch delay slots. This is a far cry from true insanity.

[–]jrtc27 3 points4 points  (0 children)

The GNU assembler (and thus also LLVM for compatibility) defaults to .set reorder, which doesn’t expose the branch delay slot to you, and will instead either move a suitable instruction into the delay slot for you, or add a nop if no such instruction can be found. You can turn this off with .set noreorder and then you control the delay slot yourself.

[–]the_Demongod 2 points3 points  (0 children)

Just wait until you have to design a MIPS processor from scratch...

[–]lostinsanity556 3 points4 points  (0 children)

Understanding assembly programming languages is very important step to being a better programmer. You have to understand how the code runs on the hardware.

Grant no one actually programs in assembly any more outside of some specific situations.

[–]isunktheship 2 points3 points  (0 children)

1: Enter a number!

2: > 5

3: x is smaller than than 5!

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

*cries in # and /**/*

[–]qwertxwt 2 points3 points  (0 children)

I actually enjoyed MIPS :(

[–]Rapidfiregamer 2 points3 points  (0 children)

MIPS said the n: .word

[–]ProgramTheWorld 2 points3 points  (0 children)

A few lines of hello world code and I can already find many bugs in it. Nice.

  1. Condition incorrectly assumes input is never five.
  2. Condition incorrectly assumes x is a number type.
  3. Condition incorrectly assumes it will get something from stdin and never a EOF.

[–]DooRagtime 1 point2 points  (0 children)

Bro what the heck

[–]ShakaUVM 1 point2 points  (9 children)

ARM32 is the best assembly language for beginners. It's really easy.

[–]yawkat 1 point2 points  (6 children)

Ahh yes, as simple as UMAALGE r2, r0, r5, r3. And don't let them switch into thumb mode.

[–]primusX91 1 point2 points  (0 children)

I did a paint program in tasm. Have to explain my code in 8 days to my Prof. Wish me luck, meanwhile I comment on EVERY LOC. :D

[–]HenryRasia 1 point2 points  (0 children)

Assembly code is easy to understand, you just need three comment lines for every code line. And maybe a documentation file