The on-wiki version of this newsletter can be found here:
https://www.wikifunctions.org/wiki/Wikifunctions:Status_updates/2024-04-19
--
Welcome, Sharvani
We are happy to welcome Sharvani Haran to the team! Sharvani is currently
an engineer on the Mobile Apps team, and joining us temporarily to explore
the role of the Product Manager. I will let Sharvani introduce herself in
her own words:
<https://www.wikifunctions.org/wiki/File:Mysore_palace_illuminated.jpg>Mysore
palace
"I come from Mysore, India. Being born and raised in this city of palaces,
world-renowned for its Dasara celebrations
<https://en.wikipedia.org/wiki/Mysore_Dasara>, I have always been in awe of
India’s ancient wisdom, diverse culture and peace-loving temperament. I'm
fascinated by different cultures and traditions - marveling at our
similarities and celebrating our differences.
Growing up with my head in books, I spent all my childhood imagining all
things that were so foreign to me like the British cultural references in
‘The Famous Five’, or stepping into Huckleberry Finn’s St. Petersburg, or
wondering how children of the world would feel if they read ‘Malgudi days
<https://en.wikipedia.org/wiki/Malgudi_Days_(short_story_collection)>’ and
its cultural references to India. I have been a lifelong fan of literary
exchange.
Graduating as a computer science engineer, I have had the opportunity to
work on various interesting projects in diverse roles for 18 years. This
amazing adventure on the Abstract Wikipedia team feels like a natural final
destination for all such linguistic and literary passions that have been a
part of me. Thrilled to be here with an amazing team of people who are
trying to make knowledge sharing easy and seamless across languages."
You already met Sharvani when she had taken care of Newsletter #150
<https://www.wikifunctions.org/wiki/Wikifunctions:Status_updates/2024-04-03>
two
weeks ago. Please join me in welcoming Sharvani on the team!
Recent Changes in the software
This week has been one of our regular "Fix-It" weeks, where we mostly focus
on technical debt and smaller feature improvements.
When you get an error when publishing an edited or new Object, we now show
the error's message and its context in a simpler way, so it should be
easier to understand, especially when multiple errors are returned (T345557
<https://phabricator.wikimedia.org/T345557>).
The internal APIs which filter by language now list and validate the
requested language against all the known languages to Wikifunctions, rather
than giving no guidance or validation (T362193
<https://phabricator.wikimedia.org/T362193>).
We improved our test coverage for several of our custom base Vue components
(T358207 <https://phabricator.wikimedia.org/T358207>), and corrected an
issue with our test code to ensure it works with asynchronous DOM actions (
T358204 <https://phabricator.wikimedia.org/T358204>).
Finally, we created a new language, now supported by MediaWiki:
Z1229/zgh-latn <https://www.wikifunctions.org/view/en/Z1229>.
Team meeting next week
Next week, the Abstract Wikipedia team is going to have our annual team
meeting. This time we are meeting in the office of the Wikimedia Foundation
in San Francisco. Among other things, we will be planning the next few
months of work. Because of the meeting, we are going to skip the regular
update next week, and will report on the results of our planning afterwards.
Function of the Week: Encode in Morse code
In the 1840s, electrical telegraphs became the standard system to allow for
fast communication. Two stations, connected with an electrical wire, would
send electric pulses along the wire. In order to be able to send and
receive messages, the stations had to agree on how to turn messages into
pulses, and how to interpret a series of pulses as messages again.
<https://www.wikifunctions.org/wiki/File:International_Morse_Code.svg>
For this, Morse code <https://en.wikipedia.org/wiki/Morse_code> was
developed. It consists of two types of pulses, a short and a long one, and
breaks between the letters as well as longer breaks between the words. The
encoding was meant to roughly support efficiency in English: letters that are
frequent in English <https://en.wikipedia.org/wiki/Entropy_coding>, such as
E or I had short codes, letters that are less frequent, such as Q or J, had
longer codes.
There are a number of slightly different codes. Wikifunctions provides
function Z10944 for the international Morse code
<https://www.wikifunctions.org/view/en/Z10944>. Enter a text, using the 26
letters of the English alphabet plus the letter é, and you get the Morse
code back: for example, the word Wiki will be encoded as ".-- .. -.- .." -
a pattern you might recognize in the Wikidata logo. Besides the letters,
the international code also covers some punctuation characters and digits.
The function has two implementations, one in Python
<https://www.wikifunctions.org/view/en/Z10945> and one in JavaScript
<https://www.wikifunctions.org/view/en/Z10968>. Both implementations
consist of a dictionary respectively a map with all the covered codepoints,
and some short code that uses these on the input. A total of seven tests
cover a number of different cases;
- A simple input such as Hello World
<https://www.wikifunctions.org/view/en/Z10947>
- The whole set of letters, both uppercase
<https://www.wikifunctions.org/view/en/Z10969> and lowercase
<https://www.wikifunctions.org/view/en/Z10946>
- Digits <https://www.wikifunctions.org/view/en/Z10948>
- Punctuation marks <https://www.wikifunctions.org/view/en/Z10949>
- Dropping characters which are not covered
<https://www.wikifunctions.org/view/en/Z10950>
- Collapsing multiple spaces
<https://www.wikifunctions.org/view/en/Z10951>
Wikifunctions has also function Z10956 for the inverse operation, decoding
Morse code <https://www.wikifunctions.org/view/en/Z10956>. It can be used
to take a text in Morse code and turn it back into the usual letters. ....
.- ...- . / ..-. ..- -. / .- -. -.. / .-- . / .- .-. . / -... .- -.-. -.- /
.. -. / - .-- --- / .-- . . -.- …
A new API for calling Wikifunctions
This week we are happy to announce the introduction of a new API to call
functions on Wikifunctions! The MediaWiki Action API for Wikifunctions was
extended by a public endpoint to run functions
<https://api.wikimedia.org/wiki/Wikifunctions_API/Reference/Run_Function>.
This allows external tools to call Wikifunctions in order to run a function
with the given arguments, and get the result back.
The new action should mostly work as a drop-in replacement for the existing
internal wikilambda_function_call API action. If there are any tools
currently using the internal action, we ask you to switch over to the
public one, as it’s more stable, reliable, and performant. We plan to
continue swiftly evolving the internal API only in ways that support the
front end better, without announcing such changes or offering guarantees of
stability. Changes to the external API on the other hand will follow
MediaWiki’s
usual policies <https://www.mediawiki.org/wiki/Stable_interface_policy>. We
also documented the new API in the API Portal <https://api.wikimedia.org/>,
in the Wikifunctions API Reference
<https://api.wikimedia.org/wiki/Wikifunctions_API/Reference>.
If you like to get support with switching the API, we are happy to provide
help.
As with everything Wikifunctions at this early stage, we ask that you use
the API gently and with consideration, and to allow us to slowly grow into
the most useful version the project can be.
The first 1000 function
<https://www.wikifunctions.org/wiki/File:Jarnioux_-_Num%C3%A9ro_de_rue_1000_…>
As of Saturday, 6 April 2024, Wikifunctions has grown to 1000 functions!
Congratulations to the community! We present the 1000th function in the
section about the Function of the Week below, here we look at a few
statistics around the functions as we have them so far.
Sixty of the functions come in the predefined space. Those are validators
for the predefined types and a small set of functions with builtins.
Of the first 1000 functions,
- 685 deal with strings
- 223 deal with Booleans
- 225 deal with numbers
- 173 deal with lists and other types
Since a function can be in more than one group, the numbers won’t add up to
a thousand.
As we can see, the majority of our functions are dealing with strings,
which is great for a system that aims to become a comprehensive natural
language generation library. According to the count in our catalogue
<https://www.wikifunctions.org/wiki/Wikifunctions:Catalogue#Natural_language…>,
we currently have functions for 20 languages.
We are excited about this early milestone, and are looking forward to
develop into a comprehensive library of functions to support Wikipedia, the
other Wikimedia projects, and beyond.
Senior Frontend Engineer position open for Wikifunctions
Are you a front end or full stack engineer and want to work with us on
Abstract Wikipedia and Wikifunctions? Then we are a looking for you! Check
out our job description on Greenhouse
<https://boards.greenhouse.io/wikimedia/jobs/5850672>.
Volunteers’ Corner recording is available on Commons
The recording of the last Volunteers’ Corner
<https://commons.wikimedia.org/wiki/File:Abstract_Wikipedia_Volunteer_Corner…>
is
now available for everyone to see on Wikimedia Commons. Thanks to all who
participated!
Recent Changes to the software
This week, we made some follow-up tweaks to the code for the new, public
API (T360359 <https://phabricator.wikimedia.org/T360359>). We adjusted our
example API call for the public to use the shorter, simpler, more familiar
'canonical form', rather than the more expansive 'normal form'.
We deployed the latest version of the back-end services, which we hope will
have fixed a number of minor issues, and helped us move forwards with other
improvements.
We improved the error-handling when using Python to wrap things in
user-readable errors in some further cases (T356715
<https://phabricator.wikimedia.org/T356715>). We no longer hard-code the
internal label for what kind of evaluation is used, but show Z14K2 or
similar (T358571 <https://phabricator.wikimedia.org/T358571>); there is
more work to do to label this nicely. We reduced the level of expansion in
argument calls, which should speed up execution in some cases (T360172
<https://phabricator.wikimedia.org/T360172>). Similarly, we switched the
expansion of Code objects to be ephemeral, so they're returned only by
reference (T359872 <https://phabricator.wikimedia.org/T359872>). Finally,
we fixed an unnecessary expansion of Types in lists (T324661
<https://phabricator.wikimedia.org/T324661>). Collectively, these three
prompted further review of how we can simplify responses (work forthcoming).
We adjusted how the front-end handles API errors (T361598
<https://phabricator.wikimedia.org/T361598>), and consolidated the code
into a central place (T315432 <https://phabricator.wikimedia.org/T315432>).
We changed how the object selector filters out 'disallowed' values so that
it can be used in certain cases which we previously unintentionally
prohibited (T336292 <https://phabricator.wikimedia.org/T336292>).
We tweaked our metrics monitoring code to not emit null values, so that the
new Metrics Platform from our colleagues won't reject the logs (T350497
<https://phabricator.wikimedia.org/T350497>). We simplified some of our
browser tests to be simpler and less likely to break as the code changes (
T349836 <https://phabricator.wikimedia.org/T349836>), and abstracted the
internationalisation label checking so it won't break tests when labels
update; the newly-fixed tests are now part of the daily browser test
regression monitoring suite, as well as the regular CI.
Function of the Week: Padovan number
<https://www.wikifunctions.org/wiki/File:Padovan_triangles_(1).svg>
Since numbers have become available, a lot of new functions have been
created for them. And some of them leave me with mixed feelings, such as
the Function of the Week for this week. I chose it because it is the 1000th
function: Padovan number (Wikifunction Z15075
<https://www.wikifunctions.org/view/en/Z15075>, Wikipedia article
<https://en.wikipedia.org/wiki/Padovan_sequence>).
Named for Richard Padovan <https://en.wikipedia.org/wiki/Richard_Padovan>,
an European architect, the Padovan numbers are a sequence of numbers where
each number is the sum of the two numbers in the sequence preceding the one
before the number we are looking for. That is, the tenth Padovan number is
the sum of the eighth and seventh numbers, the two numbers before the
ninth. That renders the definition quite similar to the far more
famous Fibonacci
sequence <https://en.wikipedia.org/wiki/Fibonacci_sequence> (Wikifunction
Z13835 <https://www.wikifunctions.org/view/en/Z13835>). The Wikipedia
article discusses the sequence in further detail.
Currently, the function offers three tests and two implementations. The
three tests define the zeroth Padovan number as 1
<https://www.wikifunctions.org/view/en/Z15077>, the tenth number as 3
<https://www.wikifunctions.org/view/en/Z15078>, and the hundredth number as
288,627,200,960 <https://www.wikifunctions.org/view/en/Z15079>. As the
Wikipedia article discusses, there are several ways to start the sequence,
and the tests specify how the sequence starts, which follows On-Line
Encyclopedia of Integer Sequences
<https://en.wikipedia.org/wiki/On-Line_Encyclopedia_of_Integer_Sequences>
sequence A000931 <https://oeis.org/A000931>, but is, interestingly,
different from what the Wikipedia article in any of the existing language
editions suggests (by being shifted by five positions). Then we do
have the Padovan
spiral number <https://www.wikifunctions.org/view/en/Z15085>, which aligns
with Wikipedia's definition, and shifts the number accordingly.
*n* *0* *1* *2* *3* *4* *5* *6* *7* *8* *9* *10*
*Wikipedia* 1 1 1 2 2 3 4 5 7 9 12
*Wikifunctions* 1 0 0 1 0 1 1 1 2 2 3
The two existing implementations are both written in Python, and represent
two different ways to calculate the number:
- The recursive implementation
<https://www.wikifunctions.org/view/en/Z15076> following the definition,
and
- A sum of binomial coefficients
<https://www.wikifunctions.org/view/en/Z15091>, as described on the
Wikipedia article
You may ask “what is this function good for?”, and in my opinion these
functions dance around the border of being useful for Wikifunctions. This
is ultimately a discussion that we have to have as a community. I don’t
expect this function to be terribly useful for Abstract Wikipedia, but I
could see that eventually we could interactively embed this function in the
Wikipedia article for the Padovan sequence itself, allowing for a better
experience of our favourite encyclopaedia. I could also see us postponing
the decision of how to define what belongs into Wikifunctions and what does
not for a little bit longer. Or making a decision now that we revise after
a while, with more experience. I am all for allowing a young project such
as Wikifunctions to have a bit more space to breathe in these early days,
to have a bit more space for fun, for exploration. And I certainly don’t
want to make a call at this point in time already about how to circumscribe
the functions which belong in Wikifunctions, but it will be a discussion
and a decision that we will have to face at some point.
I am looking forward to that discussion with curiosity and an open mind.