{"id":20130069,"url":"https://github.com/tralahm/rust_example","last_synced_at":"2026-05-14T20:06:28.010Z","repository":{"id":113331717,"uuid":"235676034","full_name":"TralahM/rust_example","owner":"TralahM","description":"A case for Oxidation with Rust-Lang...and the Future of Serverless with WEB Assembly WASM... A primer in rust programming and systems programming","archived":false,"fork":false,"pushed_at":"2020-01-26T20:52:12.000Z","size":569,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T12:37:00.452Z","etag":null,"topics":["cargo","cargo-plugin","crates","getting-started","rust-lang","rust-library","tralahm","tralahtek","wasm","webassembly"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TralahM.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-22T22:00:11.000Z","updated_at":"2020-01-26T20:52:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"ca24bc7b-dae8-4893-b331-d76cbeeb8623","html_url":"https://github.com/TralahM/rust_example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TralahM/rust_example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TralahM%2Frust_example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TralahM%2Frust_example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TralahM%2Frust_example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TralahM%2Frust_example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TralahM","download_url":"https://codeload.github.com/TralahM/rust_example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TralahM%2Frust_example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33041255,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cargo","cargo-plugin","crates","getting-started","rust-lang","rust-library","tralahm","tralahtek","wasm","webassembly"],"created_at":"2024-11-13T20:37:14.278Z","updated_at":"2026-05-14T20:06:27.978Z","avatar_url":"https://github.com/TralahM.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"Introduction to Rust Programming\n====================================\n- Created by Mozilla Devs\n- Good for chat clients,games,servers\n- System Programming Candidate\n- Designed for easy simple multithreading to address common issues faced by programmers\n- C/C++ family  code blocks delimited with {}.\n- Strict types language\n- LLVM Based\n\n- Comparable to **CYCLONE** a programming language without a garbage collector\n\n- High Level Abstraction\n\n- Build System\n\n- Data Race Free (!?)\n\n\nContents\n----------\n:ref: `A case for Oxidation \u003cMemory Safety\u003e`\n\n:ref: `\u003cGetting started with Rust\u003e`\n\n:ref: `\u003cProjects\u003e`\n\n:ref: `\u003cCrates\u003e`\n\n:ref: `\u003cRocket\u003e`\n\n:ref: `See Screenshots \u003cScreenshots\u003e`\n\n\nA Case for Oxidation (Rust)\n----------------------------\n\n.. _Memory Safety:\nMemory Safety\n**************\n\nDereferences always succeed, always points to values of a correct type\nif r:\u0026Foo then * r is always equal to Foo\n- No dangling pointers\n\n- No access after memory free\n\n- Forced Initialization+ Restricted aliasing+ Ownership = memory safety\n\nAll at *compile-time*\n\nAliasing Is hard!  avoid **segmentation faults** like in C/C++\nSo  we restrict aliasing so only 1 mutable alias or N immutable aliases\n\nBorrowing\n^^^^^^^^^^^\n\n.. code:: rust\n\n   let x=Person(\"Tralah\");\n   let y=\u0026x;\n   let z=\u0026x;\n   //let z=x;  would fail as x is already borrowed\n   /* Ownership\n    *let x=32;\n    *let y=x;\n    *let z=x;fails as x already belongs to y\n   */\n\nConcurrency\n^^^^^^^^^^^^^\nNot supported natively by the language because of the safe mem feature of Rust\nOnly Provided by Third Party Libraries which do this by using a concept of unsafe nemory\nor unsafe rust.\n\n- Minimal Runtime\n\n- StrongType System\n\n- Performance\n\n\nWhy Should we Care?\n---------------------\nWe want secure systems\nWe want the right tools\nC/C++ is old and ill designed, have to write Makefiles and toolchains\nPrevents us from doing the wrong things\nGood for writing System Software\nGuaranteed Security\n\nGuarantees\n-------------\nMemory safety without garbage collection\nNo data races\n\n.. _Getting started with Rust:\n\nGetting started with Rust\n******************************\n\n- Data types are immutable by default\n- WASM  webassembly\n\n- **cargo**  package manager for Rust\n\n.. code:: bash\n\n   # The Rust Compiler\n   rustc --version\n   # The Package Manager|Build Tool\n   cargo --version\n\nFunctions and Macros\n--------------------\n.. code:: rust\n\n   // C like Comments\n   /*Multiple\n      * Line\n      Comments*/\n   fn main(){\n      println!(\"Text\");\n      add(21,34);\n   }\n   fn add(x: \u0026int,y: \u0026int){\n      println!(\"{} + {} = {}\",x,y,x+y);\n   }\n\n.. _Projects:\nProjects\n***********\n\n.. code:: bash\n\n   cargo new project_name\n   cd project_name\n   ls\n   #Cargo.toml, src,\n   cargo run build\n   # OR\n   cargo run\n\nVariables,Types and Such\n-------------------------\n.. code:: rust\n\n   let x=32;//immutable\n   let mut y=32;//mutable\n   println!(\"x= {} \\n y={}\",x,y);//macros\n   //x=43; causes error as x is immutable\n   y=231;//is ok as y is mutable\n\n* Integers 1\n* Floats 2.3\n* Booleans true || false\n* Strings[Characters]\n\nBasic Types, Loops\n--------------------------\n.. code:: rust\n\n   let dyn_math= 8*8-2+221;\n\n   const NAME:str=\"Tralah M Brian\";\n   const ID: i32 =001;\n   println!(\"{}\",NAME);\n   println!(\"{}\",ID);\n\n   pritnln!(\"Dynamic math {}\",dyn_math);\n\n   let my_array=[1,2,3,4,5,6,7];\n\n   let my_tuple=(,42,34.3,\"tralah\");\n\n   let (dyn_x,dyn_y,dyn_z)=my_tuple;//tuple unpacking as python\n\n   // Array Indexing\n   println!(\"{}\",my_array[3]);\n\n   // Array Looping\n   for i in my_array.iter(){\n      println!(\"{}\",i);\n   }\n\n.. _Crates:\nCrates\n*******\n`\u003chttps://crates.io\u003e`_\nThird Party Libraries for\n\n- Games\n\n- Math\n\n- Networks\n\n- Graphics [ OpenGL ]\n\n.. _Rocket:\nRocket\n*******\n\nWeb Framework written is rust makes it secure by avoiding\n\n- XSS,\n\n- Directory Travesals,\n\n  .. code:: rust\n\n     #[get(\"/\u003cpath\u003e\")]\n     fn retrieve(user: User,pid: PastebinId){\n      File::f=12;\n     }\n\n- Remote Code Exec\n\n- Sql Injection\n\n- Authentication\n\n- Authorization\n\n- CORS\n\n- Mosconfiguration\n\n- Input Validation\n\n\n.. _Screenshots:\nScreenshots\n***********\n\n.. image:: helloworld.png\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftralahm%2Frust_example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftralahm%2Frust_example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftralahm%2Frust_example/lists"}