Hi all! I am working for the Wikimedia Foundation ...
# thinking-together
d
Hi all! I am working for the Wikimedia Foundation where we are starting to work on a new project [1]: a wiki of functions (name is currently being discussed by the community) [2]. Imagine that for every function, you have on wiki page, where the wiki page describes what the functions does, it's formal parameters (input types, output types), etc. Each function can have several implementations associated with it (which can be built either from other functions in the wiki or be natively written in a programming language, and we plan to support many of those) and also tests. Maybe the best way to understand the project is to take a look at some of the early mockups. [3] The functions are meant to be functional, i.e. not to rely on state (well, not too much - they are able to call out to the Web, e.g. to look up information in Wikidata, etc., so in some way, the Web does provide state. We will need to figure that part out. There's a lot of open questions around that). The type system is also in the wiki, so that it is extensible by the community. We are in very early development (and, in fact, hiring!) [4] I am happy to answer any questions, but I would love to invite folks to join us, either for discussing the project, help working on it, or ask as hard questions and think about how to solve it. [5] A preprint paper with background can be found on Arxiv. [6] The paper has been accepted, but not published yet. Happy to answer any questions here, and to have discussions about what we are doing. In the future I expect us to have many questions like "what is a good exception system", "do we need a type hierarchy", "what should the UX for the project do", etc., so would love to have a place for that. [1] https://meta.wikimedia.org/wiki/Abstract_Wikipedia [2] https://meta.wikimedia.org/wiki/Abstract_Wikipedia/Wiki_of_functions_naming_contest [3} https://meta.wikimedia.org/wiki/Abstract_Wikipedia/Early_mockups [4] https://boards.greenhouse.io/wikimedia/jobs/2338515 [5] https://meta.wikimedia.org/wiki/Abstract_Wikipedia#Participate - links to mailing list, chat, etc. [6] https://arxiv.org/abs/2004.04733
🍰 2
🤯 4
🌈 7
❤️ 2
s
this is so freaking cool, thank you for sharing ❤️
🙏 1
d
One of the goals is also to make these functions available basically everywhere: so, for example, if you create a new programming language, instead of having to provide a comprehensive standard library, you just fall back on using the wiki of functions. You still can implement as much as you want more efficiently or otherwise better, but you can always start with good coverage by relying on the wiki of functions.
Another goal is to use these functions as a large catalog of functions that people can pick from, compare their codebase with, etc.
Another goal is to use these functions through many different modalities: imagine a smart assistant or a command line in which you can simply call over to functions in the wiki of functions, and execute them in the local environment. Etc.
e
This "Wikicode" concept makes me think of a sort of Rosseta Code crossed with Zapier. WebAssembly could be a very good lingua franca on the back end for this, I think. Also, it would be really cool to have this tie in with the code examples on Wikipedia pages.
🙏 1
e
are you gonna be using RDF for specifying the functions? I stumbled upon this ontology a while ago that seems to have a similar goal to what you describe (although seems very incomplete at the moment)
I browsed the papers and the links but still not very clear if wikilambda is sort of its own programming language (a "universal programming language") that one could translate to other languages, or some sort of more abstract specification like "the function sum takes two numbers and returns the addition of them"
s
Really interesting concept. As someone who is interested in Machine Learning on Code and focused to documentation, I can see huge value this can bring. But I still am not clear about the term
function
here. As a professional developer I write and maintain thousands of them regularly. And many of them are very project specific and involves the knowledge of the business rules or domain knowledge. How am I supposed to write them here? I mean they can contain sensitive information in the first place and also they can be pretty obscure for someone with no external knowledge of what problem they are trying to solve. Also, another thing I am not sure that is there some language from which those functions come? (like C, C++, JS, Python etc.) or they are an abstract representation of some of the basic computational concept that each language exposes? This question, I believe, is close to what @Emmanuel Oga asked just before me.
d
@Everett Pompeii - yes, tying it with the code examples on Wikipedia would make a lot of sense, I love the proposal! I added that to our task list! https://meta.wikimedia.org/wiki/Abstract_Wikipedia/Tasks#O30
👍 1
@Everett Pompeii we are also taking a very close look at WebAssembler. It seems indeed a good fit to avoid a lot of headaches and reduce the number of runtimes, if we can just use a front end compiler and compile to WASM, and then figure out security, privacy, etc. only once.
💯 4
@Emmanuel Oga I took a deeper look at FNO, and talked previously with Anastasia. I like it and it would be easy to export the content in FNO. There's also http://codeontology.org/ - the differences are instructive.
@Emmanuel Oga regarding your second question, it is a little bit of both and neither: every function in the wiki will have a human readable documentation which will say what the function does, and tests, etc. Then there will be implementations in different programming languages. So, we might have, e.g. multiplication, and then an implementation in JavaScript and one in Scala. There can also be implementations which compose other functions. So one implementation of multiplication could be based on using the addition function, for example. If we have an implementation of addition in, say, Python, we can use the composition to execute multiplication in Python too, because if we know how to execute all the pieces multiplication is composed of in a specific programming language, we can also execute the composed result. This will often be less efficient than having a native implementation of multiplication in Python, but it should work. So it doesn't really translate the composition into native code, but it can still evaluate it, if that makes sense? I hope I made it a bit clear. Please keep asking! If I can't explain the system to the folks here, I am doomed 😄
The goal is definitely not to replace current programming languages with one universal programming language.
But the composition will feel a bit like a new programming language, I am just wary of actually calling it like that - it is just function application (and types, and tests, and literals, etc.)
@Shubhadeep Roychowdhury yes, you are not supposed to write your private functions in the wiki. This is a public site, that anyone can use. This is for the functions that people will share, that people want to put into a public repository, a common library. So the wiki might have a function such as "how to convert a gregorian calendar date to a julian calendar date" but not "how do I apply the coupon code in my internal system". You will be welcome to use functions from the repository in your code, but just as with Wikipedia or Wikidata, not all content makes sense in the global open repository.
👍 1
@Shubhadeep Roychowdhury regarding the language where the implementations come from: the goal is to be multilingual regarding programming languages. We will probably start with JS, and Lua, but plan to expand to as many as we can safely support.
👍 1
s
I understand it better now. It has the possibility of being a game changer in the field of using machine learning on code. Great initiative. What kind of involvement are you expecting from people? I would be happy to help out and in be involved in this from an early stage.
d
You can join the mailing list to join in discussions, or discuss on-wiki for now, or help us writing code. Once we launch the wiki itself there will be more opportunities, that is planned for next year.
👍 1
e
@Denny Vrandečić your project sounds like a form of knowledge representation, but one people can actually execute. is that right? That would mean that one could write a wiki page referencing these functions and that page could potentially be executed to yield a result. I’m curious if you’ve envisioned a potential user flow in which this product is involved. how would it look like? also, the job posting doesn’t mention the project at all. what role would the developer play in this project? I’m asking, because I’ve been thinking about something similar. I’ve been thinking of basing my knowledge representation system on lambda calculus. I don’t know if you’ve considered the same
d
@elbear I am having trouble with the term knowledge representation for this case, but this is really a terminological issue. To make it short, yes, it will be able to execute. So one possible user flow could be: hey, what's the reverse of my text? I go to the page for reverting a string, there's a box where I can enter my text, I copy and paste into it, click on "go", and it shows me the result. The job posting will be a full stack developer on the MediaWiki extension we are building to support the wiki of functions, and on the evaluation engine to run the functions for the users. We are a small team, and we plan to grow, but for now we only have one engineer, and we need more. We will specialize later with more engineers, but for now we need someone who can help with everything, if that makes sense 🙂 Regarding the lambda calculus, yes, take a look at this walkthrough through an earlier prototype, where in fact everything was built on lambda calculus: https://github.com/google/abstracttext/blob/master/eneyj/docs/walkthrough.md
e
Ok, I looked at the tasks page and I think I got a better idea of what you’re building and why. You want to be able to translate natural language into code. This would allow you to generate natural language in a different language from the code. Another benefit would be that since this is executable, you could theoretically build a program from something that looks like natural language. Did I get it right? In any case, I want to read the paper to get a better idea of your plan
d
@elbear yes on the first paragraph, no on the second. We would not be building executable programs from natural language. The executables would still be written in code. But close!
l
@Denny Vrandečić Very cool! Working on something similar (interactive graph of knowledge and logic). An interesting aspect is converters/lenses/mappers between types of values. A simple one being unit conversion, a more complex one being eg. a rephrasing of a concept with the terminology of one field, to another (where the mapping isn't 1:1). Would be cool to have the ability to associate function with functions (edge(origin function, target function, relation type/concept article)); for instance. "inverse" of a multiplication with b is a division with b (I would prefer to have the multiplicative inverse of a real number, and the rest derived, but doesn't seem to fit as well with wikilambdas current structure). + indexes of all functions applicable to a specific type (allowing fancy auto-complete). Will it support higher order functions? Thoughts regarding program termination? (I believe it can be solved for most cases in practise) Of course, a nice integration with wikidata.
Oh! oh! Allow different output than text, eg. plots. Would then be great to update datasets/tables in wikipedia to be type-annotated, both to make it accessible structurally, but also to allow
population_pyramid(country.sweden.population_history)
instead of the current images, that quickly go out of date with the underlying data (eg. https://en.wikipedia.org/wiki/Demographics_of_Sweden). (I suppose you've seen the likes of https://observablehq.com/explore) Also, show function on article pages; eg. molar mass calc for a chemical compound. Wait, it is currently manually entered?? (eg. https://en.wikipedia.org/wiki/Adenosine_triphosphate). Also, all values inline text to be type-annotated, with the ability to apply relevant single-argument functions; eg. unit conversion. In math example, ability to "link" the values, resulting in the ability to provide your own. Endless possibilities. Much excitement. Looking forward to interop with my system; both using and adding functions/data (also, when this becomes a reality, and an api gets used extensively, it would be cool with at least some sort of "estimated infrastructure cost" calculator, or a wikilambda-specific donation flag, if nothing else).
d
@Leonard Pauli plenty of good ideas! come and join us on our mailing list! 🙂 Yes plenty of these ideas should become realizable when we get there