Code Monkey home page Code Monkey logo

dlings's Introduction

Hi there!

This README is currently under construction.

@katsu's Holopin board

dlings's People

Contributors

ik4tsu avatar webfreak001 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dlings's Issues

Watch mode behaves strange on osx

First of all thanks for dlings :) Very good idea to have something like this for dlang.
I am running on osx and replaced in your source the calls to dmd with

		Exercise.Type.compile: ["rdmd"],
		Exercise.Type.test: ["rdmd", "-unittest", "-main"],

as rdmd is available for the dmd as well as for the ldc compiler distribution.
This worked nicely for me, but then I saw, that the output after a filechange is blocked until I press enter in the interactive watchmode.
I tried to fix this, but did not manage. One problem could be, that the stderr on osx with ldc at the moment dumps a lot of text like this line

ld: warning: no platform load command found in '/Users/xxxx/dlang/ldc-1.35.0/lib/libdruntime-ldc.a[160](sections_darwin_64.o)', assuming: macOS

which might block on stderr for the execute call.

Project needs recompiling each time exercises are modified

Currently, all exercises are added in source/info.d. Although they are read at compile time, it also means the project needs to compile to update any changes (addition or removal of an exercise, order swap, any data relative to their properties). Adding the exercises in an external file read at runtime would allow modifications to be made a lot easier. Using a toml or yaml format makes this possible, it's easy to parse, and maintains the nice readability.

Support different compilers and extra arguments for each exercise

Only dmd is supported as the compiler to use for all exercises. Different compilers provide support for extra compilation flags. One example is --float-abi. This flag would be useful to create a reproducible exercise teaching to not rely on == for floating point comparisons.

Taken from Programming in D

import std.stdio;

void main() {
    float result = 0;

    // Adding 0.001 for a thousand times:
    int counter = 1;
    while (counter <= 1000) {
        result += 0.001;
        ++counter;
    }

    if (result == 1) {
        writeln("As expected: 1");

    } else {
        writeln("DIFFERENT: ", result); // this is the output
    }
}

Another example

float div(float a, float b) { return a / b; }

void main()
{
	float value = div(2, 25);
	writeln(value == 0.08); // false
}

Supporting extra arguments would also be useful independently of supporting other compilers: previews, compiling in release with some contracts, ...

Specify minimum toolchain requirements

Maybe the toolchain requirements can be added to dub.json to warn from using older compilers

I just tried to run it with a somewhat recent dmd version (v2.099.1) and it doesn't compile:

source/util.d(40,26): Error: => shortened method not enabled, compile with compiler switch -preview=shortenedMethods source/util.d(41,24): Error: => shortened method not enabled, compile with compiler switch -preview=shortenedMethods source/util.d(126,31): Error: => shortened method not enabled, compile with compiler switch -preview=shortenedMethods source/util.d(127,31): Error: => shortened method not enabled, compile with compiler switch -preview=shortenedMethods
source/tutor.d(12,8): Error: module std.functionalimport bind not found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.