Jump to content

Talk:Befunge

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Turing completeness

[edit]

The article claimed that Befunge is "unlike most machine languages, not Turing-complete."

"Machine languages" describes languages that describe the operation of actual machines -- this class of language is never Turing complete. Machines have actual limits on the amount of addressable storage and on the word size, much like Befunge, so there are only a finite number of states they can enter.

Only abstract languages can be Turing complete in a strict sense. Such as the class of Turing machines themselves, or lambda calculus. Languages whose specification include no bounds on storage can be Turing complete in the abstract (but their implementations on actual machines are not.)

— Preceding unsigned comment added by 24.16.144.120 (talk) 13:31, 8 September 2013 (UTC)[reply]

Complex Hello World Example

[edit]
For this to work as expected you need a compliant interpreter that "returns" 0 when you try to pop an empty stack.

Wouldn't it make more sense and be simpler to just push zero onto the stack at the very beginning of the program? Gereeter (talk) 00:27, 20 November 2010 (UTC)[reply]

For that matter, it would make even more sense to remove the redundant ":"

>25*"!dlrow ,olleH"v,_@
                   >:^

Gereeter (talk) 15:16, 20 November 2010 (UTC)[reply]


What about

"!dlrow olleH">:#,_@  

— Preceding unsigned comment added by 145.103.102.116 (talk) 14:20, 4 June 2012 (UTC)[reply]

Latest Changes

[edit]

Not a lot of activity here, but I felt it needed a few changes. However, I was a bit conservative, so I'll post a few ideas here.

1). I can't find a link to Betty anywhere, but instead of deleting it entirely, I just put [[ ]] around it for now (which points to an empty page for good reason). If someone knows more about it, feel free to add to it. Otherwise, it's pretty pointless to mention without a link.

2). I added like two links and moved the BFC link from the middle of the article itself down to the bottom with the others. However, I can already tell it's getting big, and I know some strict admins will say, "Wikipedia is not a links directory!" And yet I feel it's more useful with more links than less (and I could still add more!). But whatever.

3). I also wonder if some mention should be made of the various test suites available (Deewiant's Mycology, Jeffrey Lee's Fungus).

4). In reality, while more exist than just Befunge93 and Funge98, it seems those are the most popular ones. Maybe the article should be split off (or expanded) into two separate ones in the future. -- Armslurp (talk) 20:54, 4 November 2009 (UTC)[reply]

Compilers

[edit]

Is the statement that 'a number of compilers have subsequently been written' true? It was my understanding that no true compiler had ever been written--all 'compilers' off Befunge code really just bundled up the Befunge program and an interpreter in a .exe.

-- Herschel 13:44, Apr 21, 2004 (UTC)

Well it seems like it would be hard to have a compiled language that allowed self-modifying code in the same way... --Grouse 13:35, 10 Jul 2004 (UTC)
Bundling a program and an interpreter together in an .exe is real compilation, even if it does feel like cheating. --lament 19:36, 28 Jul 2004 (UTC)
I would argue that it is psuedocompilation and deserves to be pointed out as such in the article. However, through some investigation, I have found that there is a "true" compiler located here. (Note that it is a link to an archival of the page, seeing as it is actually no longer online.) However, I was unable to get any Befunge programs that I tried to compile to workd correctly--probably due to some nuance of Windows XP. It looks pretty genuine to me, though. Can anyone verify that it works, and perhaps it deserves a mention in the article? --Herschel 18:54, Aug 8, 2004 (UTC)
mtfi works great, it's what i use. (i'm on Linux) --lament 05:01, 9 Aug 2004 (UTC)
MTFI is only the interpreter, so I'm guessing he meant MCBC instead (which isn't available anywhere, AFAICT). The only remnant I know of is Ryan Kusnery's BEFI.COM interpreter for DOS (which was based upon MCBC). -- Armslurp (talk) 20:54, 4 November 2009 (UTC)[reply]
MCBC was a compiler, not a bundled interpreter: it got around the self-modifying code problem by compiling to self-modifying x86 machine code. I know this because I wrote it, but I do not have an independent citation. 2620:0:1000:4310:CD4F:412A:77AC:15B3 (talk) 23:00, 9 May 2016 (UTC)[reply]
There are still copies of the MCBC distribution on the Internet Archive, and I can confirm that it is a genuine compiler rather than a bundled interpreter. It's 16-bit, though, so you'll need a VM or DOS emulator if you want to use it on a 64-bit system. Also not sure if that was the most recent version, because I think I remember it having a few bugs when I last tested it, but it does basically work.
Btw, I always assumed Betty was the first real Befunge compiler, just based on the way Chris talked about it (the wording in this article is copied directly from his contribution to the Esolangs wiki). He doesn't explicitly say as much, but it's the only compiler he mentions and the fact that it's untraceable nowadays makes me think it was probably pre-internet. Did MCBC come before that? --j4_james (talk) 13:36, 18 September 2016 (UTC)[reply]

As a friend just pointed me, it looks like the example program can't compile: nowhere the symbole '@' (end of progam) is used ;-) I would do the correction myself, but I'm not exactly sure of that ( I'm not an expert in this language :-P ), and I'm not sure either where I should put it :-D --Fafner 11:33, 28 Jul 2004 (UTC)

No, the program is correct. It doesn't have @ because it never halts. It's an endless loop. --lament 19:34, 28 Jul 2004 (UTC)
Ok, the '@' is an "exit" or "return" instruction. But I think the article would gain in precision if a more precise explanation of the algorithm were provided. It is said "This arrow technique is demonstrated in the random number generator program below". For me a random number generator is like a function that returns different values at each call. I don't see where this should be an endless loop unless the program keeps running to endlessly print random number. Is it the case or is it something else?
Fafner 08:38, 30 Jul 2004 (UTC)
This program generates (an endless stream of) random numbers, therefore (by the process of induction, we conclude that) it is a random number generator. Please explain which part of this is unclear.
Dv 12:37, 2004 Jul 30 (UTC)
Now it is clear in my mind, but what I think is that what the algorithm does should be explained more precisely. Maybe just one or two sentences ;-)
Fafner 21:07, 1 Aug 2004 (UTC)
Sure, go ahead :)
Dv 18:23, 2004 Aug 2 (UTC)
Done.
Stelio 00:19, 3 March 2006 (UTC)[reply]

New Interpreter

[edit]

Does someone want to add the following?

http://yabi93.sf.net

I agree. Added.--Dougall 11:18, 24 June 2006 (UTC)[reply]

My HTML5 Canvas Version
https://codepen.io/Alikberov/project/full/XVajxm/
https://jsfiddle.net/Alikberov/2m1cuxnw/
Using the coloured pixels…
Alikberov (talk) 08:43, 28 August 2018 (UTC)[reply]

Malicious edit?

[edit]

An anonymous user changed the word 'like' to 'unlike' here:

Since a Befunge-93 program can only have a single stack and its storage array is bounded, the Befunge-93 language 
is, unlike most machine languages, not Turing-complete. 

I don't remember which statement should be true. My gut feeling was that most machine languages are, due to address space limitations, not turing-complete, but close enough for practical purposes. Anyone CS experts care to resolve this? --Stevage 22:55, 1 December 2005 (UTC)[reply]

Most computer language specifications do not have any space limitations. Their implementations most certainly do (if you have such a machine I'd sure like to see it). So Befunge-93's hard limit of 80x25 characters made it inherently not Turing-complete, unlike other languages.

- Xbobx 09:13, 11 January 2006 (UTC)[reply]

Hello World example

[edit]

Perhaps some explanation of the example would be useful? I suppose I didnt look too hard at it, but I needed someone to explain that 32 was ascii for space, and 10 was ascii for newline.

Done.
Stelio 00:19, 3 March 2006 (UTC)[reply]

2D array?

[edit]

...then we should be using a table, right? Guess full-fledged tables are too hard to manage (one TD for each char!) so I added monospaced fonts for now. —Preceding unsigned comment added by Jafet.vixle (talkcontribs) 09:58, 9 May 2006 (UTC)[reply]

Excuse me, but what are you talking about? --ZeroOne 10:45, 9 May 2006 (UTC)[reply]

Well, for clearer code view, the characters must align up properly, no? I tried adding [span font-family] but it didn't work. Anyway, just my $0.02. Jafet

There are two code examples and in both of them the characters do align correctly. Besides, I don't see any edits in the main article made by you, so where exactly did you add monospaced fonts for now? Oh, and please sign your posts using four tildes: ~~~~. That expands automatically to your user name and current time/date. :) --ZeroOne 13:27, 9 May 2006 (UTC)[reply]

Befunge-93 vs. Befunge-98

[edit]

I think that a distinction should be made between Befunge-93 and Befunge-98. The section title "Instruction List" is an excellent list of Befunge-93 instructions, however, Befunge-98 has many more, including '[' (turn left), ']' (turn right), 'r' (reflect) and 'n' (clear stack). I think that there should either be a definative list (like the one found [1]), a line should be added stating that this is a list of Befunge-93 commands or the title should be changed to "Befunge-93 instruction list".--Dougall 11:11, 24 June 2006 (UTC)[reply]

I did it myself (but forgot to use the edit discription thing). If anyone has any objections, feel free to tell me.--Dougall 07:56, 28 June 2006 (UTC)[reply]
It seems to me that the most recent version of the language should be the one most thoroughly described. So why don't we replace the B-93 instruction list with one for B-98? I'll do it if no one has any objections. Stebbins 20:53, 4 December 2006 (UTC)[reply]
I think that would be good, as long as it says what instructions can only be used in 98, and which can be used in both.12Me21 (talk) 03:20, 18 April 2015 (UTC)[reply]

Lahey space vs. torus

[edit]
"In this model, the grid behaves like a torus of finite size with respect to wrapping, while still allowing itself to be extended indefinitely."

This doesn't seem to be an accurate description at all. In Funge-98, the PC can move diagonally. Then when it disappears off to infinity and wraps round, it always remains on the same line. This would not be generally true on a torus.

Really, Lahey space is an extension of Euclidean space, in which the 'ends' of a line are joined at infinity. I'm not sure if it can reasonably be compared to projective space. Can anyone come up with a better description? -- Smjg 18:46, 19 September 2007 (UTC)[reply]

What does the name mean?

[edit]

Does anyone know the etymology of the name "Befunge"? wr 87.139.81.19 (talk) 11:19, 10 April 2008 (UTC)[reply]


Yeah -- Befunge was originally a mistyping of "before". See: http://esolangs.org/wiki/Befunge 99.224.153.68 (talk) 13:55, 8 August 2009 (UTC)[reply]

Lahey-space

[edit]

Yeah. The description there is totally wrong. When I came up with Lahey-space, I was inspired by the Riemann sphere. Every line is joined by the infinite point to the other end of the same line. And that when you return to the beginning, you'll be at the same point.

When the PC is travelling with any velocity that isn't 1 in a cardinal direction, after executing the last instruction before going to infinity, it finds the last instruction in the other direction and starts executing from there.

Because of the inspiration from the Riemann sphere, I actually wanted to have the ability to define the instruction at the infinite point, but I couldn't think of any interesting uses, so I don't know if I even ever suggested it.

I suppose that you could say it acts like a torus when the PC is traveling at normal velocities ((0,1), (0, -1), (1,0), (-1,0),) but when the X instruction is used, it has a standard behavior, no matter the size of the grid. If you used a torus, then the size of the grid would affect the behavior.

I'm not sure whether I'm comfortable editing this page as I'm referenced. Is it acceptable for me to change the description of the math?

clahey (talk) 17:41, 3 December 2009 (UTC)[reply]

I suppose I should say "After executing the last instruction before going to infinity, it finds the last instruction in the other direction and starts executing from there." It doesn't matter if it's a simple velocity, but when it is, the wrapping scheme matches the simple torus wrapping scheme.

clahey (talk) 17:44, 3 December 2009 (UTC)[reply]

Divide by zero

[edit]

I can't find any instruction list that says what to do when there is a divide by zero for the / or % statements that doesn't look like it's been copied off this page. Marked as dubious. Can anyone confirm? 80.177.127.228 (talk) 16:23, 2 April 2011 (UTC)[reply]

That's the behaviour of the original befunge interpreter. IIRC, befunge-98 explicitly changed that behaviour. ~~ — Preceding unsigned comment added by 87.222.26.125 (talk) 11:44, 25 September 2011 (UTC)[reply]

Looking in the relevant primary sources, we find this, which indicates that division by zero asks the user, and modulus by zero crashes. I'm not sure if any of the reliable secondary sources has this behaviour cited, though, and it'd be unlikely. (Also, I just noticed that this article cites me, personally, as evidence as to who the author of the language is. I'm pretty sure I'm not a reliable source in the sense that Wikipedia uses. This article definitely needs some sort of sourcing cleanup, or possibly deletion under WP:V; although I think there's the minimum basis of sourcing that this is notable (which there is), there's a rather lower level of reliable non-primary information about the language itself.) --ais523 12:44, 31 October 2014 (UTC)
If you want a reference, you can always quote the Funge-98 specification, which claims that "Befunge-93 [...] is supposed to ask the user what they want the result of the division to be" [1]. But the original Befunge-93 specification never said anything of the sort, and the original Befunge reference implementation never followed that behaviour either (you can see that in some of the older versions of the source code floating around the net). I suspect from the comments in the change log that division by zero handling was only added to the reference implementation in January 1998.
Personally I think that claim should be dropped from the article - this isn't the place to try and strictly spec the language when it was never well defined to begin with. Same goes for the claim that an out-of-bounds "get" pushes zero, which was also never part of the specification or the original reference implementation. In practice this is all undefined behaviour. --j4_james (talk) 02:09, 28 November 2015 (UTC)[reply]
Note that I've now removed the division-by-zero and out-of-bounds "get" behaviour from the instruction list for the reasons mentioned above. If anyone feels that kind of detail really needs to be included in the article, I suggest you put it in a separate section which clearly specifies the limited circumstances in which it is applicable. --j4_james (talk) 23:39, 17 August 2016 (UTC)[reply]
  1. ^ Pressey, Chris. "Funge-98 Final Specification".

Errors?

[edit]

It doesn't say what to do in the case of potential errors. For example, what if a negative number is passed to , ? should it print; nothing, the absolute value, 128-#, give an error??? 12Me21 (talk) 12:29, 24 April 2015 (UTC)[reply]

[edit]

As explained in the content policies, Wikipedia is not a means of promotion and not a repository of links. There is absolutely no need for this article to include links to every Befunge interpreter or Befunge related website on the internet, which seems to be the direction it's going. My recommendation would to get rid of everything in the External Links section except for official links to the two main specifications, and the reference Befunge interpreter.

I'd also recommend cleaning up the Compilation section which looks like it has become a magnet for self promotion too. I'd be OK with leaving the section on bef2c given that it's part of the official distribution, and the Betty compiler is arguably notable as the first compiler (?), but I think the rest should definitely go.

Unless anyone has any objections, I'll be making these changes in the next week or so. If you think there is a reason why a particular link should be kept, please provide some justification for why you think it is notable and adds value to the article (and not just another Befunge interpreter/compiler/webpage).

--j4_james (talk) 17:25, 18 August 2016 (UTC)[reply]

[edit]

Hello fellow Wikipedians,

I have just modified one external link on Befunge. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:

When you have finished reviewing my changes, please set the checked parameter below to true or failed to let others know (documentation at {{Sourcecheck}}).

☒N An editor has determined that the edit contains an error somewhere. Please follow the instructions below and mark the |checked= to true

  • If you have discovered URLs which were erroneously considered dead by the bot, you can report them with this tool.
  • If you found an error with any archives or the URLs themselves, you can fix them with this tool.

Cheers.—InternetArchiveBot (Report bug) 21:37, 29 October 2016 (UTC)[reply]

I reviewed your edit, and the Jargon File link that you marked as dead was working fine for me (I checked on multiple occasions). I have therefore reverted that change. --j4_james (talk) 14:20, 1 November 2016 (UTC)[reply]
[edit]

Hello fellow Wikipedians,

I have just modified one external link on Befunge. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:

When you have finished reviewing my changes, you may follow the instructions on the template below to fix any issues with the URLs.

This message was posted before February 2018. After February 2018, "External links modified" talk page sections are no longer generated or monitored by InternetArchiveBot. No special action is required regarding these talk page notices, other than regular verification using the archive tool instructions below. Editors have permission to delete these "External links modified" talk page sections if they want to de-clutter talk pages, but see the RfC before doing mass systematic removals. This message is updated dynamically through the template {{source check}} (last update: 5 June 2024).

  • If you have discovered URLs which were erroneously considered dead by the bot, you can report them with this tool.
  • If you found an error with any archives or the URLs themselves, you can fix them with this tool.

Cheers.—InternetArchiveBot (Report bug) 03:00, 17 July 2017 (UTC)[reply]

[edit]
Removed 2012 "External links" tag: When the article was tagged for external links issues there was something like 17 links. This has been trimmed to three so it seems the tags was just not removed. Otr500 (talk) 01:38, 19 February 2020 (UTC)[reply]