Should I rework my code? | Sololearn: Learn to code for FREE!
+ 2

Should I rework my code?

For a project I'm working on I had to write an assembler for a machine language. I already worked out all the code in SML. I chose that because I think it's pattern matching was really useful for creating my symbol table and parsing different command and address instructions. However, I don't know much about reading and writing to other files in this language. When it comes to reading from and writing to a file I have the most experience in python. So would it be easier to look up how to handle my IO in SML, or rework my code into an oop style and use the io I already know? Also I didn't see it in the community rules, but it isn't against the rules to talk about languages not supported by SL is it?

22nd Mar 2023, 11:54 PM
3 Answers
+ 6
Bob no it isn't against the community rules to discuss other languages than the ones on sololearn. SML is fun.. I would consider maybe transitioning to C++ . It really depends on how big the program to how familiar you are with x language to y language. I, myself, restructured a super lengthy COBOL program into c++ and some additional programs into python. It's really up to you and if you have time constraints. C++ would probably be your best choice based on some things you have mentioned here.
23rd Mar 2023, 12:56 AM
BroFar - avatar
+ 2
It's fun, but if you've never programmed in a functional style it'll take some getting used to. I like that pattern matching basically lets me turn the whole thing into one case statement, which is kinda like a switch statement but each case is determined by constructors
23rd Mar 2023, 12:35 AM
+ 2
Have you googled for 'SML file io'? This is what I got. perhaps it could be helpful. SML sounds interesting, but trying to learn Rust at the moment... adding SML would probably result in a stackoverflow.😅 Looking into similar languages, if I ever managed to nail down the Rust basics and move on to more "academic" languages, I'd probably first try OCaml rather than SML. Based on this:,where%20semicolons%20might%20be%20used.
23rd Mar 2023, 10:55 AM
Bob_Li - avatar