diff --git a/.helloworld.md.swp b/.helloworld.md.swp new file mode 100644 index 0000000..b4b17fd Binary files /dev/null and b/.helloworld.md.swp differ diff --git a/README.md b/README.md index bbbf366..98f176f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Markdown Workshop +This branch was updated by cosmin. + This is a practical workshop about the syntax and the use of the [Markdown format](https://www.markdownguide.org/basic-syntax/). In particular, we will focus on the [GitHub Flavored Markdown](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax), used by GitHub. See the full specification of the GitHub Flavored Markdown [here](https://github.github.com/gfm/). diff --git a/dynamic-linking.ro.md b/dynamic-linking.ro.md index 3630d63..298cb85 100644 --- a/dynamic-linking.ro.md +++ b/dynamic-linking.ro.md @@ -13,7 +13,7 @@ Diferența este că acum, folosim linkare dinamică în loc de linkare statică Pentru aceasta, am renunțat la argumentul `-static` folosit la linkare. Pentru acest exemplu, obținem un singur executabil `main`, din legarea statică cu biblioteca `libinc.a` și legarea dinamică cu biblioteca standard C. -Similar exemplului din directorul `05-static/, folosim comanda `make` pentru a obține executabilul `main`: +Similar exemplului din directorul `05-static/`, folosim comanda make pentru a obține executabilul `main`: ```console [..]/06-dynamic$ ls @@ -39,7 +39,7 @@ main: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically link [..]/06-dynamic$ file ../05-static/main ../05-static/main: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), statically linked, for GNU/Linux 3.2.0, BuildID[sha1]=60adf8390374c898998c0b713a8b1ea0c255af38, not stripped -`` +``` Fișierul executabil `main` obținut prin linkare dinamică are un comportament identic fișierului executabil `main` obținut prin linkare statică. Observăm că dimensiunea sa este mult mai redusă: ocupă `7 KB` comparativ cu `600 KB` cât avea varianta sa statică. @@ -66,7 +66,7 @@ Investigăm simbolurile executabilului: Simbolurile obținute din modulul obiect `main.o` și din biblioteca statică `libinc.o` sunt rezolvate și au adrese stabilite. Observăm că folosirea bibliotecii standard C a dus la existența simboblului `_start`, care este entry pointul programului. -Dar, simbolurile din biblioteca standard C, (`printf`, __libc_start_main`) sunt marcate ca nedefinite (`U`). +Dar, simbolurile din biblioteca standard C, (`printf`, `__libc_start_main`) sunt marcate ca nedefinite (`U`). Aceste simboluri nu sunt prezente în executabil: rezolvarea, stabilirea adreselor și relocarea lor se va realiza mai târziu, la încărcare (load time). La încărcare, o altă componentă software a sistemului, loaderul / linkerul dinamic, se va ocupa de: @@ -77,7 +77,7 @@ La încărcare, o altă componentă software a sistemului, loaderul / linkerul d Putem investiga bibliotecile dinamice folosite de un executabil prin intermediul utilitarului `ldd`: -``console +```console [..]/06-dynamic$ ldd main linux-gate.so.1 (0xf7f97000) libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf7d8a000) @@ -99,8 +99,8 @@ De aici este, în Linux, extensia `.so` a fișierelor de tip bibliotecă partaja ## Biblioteci cu linkare dinamică -Numele corect al unei biblioteci dinamice este bibliotecă cu linkare dinamică (*dynamically linked library*) sau bibliotecă partajată. -În Windows, bibliotecile dinamice sunt numite *dynamic-link libraries* de unde și extensia `.dll`. +Numele corect al unei biblioteci dinamice este bibliotecă cu linkare dinamică (**dynamically linked library**) sau bibliotecă partajată. +În Windows, bibliotecile dinamice sunt numite **dynamic-link libraries** de unde și extensia `.dll`. Din punctul de vedere al comenzii folosite, nu diferă linkarea unei biblioteci dinamice sau a unei biblioci statice. Diferă executabilul obținut, care va avea nedefinite simbolurile folosite din bibliotecile dinamice. diff --git a/helloworld.md b/helloworld.md new file mode 100644 index 0000000..95caf25 --- /dev/null +++ b/helloworld.md @@ -0,0 +1,127 @@ +# Helloworld programs +--- + +![Hello World PNG](helloworld.png) + +We list below Helloworld programs for diff erent programming languages, i.e. programs that print "Hello, World!". Thespecifi ed compiler or interpreter is required for each programming languages. +The table below summarizes the programs: + + +| Language | Language (Spec) Site | Section | Build / Run Toolchain | Debian / Ubuntu Packages | +|----------|----------------------|---------|-----------------------|--------------------------| +|C |[The Standard - C](https://www.iso-9899.info/wiki/The_Standard) |[C](#) | GCC | build-essential | +|C++ |[The Standard - C++](https://isocpp.org/std/the-standard) |[C++](#) | GCC / G++ | build-essential, g++ | +|Dlang |[D Programming Language: Home](https://dlang.org/) |[Dlang](#) | GCC / GDC | build-essential, gdc | +|Go |[The Go Programming Language](https://go.dev/) |[Go](#) | Go | golang | +|Rust |[Rust Programming Language](https://www.rust-lang.org/) |[Rust](#) | Rust (Crate) | rustlang | +|Java |[Java Programming Language](https://docs.oracle.com/javase/8/docs/technotes/guides/language/) |[Java](#) | JDK | openjdk-17-jdk | +|x86_64 + assembly |[x86 and amd64 instruction reference](https://www.felixcloutier.com/x86/) |[x86_64Assembly](#) | GCC / GAS | build-essential | +|ARM64 + assembly |[Arm A64 Instruction Set Architecture](https://developer.arm.com/documentation/ddi0596/latest/) |[ARM64 Assembly](#) | GCC / GAS (AArch64) | build-essential | +|Bash |[Bash Reference Manual](https://www.gnu.org/software/bash/manual/bash.html) |[Bash](#) | Bash | bash | +|Python |[Welcome to Python.org](https://www.python.org/) |[Python](#) | Python | python | +|Ruby |[Ruby Programming Language](https://www.ruby-lang.org/en/) |[Ruby](#) | Ruby | ruby | +|PHP |[PHP: Hypertext Preprocessor](https://www.php.net/) |[PHP](#) | PHP | php | +|Perl |[The Perl Programming Language](https://www.perl.org/) |[Perl](#) | Perl | perl | +|Lua |[The Programming Language Lua](https://www.lua.org/) |[Lua](#) | Lua | lua | + +## C +--- + +```c +#include + +int main(void) +{ + puts("Hello, World!"); + return 0; +} + +``` + +Build with: + +``` + gcc -Wall -o helloworld helloworld.c +``` + +Run with: + + +``` + ./helloworld +``` + +## C++ +--- + +```cpp +#include + +int main() +{ + std :: cout << "Hello, World!" << std :: endl; + return 0; +} + +``` + +Build with: + +``` + g++ -Wall -o helloworld helloworld.cpp +``` + +Run with: + + +``` + ./helloworld +``` + +## Dlang +--- + +```d +import std.stdio + +void main() +{ + writeln("Hello, World!"); +} + +``` + +Build with: + +``` + gdc -Wall -o helloworld helloworld.cpp +``` + +Run with: + + +``` + ./helloworld +``` + +## Go +--- + +```go +package main + +import "fmt" + +funct main(){ + fmt.Println("Hello, World!"); +} + +``` + +Build and run with: + +``` + go run helloworld.go +``` diff --git a/newfile.md b/newfile.md new file mode 100644 index 0000000..58d7e35 --- /dev/null +++ b/newfile.md @@ -0,0 +1,34 @@ +# This file contains examples of markdown formatting + + +This file was created by [Cosmin](https://github.com/cosminstr). + +```c +#include + +int main(){ + printf("Hello, World"); + return 0; +} + +``` + +| Column 1 | Column 2 | +| ---------- | ----------- | +| Content1.1 | Content 2.1 | +| Content1.2 | Content 2.2 | + +1. Ordered list item 1 +2. Ordered list item 2 +3. Ordered list item 3 + + +- Unordered list item 1 +- Unordered list item 2 +- Unordered list item 3 + + +![Image from the ROSEdu Markdown Workshop](https://github.com/rosedu/workshop-markdown/blob/main/helloworld.png) + +Hope this files helps :+1:. +