Skip to content

A compilation of algorithms in various languages.

Notifications You must be signed in to change notification settings

chclam/algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Into the Depths

It's hard to program well. Modern programming languages are convenient and black boxy. But this causes us to distance ourselves more and more from the inner workings of the technology. This is an attempt at implementing simple algorithms in increasingly lower level of abstraction. For each challenge, we first implement it in a higher level language such as Python and then in C, and then in NASM assembly (x86). I've also decided to pick up a functional language for obtaining a broader view in programming. Some of the challenges will therefore also contain implementations in Haskell.

A few challenges that I've set up for myself are the following.

  • Basics (only for assembly)
    • Hello world
    • Variable assignment
    • Addition and subtraction
    • Conditional branching
    • For loops
  • Min
  • Sum
  • Fibonacci
  • Bubblesort
  • Insertionsort
  • Binarysearch
  • Mergesort
  • Quicksort
  • Dynamic Programming

Assembly

Following a list of sources:

  • A general introduction (no tutorial) for assembly languages and assemblers: Introduction to x86 Assembly Language Programming
    • We knew that there were various assembly languages. However, there are also languages that are OS-specific due to the assembler that converts it into an executable file. For x86 on Microsoft Windows, for example, there is MASM. A more general and free type of assembler is NASM (Netwide Assembler)
  • Tutorial on Assembly: Wikibook on x86 Assembly
  • Book on x86 Assembly in NASM (Duntemann, 2011)
  • Extensive guide on programming in x86 on Ubuntu (Jorgensen, 2020)

Haskell

Again, a list of sources:

  • The wiki seems to be a good source for reference: Haskell Wiki;

References

  • Duntemann, J. (2011). Assembly language step-by-step: Programming with Linux. John Wiley & Sons.
  • Jorgensen, E. (2020). x86-64 Assembly Language Programming with Ubuntu.