Coder Social home page Coder Social logo

clockgsl's Introduction

Clocks

Show the current time in various formats.

Discussion

Many years ago I wrote a trivial little widget that gave the time in various formats. I have rewritten it several times over the years: I did a literate programming version in java, for example. When I saw Pieter Hintjens' beautiful gsl tool I wanted to try it out. Rewriting my clock again seemed a quick, little project.

Prerequisites

What you get

The model.xml file is the meat of the project. It describes how a day is divided into so many seconds for each particular clock and how each division is formatted.

The modelToGo.gsl files converts this model into go when you run it with gsl (or you get the Makefile to run it for you). The generated files are here in the repository (clock.go and clock_test.go) It is all pretty straight-forward.

There is a CLI executable that just reads the library and prints and there is also a server executable that I run on my workstation — I have a tk client (client/clockwisher) running that reads from the server every so often and shows me my clocks. Boom.

clockgsl's People

Contributors

fepelus avatar patrickborgeest avatar

Watchers

James Cloos avatar  avatar

clockgsl's Issues

Problem: the model has only been implemented in one language

When I dreamt up the model, I had go in mind and iterated building the model along with the GSL script that targetted go so I fear they might be too tightly coupled.

Part of the glory of GSL is that a single model can serve different GSL scripts and I would like to test that by using the clockgsl model to generate code in a different language. Something that has a printf function: C, perhaps, or Ruby.

Problem: the model has only been implemented in one language

When I dreamt up the model, I had go in mind and iterated building the model along with the GSL script that targetted go so I fear they might be too tightly coupled.

Part of the glory of GSL is that a single model can serve different GSL scripts and I would like to test that by using the clockgsl model to generate code in a different language. Something that has a printf function: C, perhaps, or Ruby.

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.