Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the first real working script #2

Merged
merged 1 commit into from
Sep 28, 2021

Conversation

Kjarrigan
Copy link
Contributor

@Kjarrigan Kjarrigan commented Sep 28, 2021

RocketLang is done (as far as the book is concerned) and I tried to solve a real problem with it. It was quite a journey to get it (sort) of working due to a lot of missing stuff (some crucial, some convenience). So I want to share this piece of code to get a better feeling what is currently missing, what is possible and what not.

The issues I had (sorted from unbelievable to cumbersome):

  1. no string[idx] -> I had to convert the input string into an array[]
  2. no string comparison ("(" == "(" is currently false) -> a Hash/Dictionary worked
    • was fixed in 0.9.6-rc2
  3. no loops -> recursion worked
  4. no exit or raise
  5. running the script always outputs null at the end
  6. no comments -> strings everywhere
  7. the variable scope is sometimes a bit weird, I had to use more let than I felt was necessary
$ rocket-lang examples/aoc2015_day1.rl
Solution Day 1 Part 1: 
127
null

@Flipez Flipez merged commit 5796d71 into Flipez:master Sep 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants