is valid HTML, not just accepted. HTML is not XML, it's SGML and that allows tags that don't need terminating slash. But because of that you need to know what each tag means (whether it requires termination or not) to process them, and that's why XML with mandatory terminating slashes (and strict tree-like structure;) was introduced so you can easily process documents without actually knowing what's inside them, however XHTML that uses it never really caught on web pages. For anyone who deals with web pages processing, it's a pity.
@viora_8 жыл бұрын
XHTML would have caught on if it was an official recommendation for HTML5. Really a shame it didn't.
@ihnwtpu8 жыл бұрын
+Jan Sten Adámek In my experience with HTML sometimes it actually doesn't like when you put a slash at the end. For example, doesn't work but does.
@SolarShado8 жыл бұрын
+Samuel Lakatoš I'm pretty sure tags aren't allowed to be 'self-closing' like that, even though (as I'm sure you know) they often don't wrap any content. It's definitely an odd quirk, though I suspect there's a reason for it.
@rich10514148 жыл бұрын
+Jan Sten Adámek I thought technically is the same as . When is it right to do one, and not the other?
@TheFerdi2658 жыл бұрын
+Richard Smith AFAIK, in XML, and are equivalent. In HTML, does not even exist IIRC
@liquidminds8 жыл бұрын
So weird. So many forgotten memories from first semesters at university... Just heard the name backus and immediately backus-naur form sprung into my mind. Thx for pulling all those memories back out of my head. I appreciate it. It's like time-travel :-)
@paulsaulpaul Жыл бұрын
This guy needs his own video series. He's like the Professor on the Periodic Videos channel.
@manamimnm8 жыл бұрын
It is nice to see how we got to what we have today through the time!
@Jacob0118 жыл бұрын
This prof. can make anything interesting. Man in his place.
@IceMetalPunk8 жыл бұрын
Recently, a KZbinr named SethBling created a working lexer, parser, and interpreter for the BASIC programming language, all within Minecraft. That kind of programming-language-inside-a-program could be an extremely interesting topic for a future Computerphile video! (Plus, it gets us Minecraft fans hyped :P )
@slendy96008 жыл бұрын
i was watching one of Sethblings streams when he teased a video that would soon release which he called his "magnum opus", and that was it :D... its amazing what that guy can do
@yash11522 жыл бұрын
> _"That kind of programming-language-inside-a-program could be an extremely interesting topic"_ * yeah, lol. more like "hidden logical structures in programs" * includes those inside powerpoint, or ms word, Conway's game of life, as well - there have been videos on those already. * and if u move beyond programs, then logic can be implemented in all sorts things - with dominoes, with water siphons, with chemicals (dna), with electric circuits, and so on, and so forth....
@StasPakhomov-wj1nn Жыл бұрын
having the last line of the video be "where things finish" was a nice touch ;)
@dark_nation_78 жыл бұрын
I actually started writing a lexer for a language using utilizing YACC and BNF. Would love to see an episode discussing that!
@commentsforonce70888 жыл бұрын
04:07 for some reason I can only think of "SGML" screaming; "This is not even my final form! "
@trailkeeper8 жыл бұрын
Maybe a good way to think of all this is as: and
@MedEighty8 жыл бұрын
I love the Backus-Naur form.
@shanewakeling66988 жыл бұрын
Gotta love Professor Brailsford, hes vids are excellent
@JL-dz8sj8 жыл бұрын
John backers was one of the big investors of 4chan?
@Computerphile8 жыл бұрын
John Backus, FORTRAN
@androumac11698 жыл бұрын
Kahn Worfers, 4TrekTNG. GG myself, I think I've created a possible meme. i am dah mem loord nao. c: gg no re m80s
@androumac11698 жыл бұрын
I was actually trying to type Jahn for John, but iOS' autocorrect made it Kahn, so I went: "Screw it, I'll stick with this now since this actually gave me an idea.", and I basically made that reply.
@Xclann8 жыл бұрын
Will be interesting if this series were to evolve into a talk on designing and implementing compilers.
@hellterminator8 жыл бұрын
That is *far* beyond the scope of this channel.
@billg47472 жыл бұрын
I love that Prof. Brailsford is using line printer paper as a scratchpad.
@brianmiller1077 Жыл бұрын
It's an adaptation of Numberphile's brown paper that gets written on.
@tomlee70738 жыл бұрын
I love the way he sings "...and you see things like, pointer bracket, 'P', pointer bracket!" at 4:41 :)
@Cyndaquazy8 жыл бұрын
I had a class on compilers a couple semesters back. I was eating, sleeping, drinking BNF!
@josephgaviota3 жыл бұрын
BNF, sounds like a railroad to me.
@realraven20008 жыл бұрын
Can you do one about the history of the => arrow operator, and how it can now be used in ECMAscript? That would be awesome.
@wobblycogsyt8 жыл бұрын
They both use angle brackets but to claim BNF was the forerunner is going a bit far as they are fundamentally different tools. I'm sure the SGML / XML designers saw the notation in BNF , liked it, and decided to produce something that looked similar but that doesn't mean BNF is a direct ancestor of XML. BNF is much more like a DTD (or XML Schema) in that it defines what can be written not what is written.
@lawrencedoliveiro91046 жыл бұрын
I think so, too. The resemblance is more superficial than deep. And BNF is a more powerful notation than DTDs. DTDs are not very useful with XML anyway.
@rich10514148 жыл бұрын
Although the computer languages which are easiest to read are great when working on code with others, i do love the faster styles when doing something on your own and time is of the essense. Java is a language which is quite easy to read, but it does have shortcut styles available as well if you want them like: boolean flag = (i < 10 ? false : (i < 20 ? true : false)); Which is the same as: boolean flag; if(i < 10 || i >= 20){ flag = false; }else { flag = true; } The first is much quicker, but the second is easier to read. Dunno why I got off on this tangent, it just reminds me of the ever present debate of ease of coding vs ease of reading.
@harrisonharris69888 жыл бұрын
simple solution: make a smarter compiler to make it efficient as it compiles.
@realraven20008 жыл бұрын
+Richard Smith These trinaries are slightly dangerous as they have a low priority and you should use parentheses if you ever plan to nest them. You can have lots of unexpected side effects when you use them in conjunction with string concatenation. Consider this Javascript let msg = isEncrypted ? getStringBundle('warning.encrypted') : 'using Account: ' + account ? account.key : '0' + ' ' + ' identityName = ' + id ? id.identityName : 'empty'; always put parentheses around the three operands to make sure it works correctly. let msg = isEncrypted ? getStringBundle('warning.encrypted') : ( 'using Account: ' + account ? account.key : '0') + ' ' + (' identityName = ' + id ? id.identityName : 'empty'); otherwise you can get very weird unexpected results
@HaroldSalaila8 жыл бұрын
+Richard Smith Just note that it is also possible to write that expression as: boolean flag = !(i < 10 || i >= 20); which in my opinion is far more readable than the options you provided.
@rich10514148 жыл бұрын
Harold Salaila yes i know that. I was giving an example of inline coding style. Perhaps in hindsight using a boolean for the example was going to lead to such corrections.
@rich10514148 жыл бұрын
+Realraven2000 You are right, i corrected it.
@bernardobuffa23918 жыл бұрын
hi. could you do a bit of history of object orientation in programming? Thanks for the videos, I don't miss one, they are all so interesting
@Obtaineudaimonia8 жыл бұрын
I didn't think it was possible for Chomsky to go up in my estimation any further... but he has.
@jamesgrimwood12858 жыл бұрын
Oh god, I'm having flashbacks to the formal language part of my degree, and the terror of trying to make Lexx & Yacc behave.
@AdamCradamParkes8 жыл бұрын
also, ::= is translatable into various human languages, i.e. ::= whereas S -> LT is gibberish in any language
@yash11522 жыл бұрын
Coming from "Parsing Explained - Computerphile" @ 1:29 Please optimise the description of this video for SEO - put some more search terms in it like BNF, grammer, backus naur, formal language, etc.
@JaccovanSchaik8 жыл бұрын
Will there be an episode about lex and yacc sometime in the future? This seems like a natural extension to this one, and also to the earlier episode about state machines.
@DuncanEllis8 жыл бұрын
+Jacco van Schaik that was exactly my thought - input to parser generators is usually based on BNF.
@fobusas8 жыл бұрын
+Duncan Ellis (Dunx) I'm reading a book about compiler design, so this is really topical :)
@DuncanEllis8 жыл бұрын
Vaidas Šukauskas wait until you have to implement a domain-specific language in JavaCC!
@lawrencedoliveiro91046 жыл бұрын
After many years’ experience, most of us have come to the conclusion that lex/flex and yacc/bison are not really worth using. Yes, you can generate automatic parsers for full LR(k) grammars, but we usually find we can get by just fine with LL(1) grammars, which can be handled quite easily with recursive-descent parsers. And hand-coding parsers and lexers makes them faster anyway.
@brotherandy5 жыл бұрын
There is now!
@nekture8 жыл бұрын
Oh wow. I never knew Chomsky had a history in computer science.
@Tupster8 жыл бұрын
it was weird for me to find out later that Chomsky was more than a contributor to CS
@TheVladBlog8 жыл бұрын
+Jason Wilkins Chomsky is life in the majority of applied artificial intelligence.
@nekture8 жыл бұрын
I only knew him for his political activity.
@sergioavila27208 жыл бұрын
are you in the field of computer science?
@nekture8 жыл бұрын
No, I am not.
@b2gills8 жыл бұрын
The part where he said that it doesn't appear in the language, doesn't apply to Perl 6. That is almost literally valid code in Perl 6, both in the grammar sub-language (similar in appearance to BNF, but more powerful), and in the language as a whole.
@CarterColeisInfamous8 жыл бұрын
5:20 the doctype of the html can dictate the way its parsed by the browser and if the tag may be omitted
@lawrencedoliveiro91046 жыл бұрын
2:23 I think an early draft of ALGOL-68 very nearly violated that tradition by introducing “::=” as a syntactic symbol. Thankfully this was changed later.
@skit5558 жыл бұрын
So... There is a link between BNF and XML? Luv it :3
@Nevhision28 жыл бұрын
RIP Peter Naur
@berndeckenfels Жыл бұрын
Next up, roff notation for manpages (which in turn use metastatic variables in ankle brackets and cursive ,)
@originalmianos8 жыл бұрын
He thinks "someone saw BNF and used it for SGML" is just hearsay without referring to the original authors of SGML. Interestingly people have tended to move to double braces for templating these days because they occur much less regularly in normal text, making them, although ever so slightly more verbose, more practical as you almost never need to escape them.
@Hunnter2k38 жыл бұрын
+Rob Fowler One character I have a love of using since it pretty much never shows up in text, never mind combined with anything else: ¬ Look at it. Wonderful character. I forgot the name. Oh, negation. Bonus character: ¦ Broken bar is nice, but can be confusing if reading it. Easy to confuse with ; or | at a glance. (pipe is worse for that since you can easily confuse it with l or I) It combined with other characters makes for simplicity when it comes to templates, encoding textual data and the like. I use things like ¬:, ¬-, etc. Or words. ¬backspace Encoding non-text characters, control characters and so on.
@HashimAziz18 жыл бұрын
Well, I can safely say this is the first Computerphile video I've watched and failed to understand >= 80% of what was said.
@BodyKnight8 жыл бұрын
Professor Brailsford, you put a mark on your shirt.
@CarterColeisInfamous8 жыл бұрын
4:50 technically thats html which is a subset of xml
@sblop8 жыл бұрын
Please make a video explaining how this is converted to machine code, and how that is executed.
@GegoXaren8 жыл бұрын
I love the ooc syntax... Just sayin'....: import structs/ArrayList main: func (args: ArrayList) -> Int { if (args) { for (s in args) { " " append (s) print () } } " " print () 0 }
@ruawhitepaw8 жыл бұрын
The form of BNF I've seen has no angle brackets, but puts literal text inside quotation marks instead.
@_simmac_8 жыл бұрын
Yes, that's extended BNF (EBNF)
@AS-rl5vr8 жыл бұрын
I'm not sure if this is a matter of preference or not, but I always found XML/HTML very verbose and tiresome to read and write. Since both XML and LISP's S-expressions were both great for displaying tree structure, how come SXML never gained traction?
@typograf628 жыл бұрын
Peter Naur died recently, on january 3.
@RustyTube8 жыл бұрын
Wait... Aren’t the identifiers in XML supposed to be in lower case, or at least case sensitive, so ... is different from ...?
@FelkCraft8 жыл бұрын
+RustyTube No, xml identifiers are case insensitive
@RustyTube8 жыл бұрын
FelkCraft I'm surprised. HXTML (HTML+XML) requires all identifiers (tags) to be in the lower case. I always assumed it was because of the XML portion, since the original HTML had no such restriction.
@tamasdemjen42428 жыл бұрын
+RustyTube XML is case sensitive. HTML isn't.
@RustyTube8 жыл бұрын
***** I was talking about XHTML (sorry, I mistyped it HXTML), which requires all tags to be in the lower case.
@salerio618 жыл бұрын
I was hoping for a lot more than that :(
@liamtennant83942 жыл бұрын
Why is it that those brackets are definable as well as can be understood as less than greater than in mathematical terms
@kevincozens68374 жыл бұрын
Hmm... BNF started with elements being encased in pointy brackets? The cases of BNF grammar I've seen over the years never included them.
@Hunnter2k38 жыл бұрын
Then you have some languages that don't care so much about command identifiers, and just use anything you throw at it. Or a subset of the language. Whitespace, for example, just uses any visible space-separating characters, space, tab, newline character. You could embed a Whitespace program in an HTML page by using for webpage spacing, and now you can throw your various commands here and there in amongst the HTML markup. At least, when given a simple page. It is harder to embed Whitespace in a document using ID/class/name references since that adds a necessary space in the tags. . There are ways you can use unique tag structures to eliminate the need for IDs, but it basically means abusing the semantic meaning of HTML, which makes some people Really Mad. I think polyglots were covered before. Oh no, it wasn't. Polyglot video when? Basically 2 or more languages combined in the same document that do multiple things, be it markup, scripting, etc. You can do crazy complex polyglots with the proper use of comment tags in languages, more so if you can redefine the comment identifier. Some great examples on the Wiki page for it at the bottom. en.wikipedia.org/wiki/Polyglot_(computing)
@Professional_Youtube_Commenter8 жыл бұрын
damn chomsky, he's everywhere.
@ramonkokoramon87417 жыл бұрын
good
@marlhex6280 Жыл бұрын
wow
@THB1928 жыл бұрын
...and SGML was in many ways far nicer, and far worse, than XML ever was. But at least it had DSSL.
@FreeBobox592 Жыл бұрын
Hello
@Pinkskull694208 жыл бұрын
>Meme Brackets
@eobrandon8 жыл бұрын
Pointy brackets? I think you mean meme arrows.
@𠀔2 жыл бұрын
@TheHandOfFear8 жыл бұрын
The examples he refers to are HTML not XML. They have similar roots, but they are not the same thing. I'm surprised this slipped past.
@nagualdesign8 жыл бұрын
3:41 - Cheeky finger sniff. ^_^
@YumekuiNeru8 жыл бұрын
they are called inequality signs REEEEEEE
@ThatNateGuy8 жыл бұрын
This has nothing to do with CS, but can any Brits identify Prof. Brailsford's accent? I'm a Yank who's still learning and never been to the UK.
@szymongorczynski76218 жыл бұрын
From an NI person's point of view, it's an English accent lol
@thefrosty19258 жыл бұрын
I'm a Brit but I'm not sure. I can rule out a few places where his accent is from though: Liverpool, Yorkshire, Newcastle and Brimingham. But, there's that many different accents with different variations in strength over here that it's difficult for me to give an answer. To be honest, he could easily be from one of the places I ruled out; but his accent isn't any especially strong and I would probably say it's from down South, probably from Oxfordshire since it is more towards the posh end of the spectrum
@hpesoj008 жыл бұрын
Nottingham?
@wobblycogsyt8 жыл бұрын
+Nate Wynd (ThatNateGuy) I would say his accent isn't clearly from any one area. It's quite soft which is generally attributed to a more well off family. Someone else guessed Oxfordshire and I would agree that's a good guess although I'd perhaps go a bit further north. It's certainly not one of the well known accents like Liverpool or London.
@EgoShredder8 жыл бұрын
+Graham Smith Hmmm....just a wild guess and probably wrong, but.....Lincolnshire? Most likely a Southern accent as you say.
@Ykulvaarlck8 жыл бұрын
hello
@mensrightsedinburgh47648 жыл бұрын
is it me you're looking for?
@U014B8 жыл бұрын
+GamerGate Edin Actually, I was looking for Lionel Richie. Have you seen him around recently?
@grahamfinlayson-fife738 жыл бұрын
<>
@y2ksw18 жыл бұрын
I don't agree, but just anybody can :p
@blackasthesky4 жыл бұрын
So they basically tried to explain to humans how to explain the computer what it needs to do like they would actually explain it to a human. Actually there was no real need to define a programming language like this.
@Mr30friends8 жыл бұрын
.
@U014B8 жыл бұрын
+Olegach21 💩
@MrStrutxD8 жыл бұрын
I don't really find this interesting, could this be indicative that programming isnt my thing? or is it just something that doesnt even interest avid programmers?
@hellterminator8 жыл бұрын
It's a bit of history. Some people find it interesting, others don't. That has nothing to do with being a programmer.
@MrStrutxD8 жыл бұрын
***** Ok thank you for your input. I appricate it.
@MrNateSPF8 жыл бұрын
+Anon Ops Another thing to note is that markup is not programing.
@MrStrutxD8 жыл бұрын
MrNateSPF I understand that, but i was just talking about most of these videos.
@MrNateSPF8 жыл бұрын
Anon Ops Why didn't you post this on a video about programing? Or more peculiarly why do you watch multiples of videos that have no interest to you?
@NathanTAK8 жыл бұрын
Clearly, no one here has heard of Grammar-Oriented Programming.