{"id":43045598,"url":"https://github.com/dranidis/sdlspec","last_synced_at":"2026-01-31T09:48:06.938Z","repository":{"id":52905371,"uuid":"94004604","full_name":"dranidis/sdlspec","owner":"dranidis","description":"SDL process specification and simulation in Go (golang)","archived":false,"fork":false,"pushed_at":"2021-04-14T21:57:49.000Z","size":21,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-14T21:40:33.414Z","etag":null,"topics":["go","golang","sdl","signal","simulation","specification-language"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dranidis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-11T12:59:56.000Z","updated_at":"2021-08-27T23:31:53.000Z","dependencies_parsed_at":"2022-09-16T19:00:44.062Z","dependency_job_id":null,"html_url":"https://github.com/dranidis/sdlspec","commit_stats":null,"previous_names":["dranidis/go-sdl-spec"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/dranidis/sdlspec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dranidis%2Fsdlspec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dranidis%2Fsdlspec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dranidis%2Fsdlspec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dranidis%2Fsdlspec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dranidis","download_url":"https://codeload.github.com/dranidis/sdlspec/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dranidis%2Fsdlspec/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28937757,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T08:53:31.997Z","status":"ssl_error","status_checked_at":"2026-01-31T08:51:38.521Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","sdl","signal","simulation","specification-language"],"created_at":"2026-01-31T09:48:05.719Z","updated_at":"2026-01-31T09:48:06.934Z","avatar_url":"https://github.com/dranidis.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SDL specification and simulation in GO\n\n[![GoDoc](https://godoc.org/github.com/dranidis/sdlspec?status.svg)](https://godoc.org/github.com/dranidis/sdlspec)\n\nThe purpose of this package is to allow easy definition and simulation of SDL (Specification and Description Language http://sdl-forum.org/index.htm) processes in GO.\n\nThis is an experimental project and is not fully tested yet.\n\nExamples of specifications can be found at: https://github.com/dranidis/sdlspec-examples\n\n## Hello world example\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/dranidis/sdlspec\"\n)\n\ntype HI struct{}\n\nfunc helloStates(p *sdlspec.Process) {\n\tstart := sdlspec.State(p, \"start\", func(s sdlspec.Signal) {\n\t\tswitch s.(type) {\n\t\tcase HI:\n\t\t\tfmt.Println(\"Hello SDL\")\n\t\tdefault:\n\t\t}\n\t})\n\tgo start()\n}\n\nfunc main() {\n\tdie := make(chan sdlspec.Signal)\n\thelloProcess := sdlspec.MakeProcess(helloStates, \"hello\", die)\n\thelloProcess \u003c- HI{}\n\n\ttime.Sleep(1000 * time.Millisecond)\n\tclose(die)\n}\n```\n\nThe output is:\n\n```\nPROCESS hello AT STATE start: main.HI, {}\nHello SDL\n\n```\n\n## Signals\n\nEach SDL signal is declared as a new go struct type:\n\n```go\ntype HI struct {}\n```\n\n## Processes\n\nA process is created using the sdlspec.MakeProcess function:\n\n```go\n\thelloProcess := sdlspec.MakeProcess(helloStates, \"hello\", die)\n```\n\nthat takes as a parameter a function like the following:\n\n```go\nfunc helloStates(p *sdlspec.Process) {\n\tstart := sdlspec.State(p, \"start\", func(s sdlspec.Signal) {\n\t\tswitch s.(type) {\n\t\tcase HI:\n\t\t\tfmt.Println(\"Hello SDL\")\n\t\tdefault:\n\t\t}\n\t})\n\tgo start()\n}\n```\n\nThe function defines a state **start** using the construction:\n\n```go\n\tstart := sdlspec.State(p, \"start\", func(s sdlspec.Signal) { ... })\n```\n\nThe callback function defines the behaviour at that state. The important part is within the switch statement:\n\n```go\n\t\tswitch s.(type) {\n\t\tcase HI:\n\t\t\tfmt.Println(\"Hello SDL\")\n\t\tdefault:\n\t\t}\n```\n\nIf the received signal is of type HI, print the Hello SDL message. Else ignore the signal. Note that the signal is consumed anyway.\n\nThe process is spawned at the initial state with:\n\n```go\n\tgo start()\n```\n\nIn the main:\n\n```go\n    helloProcess \u003c- HI{}\n    time.Sleep(2000 * time.Millisecond)\n    close(die)\n```\n\nwe send the signal `HI{}` to the process, sleep for 2 secs and terminate all SDL processes by closing the `die` channel.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdranidis%2Fsdlspec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdranidis%2Fsdlspec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdranidis%2Fsdlspec/lists"}