CSCI 485 announcements: Spring 2018

Office Hours During exams:
Tue 17th 9-12
Wed 18th 1-3
Fri 20th 11-12:30 (330 final 1-4 bld 355 rm 108)
Tue 24th 11-1
Wed 25th 11-12:30 (485 final 1-4 bld 355 rm 108)

Final marks posted, World of Foo update
As I'm sure you've notices, final marks are posted - let me know if you have questions.

If anyone's curious, I've also done a lot of polishing of the World of Foo

Sample evolver species for World of Foo
The species generates a random initiate/respond function for each species it encounters (stored in hash tables), tracks the performance of the functions over time, and periodically replaces any poor performers with new randomly generated functions (hopefully for each species this eventually settles in on a function that seems to do well vs that specific species).

The full code collection (including a half dozen or so other species) is available here: World of Foo code, along with the logfile that (at the bottom) includes a result summary for a 200-turn run, and a logfile for a 1000-turn run (both starting with 30 critters per species).

Presentation evaluations
Just a reminder - I'll be getting folks to fill out an evaluation sheet for each of the project presentations.

Presentation times finalized
I've posted the full presentation schedule

Lecture cancellation Wed March 28
Sorry folks, I'm home sick (again!) today, lecture is cancelled.
When we meet on Wednesday we'll do a wrap-up on the lecture content and discuss the project presentations and assign/lab 5.
For the handful of people who haven't chosen a presentation slot, I'll randomly assign those over the weekend (all remaining time slots are on the first day of presentations so it's just a question of the order of presentation that day).

nthcdr
OK, after going back over nthcdr and nth,
(nth n L) returns the nth element of L
(nthcdr n L) returns the sublist starting with the nth element of L
e.g. (nth 0 '(10 20 30)) returns 10,
while (nthcdr 0 '(10 20 30)) returns (10 20 30)

Assignment 4 notes and corrections:

(1) In expandOpApplier.cl and the combined script, the test variable (lam) is incorrectly initialized with '(lambda-closure nil nil nil (L) L), and will cause script errors.
Try using this instead: (defvar lam (lambda (L) L))

(2) Note that the macro, as specified, can only work on lists of operators that are statically passed to the macro - you can't put the list in a variable and run the macro on the variable. (Either the macro needs to know the list structure at load time, or it needs to expand to code that produces and evaluates the desired list, which isn't the format the specs requested.)

Assume the lists will be statically provided. :-)

I've got a macro to produce code for the general case, where the expanded code is what in turn produces (and then evaluates) the desired expression (op1 (op2 ... val)), but the actual expanded code is significantly more involved than just the (op1 (op2 ... val)). (I'll post it with the rest of the assign4 solution.)

Assignment 5 posted
The Assignment 5 has been posted and the repository pushed, links to some relevant files have been added to the lab 5 page.

Project presentations
I've posted a note on presentation time slots for the project.

Assignment 4 posted
The Assignment 4 has been posted and the repository pushed.
Preliminary details are available on the lab 4 page, more specific discussion will be added shortly.

Assignment 3 update
Addenda to constexpr evaluation

It turns out the compiler can, in the interests of "optimization", actually choose to evaluate constexpr's at run time (live and learn)!

In those case, it appears to be setting aside the storage for the "constant", calculating it at run time, but treating it as read only after the value is initially set.

In that case it appears the only way to be certain whether it is performing the computation at compile time is to break out the compile-to-assembly option - which I won't require folks to do.

Since C++14, things have changed further, allowing the use of non-constexpr variables within constexpr functions. It appears that going back to compiling with -std=c++11 gives stricter controls over this, but limits the body of a constexpr function to being strictly a return statement (though nested :? operators can still be embedded within that).

Midterm sample solutions
I've posted midterm sample solutions, hopefully I'll have marks posted on Thursday.

Possible alternative project
If folks are still wondering about a project idea for the course, I've posted another possibility here.

Edit: The csci485 repository for WoFoo has been posted, but the controller is only partially complete. A list of the anticipated revisions is included at the top of the file (controller.cl). Hopefully most of those will be complete before the end of the study break.

Sample midterm questions
I've posted a set of 10 sample midterm questions

Reminder: midterm is Wednesday Feb. 21st

Assignment 3 repository pushed
The assignment 3 repo is now available, as are the lab notes.

Project/Paper ideas
I've updated the research paper/project page to include a handful of sample topics.

Assignment 2 sample run posted
The lab 2 notes now also include a sample dimento program, the resulting C code, and it's output when run.
I also tweaked the recursive macro example in the lab file, having the ProcessAll macro expanded to a ProcessCall, which then makes the correct call to doArgsX. (This may help the issue some of you are experiencing with the macros not expanding correctly.)

Assignment 2 posted, lab 2 notes coming soon...
The assignment 2 repository has been pushed, the notes for the accompanying lab are a work in progress.

Bonus assignment
I have added a bonus assignment for the course, which can be used in place of any of the other five assignments. The bonus assignment is due just after the study break (5pm Tuesday March 6th).
The assignment involves adding a number of new features to our implementation of the IttyBitty language, with all the resulting changes to the tokenizer, checker, parser, and translator.
Details are in the readme in the git repository, which has now been posted.

tokenizing/parsing in ruby
We'll be looking at a bunch of ruby routines to tokenize and parse programs in a small (fictional) language, IttyBitty.
The language specs and code are available here: tokenizing and parsing in Ruby
A tokenizer that is not dependent on having all tokens whitespace-delimited is provided here in C, along with specs for the SIMP language it tokenizes.

Assign 1: printer testing
If you want to test your printer script without actually sending something to a printer, you can use nullp as the printer name.

Preliminary announcement: labs
This is the announcements page for the spring 2018 offering of CSCI 485, Metaprogramming.
Labs will start in the second week of the term (i.e. Jan. 19th)