Rust Lang Lagos!

Hey everyone! I’m pleased to announce the rust lagos meet up. Meet Up link

we hope to hold our first meet up on the 30th of september. It would be an introduction to the rust programming language, why should you be interested in it? it’s performance, it’s safety, and zero cost abstractions. We’ve noticed that a large number of nigerian devs mostly build for the web, so we’ll be focusing majorly on the application of rust to building super high availability web servers.

use std::io::prelude::*;
use std::net::TcpListener;
use std::net::TcpStream;

fn main() {
    let listener = TcpListener::bind("127.0.0.1:8080").unwrap();

    for stream in listener.incoming() {
        let stream = stream.unwrap();

        handleRequest(stream);
    }
}

fn handleRequest(mut stream: TcpStream) {
    let mut buffer = [0; 512];

    stream.read(&mut buffer).unwrap();

    println!("Request: {}", String::from_utf8_lossy(&buffer[..]));

    stream.write("Hello World!".as_bytes())
}

At the end of the meet up, the above code (a single threaded synchronous web server) will make sense to you. and you would’ve grasped rust’s basic concepts and a good reason to love the language. (Venue isn’t decided yet, we’re talks with the guys at hotels.ng in hopes we can use their office space).

if you have any questions, feel free to ask.

EDIT: There are frameworks for building web servers in rust, infact i’m in the process of writing mine github link, the above example just uses the tcplistener from the standard library.

1 Like

OK, so I just got feedback from hotels.ng and we have successfully reserved the venue for the meet up. Please rsvp if you’ll be coming :slight_smile:

Edit: venue is 3, Birrel Avenue, off Herbert Macaulay Way, Sabo, Yaba(hotels.ng office)