Wikifunctions:Project chat

From Wikifunctions
Shortcut:
WF: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:

SpBot archives all sections tagged with {{Section resolved|1=~~~~}} after 1 day and sections whose most recent comment is older than 30 days.
Archive
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.
    "Join strings" function with the About tab open.
    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.
    "Join strings" function page with the Details tab open.
    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.

About and Function Explorer widgets on a Test page.
About and Function Explorer widgets on a Test page.

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.

Proposal for merging the About and Function Explorer widget into a new widget on the Function page.
Proposal for merging the About and Function Explorer widget into a new widget on the Function page.

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!).

Proposal for a new Function page featuring a custom widget to display About and Function Definition information.
Proposal for a new Function page featuring a custom widget to display About and Function Definition information.

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:

  1. What usually brings you to a function page? What are you trying to achieve when you visit this page?
  2. What do you think is working well in the new page?
  3. What flows are still confusing in the new proposal?
  4. Is there anything missing in the new page?
  5. 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)Reply[reply]

@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)Reply[reply]
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)Reply[reply]
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)Reply[reply]
Would the tests be able to fulfil this task of being a specification? -- DVrandecic (WMF) (talk) 23:30, 7 December 2023 (UTC)Reply[reply]
If that were the case I would not have been stuck on is valid email address (Z10410). MilkyDefer 11:00, 12 December 2023 (UTC)Reply[reply]
I don't understand, where are you stuck? -- Denny (talk) 03:57, 11 January 2024 (UTC)Reply[reply]
(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)Reply[reply]
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)Reply[reply]
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)Reply[reply]
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)Reply[reply]

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)Reply[reply]

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)Reply[reply]
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)Reply[reply]
Given the ocassion I'll suggest Polish translations too:
Msz2001 (talk) 12:32, 6 January 2024 (UTC)Reply[reply]
Here you go:
Lofhi (talk) 12:58, 6 January 2024 (UTC)Reply[reply]
All Done --Ameisenigel (talk) 16:55, 6 January 2024 (UTC)Reply[reply]
For Dutch:
Thanks! Romaine (talk) 15:15, 9 January 2024 (UTC)Reply[reply]
Done --Ameisenigel (talk) 20:05, 10 January 2024 (UTC)Reply[reply]
@Ameisenigel, For Bengali:
Thanks. আফতাবুজ্জামান (talk) 18:34, 12 January 2024 (UTC)Reply[reply]
Done --Ameisenigel (talk) 18:47, 12 January 2024 (UTC)Reply[reply]
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)Reply[reply]
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)Reply[reply]
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)Reply[reply]


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)Reply[reply]

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)Reply[reply]
With the Z+ template usages, it seems that putting everything in lowercase is the simplest. Lofhi (talk) 05:20, 6 January 2024 (UTC)Reply[reply]
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)Reply[reply]
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)Reply[reply]

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)Reply[reply]

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)Reply[reply]
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)Reply[reply]
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)Reply[reply]

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)Reply[reply]

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)Reply[reply]
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)Reply[reply]
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)Reply[reply]
@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)Reply[reply]
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)Reply[reply]

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)Reply[reply]

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)Reply[reply]
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)Reply[reply]
@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)Reply[reply]

@TomT0m:, User:GrounderUK pointed me to another inbuilt list function, Reduce Function (Z876), which allowed me to write apply two-argument function (Z13318), which in turn should enable a bunch of new types of list operation (e.g. general sort). --99of9 (talk) 23:30, 19 February 2024 (UTC)Reply[reply]

@99of9 Pretty cool. To understand the implementation, does that mean that function values supports partial application (currying (Q1144925)) and that you used that trick to pass a list of arguments to that function ?
This could be generalized to any function arity. During the reduce, a sequence of partial application of the function is built, until all the element are set ?
 Reduce Function(Argument reference("function to apply") , Typed list
    ( Object , Argument reference("second argument")),  
    Argument reference("first argument"))
I guess we could create a generalized "apply" that takes a function with any number of arguments and its arguments as a list, that would just be a wrapper to "reduce" essentially. TomT0m (talk) 20:26, 20 February 2024 (UTC)Reply[reply]
I don't think that's what I did, but I could be wrong. I just moved the first argument into the accumulator parameter of the reduce function, and the second argument into a one-element list to reduce. I haven't thought yet about whether the general apply is now possible. Feel free to try! --99of9 (talk) 23:31, 20 February 2024 (UTC)Reply[reply]
Yes, I’m being silly, "reduce" could be implemented as (sketch), for the non empty case
  reduce(list, func, acc) = reduce(rest(list), func, func(first(list), acc))
  (and just "= acc" in the case list is empty)
there is only one element in the list so there is no actual recursive call, "acc" is initialised to the first argument and "func" is just called once with the first argument (as acc) and the second argument (as the only element in the list). No partial call involved in that case. This works only because "func" is a binary function and this is a hack to call it somehow.
(The approach I suggested might work if "apply" could do partial call with something like
     reduce( 
          remove_first(list_of_parameter), 
          (partial_call, parameter) -> apply (partial_call, parameter)), 
          apply (func, first(list_of_parameter)) 
     )
after some thought) TomT0m (talk) 13:18, 21 February 2024 (UTC)Reply[reply]

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)Reply[reply]

That sounds like a great idea - I don't know if there is already a special, but it would be great to know what things already exist but are not connected --DannyS712 (talk) 00:17, 13 February 2024 (UTC)Reply[reply]

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)Reply[reply]

@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)Reply[reply]

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)Reply[reply]

@Sannita (WMF) Hello, I want to help you, but I don't have the translation-admin right :( I should be well aware of the use of the translate tag (e.g. on Meta), but I don't have this right on any wiki. So I just offer my comment (sorry if you know this): it would be easier if you duplicate the page elsewhere, replace LangSwitch with only English sentences, and mark the page for translation to finish. If there is anything else I can do to help, I will gladly help. --Tmv (talk) 06:05, 12 February 2024 (UTC)Reply[reply]

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)Reply[reply]

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)Reply[reply]

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)Reply[reply]
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)Reply[reply]
FYI The inbuilt Reduce Function (Z876), does have an initial object. --99of9 (talk) 00:25, 20 February 2024 (UTC)Reply[reply]

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)Reply[reply]

@99of9 Looks like you're one of a few users who are active... RuzDD (talk) 23:28, 8 February 2024 (UTC)Reply[reply]
Also, why codes are in public domain instead of CC BY-SA or GFDL? RuzDD (talk) 23:34, 8 February 2024 (UTC)Reply[reply]
The licenses you mention are best suited to documentation and other types of prose. Code usually has a code-specific license. Arlo Barnes (talk) 20:32, 10 February 2024 (UTC)Reply[reply]
@Arlo Barnes Thanks. By the way, what i can do without being a functioneer? RuzDD (talk) 20:53, 10 February 2024 (UTC)Reply[reply]
@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)Reply[reply]
@99of9 Where is the "Implementations" box? RuzDD (talk) 23:52, 8 February 2024 (UTC)Reply[reply]
@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)Reply[reply]
function page
function page
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)Reply[reply]
@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)Reply[reply]
@TomT0m As i understand i must be a functioner to attach functions and imlementations, right? If yes, what can i do to be trusted in there? RuzDD (talk) 02:26, 10 February 2024 (UTC)Reply[reply]
Yes, that is the permission required. I have trouble understanding the purpose of the function you've written. Can you include some test cases before we connect it? It seems like it may be related to handling Flash embedded in web pages. We don't currently have object types like that. Maybe try playing with some existing/simpler functions first. --99of9 (talk) 22:54, 11 February 2024 (UTC)Reply[reply]
@99of9 Wikifunctions currently does not permit test cases with HTML bases as i understand, but i can explain the planned usage case. You can create an HTML page with the body content <div class="wiki-swflash-container" id="filename.swf" style="width:768px;height:576px;"></div> and it must play the filename.swf if you include that script and run the function. trustedStart=0 means all movies can be played, =1 means movies from untrusted locations will be played if the user permits, =2 means movies from untrustec locations will not play.
This code will detect if you have Flash Player installed and won't activate emulator in this case, but if you don't have a Flash Player it will activate Ruffle. Ruffle may not work if you try this at local but it will work on the server side.
I'm trying to prepare the codes before proposing enabling Shockwave Flash playing and uploading on wikis, so concerns about the technical side will not be too much. RuzDD (talk) 03:47, 12 February 2024 (UTC)Reply[reply]
I've connected it for you, but it didn't seem to work when I pasted that body content in as the string parameter. --99of9 (talk) 04:09, 12 February 2024 (UTC)Reply[reply]
@99of9 No, the body content is not for string parameter :) But, seems like the problem is on Wikifunctions itself because it worked when i'm tried it on local. If you add this string (body content) to somewhere of the page (of course change filename.swf with an existing file path for example https://old.homestarrunner.com/sbemail50.swf) using developer tools and then run this function with the trustedStart value of 0 or 1, it must play the movie in somewhere on the screen but it does not do that. In fact, it does not give this function to me at all (when i wrote SWF-RIW(1); to my console, it says "SWF_RIW" is undefined). How we can solve this problem? RuzDD (talk) 04:23, 12 February 2024 (UTC)Reply[reply]
I even cannot get a function named Z13077 or Z13080 on my console... 07:54, 14 February 2024 (UTC) RuzDD (talk) 07:54, 14 February 2024 (UTC)Reply[reply]
I'm afraid that you seem to be expecting features and data-types that are not yet available on Wikifunctions. I'm not completely sure if they ever will be, but what you're hoping for is well beyond the bounds of what Wikifunctions currently does. If you can't write it as a testable deterministic function of the string parameter (without access to other pages on the internet), then I don't think this function is suitable for wikifunctions yet. --99of9 (talk) 04:47, 15 February 2024 (UTC)Reply[reply]
@99of9 As i understand, these code pieces are currently running at server side. This is the only thing that prevents this function from running as expected. I think client-side code running feature can come in soon or semi-soon, and this function will be running when it came. In fact, this function is expected to return void and it does that. When client-side running and access from other wikis features came, this function will be able to usage with full freedom. RuzDD (talk) 05:32, 15 February 2024 (UTC)Reply[reply]
@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)Reply[reply]
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)Reply[reply]

Public API for Wikifunctions

I read the latest status update for Wikifunctions. This update offers an overview about the plans for the next months. One point in this status update was establishing an public API. I think external Websites escpecially commercial ones should use their own mechanisms to calculate things. I support a public API for editing Wikifunctions. Making it possible to use a public API could lead to an development of a commercial offer from Wikimedia Enterprise for using Wikifunctions as an external service to calculate some things. Wikifunction functions call should not be commerzialized from my point of view. If people want to use functions they can copy the function and reuse it offline or build their own service. In the last weeks I experimented with parsing the Wikifuncions dump and extracting functions out of if it and creating one file per function. Additional with a script to embed a function into a HTML-page with java script included in it. The scripts to do it are not ready yet and it is important that people check the functions before using it offline. I am interested in extending support to reuse functions offline. Hogü-456 (talk) 17:23, 11 February 2024 (UTC)Reply[reply]

@Hogü-456 For now, the plan is to just create the API for the community to use it, probably with some stricter rules than the ones that WMF usually applies to its free APIs (because calling a function will be more expensive than fetching a page). As for its commercial reuse, we currently have no plans about it - and probably it's too soon to worry about it, since we still need to build an API first. Sannita (WMF) (talk) 15:01, 12 February 2024 (UTC)Reply[reply]

Handling capitalisation in language functions

How should we handle capitalisation in morphemes? Do we need functions to do their own tests on the input capitalisation, or should we concentrate on getting the lowercase versions right then either sanitising the input or wrapping the function with a case checker. WALK: handle capitalisation? (Z13217) is a simple example. --99of9 (talk) 07:26, 16 February 2024 (UTC)Reply[reply]

Basically, I think morphological functions should be case-insensitive. As I see it, the problem is that their inputs are typically “strings”, but in our functions we need to distinguish between “lemmas” and “forms”. The -ed form of the lemma “walk” is “walked”. The string “WALK” is (I would argue) a reference to the lemma “walk”, so the -ed form is also “walked”. If I input a form that differs from the lemma (“walks”, for example), I will get a result that is not valid (“walksed”); the function assumes its argument is a lemma. Ideally(?), this assumption would be explicit in the type of the input, but types of strings appear not to be a priority. As it stands, the input could also be a phrase (like “I walk to work.”) and this will also give odd results (“I walk to work.ed”). I wouldn’t want to say we should disallow phrases (because “walk out”, for example, is a perfectly reasonable lemma, with the form “walked out”) but we should have a way to make it clear that, in fact, the function can only handle a phrase with the verb at the end. What we do about trailing spaces and punctuation is another question, but I note that an iPhone (with an English keyboard) tends to default to an initial capital and a trailing space, so I would be inclined to treat that as one of the formats that morphological functions should expect (which I haven’t done, so far). GrounderUK (talk) 10:14, 16 February 2024 (UTC)Reply[reply]

Wikifunctions & Abstract Wikipedia Newsletter #143 is out: Fix-it week

There is a new update for Abstract Wikipedia and Wikifunctions. Please, come and read it!

In this issue, we take a look at the latest software developments, after our monthly "fix-it week", where we work on technical debt and other issues that pile up in our daily work.

Want to catch up with the previous updates? Check our archive on Wikifunctions and also on Meta.

Enjoy the reading! -- User:Sannita (WMF) (talk) 18:19, 16 February 2024 (UTC)Reply[reply]

Wikifunctions & Abstract Wikipedia Newsletter #144 is out: Updating the function model

There is a new update for Abstract Wikipedia and Wikifunctions. Please, come and read it!

In this issue, we present the new documentation about our function model and we take a look at the latest software developments.

Want to catch up with the previous updates? Check our archive!

Enjoy the reading! -- User:Sannita (WMF) (talk) 09:55, 23 February 2024 (UTC)Reply[reply]