UROP Proceedings 2020-21

School of Engineering Department of Computer Science and Engineering 150 Comparative Studies of Programming Languages Supervisor: ZHANG Charles Chuan / CSE Student: CHOI Siu Kai / COMP Course: UROP1000, Summer This paper will find out the strength and weaknesses of two programming languages C++ and Rust, by analyzing the manipulation of the container. We would evaluate deque first. The method compares the runtime of bubble sort and insertion sort with random integers loaded in a deque for both languages. The result shows that Rust has a faster runtime than C++ for both sorting algorithms in all datasets. We also observed that C++ could have more freedom on container type and iteration method. The result from the experiment could be that the iterator-based for loop in Rust allows faster iteration in sorting algorithms. Thus, it is showing that Rust has a faster performance over C++ on container manipulation. Comparative Studies of Programming Languages Supervisor: ZHANG Charles Chuan / CSE Student: HU Yicheng / COMP Course: UROP1000, Summer Rust is an emerging compiled programming language that resembles the syntax of c++, it constructs a set of “ownership” rules to resolve several issues occurring in c++ during the access, allocation, and deallocation of dynamic memory, as well as concurrency control. The rust standard library has implemented several sequential and associative containers which can be used as replacements to c++ STL containers. Programmers switching from c++ to rust might struggle to choose the most appropriate language which best suits their needs. This report aims to evaluate the performance of containers in two languages so that programmers can have an initial impression of which language they should use if they have decided the containers to be used.

RkJQdWJsaXNoZXIy NDk5Njg=