Wikifunctions:Project chat
Welcome to the Project chat, a place to discuss any and all aspects of Wikifunctions: the project itself, policy and proposals, individual data items, technical issues, etc.
Other places to find help:
- Wikifunctions:Administrators' noticeboard
- Wikifunctions:Report a technical problem
- Wikifunctions:FAQ
SpBot archives all sections tagged with {{Section resolved|1=~~~~}} after 1 day and sections whose most recent comment is older than 30 days. |
| edit |
| Archives |
|---|
Function page proposal: looking for feedback
Hi everyone,
This is Amin, one of the designers behind Wikifunctions.
We are currently working on the next iteration of the function page, and we would like to hear your thoughts on a possible new approach.
The current page includes two tabs:
- About, where people can read the function description, consult the function name or aliases in multiple languages, and try the function.

Function page with the About tab open. - Details, where people can read the function definition, view the function input(s) in multiple languages, consult any existing function implementation or test, and find the link to add a new implementation or test.

Function page with the Details tab open.
While reviewing feedback shared on Phabricator, the Project chat, and the Telegram group we identified a few opportunities to be addressed as a first iteration.
We noticed that some of the information that we currently feature on the function page could be displayed with the “widgets” that we deployed on other Wikifunctions pages. For instance we could use the “About widget” to display the function information, or we could use the “Function explorer widget” to display the function definition.

After a few explorations we understood that those two widgets needed to be merged together on the function page to accomodate the editing of the function labels, from the function name to the function inputs labels.

This proposal reduces the space needed to display the same information, and possibly opt for a single view approach. We’re not touching the implementations and tests tables (for now!).

While there’s still some “unused” space, this is for accommodating content that might come in the future such as a “Function documentation widget” (next to “Try this function”?) or a “Where is this function used widget” (below “About”?).
Based on the new proposal, please feel free to answer any, some, or all of the following questions right below:
- What usually brings you to a function page? What are you trying to achieve when you visit this page?
- What do you think is working well in the new page?
- What flows are still confusing in the new proposal?
- Is there anything missing in the new page?
- What functionality is redundant in the new approach?
We're looking forward to hearing from you. Thank you! AAlhazwani (WMF) (talk) 09:34, 6 December 2023 (UTC)
- @AAlhazwani (WMF) The changes look good, not needing to switch tabs is an improvement. Personally I prefer being able to see the ZID in the page title in addition to the about box. The seperation between input type and label is minimal ("String"/"first string") and not ideal when scanning a page. It might be better if the label is on the left and input type is on the right in the same way that "join strings" and "Z10000" is formatted in the Name section. Terasail[✉️] 13:08, 6 December 2023 (UTC)
- I like the idea of single tab (or rather no tab 😉) layout. I'm wondering if making the Try this function box collapsible could be beneficial (with hidden/shown state saved across visits to a page), so that an editor/administrator etc. who is not really interested in calling the function can have more screen space for the more technical widgets below. Msz2001 (talk) 16:12, 6 December 2023 (UTC)
- I share with you my experiences of defining functions and writing implementations and writing test cases. I often wish I had a requirements specification when writing implementations and when using functions written by others. Neither titles nor descriptions can fulfill this role, as their respective character limits are too tight. Titles and descriptions are for readers, but specifications, which define how the function should handle corner cases or the expected complexity, are truly useful for contributors. That can fill up the unused space, I suppose. MilkyDefer 07:42, 7 December 2023 (UTC)
- Would the tests be able to fulfil this task of being a specification? -- DVrandecic (WMF) (talk) 23:30, 7 December 2023 (UTC)
- If that were the case I would not have been stuck on is valid email address (Z10410). MilkyDefer 11:00, 12 December 2023 (UTC)
- I don't understand, where are you stuck? -- Denny (talk) 03:57, 11 January 2024 (UTC)
- (Sorry for overlooking your reply.) I am following textbook procedure of software development (waterfall model, I suppose?), and I believe tests should be made to match the spec, but not define the spec. I still hold this notion. I am currently stuck at correctly interpreting the specification of email addresses, which is essential to write valid test cases. If test cases can be used to define the specification, I could easily redefine "email address" using my current testcases, instead of being stuck at sorting out the actual spec and writing testcases. Hope that clears some of your confusions. MilkyDefer 16:09, 24 January 2024 (UTC)
- I don't understand, where are you stuck? -- Denny (talk) 03:57, 11 January 2024 (UTC)
- If that were the case I would not have been stuck on is valid email address (Z10410). MilkyDefer 11:00, 12 December 2023 (UTC)
- Would the tests be able to fulfil this task of being a specification? -- DVrandecic (WMF) (talk) 23:30, 7 December 2023 (UTC)
- 1. Instead of just “About”, why not “About this function [Z10000]?
- 2. I’m not convinced that “Name” should come before “Description”. It is just a preferred alias. In any event, it should be something like “English Name”. I’m not sure how we stand with multiple fallback languages, but I suggest we should always be clear which language each label is assigned to.
- 3. Personally, I find it often makes more sense to talk about the output of a function before specifying the required inputs.
- 4. Similarly, the label for an input is generally more informative than its type.
- 5. We don’t have a label for the output. My expectation would be that one of the aliases for a function would be an appropriate label for its “output” (that is, something like “joined string”). I suspect we may need to change the function model here, however.
- 6.It is odd that we have an “Other languages” button but no reference to the current language. This relates back to point 2. If the current language explicitly applies to all the details, then any details that are missing in that language should be shown as such, together with whatever details are available in some fallback language (with that language being explicitly labelled). GrounderUK (talk) 21:17, 7 December 2023 (UTC)
- Nice changes! As the others above, I too appreciate the tab-less layout. I have just a couple small suggestions:
- I'd like the Tests and Implementations tables to be collapsible, and I'd suggest collapsing the Tests table by default (to make the initial view less daunting). In fact, maybe even the Implementations table could be collapsed by default.
- I would suggest re-adding the "Aliases" label next to the aliases "pills", because the way they look right now conveys (to me at least) a notion of tags, rather than aliases, which may discourage people from adding useful aliases, or encourage them to add aliases that don't really fit that role well.
- Waldyrious (talk) 19:13, 18 January 2024 (UTC)
- thank you @Waldyrious for the kind feedback (and apologies for the belated reply!). collapsable tables, and even widgets in general is something that we could definitely explore. what i particularly like about this approach is that we could let people "customize" their own experience. for instance, is someone interested in the technical details only? they could collapse the about widget, and the try this function widget and keep only the implementations/tests tables open.
- re:re-adding the aliases label, the assumption we're making is:
- - when someone will add or edit aliases, this will happen in an input field with the label "Aliases" right above, giving them guidance about the expect type of content.
- - when someone will read aliases, the content will be self-explanatory, meaning that it will be hopefully clear that whose are aliases to the function name in this case, and not more generic tags.
- that said, what you shared is still a valuable feedback, and we should monitor this to observe if there's any confusion about aliases. AAlhazwani (WMF) (talk) 13:51, 8 February 2024 (UTC)
Halting
I think it should be formulated that function implementations are required to halt. In fact there should be some technical limitation that guarantees our functions to halt, because otherwise this would be an easy target for vandals, and no useful function will fail to halt. I think we should formally document this if it already exists. Jasper Deng (talk) 21:45, 16 December 2023 (UTC)
- I suspect that a general solution to this problem on Wikifunctions would be a major accomplishment in the field of computing, as it would present a solution to the Halting problem.
- Given that a function halting is undecidable, this may not be possible through automation. However, there may be a middle ground here where the computation time for individual functions (not including the time used in called functions, in the instance of composite implementations) *MUST* exit within a predetermined and sensible amount of time or the implementation/function times outs and the implementation is either disconnected from the function or rejected by human editors. But even this solution is technically flawed and gets into P vs. NP territory. Keplersj (talk) 01:24, 31 December 2023 (UTC)
- Halting is not enough, En:busy beavers Halts by definition but can occupy your machine practically indefinitely. I'm not sure there is a solution that would require halting would require a design of a formal proof language like :en:coq or another formal prover. This seems incompatible with the wiki function design as we can use several languages. This kind of stuffs needs persons that knows formal proving, and wiki functions try to be open to the most possible persons by supporting several languages. Having such a requirement for a quite rare skill is not consistent with that anyway.
- It's as the query service on Wikidata, which is opened and has a query limit of 60 seconds. Comparatively there should be few functions that run as long on Wiki functions, so this could be solved by the same kind of restrictions, limit the number of calls by a client in a certain time frame, and put a timeout for function executions, I guess. The main usecase is text generation, not bitcoin mining :) TomT0m (talk) 07:56, 13 January 2024 (UTC)
Generic list equality check: [Z503/Not implemented yet]
I am in love, and new, but in love, but confused. What does it even mean? [Z503/Not implemented yet]. I was trying to implement some generic list equality check.
Z12673 is the function, Z12674 is the implementation, ["abc", "ab", "a", "abcd", "1", "12"] sorted is [ "a", "1", "ab", "12", "abc", "abcd" ] (Z12675) is the broken test used in sort a list by string length (Z12671). Got ["Z1","a","1","ab","12","abc","abcd"] !== ["Z6","a","1","ab","12","abc","abdc"]. Why Z1 and Z6 are even added to the lists? Lofhi (talk) 07:21, 4 January 2024 (UTC)
- I know that List equality (Z889) exists, but I wanted to try an implementation of it. Guess we can delete it when someone explains me these Z1 added ones! Lofhi (talk) 07:34, 4 January 2024 (UTC)
- The first element of typed list seem indeed to be the type of the list...? Does it mean that the first element of a Typed list (Z881) is the type of the list... or the real first element of the list? first element (Z811) built-in function exists for this reason? Lofhi (talk) 07:50, 4 January 2024 (UTC)
Hi @Lofhi:! Welcome to the project, and sorry that it is still a bit confusing. Happy to help.
The Not implemented yet (Z503) error comes up because the test ["abc", "ab", "a", "abcd", "1", "12"] sorted is [ "a", "1", "ab", "12", "abc", "abcd" ] (Z12675) uses the function Z12673, which has no implementation connected yet. So when the test case runs, the system doesn't know what to do, and says there's no implementation yet.
Whereas the internal representation of a list does indeed include the type as its first element (see the function model, this shouldn't be true when it is translated to Python or JavaScript. There, an empty list should be just [], and a list with a single string "x" should be ["x"]. I wrote a Python and JavaScript implementation for length of list on the Beta, and you can see with the tests that the numbers are as expected: length of list on Beta (note that we shouldn't copy those implementations, because they don't yet implement serialization and deserialization properly).
I hope that helps! Feel free to ask more questions! --DVrandecic (WMF) (talk) 00:43, 6 January 2024 (UTC)
- Thanks for the details, @DVrandecic (WMF). Also, if I understand correctly, there is no sandbox-like available? Tests need to be done on Beta? Lofhi (talk) 04:12, 6 January 2024 (UTC)
- @Lofhi: Yes, that's correct. Tests should go to the Beta. That's our Sandbox for now. --DVrandecic (WMF) (talk) 20:03, 8 January 2024 (UTC)
- @DVrandecic (WMF): I still don't understand how to make it works: ["abc", "ab", "a", "abcd", "1", "12"] sorted is [ "a", "1", "ab", "12", "abc", "abcd" ] (Z12675). Lofhi (talk) 15:00, 12 January 2024 (UTC)
- @Lofhi: I've made it work. Check out the three recent edits. --99of9 (talk) 02:01, 15 January 2024 (UTC)
- @DVrandecic (WMF): I still don't understand how to make it works: ["abc", "ab", "a", "abcd", "1", "12"] sorted is [ "a", "1", "ab", "12", "abc", "abcd" ] (Z12675). Lofhi (talk) 15:00, 12 January 2024 (UTC)
- @Lofhi: Yes, that's correct. Tests should go to the Beta. That's our Sandbox for now. --DVrandecic (WMF) (talk) 20:03, 8 January 2024 (UTC)
Marking functions that reference future types
Every now and then I notice new functions that obviously should take a number as input and/or should return a number, but instead use Strings as workarounds. I am marking them but I am afraid that I might be overlooking some. Any help is appreciated. MilkyDefer 08:00, 5 January 2024 (UTC)
- To clarify: this means adding (!) to the beginning of the English function label so it shows up near the top of Special:ListObjectsByType/Z8 when changing interface language to English. /Autom (talk) 11:28, 21 January 2024 (UTC)
Note about MediaWiki:Sidebar
We don't have many projects using Extension:Translate, as the structure of Wikimedia projects is based on one website per language. As a French speaker, I currently have English and French links in the sidebar because some pages aren't translated (and shouldn't be?) like the Wikifunctions:Status title page or Wikifunctions:Project chat. Should we do something about this? Lofhi (talk) 04:36, 6 January 2024 (UTC)
- The labels in the sidebar can be localized like here: MediaWiki:Villagepump/de but since it's in MediaWiki namespace, it requires admin or interface admin rights (I'm not sure if it's possible to use Extension:Translate there). Msz2001 (talk) 09:26, 6 January 2024 (UTC)
- It is possible to use the translate extension on MediaWiki pages (we are doing that on Wikidata), but I am not a fan of it because we allow all users to edit the interface and circumvent the security mechanism. Just let me know what the translation into French is and I will create the subpages. --Ameisenigel (talk) 09:30, 6 January 2024 (UTC)
- Given the ocassion I'll suggest Polish translations too:
- MediaWiki:Villagepump/pl: Czat projektu
- MediaWiki:Status/pl: Aktualny status
- Msz2001 (talk) 12:32, 6 January 2024 (UTC)
- Here you go:
- MediaWiki:Villagepump/fr : Le Bistro
- MediaWiki:Status/fr : État de Wikifunctions
- Lofhi (talk) 12:58, 6 January 2024 (UTC)
- All
Done --Ameisenigel (talk) 16:55, 6 January 2024 (UTC)
- For Dutch:
- MediaWiki:Villagepump/nl: Projectchat
- MediaWiki:Status/nl: Actuele status
- Thanks! Romaine (talk) 15:15, 9 January 2024 (UTC)
Done --Ameisenigel (talk) 20:05, 10 January 2024 (UTC)
- @Ameisenigel, For Bengali:
- MediaWiki:Villagepump/bn: প্রকল্প আড্ডা
- MediaWiki:Status/bn: বর্তমান স্থিতি
- Thanks. আফতাবুজ্জামান (talk) 18:34, 12 January 2024 (UTC)
Done --Ameisenigel (talk) 18:47, 12 January 2024 (UTC)
- @Ameisenigel, For Bengali:
- For Dutch:
- All
- Given the ocassion I'll suggest Polish translations too:
- It is possible to use the translate extension on MediaWiki pages (we are doing that on Wikidata), but I am not a fan of it because we allow all users to edit the interface and circumvent the security mechanism. Just let me know what the translation into French is and I will create the subpages. --Ameisenigel (talk) 09:30, 6 January 2024 (UTC)
- I don't think interface admins should be manually adding translations. It's almost impossible for anyone to discover how to add translations for things that way. Messages on Wikidata which use/used that method are/were rarely translated into more than a few languages, even years later. Messages like that should be made translatable on Translatewiki instead (like we do for Wikidata's sidebar), I've made phab:T354608 for the sidebar here and I would suggest making tickets for any other things which aren't translatable. - Nikki (talk) 10:56, 9 January 2024 (UTC)
- On some other wikis there is a page to request the change of system messages. I think such would be helpful to centralize the requests.
- Another option is to have a page where translations can be requested. Romaine (talk) 08:21, 20 January 2024 (UTC)
- I don't think interface admins should be manually adding translations. It's almost impossible for anyone to discover how to add translations for things that way. Messages on Wikidata which use/used that method are/were rarely translated into more than a few languages, even years later. Messages like that should be made translatable on Translatewiki instead (like we do for Wikidata's sidebar), I've made phab:T354608 for the sidebar here and I would suggest making tickets for any other things which aren't translatable. - Nikki (talk) 10:56, 9 January 2024 (UTC)
- We should move MediaWiki:Status, MediaWiki:Villagepump to WikimediaMessages
- This will make it more convienient for localisation/translation.
- See https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/WikimediaMessages/+/49d5159/i18n/wikimedia/en.json . -- Winston Sung (talk) 17:08, 4 February 2024 (UTC)
What about naming convention?
I sense great inspiration possible for a long, pointless and endless battle over naming rules. For example, I have a preference for putting everything in lowercase for functions, but I do put a first capital for implementations and tests. Who'd like to fight me? Lofhi (talk) 04:59, 6 January 2024 (UTC)
- For languages like French, it's also a question of using the imperative or infinitive. A great war! Lofhi (talk) 05:01, 6 January 2024 (UTC)
- With the Z+ template usages, it seems that putting everything in lowercase is the simplest. Lofhi (talk) 05:20, 6 January 2024 (UTC)
- See WF:Naming conventions. These are language-invariant at the moment so they do not tell what verb forms to use etc. but provide some outline on the topic. Msz2001 (talk) 09:22, 6 January 2024 (UTC)
- Hot take: the names of functions that output Booleans should end in question marks, like in w:en:NetLogo. Arlo Barnes (talk) 21:26, 5 February 2024 (UTC)
Wikifunctions is a deterministic project
... but what about a seeded pseudorandom number generator? We could use a short-cycled value for the seed to hit as often as possible in the cache but still get some randomness. We could use the current weekday (1..7)/hour (0..23)/minute (0..59)? Or bigger cycles for longer caching validity (e.g. week number, month number)? Or the WMF really doesn't like the idea? Lofhi (talk) 12:20, 6 January 2024 (UTC)
- I think it would make more sense to have a proper design for how to deal with random outputs. One way could be that the seed is part of the input, and thus it would avoid caching. Having a function that returns the current day would also be problematic with regards to caching: the current day should be an input, then it all works.
- In short, it would be good to discuss this in much more detail (does someone want to start a page?). Until then, let's avoid non-deterministic output. --DVrandecic (WMF) (talk) 23:13, 8 January 2024 (UTC)
- I've started a page here: WF:Determinism where I suggested some guidelines regarding determinism in Wikifunctions, feel free to comment and/or edit it. Msz2001 (talk) 16:06, 14 January 2024 (UTC)
Is there an inbuilt function to test for the equality of objects?
As per the title. I think I need this to make a composition implementation for contains (Z12696). It would also help to have a list of inbuilt functions somewhere. --99of9 (talk) 03:33, 12 January 2024 (UTC)
- There are Built-in implementation of Equals for Strings (Z966) and Built-in implementation for List equality (Z989) for built-in equality and I think that's all. Lofhi (talk) 14:11, 12 January 2024 (UTC)
- There is also Boolean equality (Z844). But I need one for "object type". Perhaps these could all be used in combination if there was a function to return what type an object is. --99of9 (talk) 09:48, 13 January 2024 (UTC)
- I've started one here: object equality (Z13052), I think it can be done using list equality. --99of9 (talk) 01:17, 6 February 2024 (UTC)
- There is also Boolean equality (Z844). But I need one for "object type". Perhaps these could all be used in combination if there was a function to return what type an object is. --99of9 (talk) 09:48, 13 January 2024 (UTC)
Generating SPARQL and SPARQL fragment, perspectives ?
Hi, it’s early to talk about that, but I’m starting to work on a Wikidata query gadget based on SPARQL fragments, (see d:Help:Partial query on Wikidata for what kind of fragments are already available).
The assumption is that these kind of fragment may offer a higher level way for users to query Wikidata. I’m starting a user interface to build query based on this. A fragment is a template with parameters, a query built with fragment, simple version, could be a list of fragment with parameters. (For example a list of criteria : ?item has an article in enwikipedia ; ?item was a state president in 1900 ; ?spouse was the spouse of ?item in 1800)
Currently the fragments are templates, but I think that in the future they could very well become wikifunctions … It could even be a usecase for abstract content, query generation based on high level descriptors ? TomT0m (talk) 13:51, 12 January 2024 (UTC)
Please can someone help me write a composition for this? I tried, using If (Z802), Is empty (Z813) (once as a condition on returning false, and then once to wrap around list without first element (Z812) for the final answer), but I got an obscure key-ID error, and I'm not sure if I got something wrong or if there is a bug. --99of9 (talk) 09:45, 13 January 2024 (UTC)
- I also just got a similar error when trying to write a recursive composition for concatenate lists (Z12767) using prepend element to list (Z810) first element (Z811) list without first element (Z812) Is empty (Z813) and Reverse a list (Z12668). It might be something related to passing a list argument as an argument reference. --99of9 (talk) 11:25, 13 January 2024 (UTC)
Translated name about “Wikifunctions”
Wikifunctions is just a English name ,I think it is necessary to give a Chinese name to it ,"维基方程" ,“维基函数","维基功能" , which is the best one? Hong Kaile (talk) 03:07, 14 January 2024 (UTC)
- I perfer “维基函数". 函数 is exactly what Wikifunctions is doing. 方程 is a different concept. 功能 seems a bit far off and needs disambiguation. 94rain (talk) 03:13, 14 January 2024 (UTC)
- In fact a bunch of people prefer Wikifunctions as-is. MilkyDefer 04:44, 22 January 2024 (UTC)
How to use a reference to a parameter of a custom function definition ?
I probably missed something, and it’s an experiment and probably not the optimal way of doing something like that, but I tried to write a relatively complex test and got stuck at some time.
The context is the ROT13 function. I wrote a first test that checked that for a particular value the equality "x = rot13(rot13(x))" was fine. No problem with that.
Then I tried to generalize such a test by checking this property on a list of values, and began another test. I tried to use the function "all meet criteria" for this. It tries to check a predicate on a list of values. I tried to write an anonymous lambda function "x -> rot13(rot13(x)=x" for this, but I got stuck because I can’t find how to name the "x" parameter correctly and/or to reference it in the final call "rot13(x)" and in the equality test.
Is it me that missed something or is it not possible yet ? Do I need to create an explicit predicate wikifunction with an id for this to work atm ? TomT0m (talk) 10:17, 20 January 2024 (UTC)
- I'm not sure if we support anonymous functions, but regarding the test cases, I believe the more granural tests are the better the outcome is. For example if there was a test whether the function is an involution for 10 words and it fails, we know nothing about where the error stems from. On the other hand, if they were 10 different test cases, it's very easy to find the word that's processed incorrectly and to find out whether one or ten cases fail. Msz2001 (talk) 13:10, 20 January 2024 (UTC)
- Yes, that’s what I said it was a test and not optimal.
- Anyway the user interface proposes to define a function on the fly as you define parameters for "all meet criteria", so I assumed it was kind of possible to define local functions, if not anonymous one. So if it’s unintended it’s quite misleading. TomT0m (talk) 16:36, 20 January 2024 (UTC)
- A grouped approach could anyway be taken, while avoiding create a function page for the predicate to avoid code duplication.
- Something like using a "filter" function instead of "all meets criteria", you return a list of the failing testcases. The attended results is the empty list, and the UI could show the actual result instead, so you would get a list of the string that do not pass. TomT0m (talk) 16:43, 20 January 2024 (UTC)
Easier language selection / translation adding
The main thing I and many others on Wikifunctions do is the adding of a translation of a certain text in my local language. Things that can use some improvement:
- Finding where to translate the label/description/alias of the function itself is easy. I click on
to see what text has been provided for the languages (as English can be ambiguous). Then I click
# languagesAdd languageand the Edit information dialogue appears. Then I have to add my language manually, why? Why is it prefilled if I click on the
pen icon it is prefilled with my language and a lot less work, but with the Edit information dialogue it creates a lot of work. (And if there is a reason for it, then provide a click selection option, instead of that I type the language code, slow appearing of the language list, select in long list of languages the language the right one.) This sounds maybe a minor thing, but with providing 100(+) translations, this starts to get annoying and because of the amount of times it becomes a major thing. - When ready to publish another dialogue appears with the question How did you improve this page? In other projects, like Wikipedia, if I click in this field, I get an overview of earlier used edit summaries which I can choose, but here it doesn't. Or the last used summary is already suggested in the field so I don't have to type over en over the same thing again and again. Again this sounds maybe minor, but when providing 100(+) translations this is tedious.
- The left box is intended for providing translations, but apparently only some of the translations. If you want to translate the label(s) of certain fields, this is not possible via the left section, but you need to modify the whole page. As many users do not realize there is a translatable label of certain fields, this translation is often forgotten. This works counterproductive. Also the previous two issues above are here a problem too!
- In multiple functions I have provided the translation for "input" as well as for "number" (etc). Seems to me that this could and should not be provided in each function but be centralised.
- When multiple translations have been provided, the provided languages are listed in order of creation. If I want to modify it for my language, I have to search to a long list of sections before I can find mine. This is not logic. A more compact overview makes working with it a lot easier, compare for example with Wikidata.
This all creates a lot of extra work and costs extra time. Time that can be spend only once. Romaine (talk) 11:30, 20 January 2024 (UTC)
- I think it would be great if it will be easier to translate languages. I have seen many Z-Objects about Languages with only a low number of translations of the language name into other languages. 10 days ago I tried to extract out of Wikidata all Labels for Languages. Maybe it is possible to solve it with a user script what adds the language name in the field after clicking on adding new language until it is implemented in the software itself. Hogü-456 (talk) 21:13, 24 January 2024 (UTC)
Will functions which requires calling a function taken as a parameter will be supported ?
I wanted to implement a function "check fixpoint" in math, which would take a function f and a value v and would return true if the value is a fixpoint of the function :
(f, v) -> f(f(v)) == v
but it’s impossible right now to implement the call "f(v)", if I got things right. If it not going to be possible the function object string is fixpoint (Z12875) should be deleted, but I noticed another object, compose (Z10111) that would require it so maybe it’s not a deadend ? TomT0m (talk) 16:36, 24 January 2024 (UTC)
- I believe we also require this to implement right fold (Z12753) and left fold (Z12781). But I am hopeful, because there are inbuilt functions that can do this: Map Function (Z873) and Filter Function (Z872). --99of9 (talk) 10:48, 4 February 2024 (UTC)
- Oh nice, I missed those functions existed, they are important indeed. this might be "abused" to implement a function call anyway.
apply(func, value) = first(map(func, [value]))
- The function has even a name, it’s the return (aka unit) function of the "List Monad" (on enwiki)
value -> [value]
- TomT0m (talk) 11:25, 5 February 2024 (UTC)
- I tried, got an attempt of implementation first element
(Map Function(Argument reference(function), prepend element to list(value, Typed list(Object))))- But this does not type check. I don’t know why ? The function object : apply (Z13036) TomT0m (talk) 12:27, 5 February 2024 (UTC)
- @TomT0m: I followed your recipe and it worked for me: apply (Z13036): a function that applies another function to a value. --99of9 (talk) 22:11, 5 February 2024 (UTC)
- Nice, thanks. I try to understand what I did wrong, and it seem the difference to you approach and mine is that you used a function to create the
[value]list by prepending the value to the empty list, while I tried to just create a list by adding directly value as first element to the list type. TomT0m (talk) 09:00, 6 February 2024 (UTC)
- Nice, thanks. I try to understand what I did wrong, and it seem the difference to you approach and mine is that you used a function to create the
- @TomT0m: I followed your recipe and it worked for me: apply (Z13036): a function that applies another function to a value. --99of9 (talk) 22:11, 5 February 2024 (UTC)
- TomT0m (talk) 11:25, 5 February 2024 (UTC)
I tried to use the new "apply" function to implement the string is fixpoint (Z12875) function (string is fixpoint(function, value)), but still no luck. I tried this implementation (copy pasted from the compact representation, after removing the unconvenient line jumps) :
string equality(apply(Argument reference(function), apply(Argument reference(function), Argument reference( value ))), Argument reference(value))
But I get an error trying to save it (something like "malformed key / value", the error message had no Zid). I feel like I did something wrong, like this would need an argument dereference, but I’m confused. TomT0m (talk) 12:25, 6 February 2024 (UTC)
- I think I got it working string is fixpoint, composition (Z13058). Yours had an unnecessary composition. You just needed to apply the function once and test if the result was equal to the input. --99of9 (talk) 23:03, 6 February 2024 (UTC)
- Yes of course, I was not thinking clearly … I think Wikifunctions in is current state is still a bit of a maze to me, I get lost into details and forget where I want to go in the end :) TomT0m (talk) 10:34, 7 February 2024 (UTC)
- @TomT0m: stick with it. I think you're actually pushing boundaries with functions of functions. Sometimes it just takes tinkering, other times it takes practice. I'm certainly learning from your ideas. --99of9 (talk) 00:27, 8 February 2024 (UTC)
- Yes of course, I was not thinking clearly … I think Wikifunctions in is current state is still a bit of a maze to me, I get lost into details and forget where I want to go in the end :) TomT0m (talk) 10:34, 7 February 2024 (UTC)
Wikifunctions & Abstract Wikipedia Newsletter #141 is out: The Igbo Imperative!
There is a new update for Abstract Wikipedia and Wikifunctions. Please, come and read it!
In this issue, we focus on language functions in Igbo, a language spoken by more than 44 million people in South-Eastern Nigeria. Also, we take a look at the latest software developments.
Starting from this issue, the status updates will be hosted on Wikifunctions, instead of Meta. One more step towards maturation of the project!
Want to catch up with the previous updates? Check our archive (on Meta)!
Also, we remind you that if you have questions or ideas to discuss, the next Volunteers' Corner will be held on February 5, at 18:30 UTC (link to the meeting).
Enjoy the reading! -- User:Sannita (WMF) (talk) 09:14, 2 February 2024 (UTC)
Template for connection requests on Talk Page
Hi everyone! I'm proposing the creation of a template for our function's talk page that users can utilize to request connections. This template will categorize the page into specific categories, facilitating our Functioneers in reviewing all submitted connection requests efficiently. Additionally, it could specify whether the connection is for a test page, implementation, or both. If there's already a similar special page in existence, that would be great too. Regards, Asked42 (talk) 16:32, 6 February 2024 (UTC)
Stuffs that annoys me
After a bit of trying to code little stuffs in Wikifunctions, I want to leave a note about something that annoys me with the UI.
When you want to input something in the UI, when creating a function by composition for example, you first have to select an object type, then select some thing of that kind. In the process it happens that you are unsure about which kind of object you want to use, you try to select something, by entering some text, but if you change your mind and want to explore another kind of object you lose that input and have to start over if you go back to the initial object kind.
This is subpar with editing code in textual format for example. In C code if you realized that you had an int pointer and instead it should have been an integer, or vice versa, you could just remove the "*" character for example. It’s a small thing but I know this can get annoying. (I think it’s akin to the Wikidata UI, if you have the value right but realize the property is wrong you have to input the value again) TomT0m (talk) 10:43, 7 February 2024 (UTC)
- @TomT0m Thanks for your feedback. I already reported it to the team, and we'll see if we can act upon it. I'll let you know about it, but feel free to ping me if I don't come back to you. Sannita (WMF) (talk) 15:53, 8 February 2024 (UTC)
Template using LangSwitch
Hi all! Just wanted to report this old discussion about template having embedded translations. Maybe someone can help me take care of this? Sannita (WMF) (talk) 15:52, 8 February 2024 (UTC)
Wikifunctions & Abstract Wikipedia Newsletter #142 is out: Quarterly planning. Thank you, Nick! Function of the Week: is permutation
There is a new update for Abstract Wikipedia and Wikifunctions. Please, come and read it!
In this issue, we discuss about the results of our last internal planning meeting, whose objective was to define what we will work on in this quarter. Also, we take a look at the latest changes in the team and the latest software developments.
Want to catch up with the previous updates? Check our archive on Wikifunctions and also on Meta.
Enjoy the reading! -- User:Sannita (WMF) (talk) 16:22, 8 February 2024 (UTC)
Optional / default parameters
Question for the future, but … I accidentaly recreated a prototype for the (left) "fold" function, before realizing there was already one (and that we can’t implement it due to the fact the current "apply" function trick does not work for binary functions)
But it does not seem to be a duplicate because my function signature is different : right fold (Z12753) vs. fold left (Z13076)
The initial signature created by @99of9 does not include a parameter for the initial value of the accumulator variable, assuming there is a default value for the type that will initiate the fold, whereas in functional programming languages like Haskell or Caml, there is an initial value like "0" to initialize the computation (and the accumulator parameter helps with tail recursion implementation)
In languages like Javascript the parameter is provided as an optional value.
I don’t know what to do about these information, as anyway it seems impossible to implement it but the question of handling optional parameters and default values seems relevant, so maybe a discussion about it is possible. Are there plans ?
The question is also, should we delete functions and chose between right fold (Z12753) vs. fold left (Z13076) in such a case (a delete does not seem harmful if there is no implementation). TomT0m (talk) 18:21, 8 February 2024 (UTC)
- I also made a shell for left fold (Z12781). I don't have any substantive answer to your question. If it's useful, I don't mind adding a parameter that gets left blank when unused. --99of9 (talk) 22:53, 8 February 2024 (UTC)
- It’s true that a function signature can change in Wikidata, I believe this could be a problem as the signature is kind of part of the identity of the function, and changing its signature could break code that depends on it.
- Watching the implementations written in python like Right fold, python (Z12915): no description in imperative style, it seems they does not use an accumulator as a parameter and instead use on end of the list for that, using list mutation. I guess that could work if you tolerate the mutation of the list, and that does not affects the initial list in the case of Wikidata as the function call are isolated.
- To elaborate on the parameter in functional programming, if you write fold in imperative style, you’ll end up with something like
:: acc = initial_value :: for elem in list: :: acc = operation(acc, elem) ::
- in functional style the analog could be
::fold(operation, acc, list) :: if is_empty(list): :: return acc :: else: :: return fold(operation, operation(acc, first(list)), rest(list)) ::
- That’s something I would try if we were to implement this in functional style, I think, but maybe the approach of using and end of the list to store could be also used. At the cost of building new lists, but maybe this is necessary anyway in the wikifunction case.
- and a compiler could rewrite the one in functional style, in that case, exactly as a loop, this in an important optimization in functional programming as mutating the list can imply many copies and then can be costly.
- But maybe this is useless to bother about this kind of optimization in WikiFunctions as the optimisations are supposed to be handled by the compilers / interpreters for the best implementation and not by the the "composition" engine ? But in a case like this when a call to a wikifunction is handled by an implementation would it matter because maybe that would confuse the interpreter / compiler and there would be many context switch between different execution engine ? TomT0m (talk) 09:58, 9 February 2024 (UTC)
A newbie is came and needs help...
Hello, i'm a newbie in there. I have a medium amount of technical info but the structure of this wiki is very confusing. I'm tried to create a JS function but i could not do that. How can i attach JS to Untitled (Z13077)? (I wanted to create it as multilangual but i could not create it in languages other than Turkish...) RuzDD (talk) 23:20, 8 February 2024 (UTC)
- @99of9 Looks like you're one of a few users who are active... RuzDD (talk) 23:28, 8 February 2024 (UTC)
- Also, why codes are in public domain instead of CC BY-SA or GFDL? RuzDD (talk) 23:34, 8 February 2024 (UTC)
- @RuzDD: In the "Implementations" box, click the plus sign. Then on the Create a New Implementation page, switch the "Implementation" radiobutton to "code", then choose javascript in the "select programming language" dropdown. Then fill in the prestructured function, and press publish. --99of9 (talk) 23:50, 8 February 2024 (UTC)
- @99of9 Where is the "Implementations" box? RuzDD (talk) 23:52, 8 February 2024 (UTC)
- @RuzDD: in the right column of Untitled (Z13077), about halfway down. See the attached image for a similar more complete function. --99of9 (talk) 00:27, 9 February 2024 (UTC)
- Thanks, there's some language problems (not a technical problem, a problem with texts on pages). In my device it reads "Uygulamalar" and it failed me, it must write "Uygulamalar (Implementations)" (both my language and English) to make the newbies, includiing me, understand more rapidly. RuzDD (talk) 01:26, 9 February 2024 (UTC)
- @99of9 There's a problem: i cannot connect the function and implementation. It says i don't have enough permissions. How can i get these permissions? RuzDD (talk) 02:25, 9 February 2024 (UTC)
- Thanks, there's some language problems (not a technical problem, a problem with texts on pages). In my device it reads "Uygulamalar" and it failed me, it must write "Uygulamalar (Implementations)" (both my language and English) to make the newbies, includiing me, understand more rapidly. RuzDD (talk) 01:26, 9 February 2024 (UTC)
- @RuzDD: in the right column of Untitled (Z13077), about halfway down. See the attached image for a similar more complete function. --99of9 (talk) 00:27, 9 February 2024 (UTC)
- @99of9 Where is the "Implementations" box? RuzDD (talk) 23:52, 8 February 2024 (UTC)

- @RuzDD: For other languages, in the "About" box on the left of the function page, at the bottom it currently says "1 language". If you click that box, it will give you a place to add more languages. --99of9 (talk) 23:51, 8 February 2024 (UTC)
- Can i make my function language-independent, so it'll work in all languages while i made only one function? RuzDD (talk) 01:28, 9 February 2024 (UTC)


