{"id":15619863,"url":"https://github.com/nedomas/future","last_synced_at":"2025-03-29T15:32:09.817Z","repository":{"id":148089578,"uuid":"117271858","full_name":"Nedomas/future","owner":"Nedomas","description":"Welcome to the future, really.","archived":false,"fork":false,"pushed_at":"2018-01-13T09:30:51.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-04T16:25:24.366Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nedomas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-12T17:54:48.000Z","updated_at":"2018-01-12T21:17:09.000Z","dependencies_parsed_at":"2023-04-23T18:31:10.349Z","dependency_job_id":null,"html_url":"https://github.com/Nedomas/future","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nedomas%2Ffuture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nedomas%2Ffuture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nedomas%2Ffuture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nedomas%2Ffuture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nedomas","download_url":"https://codeload.github.com/Nedomas/future/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246205429,"owners_count":20740484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-03T08:42:06.464Z","updated_at":"2025-03-29T15:32:09.765Z","avatar_url":"https://github.com/Nedomas.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Future\n\n*Welcome to the future, really.*\n\nThis is a proof-of-concept of what machine-learning-first programming language might look like.\n\nI've implemented a future version of a `map` method in Ruby. It is usually done procedurially, but in the `Future` language it is done through a naive Bayes classifier. The classifier can be easily replaced by neural networks or some advanced tools like auto-ml.\n\nHere's an example of how it works:\n```ruby\ndescriptions = ['I code with laravel', 'I like it']\n\n# this is a regular Ruby code you would write to map out\n# whether the description matches text 'laravel'.\n# What's different is that underneath it trained a naive Baynes classifier\nlaravel_description_network = descriptions.map do |description|\n  !!description.match('laravel')\nend\n# =\u003e [true, false]\n# Looks normal. But it actually got the result through the classifier and not procedurially.\n\n# You can do the same for a title match:\ntitles = ['UI designer', 'php programmer']\n\nphp_title_network = titles.map do |title|\n  !!title.match('php')\nend\n# =\u003e [false, true]\n\n# Nothing special.\n# Whats special is that you can now combine your already trained networks:\npeople = [\n  { name: 'John', title: 'php dude', description: 'I must do laravel' },\n  { name: 'Peter', title: 'non cool dude', description: 'I must do something about it' }\n]\n\npeople_mapped_with_laravel = people.map([\n  { network: laravel_description_network, transform: -\u003e(person) { person[:description] } },\n  { network: php_title_network, transform: -\u003e(person) { person[:title] } }\n]) do |person, combined_networks_result_works_with_laravel|\n  { person[:name] =\u003e combined_networks_result_works_with_laravel }\nend\n# =\u003e [\n  { 'John' =\u003e true },\n  { 'Peter' =\u003e false }\n]\n# This `people.map` method combined the injected networks and trained the new combined\n# network with it as inputs.\n# `transform` key allows to transform the value of current `map` item to match to an already\n# pretrained network.\n# \n# So is the future?\n```\n\n## Why and how\n\nInspired by what the future of writing software might look like. \n\nThanks to [Danielius](https://github.com/dvisockas) and [Mindaugas](https://github.com/kurmis) for exciting late-night talks about it.\n\n## Installation\n\n1. Clone this repository.\n2. Install dependencies via:\n```shell\n$ bundle install\n```\n    \n3. Run the test to see it in action:\n```shell\n$ ./bin/test_description_title\n```\n   \n## Explanation\n\nThe usage is demonstrated in `lib/future.rb`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnedomas%2Ffuture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnedomas%2Ffuture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnedomas%2Ffuture/lists"}