Integration with Web?

This is a discussion on Integration with Web? within the C++ Programming forums, part of the General Programming Boards category; Originally Posted by Dae Interesting to note many higher level languages are written in C or C/C++[...] ok, more specifically: ...

  1. #16
    Registered User
    Join Date
    Oct 2006
    Location
    Canada
    Posts
    1,243
    Quote Originally Posted by Dae View Post
    Interesting to note many higher level languages are written in C or C/C++[...]
    ok, more specifically: using the C++ language itself and not using a language instead which was written in C++. (i.e. if i had an assignment for assembly, i wouldnt be able to (restricted by the assignment/professor) write it in C++, right?)

    Quote Originally Posted by Dae View Post
    I never have though, since I've never found found myself restricted and would simply switch languages instead.
    by restricted i figured that this is an assignment (school or work) and the requirement is "[...] must be written in C++" or whatever. of course if its a personal project or assignment without this restriction, then he could write it in assembly if he wanted.

    but yes, it is a good point to note that C++ is often used to create a new language.

  2. #17
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,649
    Quote Originally Posted by Sebastiani View Post
    Not really. But a higher level library than raw sockets, for sure. I can download a web page *and* parse it into a tree in less than three lines.

    NIIIICEEEE...even if it's not XHTML?

  3. #18
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,668
    Quote Originally Posted by rags_to_riches View Post
    NIIIICEEEE...even if it's not XHTML?
    Yep, even broken, old-fashion HTML.

  4. #19
    Registered User
    Join Date
    Sep 2009
    Posts
    4
    What language would you suggest to make this the easiest, i only know some C++ so i am more familiar with that but if it would be considerably easier to use a different language i am willing to learn

  5. #20
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,236
    Quote Originally Posted by Zach_the_Lizard View Post
    I don't think it'd be so horrible if he's looking for, say, a specific tag, such as <ul>. It's certainly doable, considering Webkit and Gecko are written in C++, and they have to do far more than simply read in what amounts to XML.
    Code:
    <script>
    var foo = "HTML is so easy to parse <ul>";
    </script>
    
    <!-- In fact <ul> it's ridiculously simple. -->
    
    <pre>
    It's not like <ul> the syntax is particularly complex.
    </pre>
    (Oh, and I encoded the whole thing in Shift-JIS)
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  6. #21
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,668
    Quote Originally Posted by brewbuck View Post
    Code:
    <script>
    var foo = "HTML is so easy to parse <ul>";
    </script>
    
    <!-- In fact <ul> it's ridiculously simple. -->
    
    <pre>
    It's not like <ul> the syntax is particularly complex.
    </pre>
    (Oh, and I encoded the whole thing in Shift-JIS)
    Seconded. Writing a decent HTML parser is not trivial. Not as difficut as, say, parsing C++, but maybe somewhere in the middle. I'm pretty sure there are a good number of open-source libraries out there to deal with it, though.

  7. #22
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,189
    Quote Originally Posted by rags_to_riches View Post
    Oh GOD, is brewbuck ever right. This here's a job for a higher-level language.
    BLASPHEMER!!!!!

    Do it in assembly

    If you are using windows, they have API calls to handle this

    http://msdn.microsoft.com/en-us/libr...96(VS.85).aspx
    Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

  8. #23
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,236
    I wasn't really trying to say that C++ is inherently a bad language for the job, but I wouldn't recommend trying to code up the nitty gritty details by yourself. HTML is large, only partially standardized, and incredibly complex. Even if you do manage to create a working parser, it's not really fun. You'll probably feel like you just finished extracting a rotting corpse from a sewer pipe -- a challenging task, but one you'd rather avoid.

    Scripting languages, on the other hand, usually have standardized libraries or packages for doing this, and they are fully functional. It's not that such libraries don't exist for C++, but they aren't ubiquitous, and you could spend days just deciding which library to use in the first place.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  9. #24
    Dae
    Dae is offline
    Deprecated Dae's Avatar
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    1,034
    Quote Originally Posted by brewbuck View Post
    ...
    So what you're saying is...

    step 1) find Sebastiani
    step 2) steal his brain
    step 3) ???
    step 4) profit

    It all makes sense now
    Warning: Have doubt in anything I post.

    GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101

  10. #25
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,668
    >> HTML is large, only partially standardized, and incredibly complex. Even if you do manage to create a working parser, it's not really fun. You'll probably feel like you just finished extracting a rotting corpse from a sewer pipe -- a challenging task, but one you'd rather avoid.

    Hell of an analogy, LOL.

    >> Scripting languages, on the other hand, usually have standardized libraries or packages for doing this, and they are fully functional. It's not that such libraries don't exist for C++, but they aren't ubiquitous, and you could spend days just deciding which library to use in the first place.

    I wouldn't necessarily rule it out on those grounds. C++ doesn't standardize a lot of things, for the sake of preserving generality, among other things, but there are nonetheless plenty of free, robust frameworks available (maybe more so than any other language, even) to make up for it.

    That said, there's nothing wrong with using an interpreted language, either. It can be a lot easier to get things rolling, for sure. That, and the interface is generally more uniform with respect to all of the other libraries that come with the language, which is nice.

    EDIT: I realize now that my refutation doesn't actually refute what you said, Brewbuck. In fact, it almost doesn't make sense in response to what you said. So I'll just leave it as a reiteration rather than a refutation. Sorry, it's late.
    Last edited by Sebastiani; 09-29-2009 at 11:59 PM.

  11. #26
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,668
    Quote Originally Posted by Dae View Post
    So what you're saying is...

    step 1) find Sebastiani
    step 2) steal his brain
    step 3) ???
    step 4) profit

    It all makes sense now
    Fools gold. Brewbuck's would be better loot.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. MS Web Services Question
    By mercury529 in forum Windows Programming
    Replies: 0
    Last Post: 11-14-2006, 05:36 PM
  2. Consuming same Web Service multiple times
    By cfriend in forum C# Programming
    Replies: 2
    Last Post: 01-10-2006, 08:59 AM
  3. SWEBS Web Server
    By nickname_changed in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 09-22-2003, 02:46 AM
  4. Further developing C for the web
    By bjdea1 in forum C Programming
    Replies: 24
    Last Post: 12-25-2002, 12:49 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21